[Bug Fix] Fix for random disconnects when a large number of guild members zone or disconnect #4402
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.
Description
Reports from multiple servers indicate that when a large number of guild members zone, or /ex to disconnect, some guild members will go linkdead and disconnect. Reports from both PEQ and EZ
It appears that the zone process is becoming overwhelmed with packet processing regarding sending guild member status (zone, time, etc). When an impacted client de-guilds, the problem is no longer experienced.
Fix
The destructor for Client was sending a guild member status packet with a zone_id = 0 to indicate that the client was offline. This packet would then be sent to all zone servers to notify guild players. This was originally established to notify clients when a player logged. However, if the client was simply zoning, the packet was still sent, even though the CompleteConnect function would immediately send another packet to indicate the new zone of the player.
Therefore, the destructor packet was modified to only be sent when the player is not zoning. This reduces the packet load by 50%, a significant reduction for large guilds.
I also confirmed that the db update for online status is occurring as designed and should not be an issue. (first logon, and a disconnect).
I believe that this will resolve the random nature of this issue.
Type of change
Testing
I monitored packets being sent when a guild member is logged in, and another guild member zones. When zoning, player A would receive 2 packets, one with a zone id of 0, another with the proper zone id. With the fix, player A receives a single packet with the updated zone id.
I logged clients into the arena, bazaar and crescent reach and monitored packets and the guild window to ensure it continues to function as expected.
Clients tested:
RoF2
Checklist