diff --git a/Assets/Mirror/Components/NetworkRoomManager.cs b/Assets/Mirror/Components/NetworkRoomManager.cs index a7a1713f8..a59bf91ac 100644 --- a/Assets/Mirror/Components/NetworkRoomManager.cs +++ b/Assets/Mirror/Components/NetworkRoomManager.cs @@ -271,7 +271,7 @@ public override void OnServerDisconnect(NetworkConnectionToClient conn) if (roomPlayer != null) roomSlots.Remove(roomPlayer); - foreach (NetworkIdentity clientOwnedObject in conn.clientOwnedObjects) + foreach (NetworkIdentity clientOwnedObject in conn.owned) { roomPlayer = clientOwnedObject.GetComponent(); if (roomPlayer != null) diff --git a/Assets/Mirror/Core/NetworkConnection.cs b/Assets/Mirror/Core/NetworkConnection.cs index 9c9a514cc..11204ff7d 100644 --- a/Assets/Mirror/Core/NetworkConnection.cs +++ b/Assets/Mirror/Core/NetworkConnection.cs @@ -47,8 +47,8 @@ public abstract class NetworkConnection // netId anymore: https://github.com/vis2k/Mirror/issues/1380 // Works fine with NetworkIdentity pointers though. // DEPRECATED 2022-02-05 - [Obsolete("Cast to NetworkConnectionToClient to access .clientOwnedObjects")] - public HashSet clientOwnedObjects => ((NetworkConnectionToClient)this).clientOwnedObjects; + [Obsolete("Cast to NetworkConnectionToClient to access .owned")] + public HashSet clientOwnedObjects => ((NetworkConnectionToClient)this).owned; // batching from server to client & client to server. // fewer transport calls give us significantly better performance/scale. diff --git a/Assets/Mirror/Core/NetworkConnectionToClient.cs b/Assets/Mirror/Core/NetworkConnectionToClient.cs index 504d3b6f7..6436be2f7 100644 --- a/Assets/Mirror/Core/NetworkConnectionToClient.cs +++ b/Assets/Mirror/Core/NetworkConnectionToClient.cs @@ -18,7 +18,10 @@ public class NetworkConnectionToClient : NetworkConnection // fixes a bug where DestroyOwnedObjects wouldn't find the // netId anymore: https://github.com/vis2k/Mirror/issues/1380 // Works fine with NetworkIdentity pointers though. - public new readonly HashSet clientOwnedObjects = new HashSet(); + public readonly HashSet owned = new HashSet(); + + [Obsolete(".clientOwnedObjects was renamed to .owned :)")] // 2022-10-13 + public new HashSet clientOwnedObjects => owned; // unbatcher public Unbatcher unbatcher = new Unbatcher(); @@ -76,18 +79,18 @@ internal void RemoveFromObservingsObservers() internal void AddOwnedObject(NetworkIdentity obj) { - clientOwnedObjects.Add(obj); + owned.Add(obj); } internal void RemoveOwnedObject(NetworkIdentity obj) { - clientOwnedObjects.Remove(obj); + owned.Remove(obj); } internal void DestroyOwnedObjects() { // create a copy because the list might be modified when destroying - HashSet tmp = new HashSet(clientOwnedObjects); + HashSet tmp = new HashSet(owned); foreach (NetworkIdentity netIdentity in tmp) { if (netIdentity != null) @@ -97,7 +100,7 @@ internal void DestroyOwnedObjects() } // clear the hashset because we destroyed them all - clientOwnedObjects.Clear(); + owned.Clear(); } } }