TrackMania Dedicated Server

(PATH)\TMDedicatedServer.exe  /game={original | sunrise | nations}
						[/dedicated_cfg=config_file] 
                        [/game_settings=settings_file] 
                        [/internet] 
                        [/verbose_rpc_full | /verbose_rpc]


1.INSTALLATION:
---------------

Decompress the zip file in a directory to install TMDedicatedServer.
It can be installed either in the same directory of TMOriginal, TMSunrise or TMNations game, or in another directory.



2.LAUNCH:
---------

The dedicated server can be runned from a windows shortcut or from a command line prompt.

The format of the command line is:

(PATH)\TMDedicatedServer.exe /game={original | sunrise | nations} [/dedicated_cfg=config_file] [/game_settings=settings_file] [/internet] [/verbose_rpc_full | /verbose_rpc]

If you use a windows shorcut, you can modify its properties to configure the launch of the server on the same way.
The target of the shortcut properties (first field) shares the same format of the command line.
So it will eventually have to look like this:

"(PATH)\TMDedicatedServer.exe" /game=sunrise /dedicated_cfg=dedicated.cfg /game_settings=MatchSettings/settings.txt /internet

Warning: only the executable "(PATH)\TMDedicatedServer.exe" is between "'s , the options are outside them.
The working directory of the shortcut must also be set to the right directory. 
It must correspond to the directory where TMDedicatedServer.exe has been installed.

The dedicated server must be launched with the '/game=' option to define the game type (TMOriginal, TMSunrise or TMNations) that it will support.
To launch the dedicated server to support connection from TMOriginal games, the '/game=original' must be specified, or '/game=sunrise' for TMSunrise, or '/game=nations' for TMNations

The dedicated server can be launched with or without a configuration file.
To pass the name of the configuration file to the dedicated server, the paramater '/dedicateg_cfg=' must be specified followed by the name of the file. 
The filename can be defined by a relative or an absolute path.
The configuration file is an xml file which defines some basic parameters for the dedicated server.
See below for further details on configuration file.

A file containing game settings can also be specified to the dedicated server. 
To do that the paramater '/game_settings=' must be defined followed by the name of the file. 
This filename can be defined either by an absolute path or by a relative path to the '(PATH)\GameData\Tracks' directory.
The game settings file is an xml file which defines the match settings and a playlist of challenge that will be loaded. 
See below for further details on game settings file.

If the server has been launched with a valid configuration file and a valid game settings file, it will directly start a new server on lan, 
or on internet if the option '/internet' is specified. 

TMDedicatedServer can be launched at the same time that the retail version of TMOriginal, TMSunrise Extreme or TMNations game, but they cannot share TCP and UDP ports. 
It is recommended to launch the dedicated server before the game, so the dedicated server can use the expected ports.

In summary all the options, that can be specified to the dedicated server, are the followings:

- /dedicated_cfg=config_file            Specify a configuration file to use.
- /game_settings=settings_file          Specify a game settings file to use.
- /internet                             Specify to the server that it must connect to the master server, in order to be an internet server.
- /verbose_rpc                          Display the XmlRpc requests the dedicated server receives. 
                                        The server will only display the name of the XmlRpc command and some parameters.
- /verbose_rpc_full                     Display the whole contents of the XmlRpc requests the dedicated server receives.
- /nodaemon 							(linux) Doesn't detach the process.
- /nologs								disable the creation of "GameLog.txt" and "ConsoleLog.txt"
- /login=xxx							Masterserver account (overrides the value from the config_file)
- /password=xxx							Masterserver account (overrides the value from the config_file)
- /servername=xxx						name of the server to create. (overrides the value from the config_file)
- /serverpassword=xxx					password to join the server. (overrides the value from the config_file)
- /loadcache							loads the "checksum.txt" instead of recomputing it. *DO NOT USE* if you run several servers in the same directory! 

3.CONTROL:
----------

After being launched (with or without configuration files), the server can be also configured and controlled by rpc calls.
An external application can use any xmlrpc library to communicate with the dedicated server.
Some calls are only permitted to certain authorization level. There are three authorization levels (User, Admin and SuperAdmin), 
each one having an associated password (by default the same as the level name). 
The 'Authenticate' method can be used to switch to a specified level.

The list of method that can be called by xmlrpc is as follows:

- 'Authenticate' : Allow user authentication by specifying a 'Login' and a 'Password', to gain access to the set of functionalities corresponding to this authorization level.
- 'ChangeAuthPassword' : Change the password for the specified authentification level. Only available to SuperAdmin.
- 'GetVersion' : Returns a struct with the 'Name' and 'Version' of the application remotely controled.
- 'GetStatus' : Returns a struct with the 'Code' and 'Name' of the current status of the server.
- 'QuitGame' : Quit the application. Only available to SuperAdmin.
- 'StartServerLan' : Start a server on lan. Only available to SuperAdmin.
- 'StartServerInternet' : Start a server on internet using the 'Login' and 'Password' specified in the struct passed as parameters. Only available to SuperAdmin.
- 'GetLastConnectionErrorMessage' : Returns the last error message for an internet connection. Only available to SuperAdmin.
- 'StopServer' : Stop the server. Only available to SuperAdmin.
- 'GetBaseDirectory' : Returns the path of the dedicated server application. Only available to Admin.
- 'GameDataDirectory' : Returns the path of the game datas directory. Only available to Admin.
- 'GetTracksDirectory' : Returns the path of the tracks directory. Only available to Admin.
- 'GetSkinsDirectory' : Returns the path of the skins directory. Only available to Admin.
- 'ChallengeRestart' : Restarts the challenge. Only available to Admin.
- 'NextChallenge' : Switch to next challenge. Only available to Admin.
- 'CallVote' : Call vote for a command. The command is a XML string corresponding to an XmlRpc request. Only available to Admin.
- 'ChatSend' : Send a text message to all clients. Only available to Admin.
- 'ChatSendToLogin' : Send a text message to the client with the specified login. Only available to Admin.
- 'ChatSendToId' : Send a text message to with the specified PlayerId. Only available to Admin.
- 'ChatSendServerMessage' : Send a server message to all clients without the server login. The message is shown using the color index. There are three predefined colors: '0'=White, '1'=Green, '2'=Red. Only available to Admin.
- 'GetChatLines' : Returns the last chat lines. Maximum of 20 lines. Only available to Admin.
- 'AddChatCommand' : Add a new command 'cmd' for the chat, i.e. a chat message that begins with '/cmd ' will not be transmitted to clients. Only available to Admin.
- 'RemoveChatCommand' : Remove a chat command. Only available to Admin.
- 'CleanChatCommand' : Remove all chat commands. Only available to Admin.
- 'GetChatCommandList' : Returns the list of chat commands. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structure. Each structure contains the following fields : 'Name'.
- 'SendDisplayServerMessage' : Display a text message on all clients. The parameters are the text message to display, the label of the first button, the label of the second button, a timeout for the message box. This message is displayed in a message box with one or two buttons, if the label are not empty. The message box will disapear after the timeout if it's non-zero. Only available to Admin.
- 'SendDisplayServerMessageToId' : Display a text message on the client with the specified UId. The parameters are the UId of the player, the text message to display, the label of the first button, the label of the second button, and a timeout for the message box. This message is displayed in a message box with one or two buttons, if the corresponding label are not empty. The message box will disapear after the timeout if it's non-zero. Only available to Admin.
- 'SendDisplayServerMessageToLogin' : Display a text message on the client with the specified login. The parameters are the login of the player, the text message to display, the label of the first button, the label of the second button, and a timeout for the message box. This message is displayed in a message box with one or two buttons, if the corresponding label are not empty. The message box will disapear after the timeout if it's non-zero. Only available to Admin.
- 'SendHideServerMessage' : Hide the displayed message on all clients. Only available to Admin.
- 'SendHideServerMessageToId' : Hide the displayed message on the client with the specified UId. Only available to Admin.
- 'SendHideServerMessageToLogin' : Hide the displayed message on the client with the specified login. Only available to Admin.
- 'SetServerOptions' : Set new server options using the struct passed as parameters. This struct must contain the following fields : 'Name', 'Comment', 'Password', 'PasswordForSpectator', 'NextMaxPlayers', ,'NextMaxSpectators', 'IsP2PUpload', 'IsP2PDownload', 'NextLadderMode', 'NextVehicleNetQuality', 'NextCallVoteTimeOut', 'CallVoteRatio' and 'AllowChallengeDownload'. Only available to Admin. A change of NextMaxPlayers, NextMaxSpectators, NextLadderMode or NextCallVoteTimeOut requires a challenge restart to be taken into account.
- 'GetServerOptions' : Returns a struct containing the server options i.d. 'Name', 'Comment', 'Password', 'PasswordForSpectator', 'CurrentMaxPlayers', 'NextMaxPlayers', 'CurrentMaxSpectators', 'NextMaxSpectators', 'IsP2PUpload', 'IsP2PDownload', 'CurrentLadderMode', 'NextLadderMode', 'CurrentVehicleNetQuality', 'NextVehicleNetQuality', 'CurrentCallVoteTimeOut', 'NextCallVoteTimeOut', 'CallVoteRatio' and 'AllowChallengeDownload'.
- 'SetServerName' : Set a new server name in utf8 format. Only available to Admin.
- 'GetServerName' : Get the server name in utf8 format.
- 'SetServerComment' : Set a new server comment in utf8 format. Only available to Admin.
- 'GetServerComment' : Get the server comment in utf8 format.
- 'SetServerPassword' : Set a new password for the server. Only available to Admin.
- 'GetServerPassword' : Get the server password if called as Admin or Super Admin, else returns if a password is needed or not.
- 'SetServerPasswordForSpectator' : Set a new password for the spectator mode. Only available to Admin.
- 'GetServerPasswordForSpectator' : Get the password for spectator mode if called as Admin or Super Admin, else returns if a password is needed or not.
- 'SetMaxPlayers' : Set a new maximum number of players. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetMaxPlayers' : Get the current and next maximum number of players allowed on server. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetMaxSpectator' : Set a new maximum number of Spectators. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetMaxSpectator' : Get the current and next maximum number of Spectators allowed on server. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'EnableP2PUpload' : Enable or disable peer-to-peer upload from server. Only available to Admin.
- 'IsP2PUpload' : Returns if the peer-to-peer upload from server is enabled.
- 'EnableP2PDownload' : Enable or disable peer-to-peer download for server. Only available to Admin.
- 'IsP2PDownload' : Returns if the peer-to-peer download for server is enabled.
- 'SetLadderMode' : Set a new ladder mode between ladder inactive (0), normal mode (1), and forced ladder (2). Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetLadderMode' : Get the current and next ladder mode on server. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetVehicleNetQuality' : Set the network vehicle quality to Fast (0) or High (1). Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetVehicleNetQuality' : Get the current and next network vehicle quality on server. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetCallVoteTimeOut' : Set a new timeout for waiting for votes. A zero value disables callvote. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetCallVoteTimeOut' : Get the current and next timeout for waiting for votes. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetCallVoteRatio' : Set a new ratio for accepting callvote. Must lie between 0 and 1. Only available to Admin.
- 'GetCallVoteRatio' : Get the current ratio for accepting callvote. This value lies between 0 and 1.
- 'AllowChallengeDownload' : Allow clients to download challenges from the server. Only available to Admin.
- 'IsChallengeDownloadAllowed' : Returns if clients can download challenges from the server.
- 'SetGameInfos' : Set new game settings using the struct passed as parameters. This struct must contain the following fields : 'GameMode', 'RoundsPointsLimit', 'RoundsUseNewRules', 'TimeAttackLimit', 'TimeAttackSynchStartPeriod', 'TeamPointsLimit', 'TeamMaxPoints', 'TeamUseNewRules', 'LapsNbLaps', 'LapsTimeLimit' and 'ChatTime'. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetGameInfos' : Returns a struct containing two other structures, the first containing the current game settings and the second the game settings for next challenge. The first structure is named 'CurrentGameInfos' and the second 'NextGameInfos'.
- 'GetCurrentGameInfo' : Returns a struct containing the current game settings i.d. 'GameMode', 'RoundsPointsLimit', 'RoundsUseNewRules', 'TimeAttackLimit', 'TimeAttackSynchStartPeriod', 'TeamPointsLimit', 'TeamMaxPoints', 'TeamUseNewRules', 'LapsNbLaps', 'LapsTimeLimit', 'ChatTime' and 'NbChallenge'.
- 'GetNextGameInfo' : Returns a struct containing the game settings for the next challenge i.d. 'GameMode', 'RoundsPointsLimit', 'RoundsUseNewRules', 'TimeAttackLimit', 'TimeAttackSynchStartPeriod', 'TeamPointsLimit', 'TeamMaxPoints', 'TeamUseNewRules', 'LapsNbLaps', 'LapsTimeLimit', 'ChatTime' and 'NbChallenge'.
- 'SetChatTime' : Set a new chat time value in milliseconds. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetChatTime' : Get the current and next chat time. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetGameMode' : Set a new game mode between Rounds (0), TimeAttack (1), Team (2), Laps (3) and Stunts (4). Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetGameMode' : Get the current game mode.
- 'SetTimeAttackLimit' : Set a new time limit for time attack mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetTimeAttackLimit' : Get the current and next time limit for time attack mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetTimeAttackSynchStartPeriod' : Set a new synchronised start period for time attack mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetTimeAttackSynchStartPeriod' : Get the current and synchronised start period for time attack mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetLapsTimeLimit' : Set a new time limit for laps mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetLapsTimeLimit' : Get the current and next time limit for laps mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetNbLaps' : Set a new number of laps for laps mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetNbLaps' : Get the current and next number of laps for laps mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetRoundPointsLimit' : Set a new points limit for rounds mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetRoundPointsLimit' : Get the current and next points limit for rounds mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetUseNewRulesRound' : Set if new rules are used for rounds mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetUseNewRulesRound' : Get if the new rules are used for rounds mode (Current and next values). The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetTeamPointsLimit' : Set a new points limit for team mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetTeamPointsLimit' : Get the current and next points limit for team mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetMaxPointsTeam' : Set a new number of maximum points per round for team mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetMaxPointsTeam' : Get the current and next number of maximum points per round for team mode. The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'SetUseNewRulesTeam' : Set if new rules are used for team mode. Only available to Admin. Requires a challenge restart to be taken into account.
- 'GetUseNewRulesTeam' : Get if the new rules are used for team mode (Current and next values). The struct returned contains two fields 'CurrentValue' and 'NextValue'.
- 'GetCurrentChallengeIndex' : Returns the current challenge index in the selection.
- 'GetCurrentChallengeInfo' : Returns a struct containing the infos for the current challenge. The struct contains the following fields : 'Name', 'UId', 'FileName', 'Author', 'Environnement', 'Mood', 'BronzeTime', 'SilverTime', 'GoldTime', 'AuthorTime', 'CopperPrice' and 'LapRace'.
- 'GetChallengeInfo' : Returns a struct containing the infos for the challenge with the specified filename. The struct contains the following fields : 'Name', 'UId', 'FileName', 'Author', 'Environnement', 'Mood', 'BronzeTime', 'SilverTime', 'GoldTime', 'AuthorTime', 'CopperPrice' and 'LapRace'.
- 'GetChallengeList' : Returns a list of challenges among the current selection of the server. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the selection. The list is an array of structure. Each structure contains the following field : 'Name', 'UId', 'FileName', 'Environnement', 'Mood', 'GoldTime' and 'CopperPrice'.
- 'AddChallenge' : Add the challenge with the specified filename at the end of the current selection. Only available to Admin.
- 'AddChallengeList' : Add the list of challenges with the specified filename at the end of the current selection. Only available to Admin.
- 'RemoveChallenge' : Remove the challenge with the specified filename from the current selection. Only available to Admin.
- 'RemoveChallengeList' : Remove the list of challenges with the specified filenames from the current selection. The list of challenge to remove is an array of strings. Only available to Admin.
- 'InsertChallenge' : Insert the challenge with the specified filename after the current challenge. Only available to Admin.
- 'InsertChallengeList' : Insert the list challenges with the specified filenames after the current challenge. The list of challenge to insert is an array of strings. Only available to Admin.
- 'ChooseNextChallenge' : Set as next challenge the one with the specified filename, if it is present in the selection. Only available to Admin.
- 'ChooseNextChallengeList' : Set as next challenge the list of challenges with the specified filename, if they are present in the selection. Only available to Admin.
- 'LoadMatchSettings' : Set a list of challenges defined in the playlist with the specified filename as the current selection of the server, and load the gameinfos from the same file. Only available to Admin.
- 'AppendPlaylistFromMatchSettings' : Add a list of challenges defined in the playlist with the specified filename at the end of the current selection. Only available to Admin.
- 'SaveMatchSettings' : Save the current selection of challenge in the playlist with the specified filename, as well as the current gameinfos. Only available to Admin.
- 'InsertPlaylistFromMatchSettings' : Insert a list of challenges defined in the playlist with the specified filename after the current challenge. Only available to Admin.
- 'GetPlayerList' : Returns the list of players on the server. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structure. Each structure contains the following field : 'Login', 'NickName', 'PlayerId' and 'LadderRanking'.
- 'GetPlayerInfo' : Returns a struct containing the infos on the player with the specified login. The structure contains the following fields : 'Login', 'NickName', 'IPAddress', 'ConnectionType', 'PlayerId', 'IsSpectator', 'IsInOfficialMode', 'HasJoinMatch', a structure named 'Avatar', an array of structure named 'Skins' and a structure named 'LadderStats'. The structure 'Avatar' and each structure of the array 'Skins' contains two fields 'FileName' and 'Checksum'. The structure 'LadderStats' contains the following fields : 'Ranking', 'Score', 'LastMatchScore', 'NbrMatchWins', 'NbrMatchDraws', 'NbrMatchLosses', 'NbrTotalPlayers', 'TeamName', 'TeamRanking', 'NbrTotalTeams'.
- 'GetCurrentRanking' : Returns the current ranking for the race in progress. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the ranking. The ranking returned is a list of structure. Each structure contains the following fields : 'Login', 'NickName', 'Rank', 'BestTime', 'Score' and 'LadderScore'.
- 'GetNetworkStats' : Returns a struct containing the networks stats of the server. The structure contains the following fields : 'Uptime', 'NbrConnection', 'MeanConnectionTime', 'MeanNbrPlayer', 'RecvNetRate', 'SendNetRate', 'TotalReceivingSize', 'TotalSendingSize' and an array of structure named 'PlayerNetInfos'. Each structure of the array PlayerNetInfos contains the following fields : 'Login', 'IPAddress', 'LastTransferTime', 'DeltaBetweenTwoLastNetState', 'PacketLossRate'. Only available to SuperAdmin.
- 'Kick' : Kick the player with the specified login. Only available to Admin.
- 'KickId' : Kick the player with the specified PlayerId. Only available to Admin.
- 'Ban' : Ban the player with the specified login. Only available to Admin.
- 'BanId' : Ban the player with the specified PlayerId. Only available to Admin.
- 'UnBan' : Unban the player with the specified client name. Only available to Admin.
- 'CleanBanList' : Clean the ban list of the server. Only available to Admin.
- 'GetBanList' : Returns the list of player banned. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structure. Each structure contains the following fields : 'Login', 'ClientName' and 'IPAddress'.
- 'AddGuest' : Add the player with the specified login on the guest list. Only available to Admin.
- 'RemoveGuest' : Remove the player with the specified login from the guest list. Only available to Admin.
- 'CleanGuestList' : Clean the guest list of the server. Only available to Admin.
- 'GetGuestList' : Returns the list of player on the guest list. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structure. Each structure contains the following fields : Login.
- 'LoadGuestList' : Load the guest list file with the specified file name. Only available to Admin.
- 'SaveGuestList' : Save the guest list in the file with specified file name. Only available to SuperAdmin.
- 'BlackList' : Blacklist the player with the specified login. Only available to SuperAdmin.
- 'UnBlackList' : UnBlackList the player with the specified login. Only available to SuperAdmin.
- 'CleanBlackList' : Clean the blacklist of the server. Only available to SuperAdmin.
- 'GetBlackList' : Returns the list of player blacklisted. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structure. Each structure contains the following fields : 'Login'.
- 'LoadBlackList' : Load the black list file with the specified file name. Only available to SuperAdmin.
- 'SaveBlackList' : Save the black list in the file with specified file name. Only available to SuperAdmin.

In the '(PATH)\Server' directory, there is a .php script file that allows controlling the dedicated server. 
To use it, a webserver must be installed on the same computer. 
Any web server supporting PHP can be used, as the free web server Apache (www.apache.org) or EasyPHP a software package including Apache, PHP and MySQL (www.easyphp.org).

There is also the "GameController.exe", that allows controlling the dedicated server through a point&clic interface.
The sources are provided to build the application.
You can use them easily with either Microsoft's "Visual Studio .NET" or the free IDE "SharpDevelop" ( http://www.icsharpcode.net/OpenSource/SD/Default.aspx ).
Both projects files are provided (GameController.sln and GameController.cmbx).
A slightly modified version (that supports connecting to Trackmania) of the Xml-RPC.Net library is also included. ( http://www.xml-rpc.net/ )



4.CONFIGURATION FILE:
---------------------

The configuration file is an xml file which defines some parameters like the system configuration of server (IP address, ports...), passwords for the three authorization levels,
the master server account parameters that can be used for the launch of the dedicated server on internet, and other server parameters (name, comment, password, max players/spectators...).

You can find an example of configuration file (dedicated.cfg) in the TMDedicatedServer root directory.
Here is what it contains by default:

<?xml version="1.0" encoding="utf-8" ?>
<dedicated>
    <authorization_levels>
        <level>
            <name>SuperAdmin</name>
            <password>SuperAdmin</password>
        </level>
        <level>
            <name>Admin</name>
            <password>Admin</password>
        </level>
        <level>
            <name>User</name>
            <password>User</password>
        </level>
    </authorization_levels>
    
    <masterserver_account>
        <login></login>
        <password></password>
    </masterserver_account>
    
    <system_config>
        <connection_type>DSL_512</connection_type>
        <server_port>2350</server_port>
        <server_p2p_port>3450</server_p2p_port>
        <client_port>0</client_port>
        <xmlrpc_port>5000</xmlrpc_port>
        <force_ip_address>0.0.0.0:0</force_ip_address>
		<blacklist_url></blacklist_url>
    </system_config>
    
    <server_options>
        <name>TrackMania Dedicated Server</name>
        <comment></comment>
        <password></password>
        <password_spectator></password_spectator>
        <max_players>8</max_players>
        <max_spectators>8</max_spectators>
        <ladder_mode>normal</ladder_mode> // value between 'inactive', 'normal' and 'forced' (or '0', '1', '2')
        <vehicle_netquality>0</vehicle_netquality> // value between 'fast' and 'high' (or '0', '1')
        <enable_p2p_upload>True</enable_p2p_upload>
        <enable_p2p_download>True</enable_p2p_download>
        <callvote_timeout>60000</callvote_timeout>
        <callvote_ratio>0.5</callvote_ratio>
        <allow_challenge_download>True</allow_challenge_download>
    </server_options>
</dedicated>

The first block of parameters (<authorization_levels>...</authorization_levels>) allows to define passwords for the three authorization levels, 
that are SuperAdmin, Admin and User. 

SuperAdmin has all rights on the dedicated server. It can call any request, start and stop server, quit the application. 
It is recommanded to change this password, and to not give it to any other person.

Admin can be used to manage a launched server, but cannot neither stop or start server, nor quit the application. Admin password can be given 
to a group of users to facilitate the remote management of a dedicated server.

User can only access to 'get' requests, so it is not necessary to change this password.


The second block of parameters (<masterserver_account>...</masterserver_account>) is used for the connection to master server of the dedicated server.
To allow the server to connect to master server, a login and password, that identify the dedicated server, must be specified.
First this account has to be created. 
To do that, go to: 
    http://www.trackmania.com/dedicated/indexUk.php
or 
    http://www.trackmania.com/dedicated/indexFr.php
for a dedicated server account for TrackMania Original

And go to: 
    http://www.trackmaniasunrise.com/dedicated/indexUk.php
or 
    http://www.trackmaniasunrise.com/dedicated/indexFr.php
for a dedicated server account for TrackMania Sunrise

And go to: 
    http://www.trackmanianations.com/dedicated/indexUk.php
or 
    http://www.trackmanianations.com/dedicated/indexFr.php
for a dedicated server account for TrackMania Nations
*NOTE* Nations account management doesn't work at the moment. You'll have to create the accounts from the game.
    
Here you must enter your multiplayer key to connect to the account creation site. 
After that, you can create/modify as many accounts you want for dedicated server.
All these accounts must have logins different from the login used in TMOriginal, TMSunrise or TMNations game for the connection to internet. 
Game player accounts and dedicated server accounts are distinct.

The login and password of a game player account can also be used in the 'masterserver_account' block, instead of parameters from a dedicated server account.
But in this case the player cannot connect to internet with his game, because his account is already used by the dedicated server.


The third block of parameters (<system_config>...</system_config>) defines the system configuration of the server.
For example it allows to define the type of network connection used, the different ports used by the dedicated server, or an IP that will be published on the master server.
The different settings are :
    - connection_type			type of network connection used. It defines the network limitations of bandwidth that can be expected by the dedicated server
    - server_port				port number used by the server to listen the game connections
	- server_p2p_port			port number used by the server to listen the peer-to-peer connections
    - client_port				not used by dedicated server
    - xmlrpc_port				port number used by the server to listen xmlrpc calls
	- force_ip_address			if an IP address is defined in this parameter, the dedicated server will not search to detect its own IP address, but it will use this one instead.
	- blacklist_url				if an url is specified here, the dedicated server will check if there is an xml file that can be downloaded, and in this case if it's a blacklist file. If it is the case this blacklist will automaticly loaded for this server
	
The values allowed for the 'connection_type' parameter are the followings : 'Modem_56K', 'DSL_128', 'DSL_512', 'DSL_1024_128', 'DSL_1024_256', 
'DSL_2048_128', 'DSL_2048_256', 'DSL_2048_512', 'DSL_4096_256', 'DSL_4096_512', 'DSL_4096_1024', 'DSL_6144_256', 'DSL_6144_512', 'DSL_6144_1024', 
'DSL_8192_256', 'DSL_8192_512', 'DSL_8192_1024', 'DSL_8192_2048', 'DSL_16384_512', 'DSL_16384_1024', 'DSL_16384_2048', 'DSL_16384_4096', 'LAN'.


The fourth block of parameters (<server_options>...</server_options>) defines the main paramaters that will be used by the dedicated server.
The different settings are : 
    - name                      name of the dedicated server
    - comment                   comment of the dedicated server
    - password                  password needed at the connection to the dedicated server as player
    - password_spectator        password needed at the connection to the dedicated server as spectator
    - max_players               maximum number of client that can join the server as player
    - max_spectators            maximum number of client that can join the server as spectator
    - ladder_mode               ladder mode. The mode can be defined between these values : 'inactive' (0), 'normal' (1), and 'forced' (2)
    - enable_p2p_upload         value indicating if the server can upload custom data for P2P (0=False, 1=True)
    - enable_p2p_download       value indicating if the server can download custom data for P2P (0=False, 1=True)
    - callvote_timeout          timeout for waiting for votes (value in milliseconds)
    - callvote_ratio            ratio for accepting callvote. The value must lie between 0 and 1 (0=0%, 1=100%)
    - allow_challenge_download  value indicating if the server allows clients to download challenge (0=False, 1=True)



5.GAME SETTINGS FILE:
---------------------

A game settings file is an xml file which defines the match settings like chat time, game mode, mode parameters, and a playlist of challenge that will be loaded. 

You can find an example of game settings file (AllRaces_Original.txt) in the (PATH)\GameData\Tracks\MatchSettings\ directory.
Here is what it contains (not all challenges appear here) by default:

<?xml version="1.0" encoding="utf-8" ?>
<playlist>
    <gameinfos>
        <game_mode>1</game_mode>
        <chat_time>15000</chat_time>
        <rounds_pointslimit>50</rounds_pointslimit>
        <rounds_usenewrules>0</rounds_usenewrules>
        <timeattack_limit>300000</timeattack_limit>
        <team_pointslimit>5</team_pointslimit>
        <team_maxpoints>8</team_maxpoints>
        <team_usenewrules>1</team_usenewrules>
        <laps_nblaps>3</laps_nblaps>
        <laps_timelimit>0</laps_timelimit>
    </gameinfos>

 	<challenge>
		<file>Campaigns\Nadeo\Sunrise\Race\Holidays\CarPark.Challenge.Gbx</file>
	</challenge>
	<challenge>
		<file>Campaigns\Nadeo\Sunrise\Race\Holidays\GoodMorning.Challenge.Gbx</file>
	</challenge>
	.
	.
	.
	<challenge>
		<file>Campaigns\Nadeo\Sunrise\Race\Pointbreak\HappyBay.Challenge.Gbx</file>
	</challenge>
	<challenge>
		<file>Campaigns\Nadeo\Sunrise\Race\Pointbreak\Orbital.Challenge.Gbx</file>
	</challenge>
</playlist>

The first block of parameters (<gameinfos>...</gameinfos>) defines the match settings that will be used by the dedicated server.
The different settings are : 
    - game_mode             game mode used between Rounds (0), TimeAttack (1), Team (2), Laps (3) and Stunts (4)
    - chat_time             chat time value in milliseconds
    - rounds_pointslimit    points limit for rounds mode
    - rounds_usenewrules    value indicating if new rules are used for rounds mode (0=False, 1=True)
    - timeattack_limit      time limit in millseconds for time attack mode
    - team_pointslimit      points limit for team mode
    - team_maxpoints        number of maximum points per round for team mode
    - team_usenewrules      value indicating if new rules are used for team mode (0=False, 1=True)
    - laps_nblaps           number of laps for laps mode
    - laps_timelimit        time limit in milliseconds for laps mode

Other blocks (<challenge>...</challenge>) describe all the challenge that will be loaded by the dedicated server.
Each block specifies the filename of a challenge.
Filenames can be defined either by an absolute path or by a relative path to the '(PATH)\GameData\Tracks' directory.

Game settings file can be saved by the game with the 'save match settings' button in the server creation menu, after having selected the maps.
The files saved by the game are in the '(PATH)\GameData\Tracks\MatchSettings' directory.
So the relative designation for a such file is 'MatchSettings/settings_file.txt', where 'settings_file.txt' is the name of the saved file.



6.GUESTLIST FILE:
-----------------

A guestlist file ("guestlist.txt") can be created in the GameData repertory, and will be automaticly loaded by the game or server.
The guestlist file is an xml file as follows :

<?xml version="1.0" encoding="utf-8" ?>
<guestlist>
    <player>
        <login>Login1</login>   // login of the first player to blacklist
    </player>
    .
    .
    .
    <player>
        <login>LoginN</login>   // login of the n-th player to blacklist
    </player>
</guestlist>

A player on the guest list is allowed to enter into the server in any case, even if there is no player slot left, and without specifying the password, if it's required.



7.BLACKLIST FILE:
-----------------

A blacklist file ("blacklist.txt") can be created in the GameData repertory, and will be automaticly loaded by the game or server.
The blacklist file is an xml file as follows :

<?xml version="1.0" encoding="utf-8" ?>
<blacklist>
    <player>
        <login>Login1</login>   // login of the first player to blacklist
    </player>
    .
    .
    .
    <player>
        <login>LoginN</login>   // login of the n-th player to blacklist
    </player>
</blacklist>

A player on the black list will never be able to enter into the server.

8. KNOWN ISSUES
-----------------

- On the command you can't use names with ' ' in them, since the options are separated on whitespace, and no escaping (neither '\ ' nor '"') is supported...
- (linux only) the server expects the file names to be utf-8 encoded. So pay attention if you're using non-ascii characters.
- Nations account management doesn't work at the moment. You'll have to create the accounts from the game.


8.CHANGELOG
-----------------

2006-01-29:
- xml-rpc LoadGuestList and LoadBlackList now work (linux).
- support of running several instances of the server in the same folder. 
the logs are now postfixed with process id / login; and the cache checksum file is ignored by default.
- support of overriding some config_file values from the command line.
- fixed a network race condition, where a server could be put in a state where 
it was still running but no longer published on the masterserver.


2006-01-25b:
initial Nations support release.

