Laser Squad Nemesis Tournament Administrator System

 

INITIATING A GAME

CALLING THE START GAME URL

To start a game, call the following url with the correct data (best using the post method):

http://codo-linux1.bytemark.co.uk/GameAdmin/StartGame

The http response will contain xml data reporting the outcome of the request. It is essential that your program checks this xml data in case there are errors arising from your request.

Parameters you must supply to the game start URL are:

admin_id Your tournament administrator id number.
scenario Scenario type either ‘HQ’ or ‘WipeOut’.
Map The name of the map.
turn_limit Turn limit from 5 to 40 inclusive.
time_limit Time limit in days, set from 1 to 60 inclusive.
response_deadline The time in days that players have to deploy, from 1 to 14 inclusive.
player1_name Player name of the first player.
player1_force_points Force points for player 1, from 1 to 30 inclusive.
player1_fpmax Maximum FPs per unit for player 1, from 1 to 6 inclusive.
player1_race_allow Race allowed for player 1, either 'any', 'mech', 'marn', 'spwn' or 'grey'.
player2_name Player name of the second player.
player2_force_points Force points for player 2, from 1 to 30 inclusive.
player2_fpmax Maximum FPs per unit for player 2, from 1 to 6 inclusive.
player2_race_allow Race allowed for player 1, either 'any', 'mech', 'marn', 'spwn' or 'grey'
message A message for both players containing information about the paticular game being played. Maximum 300 characters.

THE HTTP RESPONSE

When you call the game start urlyou will get an xml error report in the HTTP response. You must check this response to make sure the game has been started, because there are many reasons why a game start will fail, and your system needs to take appropriate action. The response will also contain the game id for a successfully started game, which you must use to track the results of the game when it is finished.

If you are using IE you can see an example of the xml response (albeit mostly errors!).

Here is an explanation of how to process the response.

The top level xml group for group is <new_game_status>. The first variable to check is errors. If this is ‘0’, then the game has started properly. You must then record the variable game_id in your database so you can track the outcome of your game.

If errors is greater than zero, then there has been a problem with the game start and you need to find out why and take appropriate action. Each variable in the xml response will be ‘OK’ if there was no error, otherwise the string will begin with ‘error:’ followed by an explanation of the error, and then the value that you originally supplied.

Here is an explanation of all the error reports:

admin_id error: incorrect admin_id:

The first error you must check is ‘admin_id’. If this is not ‘OK’ then there will be no further error reports.

ip_check error: unauthorised IP address

If admin_id is OK, then the IP address you are calling from is checked to see if it is the same as the one recorded in the admin database. This is an important security check, so you must make us aware of any changes to your IP address.

These scenario parameter errors are fairly self-explanatory:

response_deadline error: response deadline not in range 1-14
map error: map does not exist:
time_limit error: time limit not in the range 1-60:
scenario error: scenario does not exist:

Then there is an error report for each player under the xml grouping <game_player>

player_num '1' for player one, '2' for player two.
player 'error: player does not exist:' The player does not exist, or 'error: account expired:', the player’s account has expired, and cannot play games
race error: race does not exist:
force_points error: force points not in range 1-30:
fpmax error: fp max not in range 1-6: