Dedimania : Help Page
Site & Statistics:
Usage:
Where to send queries ?
-
The initial script query dedimania.OpenSession should be done on a specific url, http://dedimania.net/RPC5/server.php , because if the account was not authenticated successfully then on http://dedimania.net:80xx/ ones it could make timeouts, slowing the other scripts/clients requests responses.
-
Next script queries (once successfully authenticated!) should be made on the http://dedimania.net:80xx/ urls, because these ones use far less server resources than the main one. You have to contact me at Slig or on the Dedimania forum for scripts devs, to both tell me that you are going to use Dedimania for your script, and to know what url you should use.
Note that later the main url will reply only to dedimania.CheckConnection, dedimania.GetVersion, dedimania.Authenticate and dedimania.ValidateAccount methods !
How to send a query ?
-
The query is a standard http text/xml call, with the xml message as the http body. This form is the standard xmlrpc calling form, and the reply will have that form too. This method is the right xmlrpc one, and should be preferred !
-
The query can also be a standard http text/html call, with the attribute 'xmlrpc'. This was added to permit easy requests using a standard html GET or POST query :
- The value for the 'xmlrpc' attribute is just a xmlrpc text, urlsafe base64 encoded.
- The method can be either GET or POST.
- The reply is just plain xmlrpc.
In the case of a GET query, the xmlrpc value has to be base64 encoded, but be cautious : it has to use the url-safe base64 RFC 3548 ('+' replaced by '-' and '/' replaced by '_'), and the URI size can be limited.
-
In all cases, the query and the reply can (and should) be compressed (gzip or deflate), using the standard http headers. After test and debug the compression should be used !
-
The client should try to support http keepalive (with long timeout, ie 4 minutes or more) : it will save some Dedimania server resources, and avoid to have connection timeouts on client side for each request !
The form of xmlrpc queries and replies
-
The xmlrpc query and result fully respect the xml-rpc specification.
-
It is better if client support cookies and keep-alive connections, avoiding to make a new connection for each request, which is better both for server and client. The server support long keep-alive (more than 5min), so the client really should support it too, to help reduce the server load ! In fact your script should support long http keep-alive and http compression !
What kind of records does Dedimania support ?
- General: the low limit for records is now 6s : no records under that limit will be stored. Scripts should not send records for challenges with author time under 8s !
- Rounds: round final time. And for a multilap challenge only if the number of laps is the main number of laps of the map, and not a different number forced using RoundForcedLaps !
- Time attack: attempt final time.
- Laps: lap time (ie best lap time). Is merged with Time Attack records.
- Stunts: attempt final score (actually not supported).
- Cup: round final time. Is merged with Rounds records.
What kind of records does Dedimania not support ?
- General: times under 6s are refused.
- Rounds: multilap challenge with the number of laps different than the main number of laps of the map (mainly using RoundForcedLaps) is not supported ! (eventually the script can send best lap as a Laps record)
- Laps: more than one lap is not supported, only lap time is.
- Stunts: actually not supported.
Sending xmlrpc request methods
- It is mandatory to first send a 'dedimania.OpenSession' to get the SessId which is asked in the other methods. You do not need to send OpenSession in each request, and in fact you must not do it !
You have to use system.multicall in most cases to be able to send several methods in one single query ; you should probably always use 'dedimania.WarningsAndTTR' as last method in your queries, so you will get warnings and not definitive errors of the previous methods in the query.
- In dedimania.OpenSession you can send the community code of the server login, instead of the password. After the first successful authentication with Nadeo masters, an MD5 of the password is stored, to make further authentications faster. The password and/or community code are not stored in the Dedimania database.
- Mainly, the standard usage of requests methods for a script using Dedimania records is :
dedimania.GetChallengeRecords at beginning of map (to indicate the current map, players, and get current records),
dedimania.SetServerPlayers every 4 minutes after the beginning of the map (to keep up to date server and players infos),
dedimania.SetChallengeTimes at the end of map (sending all players best time -new records or not-, and get the new records list),
dedimania.PlayerConnect when a player connects (can be skipped),
dedimania.PlayerDisconnect when a player disconnects (not really needed, will only speedup to show the player offline on tmstats).
- dedimania.CheckConnection and dedimania.GetVersion can be used to verify that your script requests are received correctly and understood by the Dedimania server, and that your script receives and understands the reply (most time only dedimania.Authenticate is used).
- dedimania.WarningsAndTTR should be used as last method of the request, to get warnings/errors (and some other infos) about previous methods.
Raw query/reply examples (without http compression of course)
Note1:
If you make a client script support, please notify it to Slig. First because I may open a new url port for your script, because the port 80 url use more resources, also because you should not use url used by other without telling it, and finally because i want to know what scripts are using Dedimania resources and on what port(s).
Note2:
The url http://dedimania.net/RPC5/server.php must never be used except for the dedimania.OpenSession method. To know what url you have to use, see note 1 !
Note3: MaxRank
The MaxRank work at several levels. Except special case where the player MaxRank is 0 because he is banned, a player
can always make a record on a server and challenge at the max rank determined by the max of ServerMaxRecords, his own MaxRank, and the MaxRank stored for his current record if he has one.
- ServerMaxRecords is the server MaxRank, any player connected and not banned can make a record at least up to this value.
- dedimania.PlayerArrive/MaxRank is the player MaxRank, the player can make a record up to this value also if ServerMaxRecords is smaller.
- records MaxRank is the max of current player record and his general MaxRank, the record remain valid if not above that value (or ServerMaxRecords value if bigger).
Please, don't use robots on this page. Thanks.