MessagePacker.MessageHandler renamed to WrapHandler because that's what it does

This commit is contained in:
vis2k 2020-10-01 14:49:48 +02:00
parent 99b3d95484
commit 56a054ba67
3 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@ public static bool UnpackMessage(NetworkReader messageReader, out int msgType)
} }
} }
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 T : struct, NetworkMessage
where C : NetworkConnection where C : NetworkConnection
=> (conn, reader) => => (conn, reader) =>

View File

@ -204,7 +204,7 @@ public static void RegisterHandler<T>(Action<NetworkConnection, T> handler, bool
{ {
Debug.LogWarning($"NetworkClient.RegisterHandler replacing handler for {typeof(T).FullName}, id={msgType}. If replacement is intentional, use ReplaceHandler instead to avoid this warning."); Debug.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> /// <summary>

View File

@ -475,7 +475,7 @@ public static void RegisterHandler<T>(Action<NetworkConnection, T> handler, bool
{ {
Debug.LogWarning($"NetworkServer.RegisterHandler replacing handler for {typeof(T).FullName}, id={msgType}. If replacement is intentional, use ReplaceHandler instead to avoid this warning."); Debug.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> /// <summary>
@ -502,7 +502,7 @@ public static void ReplaceHandler<T>(Action<NetworkConnection, T> handler, bool
where T : struct, NetworkMessage where T : struct, NetworkMessage
{ {
int msgType = MessagePacker.GetId<T>(); int msgType = MessagePacker.GetId<T>();
handlers[msgType] = MessagePacker.MessageHandler(handler, requireAuthentication); handlers[msgType] = MessagePacker.WrapHandler(handler, requireAuthentication);
} }
/// <summary> /// <summary>