Skip to content

Commit e6bcbfd

Browse files
update
Updating the logic behind the list of client identifiers that should receive the ChangeOwnershipMessage when running a distributed authority network topology.
1 parent 83f09b7 commit e6bcbfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ internal void ChangeOwnership(NetworkObject networkObject, ulong clientId, bool
588588
networkObject.ChildNetworkBehaviours[i].UpdateNetworkProperties();
589589
}
590590

591-
// DANGO-TODO: CMB Service needs to be updated to check for these two already existing properties.
592-
message.ClientIds = NetworkManager.ConnectedClientsIds.Where((c) => c != NetworkManager.ServerClientId || !IsObjectVisibilityPending(c, ref networkObject)).ToArray();
591+
// Populate valid target client identifiers that should receive this change in ownership message.
592+
message.ClientIds = NetworkManager.ConnectedClientsIds.Where((c) => !IsObjectVisibilityPending(c, ref networkObject) && networkObject.IsNetworkVisibleTo(c)).ToArray();
593593
message.ClientIdCount = message.ClientIds.Length;
594594

595595
size = NetworkManager.ConnectionManager.SendMessage(ref message, NetworkDelivery.ReliableSequenced, NetworkManager.ServerClientId);

0 commit comments

Comments
 (0)