Change manual packet numbering to a dictionary

This commit is contained in:
derek.holloway committed 2026-08-03 10:57:17 -07:00
1 parent 37a6b5d59b
commit b83887cb2a
8 files changed
+53 -44

No files matched your search

+9 -4
View File
@@ -4,27 +4,32 @@ using Mistox.Attributes;
namespace Mistox.ResevedPackets {
[mPacket(0xFF)]
[mPacket]
public class UserConnectedPacket {
public string UserName { get; set; }
public IPAddress ClientIPAddress { get; set; }
public int ClientPort { get; set; }
}
[mPacket(0xFE)]
[mPacket]
public class UserAuthPacket {
public string UserName { get; set; } = "";
public string ConnectionKey { get; set; } = "";
public int AuthSuccessful { get; set; } = 0; // 0 is standard, -1 is auth failure, 1 is auth success
}
[mPacket(0xFD)]
[mPacket]
public class EntityPacket {
// Tag to make sure the object on the other side is the same object i want to update here
// Need to map these Object ID's to a dictionary to make sure I only send network updates when there is a change
public ushort ObjectId { get; set; }
// Packet payload data that im matching for in the dictionary
public byte[] InnerPayload { get; set; }
}
[mPacket(0xFC)]
[mPacket]
public class UserDisconnectedPacket {
public string UserName { get; set; }
}