godotengine / godotengine/godot
MultiplayerSynchronizer - SetVisibilityFor spam errors if Peer is already removed.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.5.beta5.mono.official [c81fd6c51]
### System information
Godot v4.5.beta5.mono - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 32.0.15.6094) - AMD Ryzen 7 3700X 8-Core Processor (16 threads) - 31.92 GiB memory
### Issue description
I use BodyEntered and BodyExited to update my MultiplayerSynchronizer with SetVisibilityFor, this areas is attached to each Player in my game, however when this player disconnects with
```Csharp
Multiplayer.MultiplayerPeer.DisconnectPeer((int)id);
```
How I'm supposed to clean the Visible peers after they disconnect without get this amount of spam?
### Steps to reproduce
Just call SetVisibilityFor((int)_peerId, false) to any peer after it disconnects.
### Minimal reproduction project (MRP)
[network-test.zip](https://github.com/user-attachments/files/22258996/network-test.zip)
Contributor guide
Research direction
Start with MultiplayerSynchronizer and the SetVisibilityFor entry point, then trace how peer removal from DisconnectPeer interacts with the BodyEntered and BodyExited callbacks. Use the linked network-test.zip reproduction to trigger SetVisibilityFor for a disconnected peer; done means the disconnect no longer produces repeated errors while visibility updates remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100