Delay in Network Resync for Clients After Host Re-hosts
Description:
We are experiencing a delay in network synchronization when the host of a multiplayer game stops their server and then re-hosts. Here’s the situation:
- A player hosts a match, and the “Network List” (a custom struct) syncs correctly with all clients.
- When the host stops the server and re-hosts, there is a noticeable delay in the synchronization of the network data for clients that were previously connected to the old host (delays range from 10 seconds to 50+ seconds).
- This issue does not occur if the host closes their application completely and restarts.
- The client closing their application has no effect on this issue.
- New clients (those that did not connect to the previous session) do not experience this delay, and the host version of the list updates as expected.
Steps to Reproduce:
- Have a player host a multiplayer match with a custom “Network List.”
- Clients connect to the server, and everything syncs correctly.
- The host shuts down the server and then re-hosts it.
- Clients who were previously connected to the first server experience a delay in the resync of the “Network List.”
- New clients joining the re-hosted server do not experience any delay.
Expected Behavior: When the host stops and re-hosts, all clients, including previously connected ones, should immediately sync with the new host without any noticeable delay in the data for the “Network List.”
Observed Behavior: Only new clients experience immediate synchronization with the new host. Clients that were previously connected experience a noticeable delay before the “Network List” is updated and resynced correctly.
Things I’ve Tried:
- Investigated the host migration and re-hosting process, but the issue persists.
- Checked for network message delays and race conditions, but could not identify the root cause.
Environment:
- Unity version: 6.000.00.30f1
- Network transport Solution tried: Facepunch, Local Network
- Netcode for GameObjects version tried: 2.2, 2.1, 1.11.0