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
@@ -42,13 +42,8 @@ namespace Mistox.Client {
// Read off the data
await ns.ReadExactlyAsync(payloadBuffer, 0, dataLength);
// Get the type from the tag
if (!DataPacket.ServerToClientPackets.TryGetValue(packetbyte, out Type resolvedType)) {
throw new Exception($"Unknown packet type ID: {packetbyte}");
}
// Create the dataobject
dynamic dataobject = DataPacket.Deserialize( resolvedType, dataLength, payloadBuffer.AsMemory(DataPacket.HeaderLength, dataLength) );
dynamic dataobject = DataPacket.Deserialize( packetbyte, dataLength, payloadBuffer.AsMemory(DataPacket.HeaderLength, dataLength) );
// Return the object
ClientInterface.ServerClientInstance.InvokeOnReceived(dataobject);