Fix: [Network] State conditions for sending client info/quit packets #8959
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.
Motivation / Problem
The client connection state conditions under which clients connections are informed by the server of the presence or lack thereof of other connected clients are not consistent.
In particular, in the case where a client quits at approximately the same time as another clients joins, the joining client can informed of the presence of the other client, but not informed that it has quit, resulting in a stale entry in the joining client's client list window which remains indefinitely.
This can be artificially triggered by inserting a suitable sleep into ClientNetworkGameSocketHandler::SendGetMap.
A report was sent to me indicating that this can occur under normal conditions.
Description
Use status >= STATUS_AUTHORIZED as the state criteria for all cases where updates about other clients are sent.
This avoids the case where a client is informed that another client is present but not informed when it later quits, resulting in stale entries in the client list window.
Limitations
N/A
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.