smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

init message type is improperly documented #4773

Closed davidstone closed 6 years ago

davidstone commented 6 years ago

The documentation at https://github.com/Zarel/Pokemon-Showdown/blob/master/PROTOCOL.md states that an init message looks like:

|init|ROOMTYPE

The first message received from a room when you join it. ROOMTYPE is one of: chat or battle

However, the message received is actually that followed by a lot more information: the title of the room, the users logged in, the chat backlog, and some html. It also looks like various groups of things are separated by newlines in addition to the standard '|' separator.

Zarel commented 6 years ago

You're definitely misreading the documentation. Scroll up to the part that says:

Messages from the server to the user are in the form:

>ROOMID
MESSAGE
MESSAGE
MESSAGE
...

|init|ROOMTYPE is the first message. Nowhere in the documentation does it say that it's the only message.