Fix: [Network] clients leaving because of broken connections was not broadcasted #9238
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.
During play-testing we found that if a client crashes (looking at your client @LordAro :P), only the server knew the client left. When he returned, there were two people with the same name, triggering a panic that our code is buggy.
In a sense, it is, but not in the way people were thinking :P
Motivation / Problem
To put it in different words:
https://github.com/OpenTTD/OpenTTD/blob/release/1.11/src/network/core/tcp_game.cpp#L54 is called when a connection is lost. It calls https://github.com/OpenTTD/OpenTTD/blob/release/1.11/src/network/network_server.cpp#L269 which said: owh, this status code? That means the clients were already informed! And didn't tell anyone about the loss of client.
Description
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.