Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Fixed

- Fixed: Hosting again after failing to host now works correctly

- Fixed: NetworkHide followed by NetworkShow on the same frame works correctly (#1940)
- Fixed Hosting again after failing to host now works correctly (#1938)
- Fixed NetworkManager to cleanup connected client lists after stopping (#1945)
- Fixed NetworkHide followed by NetworkShow on the same frame works correctly (#1940)

## [1.0.0-pre.8] - 2022-04-27

Expand Down
19 changes: 13 additions & 6 deletions com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,7 @@ private void Initialize(bool server)
#endif
LocalClientId = ulong.MaxValue;

PendingClients.Clear();
m_ConnectedClients.Clear();
m_ConnectedClientsList.Clear();
m_ConnectedClientIds.Clear();
LocalClient = null;
NetworkObject.OrphanChildren.Clear();
ClearClients();

// Create spawn manager instance
SpawnManager = new NetworkSpawnManager(this);
Expand Down Expand Up @@ -862,6 +857,16 @@ private void Initialize(bool server)
NetworkConfig.NetworkTransport.Initialize(this);
}

private void ClearClients()
{
PendingClients.Clear();
m_ConnectedClients.Clear();
m_ConnectedClientsList.Clear();
m_ConnectedClientIds.Clear();
LocalClient = null;
NetworkObject.OrphanChildren.Clear();
}

/// <summary>
/// Starts a server
/// </summary>
Expand Down Expand Up @@ -1301,6 +1306,8 @@ internal void ShutdownInternal()
IsListening = false;
m_ShuttingDown = false;
m_StopProcessingMessages = false;

ClearClients();
}

// INetworkUpdateSystem
Expand Down