Skip to content

Commit 8c0ad0f

Browse files
update
Removing exception and using error log and continue processing sending to any remaining clients.
1 parent c409a98 commit 8c0ad0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ internal void ChangeOwnership(NetworkObject networkObject, ulong clientId, bool
627627
{
628628
if (client.Key != client.Value.ClientId)
629629
{
630-
throw new Exception($"Client key {client.Key} does not match the Client Id {client.Value.ClientId}");
630+
NetworkLog.LogError($"[Client-{client.Key}] Client key ({client.Key}) does not match the {nameof(NetworkClient)} client Id {client.Value.ClientId}! Client-{client.Key} will not receive ownership changed message!");
631+
continue;
631632
}
632633
size = NetworkManager.ConnectionManager.SendMessage(ref message, NetworkDelivery.ReliableSequenced, client.Value.ClientId);
633634
NetworkManager.NetworkMetrics.TrackOwnershipChangeSent(client.Key, networkObject, size);

0 commit comments

Comments
 (0)