Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code base already started a convention of prefixing methods
that send a network message with
Send
But not all methods followed this pattern. This commit cleans that up.
While reading the code it is now more obvious when a network message is
sent. See the following example.
Before it was hard to understand if ForceVote changes some internal
state or sends a network message.
Now it is clear that
SendForceVote
does send a message.Also chat.cpp had the methods
Say
andAddLine
one sends a networkmessage the other just locally adds a new line to the chat log.
I renamed
Say
toSendChat
which is also now matching the namingof the server side. Any other method in chat.cpp can now be assumed to
not send any network message.
The method
UpdateGameInfo(int ClientID)
does not have any sideeffects. It does not update any game info variables. The only thing it
does is sending the current game info to the ClientID. So the new name
SendGameInfo(int ClientID)
is more descriptive.The client sending the startinfo is a crucial part of building up
a healthy connection.
The server responds with 3 or more (depending on the amount of votes) messages.
That used to be one big wall of code that required comments to
understand where a new message starts. Now the protocol is easier to
understand while looking at the code. Without the need of comments.