From 76a0480f52aabac725bd960db1e0f944b9763cd5 Mon Sep 17 00:00:00 2001 From: Noellie Velez Date: Mon, 23 Mar 2026 16:52:46 +0100 Subject: [PATCH 1/4] styling + is spawned check in internal has authory --- .../Runtime/Core/NetworkObject.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index c667af47db..05df0eabc0 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -390,7 +390,7 @@ private void CheckForInScenePlaced() /// Defaults to true, determines whether the will be destroyed. public void DeferDespawn(int tickOffset, bool destroy = true) { - // Ensure we log the DAMode message first as locking ownership is not allowed if not DA so the DA message is the most relevant. + // The DAMode message is logged first, as ownership locking isn’t allowed when not in DAMode, making it the most relevant message. if (!NetworkManager.DistributedAuthorityMode) { if (NetworkManager.LogLevel <= LogLevel.Error) @@ -606,7 +606,7 @@ internal void RemoveOwnershipExtended(OwnershipStatusExtended extended) /// true or false depending upon lock operation's success public bool SetOwnershipLock(bool lockOwnership = true) { - // Ensure we log the DAMode message first as locking ownership is not allowed if not DA so the DA message is the most relevant. + // The DAMode message is logged first, as ownership locking isn’t allowed when not in DAMode, making it the most relevant message. if (!NetworkManager.DistributedAuthorityMode) { if (NetworkManager.LogLevel <= LogLevel.Error) @@ -1154,8 +1154,11 @@ public bool HasOwnershipStatus(OwnershipStatus status) [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool InternalHasAuthority() { - var networkManager = NetworkManager; - return networkManager.DistributedAuthorityMode ? OwnerClientId == networkManager.LocalClientId : networkManager.IsServer; + if (!IsSpawned) + { + return false; + } + return NetworkManagerOwner.DistributedAuthorityMode ? OwnerClientId == NetworkManagerOwner.LocalClientId : NetworkManagerOwner.IsServer; } /// @@ -3541,7 +3544,7 @@ internal void SceneChangedUpdate(Scene scene, bool notify = false) OnMigratedToNewScene?.Invoke(); // Only the authority side will notify clients of non-parented NetworkObject scene changes - if (isAuthority && notify && !transform.parent) + if (isAuthority && notify && transform.parent == null) { NetworkManagerOwner.SceneManager.NotifyNetworkObjectSceneChanged(this); } From d9c9211a9daffcb2fbe241c1e992d45bb3812c27 Mon Sep 17 00:00:00 2001 From: Noellie Velez Date: Wed, 10 Jun 2026 15:46:04 +0200 Subject: [PATCH 2/4] Use InternalHasAuthority instead of public field --- .../Runtime/Core/NetworkBehaviour.cs | 2 +- .../Runtime/Core/NetworkObject.cs | 28 ++++++++----------- .../DefaultSceneManagerHandler.cs | 4 +-- .../SceneManagement/NetworkSceneManager.cs | 6 ++-- .../Runtime/Spawning/NetworkSpawnManager.cs | 8 +++--- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index 16b6d3be62..ab92df14c3 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -670,7 +670,7 @@ internal void UpdateNetworkProperties() IsClient = m_NetworkManager.IsListening && m_NetworkManager.IsClient; IsServer = m_NetworkManager.IsListening && m_NetworkManager.IsServer; IsSessionOwner = m_NetworkManager.IsListening && m_NetworkManager.LocalClient.IsSessionOwner; - HasAuthority = m_NetworkObject.HasAuthority; + HasAuthority = m_NetworkObject.InternalHasAuthority(); ServerIsHost = m_NetworkManager.IsListening && m_NetworkManager.ServerIsHost; } } diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 47570b74e6..cb0b23006b 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -402,7 +402,6 @@ public void DeferDespawn(int tickOffset, bool destroy = true) { NetworkLog.LogErrorServer($"[{name}] This method is only available in distributed authority mode."); } - return; } @@ -412,11 +411,10 @@ public void DeferDespawn(int tickOffset, bool destroy = true) { NetworkLog.LogErrorServer($"[{name}] Cannot defer despawn while not spawned."); } - return; } - if (!HasAuthority) + if (!InternalHasAuthority()) { if (NetworkManagerOwner.LogLevel <= LogLevel.Error) { @@ -628,12 +626,11 @@ public bool SetOwnershipLock(bool lockOwnership = true) { NetworkLog.LogErrorServer($"[{name}][Attempted Lock While not spawned]"); } - return false; } // If we don't have authority exit early - if (!HasAuthority) + if (!InternalHasAuthority()) { if (NetworkManager.LogLevel <= LogLevel.Error) { @@ -671,7 +668,6 @@ public bool SetOwnershipLock(bool lockOwnership = true) { SendOwnershipStatusUpdate(); } - return true; } @@ -797,7 +793,6 @@ public OwnershipRequestStatus RequestOwnership() { NetworkLog.LogErrorServer($"[{name}][Invalid Operation] Cannot request ownership of an NetworkObject before it is spawned."); } - return OwnershipRequestStatus.InvalidOperation; } // Exit early the local client is already the owner @@ -909,7 +904,7 @@ internal void OwnershipRequest(ulong clientRequestingOwnership) // This action is always authorized as long as the client still has authority. // We need to pass in that this is a request approval ownership change. - NetworkManagerOwner.SpawnManager.ChangeOwnership(this, clientRequestingOwnership, HasAuthority, true); + NetworkManagerOwner.SpawnManager.ChangeOwnership(this, clientRequestingOwnership, InternalHasAuthority(), true); } else { @@ -1158,7 +1153,7 @@ public bool HasOwnershipStatus(OwnershipStatus status) public bool HasAuthority => InternalHasAuthority(); [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool InternalHasAuthority() + internal bool InternalHasAuthority() { if (!IsSpawned) { @@ -1509,7 +1504,7 @@ public void NetworkShow(ulong clientId) return; } - if (!HasAuthority) + if (!InternalHasAuthority()) { if (NetworkManagerOwner.DistributedAuthorityMode) { @@ -1604,7 +1599,7 @@ public void NetworkHide(ulong clientId) return; } - if (!HasAuthority) + if (!InternalHasAuthority()) { if (NetworkManagerOwner.DistributedAuthorityMode) { @@ -1763,7 +1758,7 @@ private void OnDestroy() { // An authorized destroy is when done by the authority instance or done due to a scene event and the NetworkObject // was marked as destroy pending scene event (which means the destroy with scene property was set). - var isAuthorityDestroy = HasAuthority || NetworkManager.DAHost || DestroyPendingSceneEvent; + var isAuthorityDestroy = InternalHasAuthority() || NetworkManager.DAHost || DestroyPendingSceneEvent; // If the NetworkObject's GameObject is still valid and the scene is still valid and loaded, then we are still valid var isStillValid = gameObject != null && gameObject.scene.IsValid() && gameObject.scene.isLoaded; @@ -2102,7 +2097,7 @@ public void ChangeOwnership(ulong newOwnerClientId) } return; } - NetworkManagerOwner.SpawnManager.ChangeOwnership(this, newOwnerClientId, HasAuthority); + NetworkManagerOwner.SpawnManager.ChangeOwnership(this, newOwnerClientId, InternalHasAuthority()); } /// @@ -2337,7 +2332,7 @@ public bool TrySetParent(NetworkObject parent, bool worldPositionStays = true) // DANGO-TODO: Do we want to worry about ownership permissions here? // It wouldn't make sense to not allow parenting, but keeping this note here as a reminder. - var isAuthority = HasAuthority || (AllowOwnerToParent && IsOwner); + var isAuthority = InternalHasAuthority() || (AllowOwnerToParent && IsOwner); // If we don't have authority and we are not shutting down, then don't allow any parenting. // If we are shutting down and don't have authority then allow it. @@ -2412,7 +2407,7 @@ private void OnTransformParentChanged() // With distributed authority, we need to track "valid authoritative" parenting changes. // So, either the authority or AuthorityAppliedParenting is considered a "valid parenting change". - var isParentingAuthority = HasAuthority || AuthorityAppliedParenting || (AllowOwnerToParent && IsOwner); + var isParentingAuthority = InternalHasAuthority() || AuthorityAppliedParenting || (AllowOwnerToParent && IsOwner); // If we are spawned and don't have authority; reset the parent back to the cached parent and exit if (!isParentingAuthority) { @@ -3407,7 +3402,6 @@ internal static NetworkObject Deserialize(in SerializedObject serializedObject, { Destroy(networkObject.gameObject); } - return null; } @@ -3529,7 +3523,7 @@ internal void SceneChangedUpdate(Scene scene, bool notify = false) return; } - var isAuthority = HasAuthority; + var isAuthority = InternalHasAuthority(); SceneOriginHandle = scene.handle; // non-authority needs to update the NetworkSceneHandle diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs index 76ea8feb04..c4041b18c1 100644 --- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs +++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs @@ -302,7 +302,7 @@ public void MoveObjectsFromSceneToDontDestroyOnLoad(ref NetworkManager networkMa } // Check to determine if we need to allow destroying a non-authority instance - if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.HasAuthority) + if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.InternalHasAuthority()) { networkObject.DestroyPendingSceneEvent = true; } @@ -316,7 +316,7 @@ public void MoveObjectsFromSceneToDontDestroyOnLoad(ref NetworkManager networkMa UnityEngine.Object.DontDestroyOnLoad(networkObject.gameObject); } } - else if (networkObject.HasAuthority) + else if (networkObject.InternalHasAuthority()) { // We know this instance is going to be destroyed (when it receives the destroy object message). // We have to invoke this prior to invoking despawn in order to know that we are de-spawning in diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs index 8c07fbd603..1a4fa0d146 100644 --- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs @@ -2713,7 +2713,7 @@ internal void MoveObjectsToDontDestroyOnLoad() } // Check to determine if we need to allow destroying a non-authority instance - if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.HasAuthority) + if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.InternalHasAuthority()) { networkObject.DestroyPendingSceneEvent = true; } @@ -2731,7 +2731,7 @@ internal void MoveObjectsToDontDestroyOnLoad() networkObject.SceneOriginHandle = networkObject.gameObject.scene.handle; } } - else if (networkObject.HasAuthority) + else if (networkObject.InternalHasAuthority()) { networkObject.SetIsDestroying(); // Only destroy non-scene placed NetworkObjects to avoid warnings about destroying in-scene placed NetworkObjects. @@ -2889,7 +2889,7 @@ internal bool IsSceneUnloading(NetworkObject networkObject) internal void NotifyNetworkObjectSceneChanged(NetworkObject networkObject) { // Really, this should never happen but in case it does - if (!networkObject.HasAuthority) + if (!networkObject.InternalHasAuthority()) { if (NetworkManager.LogLevel == LogLevel.Developer) { diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs index 46f52bc4f9..e868424998 100644 --- a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs @@ -1574,7 +1574,7 @@ internal void ServerDestroySpawnedSceneObjects() if (networkObject.InScenePlaced && networkObject.DestroyWithScene && networkObject.gameObject.scene != NetworkManager.SceneManager.DontDestroyOnLoadScene) { - if (networkObject.IsSpawned && networkObject.HasAuthority) + if (networkObject.IsSpawned && networkObject.InternalHasAuthority()) { networkObject.Despawn(false); } @@ -1729,7 +1729,7 @@ internal void ServerSpawnSceneObjectsOnStartSweep() /// internal void OnDespawnNonAuthorityObject([NotNull] NetworkObject networkObject, bool destroyGameObject) { - if (networkObject.HasAuthority) + if (networkObject.InternalHasAuthority()) { if (NetworkManager.LogLevel <= LogLevel.Error) { @@ -1806,7 +1806,7 @@ internal void OnDespawnObject([NotNull] NetworkObject networkObject, bool destro } // For mixed authority hierarchies, if the parent is despawned then any removal of children // is considered "authority approved". Set the AuthorityAppliedParenting flag. - spawnedNetObj.AuthorityAppliedParenting = distributedAuthority && !networkObject.HasAuthority; + spawnedNetObj.AuthorityAppliedParenting = distributedAuthority && !networkObject.InternalHasAuthority(); // Try to remove the parent using the cached WorldPositionStays value // Note: WorldPositionStays will still default to true if this was an @@ -1834,7 +1834,7 @@ internal void OnDespawnObject([NotNull] NetworkObject networkObject, bool destro networkObject.InvokeBehaviourNetworkDespawn(); // Whether we are in distributedAuthority mode and have authority on this object - var hasDAAuthority = distributedAuthority && (networkObject.HasAuthority || (NetworkManager.DAHost && authorityOverride)); + var hasDAAuthority = distributedAuthority && (networkObject.InternalHasAuthority() || (NetworkManager.DAHost && authorityOverride)); // Don't send messages if shutting down // Otherwise send messages if we are the authority (either the server, or the DA mode authority of this object). From f5ea5cbb18b07dc514d0710332c45c1a0494679f Mon Sep 17 00:00:00 2001 From: Noellie Velez Date: Thu, 11 Jun 2026 11:13:50 +0200 Subject: [PATCH 3/4] Revert IsSpawn check --- .../Runtime/Core/NetworkObject.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index cb0b23006b..affe436e80 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -861,7 +861,7 @@ public OwnershipRequestStatus RequestOwnership() public OnOwnershipRequestedDelegateHandler OnOwnershipRequested; /// - /// Invoked by ChangeOwnershipMessage + /// Invoked by /// /// the client requesting ownership internal void OwnershipRequest(ulong clientRequestingOwnership) @@ -1155,11 +1155,8 @@ public bool HasOwnershipStatus(OwnershipStatus status) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal bool InternalHasAuthority() { - if (!IsSpawned) - { - return false; - } - return NetworkManagerOwner.DistributedAuthorityMode ? OwnerClientId == NetworkManagerOwner.LocalClientId : NetworkManagerOwner.IsServer; + var networkManager = NetworkManager; + return networkManager.DistributedAuthorityMode ? OwnerClientId == networkManager.LocalClientId : networkManager.IsServer; } /// From 75b7480d0f1a0448fb3b90071b0b3e6d770b1a14 Mon Sep 17 00:00:00 2001 From: Noellie Velez Date: Thu, 11 Jun 2026 11:36:53 +0200 Subject: [PATCH 4/4] Revert private to internal change --- .../Runtime/Core/NetworkBehaviour.cs | 2 +- .../Runtime/Core/NetworkObject.cs | 2 +- .../Runtime/SceneManagement/DefaultSceneManagerHandler.cs | 4 ++-- .../Runtime/SceneManagement/NetworkSceneManager.cs | 6 +++--- .../Runtime/Spawning/NetworkSpawnManager.cs | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index ab92df14c3..16b6d3be62 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -670,7 +670,7 @@ internal void UpdateNetworkProperties() IsClient = m_NetworkManager.IsListening && m_NetworkManager.IsClient; IsServer = m_NetworkManager.IsListening && m_NetworkManager.IsServer; IsSessionOwner = m_NetworkManager.IsListening && m_NetworkManager.LocalClient.IsSessionOwner; - HasAuthority = m_NetworkObject.InternalHasAuthority(); + HasAuthority = m_NetworkObject.HasAuthority; ServerIsHost = m_NetworkManager.IsListening && m_NetworkManager.ServerIsHost; } } diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index affe436e80..744b142d96 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -1153,7 +1153,7 @@ public bool HasOwnershipStatus(OwnershipStatus status) public bool HasAuthority => InternalHasAuthority(); [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool InternalHasAuthority() + private bool InternalHasAuthority() { var networkManager = NetworkManager; return networkManager.DistributedAuthorityMode ? OwnerClientId == networkManager.LocalClientId : networkManager.IsServer; diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs index c4041b18c1..76ea8feb04 100644 --- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs +++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/DefaultSceneManagerHandler.cs @@ -302,7 +302,7 @@ public void MoveObjectsFromSceneToDontDestroyOnLoad(ref NetworkManager networkMa } // Check to determine if we need to allow destroying a non-authority instance - if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.InternalHasAuthority()) + if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.HasAuthority) { networkObject.DestroyPendingSceneEvent = true; } @@ -316,7 +316,7 @@ public void MoveObjectsFromSceneToDontDestroyOnLoad(ref NetworkManager networkMa UnityEngine.Object.DontDestroyOnLoad(networkObject.gameObject); } } - else if (networkObject.InternalHasAuthority()) + else if (networkObject.HasAuthority) { // We know this instance is going to be destroyed (when it receives the destroy object message). // We have to invoke this prior to invoking despawn in order to know that we are de-spawning in diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs index 1a4fa0d146..8c07fbd603 100644 --- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs @@ -2713,7 +2713,7 @@ internal void MoveObjectsToDontDestroyOnLoad() } // Check to determine if we need to allow destroying a non-authority instance - if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.InternalHasAuthority()) + if (distributedAuthority && networkObject.DestroyWithScene && !networkObject.HasAuthority) { networkObject.DestroyPendingSceneEvent = true; } @@ -2731,7 +2731,7 @@ internal void MoveObjectsToDontDestroyOnLoad() networkObject.SceneOriginHandle = networkObject.gameObject.scene.handle; } } - else if (networkObject.InternalHasAuthority()) + else if (networkObject.HasAuthority) { networkObject.SetIsDestroying(); // Only destroy non-scene placed NetworkObjects to avoid warnings about destroying in-scene placed NetworkObjects. @@ -2889,7 +2889,7 @@ internal bool IsSceneUnloading(NetworkObject networkObject) internal void NotifyNetworkObjectSceneChanged(NetworkObject networkObject) { // Really, this should never happen but in case it does - if (!networkObject.InternalHasAuthority()) + if (!networkObject.HasAuthority) { if (NetworkManager.LogLevel == LogLevel.Developer) { diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs index e868424998..46f52bc4f9 100644 --- a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs @@ -1574,7 +1574,7 @@ internal void ServerDestroySpawnedSceneObjects() if (networkObject.InScenePlaced && networkObject.DestroyWithScene && networkObject.gameObject.scene != NetworkManager.SceneManager.DontDestroyOnLoadScene) { - if (networkObject.IsSpawned && networkObject.InternalHasAuthority()) + if (networkObject.IsSpawned && networkObject.HasAuthority) { networkObject.Despawn(false); } @@ -1729,7 +1729,7 @@ internal void ServerSpawnSceneObjectsOnStartSweep() /// internal void OnDespawnNonAuthorityObject([NotNull] NetworkObject networkObject, bool destroyGameObject) { - if (networkObject.InternalHasAuthority()) + if (networkObject.HasAuthority) { if (NetworkManager.LogLevel <= LogLevel.Error) { @@ -1806,7 +1806,7 @@ internal void OnDespawnObject([NotNull] NetworkObject networkObject, bool destro } // For mixed authority hierarchies, if the parent is despawned then any removal of children // is considered "authority approved". Set the AuthorityAppliedParenting flag. - spawnedNetObj.AuthorityAppliedParenting = distributedAuthority && !networkObject.InternalHasAuthority(); + spawnedNetObj.AuthorityAppliedParenting = distributedAuthority && !networkObject.HasAuthority; // Try to remove the parent using the cached WorldPositionStays value // Note: WorldPositionStays will still default to true if this was an @@ -1834,7 +1834,7 @@ internal void OnDespawnObject([NotNull] NetworkObject networkObject, bool destro networkObject.InvokeBehaviourNetworkDespawn(); // Whether we are in distributedAuthority mode and have authority on this object - var hasDAAuthority = distributedAuthority && (networkObject.InternalHasAuthority() || (NetworkManager.DAHost && authorityOverride)); + var hasDAAuthority = distributedAuthority && (networkObject.HasAuthority || (NetworkManager.DAHost && authorityOverride)); // Don't send messages if shutting down // Otherwise send messages if we are the authority (either the server, or the DA mode authority of this object).