This commit is contained in:
vis2k 2021-05-24 15:06:29 +08:00
parent 02e8cde323
commit 9ac8997d6a

View File

@ -37,6 +37,7 @@ void Handler(NetworkConnection conn, NetworkReader reader, int channelId)
invoked = true;
}
// set up handler on the server connection
Dictionary<ushort, NetworkMessageDelegate> handlers = new Dictionary<ushort, NetworkMessageDelegate>();
handlers.Add(MessagePacking.GetId<TestMessage>(), Handler);
connectionToClient.SetHandlers(handlers);
@ -58,6 +59,7 @@ void Handler(NetworkConnection conn, NetworkReader reader, int channelId)
invoked = true;
}
// set up handler on the client connection
Dictionary<ushort, NetworkMessageDelegate> handlers = new Dictionary<ushort, NetworkMessageDelegate>();
handlers.Add(MessagePacking.GetId<TestMessage>(), Handler);
connectionToServer.SetHandlers(handlers);