diff --git a/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs index 89bc9845f..116051b8a 100644 --- a/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs @@ -32,7 +32,7 @@ public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnection return Vector3.Distance(identity.transform.position, newObserver.identity.transform.position) < range; } - public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers, bool initialize) + public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers) { // cache range and .transform because both call GetComponent. int range = GetVisRange(identity); diff --git a/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs index 65ae6d4b1..ff2eadc13 100644 --- a/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs @@ -137,7 +137,7 @@ public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnection return identityNetworkMatch.matchId == newObserverNetworkMatch.matchId; } - public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers, bool initialize) + public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers) { if (!identity.TryGetComponent(out NetworkMatch networkMatch)) return; diff --git a/Assets/Mirror/Components/InterestManagement/Scene/SceneInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/Scene/SceneInterestManagement.cs index 94638b22c..8cbfa3bb8 100644 --- a/Assets/Mirror/Components/InterestManagement/Scene/SceneInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/Scene/SceneInterestManagement.cs @@ -94,7 +94,7 @@ public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnection return identity.gameObject.scene == newObserver.identity.gameObject.scene; } - public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers, bool initialize) + public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers) { if (!sceneObjects.TryGetValue(identity.gameObject.scene, out HashSet objects)) return; diff --git a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs index b02c9e75c..eb4c2c562 100644 --- a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs @@ -52,7 +52,7 @@ public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnection return (projected - observerProjected).sqrMagnitude <= 2; } - public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers, bool initialize) + public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers) { // add everyone in 9 neighbour grid // -> pass observers to GetWithNeighbours directly to avoid allocations diff --git a/Assets/Mirror/Components/InterestManagement/Team/TeamInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/Team/TeamInterestManagement.cs index 3fe284bf4..22a8eb017 100644 --- a/Assets/Mirror/Components/InterestManagement/Team/TeamInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/Team/TeamInterestManagement.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using UnityEngine; namespace Mirror @@ -145,7 +144,7 @@ public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnection return identityNetworkTeam.teamId == newObserverNetworkTeam.teamId; } - public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers, bool initialize) + public override void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers) { // If this object doesn't have a NetworkTeam then it's visible to all clients if (!identity.TryGetComponent(out NetworkTeam networkTeam)) diff --git a/Assets/Mirror/Runtime/InterestManagement.cs b/Assets/Mirror/Runtime/InterestManagement.cs index ae53c6379..ab149c324 100644 --- a/Assets/Mirror/Runtime/InterestManagement.cs +++ b/Assets/Mirror/Runtime/InterestManagement.cs @@ -54,7 +54,7 @@ public virtual void Reset() {} // // Mirror maintains .observing automatically in the background. best of // both worlds without any worrying now! - public abstract void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers, bool initialize); + public abstract void OnRebuildObservers(NetworkIdentity identity, HashSet newObservers); // helper function to trigger a full rebuild. // most implementations should call this in a certain interval. diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 95c5644a5..c8dfbc129 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -1442,7 +1442,7 @@ static void RebuildObserversCustom(NetworkIdentity identity, bool initialize) // not force hidden? if (identity.visible != Visibility.ForceHidden) { - aoi.OnRebuildObservers(identity, newObservers, initialize); + aoi.OnRebuildObservers(identity, newObservers); } // IMPORTANT: AFTER rebuilding add own player connection in any case