Clone wiki

Matchmaker / Home


Matchmaker is a simple PHP matchmaking service for indie and hobby game developers.


  • Post game server information to a web server at a known location where clients will be able to access it
  • Discover active game servers so that clients can connect directly to the game servers
  • Install on any web server with PHP and MySQL, so pretty much anywhere


  1. Grab a copy of the source and extract it to your local drive for editing
  2. Create a new MySQL database for Matchmaker
  3. Execute the SQL contained in createTable.sql against your new database. Modify the default port number if desired.
  4. Open dbTEMPLATE.php and fill in the variables with information for your own database
  5. Rename dbTEMPLATE.php to db.php
  6. Upload db.php, getServers.php, and postServer.php to your web server in the same directory
  7. Visit getServers.php in your web browser. You should be presented with a very plain page with "No Games" listed.

Posting a Server

You can post a server by visiting postServer.php in your browser with a few parameters:

  • game (required), The name of the game you are posting a server for. Case sensitive
  • version (required), The version of the game you are posting a server for
  • port (optional), The port number the game server is listening on. If not provided, it will use the default defined in postServer.php

If the server posting was successful, it will return either:

<?xml version="1.0"?>

<success code="200">
Successfully Added


<?xml version="1.0"?>

<success code="201">
Successfully Updated

Each game server posting will expire after 2 minutes. The game server should re-post the server information at a regular interval, I would recommend every 1 minute. This prevents clients from attempting to connect to stale servers.

Example Server Posts

  • Simple usage:

  • version is a string and can be anything you want, except nothing:

  • Providing a non-default port:

Discovering Servers

The client should visit getServers.php with some optional parameters:

  • game (optional), Filters the server results to those hosting this game. Case sensitive
  • version (optional), Filters the server results to those hosting with this version (only recognized if game is also provided)

If the user-agent is set to game, then the results will be returned in XML, otherwise the results will be returned in a HTML table.

If servers have been active in the last 2 minutes, the XML will look like:

<?xml version="1.0" encoding="utf-8"?>

	{ ... repeated for every active server ... }

Otherwise, if there are no active servers, the XML will look like:

<?xml version="1.0" encoding="utf-8"?>

	No Results

If you visit in your browser, the HTML is in a table with the same columns.

Example Server Discoveries

  • Grab everything:

  • Grab only servers hosting "My Game":

  • Grab only servers hosting "My Game" version 2:

This work is licensed under a Creative Commons Attribution 3.0 Unported License

Licence is negotiable, just contact me.