Protocol description clarification

Protocol description clarification

Discuss development of lobby clients, server, autohosts and auto-download software.

Moderators: Moderators, Lobby Developers

Post Reply
p4wl
Posts: 6
Joined: 20 Oct 2013, 23:50

Protocol description clarification

Post by p4wl »

The protocol description says
{} = sentence = several words (at least one!) separated by space characters
{} {} ... = two or more sentences. They are separated by TAB characters.
words are always separated by space characters.
As an example here is the syntax of BattleOpened command:
BATTLEOPENED battleID type natType founder ip port maxPlayers passworded rank mapHash {engineName} {engineVersion} {map} {title} {gameName}
Reading the introduction, i assumed there should be a TAB after mapHash. It does not work like i thought (at least uberserver doesn't), there is a space between last 'word' and first 'sentence'. Is this the correct behavior to which all commands comply?

-P-
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: Protocol description clarification

Post by bibim »

p4wl wrote:Reading the introduction, i assumed there should be a TAB after mapHash.
Afaik the introduction defines how word parameters are separated, how sentence parameters are separated, but it doesn't define how the sentence parameters part is separated from the word parameters part.
p4wl wrote:It does not work like i thought (at least uberserver doesn't), there is a space between last 'word' and first 'sentence'. Is this the correct behavior to which all commands comply?
I can't say it is "the correct behavior" because it's not specified. But it's the way all commands have been implemented in the original lobby server and thus also in uberserver.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Protocol description clarification

Post by SirMaverick »

p4wl wrote:Reading the introduction, i assumed there should be a TAB after mapHash.
As you quoted the protocol description, sentences are separated from each other by tabs. A sentence following a word is therefore separated by space.
Funny fact: this way you cannot have words after sentences.
p4wl
Posts: 6
Joined: 20 Oct 2013, 23:50

Re: Protocol description clarification

Post by p4wl »

A sentence following a word is therefore separated by space.
This 'therefore' didn't crossed my mind :)

It seems like sentences are used for values containing spaces (strings like messages, engine names, titles, etc.) while all other data types are transmitted as words. The different separators make it mandatory to put all strings which possibly contain spaces at the end of a commands param list.

Anyway, i know how it works now, thank you for the replies.
Post Reply

Return to “Lobby Clients & Server”