Moonbase
A moonbase commander clone.
Messages
Example of comms between sever and game master client.
| Server | Dest | Client 0 |
| HELLO_CLIENT protocolVersion:0, clientId:0 | New client | |
| HELLO_SERVER | ||
| YOU_ARE_THE_GAME_MASTER | First client to connect | |
| MAP_LIST [(mapId, name), …] | New client | |
| MAP_SELECTED mapId:0 | All clients | |
| MAP_DETAILS_REQ mapId:0 | ||
| MAP_DETAILS mapId:0, … | Client who requested | |
| PLAYER_JOINED clientId:0, name:"A", colour:0, race:0, team:0 | All clients | |
| GAME_OPTIONS wind:1, timer:30, fog:false | ||
| GAME_OPTIONS wind:1, timer:30, fog:false | All clients | |
| PLAYER_OPTIONS name:"A", colour:4, race:0, team:0 | ||
| PLAYER_OPTIONS clientId:0, name:"A", colour:4, race:0, team:0 | All clients | |
| PLAYER_JOINED clientId:1, name:"B", colour:1, race:1, team:1 | All clients | |
| PLAYER_JOINED clientId:2, name:"C", colour:2, race:2, team:2 | All clients | |
| CHAT message:"Hi B" | ||
| CHAT message:"Hi B" | All clients | |
| WHISPER toClientId:1, message:"I love you" | ||
| CHAT message:"I love you" | Client 1 | |
| READY | ||
| READY clientId:0 | All clients | |
| START_GAME state: … | All clients | |
| LAUNCH fromNodeId:0, angle:283, power:28, projectileId:4 | ||
| LAUNCH clientId:0, fromNodeId:0, angle:283, power:28, projectileId:4, result: … | All clients |
The LAUNCH messages to be sent from server to client should contain the complete server calculation of what happened. This can be quite complex for Moonbase. It will be a heirarchical data structure where child nodes occur as a result of parent nodes. e.g.
- (spike, from, to)
- (spike_trail, from, to)
- (damage, node, amount)
- (spike_trail, from, to)
- (damage, node, amount)
- (spike_trail, from, to)
page_revision: 1, last_edited: 1177383162|%e %b %Y, %H:%M %Z (%O ago)





