mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
MessageHandler.MessageHandler renamed to WrapHandler because that's what it does. (#2431)
This commit is contained in:
parent
1e9a3b03de
commit
14ae0d094d
@ -59,7 +59,7 @@ public static bool UnpackMessage(NetworkReader messageReader, out int msgType)
|
||||
}
|
||||
|
||||
// wraps a handler function with extra code
|
||||
internal static NetworkMessageDelegate MessageHandler<T, C>(Action<C, T> handler, bool requireAuthenication)
|
||||
internal static NetworkMessageDelegate WrapHandler<T, C>(Action<C, T> handler, bool requireAuthenication)
|
||||
where T : struct, NetworkMessage
|
||||
where C : NetworkConnection
|
||||
=> (conn, reader, channelId) =>
|
||||
|
@ -315,7 +315,7 @@ public static void RegisterHandler<T>(Action<NetworkConnection, T> handler, bool
|
||||
{
|
||||
logger.LogWarning($"NetworkClient.RegisterHandler replacing handler for {typeof(T).FullName}, id={msgType}. If replacement is intentional, use ReplaceHandler instead to avoid this warning.");
|
||||
}
|
||||
handlers[msgType] = MessagePacker.MessageHandler(handler, requireAuthentication);
|
||||
handlers[msgType] = MessagePacker.WrapHandler(handler, requireAuthentication);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -342,7 +342,7 @@ public static void ReplaceHandler<T>(Action<NetworkConnection, T> handler, bool
|
||||
where T : struct, NetworkMessage
|
||||
{
|
||||
int msgType = MessagePacker.GetId<T>();
|
||||
handlers[msgType] = MessagePacker.MessageHandler(handler, requireAuthentication);
|
||||
handlers[msgType] = MessagePacker.WrapHandler(handler, requireAuthentication);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -596,7 +596,7 @@ public static void RegisterHandler<T>(Action<NetworkConnection, T> handler, bool
|
||||
{
|
||||
logger.LogWarning($"NetworkServer.RegisterHandler replacing handler for {typeof(T).FullName}, id={msgType}. If replacement is intentional, use ReplaceHandler instead to avoid this warning.");
|
||||
}
|
||||
handlers[msgType] = MessagePacker.MessageHandler(handler, requireAuthentication);
|
||||
handlers[msgType] = MessagePacker.WrapHandler(handler, requireAuthentication);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -623,7 +623,7 @@ public static void ReplaceHandler<T>(Action<NetworkConnection, T> handler, bool
|
||||
where T : struct, NetworkMessage
|
||||
{
|
||||
int msgType = MessagePacker.GetId<T>();
|
||||
handlers[msgType] = MessagePacker.MessageHandler(handler, requireAuthentication);
|
||||
handlers[msgType] = MessagePacker.WrapHandler(handler, requireAuthentication);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user