MegaGlest/source/masterserver
Mark Vejvoda 8414077d7a - bugfix for headless server's reporting of winning players and team.
- masterserver returns proper JSON header now
2013-11-22 21:17:38 +00:00
..
flags - masterserver: determine + store game servers' ISO_3166-1 alpha-2 country code, display country flag 2011-01-21 22:43:43 +00:00
images Master server: 2013-10-13 01:44:27 +00:00
install - added player platform to game stats 2013-11-02 19:05:59 +00:00
scripts added game duration to main server page 2013-11-01 15:42:19 +00:00
style added aynch fetch for game stats 2013-10-31 09:49:23 +00:00
LICENSE Masterserver: 2013-11-08 12:41:11 +00:00
README Masterserver: 2013-11-08 12:41:11 +00:00
addGameStats.php - fixed bug where we used wrong var name to save quit time to db 2013-11-02 23:38:19 +00:00
addServerInfo.php - bugfix masterserver showing multiple hosts when host opens and closes mutlipel times without starting 2013-11-09 01:08:56 +00:00
cleanUpServerList.php Masterserver: 2013-11-08 12:41:11 +00:00
config.php - added game stats purge function 2013-11-01 17:23:17 +00:00
functions.php Masterserver: 2013-11-08 12:41:11 +00:00
index.php - updated copyright headers is some files that had them missing 2012-08-02 00:57:28 +00:00
robots.txt · Make search engine robots not index the masterserver 2013-11-07 01:29:06 +00:00
showGameStats.php - bugfix masterserver showing multiple hosts when host opens and closes mutlipel times without starting 2013-11-09 01:08:56 +00:00
showMapsForGlest.php * masterserver scripts: no more undefined indexes 2012-12-15 22:02:10 +00:00
showRecentServers.php Masterserver: 2013-11-08 12:41:11 +00:00
showScenariosForGlest.php * masterserver scripts: no more undefined indexes 2012-12-15 22:02:10 +00:00
showServers.php added game duration to main server page 2013-11-01 15:42:19 +00:00
showServersForGlest.php - Web and JSon scripts now show finsihed games that are no older than 8 hours 2013-10-31 01:35:47 +00:00
showServersJson.php - bugfix for headless server's reporting of winning players and team. 2013-11-22 21:17:38 +00:00
showTechsForGlest.php * masterserver scripts: no more undefined indexes 2012-12-15 22:02:10 +00:00
showTilesetsForGlest.php * masterserver scripts: no more undefined indexes 2012-12-15 22:02:10 +00:00

README

ABOUT

This is the MegaGlest master server. MegaGlest (http://megaglest.org) is a
libre software cross platform real-time strategy game. 

This master server does the following:
· publish game hosts (when a user decides to host)
· list hosted games (HTML, CSV, JSON output)
· list recently hosted gamed (HTML output) - this code is currently disabled
· list available game mods (CSV output)
· provide a version check for game installations

It uses a standard PHP/MySQL setup to achieve this. When instances of MegaGlest
engine based games publish their game information, they do so by pushing it to
this web server in regular intervals. Stale entries are removed when the next
client requests the list. When game instances retrieve the list of hosted games
or available game mods, they do so by pulling this information from the server.
Game and master server communicate using HTTP. The client sends requests by
HTTP GET passing along URL parameters while the server responds in a CSV format
or single field plain text. The version check is currently implemented as plain
text files (which use symbolic links for deduplication purposes) on the server.
This may be replaced by a single configurable PHP script in the future.

The MegaGlest Team hosts a live copy of this code at 
  http://master.megaglest.org
Please do not use this instance for your tests, but set up a copy of your own.



INSTALLATION

1. Setup a web server with PHP and a MySQL database server.
   Sucessfully tested configurations (on Debian GNU/Linux 6 and 7):
   · Apache 2.2 + mod_php 5.3.3
   · Nginx 1.2.1 + fastcgi + PHP-FPM 5.4.4
   · MySQL Community Server/Edition 5.1 (Oracle)
   · MySQL Server 5.5 (Percona)

2. Create a new MySQL database and a user who has has all standard permissions
   to work on this database after authentication.
   Example:
   CREATE DATABASE 'megaglest-master' ENGINE=InnoDB;
   CREATE USER 'megaglest-master'@'localhost' IDENTIFIED BY 'secret password';
   GRANT ALL ON 'megaglest-master.*' TO 'megaglest-master';

3. Copy all files (you can omit INSTALL and install/) to your webserver and
   edit config.php to reflect the MySQL connection parameters and game title;
   also replace the images in images/ by some which match your game title.

4. Connect the new user to the new database, then execute the SQL statments in
   install/scheme_mysql.sql.
   Example:
   mysql -u megaglest-master -p megaglest-master < install/scheme_mysql.sql

5. Set up the webserver to allow access to, and set up PHP to execute, the
   PHP files you placed on your webserver. Practically you may want to create
   a new "VirtualHost"/"Server" and make sure it points to where you placed
   the files and can run PHP.

To test and use this server with your MegaGlest engine based game, configure
the "Masterserver" property in glestuser.ini (if it's MegaGlest) or glest.ini
(if it's a different game).

To add mods to the game mod menu, edit the database contents using your 
favorite MySQL editor or develop a web based frontend to do so. In the latter
case, please let us know about it and try to use a compatible license.