Skip to content

Fix duplicate zone enter/leave messages caused by bots in the player … - #466

Merged
enenra merged 2 commits into
MeridiusIX:masterfrom
jayph:fix/zone-announce-bot-players
Nov 17, 2026
Merged

enenra merged 2 commits into
MeridiusIX:masterfrom
jayph:fix/zone-announce-bot-players

Conversation

@jayph

@jayph jayph commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

…list

Vanilla bots (wildlife/creature spawners such as deer, wolves, spiders) are IMyPlayer objects that share the host's SteamUserId. RefreshAllPlayers matched them to the real player's entry by SteamUserId and replaced its Player reference, so on the next refresh the real player matched nothing and a new entry was created, which a bot then hijacked again. The list grew with stale or offline copies of the player, and each new entry re-triggered zone announcements (for example Entering Earth plus Leaving Helios on load or while standing still).

  • Skip bots and non-player identities when refreshing the player list
  • Flag PlayerEntityChanged when an entry's Player is reassigned
  • Stop searching after the first SteamUserId match

…list

Vanilla bots (wildlife/creature spawners such as deer, wolves, spiders) are
IMyPlayer objects that share the host's SteamUserId. RefreshAllPlayers matched
them to the real player's entry by SteamUserId and replaced its Player
reference, so on the next refresh the real player matched nothing and a new
entry was created, which a bot then hijacked again. The list grew with stale
or offline copies of the player, and each new entry re-triggered zone
announcements (for example Entering Earth plus Leaving Helios on load or
while standing still).

- Skip bots and non-player identities when refreshing the player list
- Flag PlayerEntityChanged when an entry's Player is reassigned
- Stop searching after the first SteamUserId match
@jayph

jayph commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Retested with the suggested IsIdentityNPC change applied (2cde27b), using the reporter's world. Loading in near the Earth zone boundary produced no messages, and crossing from outside to inside and back gave exactly one Entering Earth and one Leaving Earth message, with no repeats. The debug logging I used during the investigation showed the player list staying at a single entry even with vanilla wildlife bots spawned, where before it grew to 10 copies of the player within a few seconds.

@enenra
enenra merged commit b00cb93 into MeridiusIX:master Nov 17, 2026
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.

2 participants