Skip to content

Commit 26dcdc6

Browse files
fix
Need to keep the NetworkClient around a tad longer during shutdown. Making adjustments for this.
1 parent 3706834 commit 26dcdc6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,8 +1512,9 @@ internal void Shutdown()
15121512
}
15131513
}
15141514

1515-
// Completely clear out the NetworkClient to default settings
1516-
LocalClient = new NetworkClient();
1515+
// Reset the approved and connectd flags
1516+
LocalClient.IsApproved = false;
1517+
LocalClient.IsConnected = false;
15171518

15181519
// Clear all lists
15191520
ConnectedClients.Clear();

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,8 @@ internal void ShutdownInternal()
15901590
// In the event shutdown is invoked within OnClientStopped or OnServerStopped, set it to false again
15911591
m_ShuttingDown = false;
15921592

1593-
// Reset the client's roles
1594-
ConnectionManager.LocalClient.SetRole(false, false);
1593+
// Completely reset the NetworkClient
1594+
ConnectionManager.LocalClient = new NetworkClient();
15951595

15961596
// This cleans up the internal prefabs list
15971597
NetworkConfig?.Prefabs?.Shutdown();

0 commit comments

Comments
 (0)