Difference between revisions of "API"

From BattleMaster Wiki
Jump to navigation Jump to search
 
 
Line 3: Line 3:
 
* HTTP Basic authentication
 
* HTTP Basic authentication
 
* Sessions are supported
 
* Sessions are supported
 +
* Basic API documentation is available via the XML-RPC introspection
  
  
==Information==
+
==Client Data==
;struct playerlist():Returns an associative array containing the list of players.
+
Clients can store arbitrary data server-side. This is intended for web-clients to store their data, but can be use creatively as well.
;struct characterlist():Returns an associative array containing the list of characters.
+
Clients have to supply a ClientID, a 16-byte string used to uniquely identify each client (and client version). It is very, very strongly recommended that clients only ever access their own data cache!
  
 
+
The data stored can be set via clientcache.store() and retrieved via clientcache.retrieve(). There are no other functions, all data handling must be done client-side.
==Management==
+
The cache is limited to 1024 characters and is stored as a blob. While clients can, in theory, bypass the limit and store data under several client IDs, doing so will result in the client being blocked.
;bool newplayer(Name,EMail,passhash,adminhash):Creates a new player account. Note that both password and adminpassword are md5 hashes, the actual passwords should '''never''' be sent over the network. Returns true/false for success/failure.
 
;bool deleteplayer(adminhash):Deletes player account. Returns true/false for success/failure.
 
  
  
 
[[Category: CombatMaster]]
 
[[Category: CombatMaster]]

Latest revision as of 11:22, 26 February 2006

Basics

  • XML-RPC
  • HTTP Basic authentication
  • Sessions are supported
  • Basic API documentation is available via the XML-RPC introspection


Client Data

Clients can store arbitrary data server-side. This is intended for web-clients to store their data, but can be use creatively as well. Clients have to supply a ClientID, a 16-byte string used to uniquely identify each client (and client version). It is very, very strongly recommended that clients only ever access their own data cache!

The data stored can be set via clientcache.store() and retrieved via clientcache.retrieve(). There are no other functions, all data handling must be done client-side. The cache is limited to 1024 characters and is stored as a blob. While clients can, in theory, bypass the limit and store data under several client IDs, doing so will result in the client being blocked.