diff --git a/Server/Server.cs b/Server/Server.cs index 4280621..92ef34d 100644 --- a/Server/Server.cs +++ b/Server/Server.cs @@ -254,7 +254,7 @@ public class Server { tempBuffer.Dispose(); }); - Logger.Info($"Client {client.Name} ({client.Id}/{socket.RemoteEndPoint}) connected."); + Logger.Info($"Client {client.Name} ({client.Id}/{socket.RemoteEndPoint}) connected. Using PM = {header.IsCheats}"); } else if (header.Id != client.Id && client.Id != Guid.Empty) { throw new Exception($"Client {client.Name} sent packet with invalid client id {header.Id} instead of {client.Id}"); } diff --git a/Shared/Packet/PacketHeader.cs b/Shared/Packet/PacketHeader.cs index 38d65ed..85faf51 100644 --- a/Shared/Packet/PacketHeader.cs +++ b/Shared/Packet/PacketHeader.cs @@ -9,6 +9,7 @@ public struct PacketHeader : IPacket { public Guid Id; public PacketType Type; public short PacketSize; + public bool IsCheats; public static short StaticSize => 20; public short Size => StaticSize; @@ -17,11 +18,13 @@ public struct PacketHeader : IPacket { MemoryMarshal.Write(data[..16], ref Id); MemoryMarshal.Write(data[16..], ref Type); MemoryMarshal.Write(data[18..], ref PacketSize); + MemoryMarshal.Write(data[20..], ref IsCheats); } public void Deserialize(ReadOnlySpan data) { Id = MemoryMarshal.Read(data[..16]); Type = MemoryMarshal.Read(data[16..]); PacketSize = MemoryMarshal.Read(data[18..]); + IsCheats = MemoryMarshal.Read(data[20..]); } } \ No newline at end of file diff --git a/TestClient/Program.cs b/TestClient/Program.cs index b3f030a..71b088c 100644 --- a/TestClient/Program.cs +++ b/TestClient/Program.cs @@ -55,6 +55,8 @@ async Task S(string n, Guid otherId, Guid ownId) { Type = PacketType.Connect, Id = ownId, PacketSize = connect.Size, + + }; IMemoryOwner connectOwner = MemoryPool.Shared.RentZero(Constants.HeaderSize + connect.Size); // coolHeader.Serialize(connectOwner.Memory.Span[..Constants.HeaderSize]);