Page 1 of 3

Create your own server list

Posted: 29 Aug 2012, 14:16
by farfa
Hi fellow coders,

You can now create you own server list on your website or manialink. With the latest SDK version you can get a list of server and use simple filters to get a list of server.

To do it use the method \Maniplanet\WebServices\Servers::getFilteredList($filters).
$filters must be an associative array where the key are the filter name. Here is the documentation for the values.
  • environment string The environment name, at the moment only Storm or Canyon
  • title string The Title idString for example SMStormElite@nadeolabs
  • playersMin int Minimum number of player connected on the server
  • playersMax int Maximum number of player connected on the server
  • hideFull bool If true, full servers will not be displayed
  • visibility string It can take one of those 3 values: all, public or private
  • zone string The path to a zone, for example: World|France. It will display every server in France subzones
  • mode mixed It can be one of class constant, or directly the game mode name itself (TimeAttack, Melee, ...)
  • offset int The offset in the list where the results will start
  • length int Number of elements returned
example to get 20 Melee public non empty and non full servers in France

Code: Select all

$service = new \Maniaplanet\WebServices\Servers('api_username','api_password');
$list = $service->getFilteredList(array('title'=>'SMStorm', 'mode'=>'Melee', 'playersMin'=>1, 'hideFull'=>true, 'visibility'=>'all', 'zone'=>'World|France','length'=>20));

Re: Create your own server list

Posted: 06 Oct 2012, 19:43
by spaii
Hi Farfa,

Function example not working, missing 'environment'=>'Storm' in your array ;)

Re: Create your own server list

Posted: 22 Oct 2012, 09:47
by magnetik
spaii wrote:Hi Farfa,

Function example not working, missing 'environment'=>'Storm' in your array ;)
Hi,

There is no mandatory arguments in this method. Doing a request with only array('title' => 'SMStorm') is working fine.

The 'visibility' argument had the value 'visible' which was not valid. It should be 'all', 'public' or 'private'.

I've edited his post.

Re: Create your own server list

Posted: 22 Oct 2012, 11:23
by spaii
Thx for this precision ;)

Re: Create your own server list

Posted: 03 Dec 2012, 11:15
by magnetik
I've just added ladderLimitMin and ladderLimitMax to server list API.

Re: Create your own server list

Posted: 15 Apr 2013, 13:31
by steeffeen
hey there
i'm desperately trying to get my server list request working but .. i'm puzzled...

Code: Select all

$list = $server->getFilteredList(array('title'=>'SMStorm', 'length'=>20));
works fine

but

Code: Select all

$list = $server->getFilteredList(array('environment'=>'Storm', 'length'=>20));
gives
HTTP Response: 400 Bad Request API Response: Invalid login "" (400)
there are no changes made in the rest of the code..
any idea how this comes?

regards
steff

Re: Create your own server list

Posted: 15 Apr 2013, 13:33
by w1lla
Title is for All the Titles, Environments don't exist anymore, i believe.

Re: Create your own server list

Posted: 15 Apr 2013, 13:34
by steeffeen
okay o.O
aand so it's not possible to get a list of servers from different titles all based on storm with one request?..

//Edit: custom game modes filtering is also not possible???
i would expect that the result list is empty if you enter a mode like "WADDEHADDEDUDEDA", but noo it just returns everything..

Re: Create your own server list

Posted: 15 Apr 2013, 13:56
by w1lla
Titles from Nadeo

Code: Select all

array(
    'title' => 'SMStorm',
    'mode' => 'Siege',
    'length' => 20
   )
);
Titles from others :P

Code: Select all

array(
    'environment' => 'Storm',
    'title' => 'Alphapack@w1lla',
    'length' => 20
   )
);
Not sure how Obstacle can be reached :P.

Re: Create your own server list

Posted: 15 Apr 2013, 14:10
by steeffeen
it's just the problem that i want to to display servers in Storm with a specific game mode.. and that's not possible without a request to get ALL servers (which is dumb).. PLEASE prove me wrong!! :|