0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-19 17:55:16 +00:00

fix: properly handling minutes

Seconds are only one byte big and not two, so the Minutes start at byte 3 and not 4.
This commit is contained in:
Robin C. Ladiges 2024-06-21 22:01:50 +02:00 committed by Aubrey
parent bec6dde076
commit fb55820e2b

View file

@ -15,14 +15,14 @@ public struct TagPacket : IPacket {
MemoryMarshal.Write(data, ref UpdateType);
MemoryMarshal.Write(data[1..], ref IsIt);
MemoryMarshal.Write(data[2..], ref Seconds);
MemoryMarshal.Write(data[4..], ref Minutes);
MemoryMarshal.Write(data[3..], ref Minutes);
}
public void Deserialize(ReadOnlySpan<byte> data) {
UpdateType = MemoryMarshal.Read<TagUpdate>(data);
IsIt = MemoryMarshal.Read<bool>(data[1..]);
Seconds = MemoryMarshal.Read<byte>(data[2..]);
Minutes = MemoryMarshal.Read<ushort>(data[4..]);
Minutes = MemoryMarshal.Read<ushort>(data[3..]);
}
[Flags]