diff options
Diffstat (limited to 'Net.cs')
| -rw-r--r-- | Net.cs | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -50,29 +50,23 @@ public static class NetExtensions public enum PacketType : byte { - MousePosition, - OnekoTargetPosition, + MouseState, + OnekoState, UserInfo, UserId, Disconnect, Invalid } -public struct PacketInfo +public struct PacketInfo(PacketType type, int id) { - public readonly PacketType Type; - public readonly int FromId; + public readonly PacketType Type = type; + public readonly int FromId = id; public const int SizeOf = sizeof(int) + 1; public readonly bool IsValid => Type != PacketType.Invalid; public static readonly PacketInfo InvalidPacket = new(PacketType.Invalid, -1); - public PacketInfo(PacketType type, int id) - { - Type = type; - FromId = id; - } - public readonly void Serialize(Span<byte> span) { span[0] = (byte)Type; |
