From fb5c8399b5d52f502c88005b8f00450fe83d3c15 Mon Sep 17 00:00:00 2001 From: ninjakickja <80569286+ninjakickja@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:25:38 +0800 Subject: [PATCH] Amend Register Handler Command to not require authority Any object on that connection can send the command. We don't need an authorised object. --- .../Components/NetworkTransform/HybridNetworkTransformV2.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/Mirror/Components/NetworkTransform/HybridNetworkTransformV2.cs b/Assets/Mirror/Components/NetworkTransform/HybridNetworkTransformV2.cs index fd8c46aaa..30006658a 100644 --- a/Assets/Mirror/Components/NetworkTransform/HybridNetworkTransformV2.cs +++ b/Assets/Mirror/Components/NetworkTransform/HybridNetworkTransformV2.cs @@ -115,7 +115,7 @@ public override void OnStartClient() base.OnStopClient(); if (!registeredHandlers) RegisterClientHandlers(); - if (isOwned) CmdRegisteredHandler(); + CmdRegisteredHandler(); } protected virtual void RegisterServerHandlers() @@ -133,13 +133,11 @@ protected virtual void RegisterClientHandlers() registeredHandlers = true; } - [Command] + [Command(requiresAuthority = false)] private void CmdRegisteredHandler() { if (!registeredConnections.Contains(connectionToClient)) registeredConnections.Add(connectionToClient); - - Debug.Log($"Hashset cound {registeredConnections.Count}"); } #endregion