mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
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:
parent
af4bab60b2
commit
fb5c8399b5
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user