Skip to content

fix(protocol/gamespy1): ignore stale player list entries - #744

Merged
CosminPerRam merged 1 commit into
gamedig:masterfrom
cetteup:fix/protocol-gamespy1/ignore-stale-player-list-entries
Nov 16, 2025
Merged

CosminPerRam merged 1 commit into
gamedig:masterfrom
cetteup:fix/protocol-gamespy1/ignore-stale-player-list-entries

Conversation

@cetteup

@cetteup cetteup commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Removed the (now obsolete) handling of keyhash duplicates. Tested successfully on a few servers.

The old code logged a debug message, should we add one here to match?

closes #743

@cetteup

cetteup commented Nov 13, 2025

Copy link
Copy Markdown
Contributor Author

Turns out the old code (cd key hash deduplication) was an incomplete solution, as only some servers report the cd key hash. Meaning it still returned duplicate players for servers which do not report the key hash.

The new code reliability addresses the duplicates (which are stale entries with the same name).

@CosminPerRam CosminPerRam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supposing the server always sends the stale data after the N reported players count, this is a great fix.
Everything LGTM, please also add a line in the changelog file.

@cetteup
cetteup force-pushed the fix/protocol-gamespy1/ignore-stale-player-list-entries branch from ea555d9 to 3faf29e Compare November 16, 2025 15:28
@cetteup

cetteup commented Nov 16, 2025 •

Copy link
Copy Markdown
Contributor Author

@CosminPerRam It's no more than a guess, but it might be that the server allocates a fixed-size array for the list of players. That array might only be implemented to be replaced when players join, not when players leave. So after a player leaves, the data for the remaining players is updated in the first n = numplayers entries of the array, while any entries after that remain as they last were without receiving further updates. This explanation does align with what I saw during testing. The only time the servers seem to reset/reallocate the array is at round end/map load.

Added a line to changelog now.

@CosminPerRam
CosminPerRam merged commit 3f1a066 into gamedig:master Nov 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Battlefield 1942 servers send stale player list entries

2 participants