summaryrefslogtreecommitdiff
path: root/Net.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Net.cs')
-rw-r--r--Net.cs16
1 files changed, 5 insertions, 11 deletions
diff --git a/Net.cs b/Net.cs
index 3fa5f8a..4bf984e 100644
--- a/Net.cs
+++ b/Net.cs
@@ -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;