Fandom

Glest

MG/Master Server

< MG

275pages on
this wiki
Add New Page
Talk0 Share

Those informations are/may be very outdated, please go to: new wiki

Masterserver RESTful APIEdit

This document describes a RESTful API design which MegaGlest could use to communicate with the Master Server.

Version 0.9Edit

The first version of this API will try to provide a simple RESTful variant of the previous masterserver requests and responses. Its primary target is to provide backward compatibility to old-style URIs and requests in combination with HTTP redirections to the endpoints this API provides. On the other hand it shall provide a solid base to develop a proper RESTful API for the future. Nevertheless, this API version may add support for some new request types, i.e. add more functionality.

The most obvious difference to the previous interface is the newly introduced separation of gameserver related requests and game mod related requests into megaglest.org subdomains: master.megaglest.org and mods.megaglest.org.

Until explicitly noted otherwise, this is work in progress.


Host: master.megaglest.orgEdit

This subdomain hosts the API which provides information on available gameservers.

Old-style URI's:
http://master.megaglest.org/showServers.php
http://master.megaglest.org/showServersForGlest.php
http://master.megaglest.org/showServersJson.php
http://master.megaglest.org/addServerInfo.php

Mapping of old-style URIs to API URIs:

OLD-STYLE URI               FUNCTION  VERB  API-URI

/showServers.php         -> (list)    GET   /servers.html

/showServersForGlest.php -> (list)    GET   /servers.csv

/showServersJson.php     -> (list)    GET   /servers.json

/showRecentServers.php   -> (list)    GET   /servers-recent.html

/addServerInfo.php       -> (add)     POST  /server.txt/ip/<IP address>/version/<version>
                            (update)  PUT   /server.txt/ip/<IP address>/version/<version>


Host: mods.megaglest.orgEdit

This subdomain hosts the API which provides information on available game mods.

Old-style URIsEdit

http://master.megaglest.org/showScenariosForGlest.php
http://master.megaglest.org/showMapsForGlest.php
http://master.megaglest.org/showTechsForGlest.php
http://master.megaglest.org/showTilesetsForGlest.php

Mapping of old-style URIs to API URIsEdit

OLD-STYLE URI               FUNCTION  VERB  API-URI

/showMapsForGlest.php      ->          GET  /maps.csv
/showScenariosForGlest.php -> (list)   GET  /scenarios.csv
/showTechsForGlest.php     -> (list)   GET  /techtrees.csv
/showTilesetsForGlest.php  -> (list)   GET  /tilesets.csv

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.