com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Host and client not disconnected when relay connection lost

Open LPLafontaineB opened this issue 4 years ago • 3 comments

Describe the bug In Boss Room, if we start a game using Unity Relay, with a host and a client, then later remove our internet connection by disabling wifi on the device, or pulling out the ethernet cable, no disconnection message is sent either to the host nor to the client. The client doesn't receive any updates, and its messages aren't sent to the host, but the host can still play.

Both the host and the client receive hundreds of "There are pending packets after the baselib process send" warnings, and this error: Error sending the message: Currently unable to queue packet as there is too many inflight packets. UnityEngine.Debug:LogError (object) Unity.Netcode.UnityTransport:SendBatchedMessage (ulong,Unity.Collections.NativeArray`1<byte>&,Unity.Networking.Transport.NetworkPipeline) (at Library/PackageCache/[email protected]/Runtime/UnityTransport.cs:689) Unity.Netcode.UnityTransport:SendBatchedMessageAndClearQueue (Unity.Netcode.UnityTransport/SendTarget,Unity.Netcode.UnityTransport/SendQueue) (at Library/PackageCache/[email protected]/Runtime/UnityTransport.cs:750) Unity.Netcode.UnityTransport:FlushAllSendQueues () (at Library/PackageCache/[email protected]/Runtime/UnityTransport.cs:736) Unity.Netcode.UnityTransport:Update () (at Library/PackageCache/[email protected]/Runtime/UnityTransport.cs:518)

To Reproduce Steps to reproduce the behavior:

  1. Download and setup Boss Room to use it with Unity Relay
  2. Start a game as a host and join with a client, e.g. via ParrelSync
  3. Go through character selection to move to the game scene
  4. Remove internet connection
  5. See outcome

Actual outcome The host continues playing as if nothing happened, even though it receives no messages from clients and none of its messages reach any of them. The client's game is stuck.

Expected outcome The host and client should be disconnected.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows10
  • Unity Version: 2020.3.21f1
  • Netcode Version: 1.0.0-pre.3

Additional context Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue.

LPLafontaineB avatar Dec 02 '21 18:12 LPLafontaineB

We are having the same issue but over a real network. The service will cut out after a few minutes of actually being in the game. The game state freezes for the client but our inputs are still processed at the host end. So this means we can see updates on the host when the frozen client clicks but the client does not update.

kylemiller3 avatar Dec 08 '21 04:12 kylemiller3

Added to backlog MTT-3065

ashwinimurt avatar Mar 30 '22 15:03 ashwinimurt

Assigning to @ashwinimurt to verify if this is fixed.

ashwinimurt avatar Aug 22 '22 18:08 ashwinimurt

@LPLafontaineB I believe this issue is already fixed. Please reopen if we encounter again.

ashwinimurt avatar Nov 01 '22 18:11 ashwinimurt

I tested it on my side and see that the client is now properly disconnected, but the host still thinks it is connected and can carry on playing. Is there a way to notify the host that it is no longer connected to the relay server?

LPLafontaineB avatar Nov 03 '22 14:11 LPLafontaineB