-
Notifications
You must be signed in to change notification settings - Fork 0
Protocol
- summary Specification of client-server communication.
The protocol should be simple and human-readable. Much like IRC, it is string-based and above TCP.
Commands must start with a number that must be included in the response. For example:
28 NEWUSER foo bar 28 OK
The server sometimes send broadcast messages to all clients. For example, when a new user is created, the server will send this message:
BROADCAST NEW_PLAYER 1 foo
Clients cannot send broadcast messages.
Lists and dictionaries are sent using the JSON encoding.
Get server capabilities
* OK <CAPS>
Standard PING command, is the server still alive?
* PONG <STRING>
Register a new user. Client must do LOGIN after this.
* OK * NOT_OK
Try to login.
* <PLAYERID> * NOT_OK
Try to set a property
* OK * NOT_OK
Ask the server for a visible object list.
* JSON encoded list of entities
Tell the server that we are now interested in objects close to POS.
* Difference list, objects to forget, new objects * NOT_OK (when can this error occur?)
Get info about specified type.
* Dict of information on the type.
Get info of specified entity
* List of information on the object * NOT_OK (User is not allowed to see this object at all)
Get list of players (all players or only players that are logged in right now).
* List of player ids
Get info on specified player, including oneself.
* Dictionary of players (player id as key, player name as value)
Objects may have actions, do a specific one. See EntityActions
* RET_VAL * NOT_OK
The game has a few actions, like "leave", "message player", and so forth. Do one such action.
* RET_VAL * NOT_OK
Is the player still connected?
* PONG <STRING>
Ask the client to move to POS, where it will likely be more interesting to be.
* OK
Things like players joining, The game being over and so on. The clients may want to request info on all other players to show a pretty scoreboard or sth.
* OK
A new entity shall be visible to the player.
* OK
Informs client that the amount of cash has changed. No reply.
This entity is no longer interesting
* OK
Update some property of Entity.
* OK