WarWorld protocol

1. Introduction

The current client-server architecture is very thin-client. This implies lots of communications and very few client-side tasks.

The protocol is currently text based, for debugging reasons (it is easy to connect to the server with telnet and type commands by hand).

The server tick during the game is 0.1 seconds by default, so the clients should be done with any drawing in this time. However, there is a simple synchronization that allows clients to run a bit slower.

Data representation


Rough communication example.


2. Connection initialization and termination

2.1. Server-to-client messages

Connections are accepted any time during the game. A future option might be creating a lobby system for synchronized launching.


VER varsionid
PLR playerid ipaddress name
LCH


QIT playerid

2.2. Client-to-server messages

PLR name
LCH


QIT

3. Messages during the game

3.1. Server-to-client messages


INI
END
RES amount
NEW playerid unitid classid
POS unitid x y orientation [cannon_orientation] Note: The classid is redundant. It might be more efficient to tell about new units and their unitclasses with a separate command.


WPT unitid x y
SHT unitid x y
HIT unitid hits_remaining
SCR playerid0 score0 died0 playerid1 score1 died1 playerid2 score2 ...
SEL playerid unitid1 unitid2 unitid3 ...


AIM playerid x y
SAY playerid message
ERR num message

3.2. Client-to-server messages


RDY


SEL unitid1 unitid2 unitid3 ...


AIM x y
MOV queue_cmd


SHT queue_cmd n
BLD classnid queue_cmd n

Notes


References

Earlier protocol propositions:


Pääsivu Takaisin Last modified: Tue Feb 1 10:20:53 EET 2000