Create your own server list

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

User avatar
farfa
Nadeo
Nadeo
Posts: 601
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Create your own server list

Post by farfa » 29 Aug 2012, 14:16

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));
Also known as: satanasdiabolo

User avatar
spaii
Posts: 1100
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: Create your own server list

Post by spaii » 06 Oct 2012, 19:43

Hi Farfa,

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

User avatar
magnetik
Nadeo
Nadeo
Posts: 1670
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Create your own server list

Post by magnetik » 22 Oct 2012, 09:47

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.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
spaii
Posts: 1100
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: Create your own server list

Post by spaii » 22 Oct 2012, 11:23

Thx for this precision ;)

User avatar
magnetik
Nadeo
Nadeo
Posts: 1670
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Create your own server list

Post by magnetik » 03 Dec 2012, 11:15

I've just added ladderLimitMin and ladderLimitMax to server list API.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Create your own server list

Post by steeffeen » 15 Apr 2013, 13:31

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
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks

    User avatar
    w1lla
    Posts: 2373
    Joined: 15 Jun 2010, 11:09
    Location: Netherlands
    Contact:

    Re: Create your own server list

    Post by w1lla » 15 Apr 2013, 13:33

    Title is for All the Titles, Environments don't exist anymore, i believe.
    TM² Info
    SM Info
    QM Info

    OS: Windows 10 x64 Professional
    MB: MSI 970A-G46
    Processor: AMD FX-6300 3500 mHz
    RAM Memory: 16 GB DDR3
    Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
    KB: Logitech G510s
    Mouse: Logitech G300s
    Mode Creation
    ManiaScript Docs

    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2472
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: Create your own server list

    Post by steeffeen » 15 Apr 2013, 13:34

    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..
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks

      User avatar
      w1lla
      Posts: 2373
      Joined: 15 Jun 2010, 11:09
      Location: Netherlands
      Contact:

      Re: Create your own server list

      Post by w1lla » 15 Apr 2013, 13:56

      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.
      TM² Info
      SM Info
      QM Info

      OS: Windows 10 x64 Professional
      MB: MSI 970A-G46
      Processor: AMD FX-6300 3500 mHz
      RAM Memory: 16 GB DDR3
      Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
      KB: Logitech G510s
      Mouse: Logitech G300s
      Mode Creation
      ManiaScript Docs

      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: Create your own server list

      Post by steeffeen » 15 Apr 2013, 14:10

      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!! :|
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks

        Post Reply

        Return to “Maniaplanet Web Services”

        Who is online

        Users browsing this forum: No registered users and 2 guests