2021-11-29 18:09:12 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2022-02-10 01:44:50 +00:00
|
|
|
|
namespace Shared.Packet.Packets;
|
2021-11-29 04:04:34 +00:00
|
|
|
|
|
|
|
|
|
[Packet(PacketType.Shine)]
|
|
|
|
|
public struct ShinePacket : IPacket {
|
|
|
|
|
public int ShineId;
|
2022-02-10 01:44:50 +00:00
|
|
|
|
|
2022-03-11 05:59:02 +00:00
|
|
|
|
public short Size => 4;
|
|
|
|
|
|
2021-11-29 18:09:12 +00:00
|
|
|
|
public void Serialize(Span<byte> data) {
|
|
|
|
|
MemoryMarshal.Write(data, ref ShineId);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-04 04:29:34 +00:00
|
|
|
|
public void Deserialize(ReadOnlySpan<byte> data) {
|
2021-11-29 18:09:12 +00:00
|
|
|
|
ShineId = MemoryMarshal.Read<int>(data);
|
|
|
|
|
}
|
2021-11-29 04:04:34 +00:00
|
|
|
|
}
|