XWIS/WOL Game Server Protocol
This server is essentially used to organize games and provide player chat capabilities. Games however are played between clients (p2p) and not run over this server.
The server is heavily influenced by IRC therefore “game lobbies” are actually IRC channels, with a password of zotclot9
. The game then interprets these channels as lobby names (eg: #Lob_18_0
translates to "GDI Barracks"). Player created channels however, are not converted. By default, the game client attempts to join #Lob_18_0
.
Notes:
This documentation reflects protocol used within the Tiberian Sun game client
→
denotes outbound traffic sent from the game client to server
←
denotes the expected response from the server to the game client
CVERS
This is how the client tells the server which C&C game it is. This uses the same number as the LOBCOUNT param passed to the Server Listing Server
→ CVERS 10496
VERCHK
This is how the game client checks if an update is available.
→ VERCHK 32512 720912 ← :irc.westwood.com 379 u :none none none 1 1000 NONREQ→ VERCHK 8448 65536 ← :irc.westwood.com 606 u :update.ea.com update world96 ts 65542_.rtp 65542 8448 REQ
PASS
To prevent normal IRC clients connecting, the server uses a password. The password is “supersecret”.
→ PASS supersecret
NICK
This line contains the desired username of the client
→ NICK Sean
APGAR
“APGAR” is the Westwood routine for encrypting passwords. This is a one-way hash and is generally never decrypted.
→ APGAR WaIMMsbf 0
SERIAL
This is the serial number used during game installation. WOL used it to check for pirated copies. Sometimes this is sent with a trailing 0
→ SERIAL 0000000000000000000000
USER
This is only used to maintain compatibility with the IRC Protocol. This exact line is sent to the server
→ USER UserName HostName irc.westwood.com :RealName
SETLOCALE
When you first connect to WOL, the game asks for your location. All locations have a code, this code is sent to the server to store.
→ SETLOCALE 4
← :irc.westwood.com 310 Sean 4
SETCODEPAGE
The SetCodePage method sets code page used for Unicode conversion. By default ANSI code page is used.
→ SETCODEPAGE 1252
← :irc.westwood.com 329 u 1252
GETLOCALE
Get the locale information for another user.
→ GETLOCALE Sean
← :irc.westwood.com 309 u Sean`4
GETCODEPAGE
Get the code page information provided by SETCODEPAGE.
→ GETCODEPAGE Sean
← :irc.westwood.com 328 u Sean`1252
SETOPT
This informs the server about the user’s preference. Two numbers represent the options set in the game’s options panel. 16 is Find Disable, 17 is Find Enable. 32 is Page Disable, 33 is Page Enable. No response is expected from the server
→ SETOPT 17,33
Retrieve clan information
If the ClanId is 0, the client is looking for it’s own clan information
→ SQUADINFO 0 ← :irc.westwood.com 310 u 8
← :irc.westwood.com 358 u 1`CNC Evolved`cnc:evo`0`0`1`0`0`0`0`0`0`0`x`x`x
Otherwise, retrieve clan info based on provided ClanId
→ SQUADINFO 1 ← :irc.westwood.com 358 u 1`CNC Evolved`cnc:evo`0`0`1`0`0`0`0`0`0`0`x`x`x
If there’s no clan information either way
→ SQUADINFO 0
← :irc.westwood.com 439
LIST
Retrieve channel (or lobby) listings
If the 0 18
parameters are sent, the client is looking for the main lobby listing
→ List 0 18
← :irc.westwood.com 321 u:
← :irc.westwood.com 327 u #Lob_18_0 13 0 388
← :irc.westwood.com 327 u #Lob_18_1 11 0 388
← :irc.westwood.com 323 u:End of /LIST
If the 18 18
parameters are sent, the client is looking for the player channel listing
→ List 18 18
← :irc.westwood.com 321 u:
← :irc.westwood.com 326 u #Sean's_game 1 0 18 0 0 128::g12X10,1614000249,10,10000,0,1,0,1,M.
← :irc.westwood.com 323 u:End of /LIST
JOIN
Used to join a lobby. Upon join the server needs to send the client the user listing (353), 366 and inform other clients of the join event
→ JOIN #Lob_18_0 zotclot9
← :Sean!u@h JOIN :1,0 #Lob_18_0
← :irc.westwood.com 353 u * #Lob_18_0 :@Sunbot,0,0 sean,0,0 cncwraith,1,0
← :irc.westwood.com 366 u #Lob_18_0 :End of /NAMES list
JOINGAME
User game channel creation or client joining user game channel. Upon either join, the server needs to send user listing (353), 366 and channel topic (332). If joining an existing game channel, the server needs to inform other clients of the join event.
Creating New Game
→ JOINGAME #Sean's_game 1 2 18 3 1 0 0
← :Sean!u@h JOINGAME 1 2 18 1 1 1095813458 0 :#Sean's_game
← :irc.westwood.com 332 u #Sean's_game :g12X10,1614000249,10,10000,0,1,0,1,ACCESS.MA
← :irc.westwood.com 353 u = #Sean's_game :@Sean,1,1095813458
← :irc.westwood.com 366 u #Sean's_game :End of /NAMES list
Joining an (existing) user game channel
→ JOINGAME #Sean's_game 1
← INFORMATION COMING SOON
PART
Used for a client to leave a channel.
→ PART #Sean's_game
← :Sean!u@h PART #Sean's_game
TOPIC
This needs to be saved and sent in LIST and On join. Standard IRC Topic Reply
→ TOPIC #Sean's_game :g12X10,1614000249,10,10000,0,1,0,1,G_CANYON.
GAMEOPT
Used within game channel to change color or side.
→ GAMEOPT #Sean's_game :R1,7
← GAMEOPT Sean :R1,7
STARTG
Used within a game channel by the channel operator (host) to start a game once all users have accepted.
→ STARTG #Sean's_game Sean,cncwraith
← Sean!u@h STARTG u :Sean 192.168.1.2 cncwraith 192.168.1.3 :12 1115237380
PAGE
Page another user, this works in game as well. Pages can only be sent to the recieving user if the user allows it via SETOPT
→ PAGE Sean :Hello world!
PRIVMSG
Used to send a private message. Private messages can be sent to any channel or user
→ :Sean!u@h PRIVMSG #Lob_18_0 :Hello world!
QUIT
Used to exit, leave or disconnect from the server.
→ QUIT
FINDUSEREX
Used to find an user. The user can only be found if the user allows it via SETOPT
User online
→ FINDUSEREX Sean 0
← :irc.westwood.com 398 u 0 :#Lob_18_0,0
User offline
→ FINDUSEREX Sean 0
← :irc.westwood.com 398 u 1
Originally published at seanwragg.com on August 10, 2007.