From 1c365fc3d55d7b3de302e9e8f26fff05be90339b Mon Sep 17 00:00:00 2001 From: Justin Nolan Date: Sun, 28 Jan 2024 11:09:35 +0100 Subject: [PATCH] Add network messages to lookup dict in network server replace handler (#3753) --- Assets/Mirror/Core/NetworkServer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/Mirror/Core/NetworkServer.cs b/Assets/Mirror/Core/NetworkServer.cs index 9ba88d2c6..547ba470c 100644 --- a/Assets/Mirror/Core/NetworkServer.cs +++ b/Assets/Mirror/Core/NetworkServer.cs @@ -928,6 +928,10 @@ public static void ReplaceHandler(Action handle where T : struct, NetworkMessage { ushort msgType = NetworkMessageId.Id; + + // register Id <> Type in lookup for debugging. + NetworkMessages.Lookup[msgType] = typeof(T); + handlers[msgType] = NetworkMessages.WrapHandler(handler, requireAuthentication, exceptionsDisconnect); } @@ -936,6 +940,10 @@ public static void ReplaceHandler(Action h where T : struct, NetworkMessage { ushort msgType = NetworkMessageId.Id; + + // register Id <> Type in lookup for debugging. + NetworkMessages.Lookup[msgType] = typeof(T); + handlers[msgType] = NetworkMessages.WrapHandler(handler, requireAuthentication, exceptionsDisconnect); }