-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The implementation of the game protocol assumes that the 40th packet type is a shut down. However, this lies far within the range of the packet types for which "ordering is unimportant from here".
As a result of changes this will now parse the "server company update" packet, and when the company passwords are gone the "client quit" packet. Those are not necessarily a big issue on itself, as the only user of the "server shutdown" packet is the game-coordinator, and that does not login so it won't get the "server company update" packet and it should never get the "client quit" packet from the server. It might receive an actual shutdown that causes a PacketInvalidType to be raised though.
So might it maybe make sense, since we know it's "broken" in any case to fix this for the future by moving a number of the more useful packets to the "stable" range such as "server shutdown" and maybe some others? Or would only "server shutdown" be enough?
As I understand the OpenTTD code at least "shut down", "new game", "send chat" and "send external chat" are called for all connections.
I would consider both chats to be bugs in OpenTTD; it should not send those unless at least identified (having logged in) => OpenTTD/OpenTTD#12377.
I would suggest moving "server shut down" and "server new game" to just after the 8 original stable packet types and before the range of unstable packet types. That way those packets will remain stable in the future.
Since the packets immediately after the original 8 stable packets will not be called without triggering a join, it is unlikely that any server will be sending anything with those packet numbers that isn't a shut down or new game packet without (the game-coordinator) sending a join. So it wouldn't break the game-coordinator any more than it already is => OpenTTD/OpenTTD#12379.