This commit is contained in:
vis2k 2021-03-07 13:30:14 +08:00
parent 85287fe642
commit b2490f9c1f

View File

@ -649,13 +649,7 @@ public static void RegisterHandler<T>(Action<NetworkConnection, T> handler, bool
handlers[msgType] = MessagePacking.WrapHandler(handler, requireAuthentication);
}
/// <summary>
/// Register a handler for a particular message type.
/// <para>There are several system message types which you can add handlers for. You can also add your own message types.</para>
/// </summary>
/// <typeparam name="T">Message type</typeparam>
/// <param name="handler">Function handler which will be invoked when this message type is received.</param>
/// <param name="requireAuthentication">True if the message requires an authenticated connection</param>
/// <summary>Register a handler for message type T. Most should require authentication.</summary>
[Obsolete("Use RegisterHandler(Action<NetworkConnection, T), requireAuthentication instead.")]
public static void RegisterHandler<T>(Action<T> handler, bool requireAuthentication = true)
where T : struct, NetworkMessage
@ -663,13 +657,7 @@ public static void RegisterHandler<T>(Action<T> handler, bool requireAuthenticat
RegisterHandler<T>((_, value) => { handler(value); }, requireAuthentication);
}
/// <summary>
/// Replaces a handler for a particular message type.
/// <para>See also <see cref="RegisterHandler{T}(Action{NetworkConnection, T}, bool)">RegisterHandler(T)(Action(NetworkConnection, T), bool)</see></para>
/// </summary>
/// <typeparam name="T">Message type</typeparam>
/// <param name="handler">Function handler which will be invoked when this message type is received.</param>
/// <param name="requireAuthentication">True if the message requires an authenticated connection</param>
/// <summary>Replace a handler for message type T. Most should require authentication.</summary>
public static void ReplaceHandler<T>(Action<NetworkConnection, T> handler, bool requireAuthentication = true)
where T : struct, NetworkMessage
{