Client-Lobby Protocol

From Soldat Community Wiki
Jump to: navigation, search

Here you will find an explanation of the entire Soldat client<>lobby server protocol. Right now this document explains the protocol used by the Soldat client. A cleaner and more user-friendly 3rd party lobby protocol will be created in the future to allow for 3rd party applications to more easily communicate with the lobby server.

This is the the protocol used as of Soldat 1.4.0, as implemented by FliesLikeABrick and EnEsCe. There is no documentation available for the earlier lobby protocol. As of late January 2011, the lobby server is partially maintained by jrgp.

General notes:

  • The current lobby is available at rr.soldat.pl:13073
  • The HTTP lobby is available at http://rr.soldat.pl
  • © is used as a field separator in all dealings with the lobby
  • All packets to/from the lobby end with \n


Every packet to/from the lobby starts with a byte that indicates what kind of data is contained. These types are involved in client communication with the lobby:

  • 101: A request to the lobby for the server list
  • 102: List beginning, specifies total number of servers about to be sent
  • 103: A server
  • 104: Signifies the end of the server list.

Packet Structures

101 Request List

This is the list request sent from the client to the lobby with all of the filter information set. The request format is:

VERSION©DEDICATED©PASSSWORDED©BOTS©SURVIVAL©REALISTIC©BONUSES©ADVANCE©WM©FULL©EMPTY©GAMETYPE©BE\n

Where:

  • VERSION is XY, coming from the Soldat version number 1.X.Y. For example, the version for 1.4.2 is 42, 0 is "do not care."
  • DEDICATED is 1 to filter "dedicated only," 0 is "do not care," ! is "not dedicated."
  • PASSWORDED is 1 to filter "no password," 0 is "do not care," ! is "passworded."
  • BOTS is 1 to filter "no bots," 0 is "do not care," ! is "with bots."
  • SURVIVAL is 1 to filter "survival mode only," 0 is "do not care," ! is "not survival."
  • REALISTIC is 1 to filter "realistic mode only," 0 is "do not care," ! is "not realistic."
  • BONUSES is 1 to filter "no bonuses," 0 is "do not care."
  • ADVANCE is 1 to filter "advance mode only," 0 is "do not care," ! is "not advanced."
  • WM is 1 to filter "wm servers only," 0 is "do not care," ! is "not wm."
  • FULL is 1 to filter "non-full games only," 0 is "do not care."
  • EMPTY is 1 to filter "non-empty games only," 0 is "do not care."
  • GAMETYPE is set to the game type that you want to see:
    • -1 is "do not care"
    • 0 is "DM only"
    • 1 is "PM only"
    • 2 is "TM only"
    • 3 is "CTF only"
    • 4 is "RM only"
    • 5 is "INF only"
    • 6 is "HTF only"
  • BE is 1 to filter "BE-protected servers only," 0 is "do not care."

Setting any fields to values other than those specified here will produce unexpected results.

102 List begin

This data type indicates the beginning of the server list that is returned from the lobby to the client. It contains no data except the number of servers that the list represents.

SERVERCOUNT\n

Where:

  • SERVERCOUNT is the number of servers in the list. The list starts with the next packet received in this connection



103 Server Entry

VERSION©IP©PORT©GAMESTYLE©PLAYERS©MAXPLAYERS©MAP©NAME©BOTS
©BONUSFREQ©RESPAWN©CONNECTION©SURVIVAL©REALISTIC©DEDICATED©OS©PASSWORDED©BE©COUNTRY\n

Where:

  • VERSION is XY, coming from the Soldat version number 1.X.Y. For example, the version for 1.4.2 is 42
  • IP is the IP of the server in dotted-quad format.
  • PORT is the port of the server
  • GAMESTYLE is the gamestyle of the server:
    • 1 is PM
    • 2 is TM
    • 3 is CTF
    • 4 is RM
    • 5 is INF
    • 6 is HTF
  • PLAYERS is the number of players in the server
  • MAXPLAYERS is the player limit of the server
  • MAP is the server's current map name
  • NAME is the name of the server
  • BOTS is the number of bots in the server
  • BONUSFREQ is the bonus frequency of the server
  • RESPAWN is the respawn time for the server
  • CONNECTION is the connection type of the server:
    • 0 is Modem
    • 1 is ISDN
    • 2 is DSL
    • 3 is T1
  • SURVIVAL is 1 for survival mode, 0 for not.
  • REALISTIC is 1 for realistic mode, 0 for not
  • DEDICATED is 1 for dedicated, 0 for not
  • OS is 1 for Linux, 0 for Windows
  • PASSWORDED is 1 for "password set," 0 for "no password"
  • BE is 1 if the server is BE-protected, 0 for not
  • COUNTRY is the 2 letter country code of the server or A1 for unknown



104 List End

This packet type signifies the end of the server list. It only consists of five field separators and an end-line character.

h©©©©©\n



Future Work

There are changes coming in the future. The lobby protocol as of 1.5.1 will most likely allow a client to specify a filter for scripting.

A future version of Soldat, possibly 1.5.2 or 1.6.0 (whatever "major" version there is after 1.5.0) will contain a new lobby that will allow the protocol to support link-dead and Berserker, as well as other games. This is to remove the need to maintain a server and protocol for each game. This new lobby will be called exLobby, and is currently being worked on by FliesLikeABrick

See Also

External Links