Guns Lobby Protocol

The lobby protocol is transported via TCP, so it's a reliable stream of data. The Edicomm base protocol may be occasionally relaxed for certain data transmission (e.g. tank shapes, map data).

Common Messages
These can be sent by either client or server, as needed.

Ping/pong: lag test
LAG [identifier]

A lag-test message requires that the receiving party (server or client) respond immediately to the sender with a LAG message of the same identifier. The identifier can be any string of reasonable length (recommend 2-4 chars for normal use). The sender can use the duration between sending original message and receiving reply to determine a reasonable round-trip time.

Implementation detail: The server may use this to poke at a client that hasn't sent any updates in a while.

Username change
USN &lt;new username&gt;

Self-explanatory. See also S2C nick change notification.

Chat to everyone
MSG &lt;text&gt;

Asks the server to relay a chat message on the current user's behalf. The server has an equivalent message that includes information on which client sent the chat message.

Chat to team members
MST &lt;text&gt;

Asks the server to relay a chat message only to the sender's team. The server has an equivalent message that includes information on which client sent the chat message.

Disconnect notification
USD [optional reason]

The client should notify the server when it intends to disconnect by sending this message. The client can optionally include a reason for disconnecting, which will be sent by the server to remaining players using the appropriate server-to-client message.

Global chat
MSG &lt;user-id&gt; &lt;text&gt;

This is the S2C version of the global chat C2S command. Note that this includes the user ID of the person messaging.

Team chat
MST &lt;user-id&gt; &lt;text&gt;

Another S2C version of an existing C2S command.

Name change notification
USN &lt;user-id&gt; &lt;username&gt;

This is sent to all clients when a player changes their nickname, as well as when they send their nickname in the first place. See also C2S username change.

Player disconnect notification
USD &lt;user-id&gt; [reason]

Sent to all but the departing client when a client announces its (duh?) imminent disconnection. The optional reason may be set by the client, or the server can fill in if necessary (e.g. USD 5 Connection lost and no reconnect for 30 seconds).