mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
ec37f1c790
The client cancels its own room load when the server says it is nowhere. OnPresenceHeartbeatResponse XORs (cachedRoomInstance != null) against (serverRoomInstance != null), so a client holding the instance it is joining while we answer null reads as the room vanishing mid-join: it logs "presence heartbeat response indicates local presence is out-of-sync", then "Attempting to go to Invalid RoomInstance", and cancels the very join the server was waiting on. It then retried until a heartbeat happened to miss the window, so entering a dorm took several attempts and looked like a load failure. Deferring the presence commit is about what everyone ELSE sees — presence stays uncommitted until the join is confirmed so a failed join leaves no ghost behind. It was never meant to change what the joining player is told about themselves. Echoing the pending target satisfies the XOR and matches what the client already has, while presence itself stays uncommitted. The null-room branch a few lines below already documents this exact XOR for the boot race and synthesises a dorm rather than answering null; the deferred branch contradicted it. The test drives matchmake/dorm and heartbeats inside the window before the join is reported, which is the state the client is actually in. Verified to fail against the previous behaviour rather than passing vacuously.