Amend Register Handler Command to not require authority

Any object on that connection can send the command. We don't need an authorised object.
This commit is contained in:
ninjakickja 2024-01-18 13:25:38 +08:00
parent af4bab60b2
commit fb5c8399b5

View File

@ -115,7 +115,7 @@ public override void OnStartClient()
base.OnStopClient(); base.OnStopClient();
if (!registeredHandlers) RegisterClientHandlers(); if (!registeredHandlers) RegisterClientHandlers();
if (isOwned) CmdRegisteredHandler(); CmdRegisteredHandler();
} }
protected virtual void RegisterServerHandlers() protected virtual void RegisterServerHandlers()
@ -133,13 +133,11 @@ protected virtual void RegisterClientHandlers()
registeredHandlers = true; registeredHandlers = true;
} }
[Command] [Command(requiresAuthority = false)]
private void CmdRegisteredHandler() private void CmdRegisteredHandler()
{ {
if (!registeredConnections.Contains(connectionToClient)) if (!registeredConnections.Contains(connectionToClient))
registeredConnections.Add(connectionToClient); registeredConnections.Add(connectionToClient);
Debug.Log($"Hashset cound {registeredConnections.Count}");
} }
#endregion #endregion