Seperate out the NetworkPacketDictonary

This commit is contained in:
derek.holloway committed 2026-07-08 07:24:05 -07:00
1 parent 531fd2572f
commit 3992c3debc
6 files changed
+48 -46

No files matched your search

+1 -6
View File
@@ -41,13 +41,8 @@ namespace Mistox.Client {
ushort DataLength = (ushort)((dataPacket[1] << 8) | dataPacket[2]);
ReadOnlyMemory<byte> data = dataMemory.Slice(DataPacket.HeaderLength, DataLength);
// Get the type from the tag
if (!DataPacket.ClientToClientPackets.TryGetValue(dataType, out Type resolvedType)) {
throw new Exception($"Unknown packet type ID: {dataType}");
}
// Extract the object
dynamic buildObj = DataPacket.Deserialize( resolvedType, DataLength, data );
dynamic buildObj = DataPacket.Deserialize( dataType, DataLength, data );
// Return the object
ClientInterface.ServerClientInstance.InvokeOnReceived( buildObj );