diff --git a/Shared/Packet/Packets/CapPacket.cs b/Shared/Packet/Packets/CapPacket.cs index b974c52..05c738b 100644 --- a/Shared/Packet/Packets/CapPacket.cs +++ b/Shared/Packet/Packets/CapPacket.cs @@ -12,7 +12,7 @@ public struct CapPacket : IPacket { public bool CapOut; public string CapAnim; - public short Size => 0x50; + public short Size => 32 + NameSize; public void Serialize(Span data) { MemoryMarshal.Write(data, ref Position); diff --git a/Shared/Packet/Packets/GamePacket.cs b/Shared/Packet/Packets/GamePacket.cs index 4aae9b8..52a7c23 100644 --- a/Shared/Packet/Packets/GamePacket.cs +++ b/Shared/Packet/Packets/GamePacket.cs @@ -12,16 +12,16 @@ public struct GamePacket : IPacket { public GamePacket() { } - public short Size => 0x42; + public short Size => 5 + StageSize; public void Serialize(Span data) { MemoryMarshal.Write(data, ref Is2d); - MemoryMarshal.Write(data[1..], ref ScenarioNum); - Encoding.UTF8.GetBytes(Stage).CopyTo(data[2..(2 + StageSize)]); + MemoryMarshal.Write(data[4..], ref ScenarioNum); + Encoding.UTF8.GetBytes(Stage).CopyTo(data[5..(5 + StageSize)]); } public void Deserialize(ReadOnlySpan data) { Is2d = MemoryMarshal.Read(data); - ScenarioNum = MemoryMarshal.Read(data[1..]); - Stage = Encoding.UTF8.GetString(data[2..(2 + StageSize)]).TrimEnd('\0'); + ScenarioNum = MemoryMarshal.Read(data[4..]); + Stage = Encoding.UTF8.GetString(data[5..(5 + StageSize)]).TrimEnd('\0'); } } \ No newline at end of file diff --git a/Shared/Packet/Packets/ShinePacket.cs b/Shared/Packet/Packets/ShinePacket.cs index 197ba9d..3eaf323 100644 --- a/Shared/Packet/Packets/ShinePacket.cs +++ b/Shared/Packet/Packets/ShinePacket.cs @@ -5,14 +5,17 @@ namespace Shared.Packet.Packets; [Packet(PacketType.Shine)] public struct ShinePacket : IPacket { public int ShineId; + public bool IsGrand; - public short Size => 4; + public short Size => 8; public void Serialize(Span data) { MemoryMarshal.Write(data, ref ShineId); + MemoryMarshal.Write(data[4..], ref IsGrand); } public void Deserialize(ReadOnlySpan data) { ShineId = MemoryMarshal.Read(data); + IsGrand = MemoryMarshal.Read(data[4..]); } } \ No newline at end of file diff --git a/Shared/Packet/Packets/TagPacket.cs b/Shared/Packet/Packets/TagPacket.cs index 23f3cfc..d455778 100644 --- a/Shared/Packet/Packets/TagPacket.cs +++ b/Shared/Packet/Packets/TagPacket.cs @@ -9,20 +9,20 @@ public struct TagPacket : IPacket { public byte Seconds; public ushort Minutes; - public short Size => 6; + public short Size => 8; public void Serialize(Span data) { 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[5..], ref Seconds); + MemoryMarshal.Write(data[6..], ref Minutes); } public void Deserialize(ReadOnlySpan data) { UpdateType = MemoryMarshal.Read(data); IsIt = MemoryMarshal.Read(data[1..]); - Seconds = MemoryMarshal.Read(data[2..]); - Minutes = MemoryMarshal.Read(data[4..]); + Seconds = MemoryMarshal.Read(data[5..]); + Minutes = MemoryMarshal.Read(data[6..]); } [Flags]