From a5bc753150988cf121875427ff8809c0c04892e5 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 7 Mar 2021 13:31:35 +0800 Subject: [PATCH] cleanup --- Assets/Mirror/Runtime/NetworkServer.cs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index e5c0e9c14..51d22a053 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -665,23 +665,14 @@ public static void ReplaceHandler(Action handler, bool handlers[msgType] = MessagePacking.WrapHandler(handler, requireAuthentication); } - /// - /// Replaces a handler for a particular message type. - /// See also RegisterHandler(T)(Action(NetworkConnection, T), bool) - /// - /// Message type - /// Function handler which will be invoked when this message type is received. - /// True if the message requires an authenticated connection + /// Replace a handler for message type T. Most should require authentication. public static void ReplaceHandler(Action handler, bool requireAuthentication = true) where T : struct, NetworkMessage { ReplaceHandler((_, value) => { handler(value); }, requireAuthentication); } - /// - /// Unregisters a handler for a particular message type. - /// - /// Message type + /// Unregister a handler for a message type T. public static void UnregisterHandler() where T : struct, NetworkMessage { @@ -689,20 +680,13 @@ public static void UnregisterHandler() handlers.Remove(msgType); } - /// - /// Clear all registered callback handlers. - /// + /// Clears all registered message handlers. public static void ClearHandlers() { handlers.Clear(); } - /// - /// send this message to the player only - /// - /// Message type - /// - /// + /// Send this message to the player only [Obsolete("Use identity.connectionToClient.Send() instead! Previously Mirror needed this function internally, but not anymore.")] public static void SendToClientOfPlayer(NetworkIdentity identity, T msg, int channelId = Channels.DefaultReliable) where T : struct, NetworkMessage