mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Remove NetworkClient.ReplaceHandler
This commit is contained in:
parent
84cf753f19
commit
de6b63ef2f
@ -220,33 +220,6 @@ public static void RegisterHandler<T>(Action<T> handler, bool requireAuthenticat
|
|||||||
RegisterHandler((NetworkConnection _, T value) => { handler(value); }, requireAuthentication);
|
RegisterHandler((NetworkConnection _, 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>
|
|
||||||
public static void ReplaceHandler<T>(Action<NetworkConnection, T> handler, bool requireAuthentication = true)
|
|
||||||
where T : struct, NetworkMessage
|
|
||||||
{
|
|
||||||
int msgType = MessagePacker.GetId<T>();
|
|
||||||
handlers[msgType] = MessagePacker.MessageHandler(handler, 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>
|
|
||||||
public static void ReplaceHandler<T>(Action<T> handler, bool requireAuthentication = true)
|
|
||||||
where T : struct, NetworkMessage
|
|
||||||
{
|
|
||||||
ReplaceHandler((NetworkConnection _, T value) => { handler(value); }, requireAuthentication);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unregisters a network message handler.
|
/// Unregisters a network message handler.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user