SmoOnlineServer/Shared/Packet/Packets/TagPacket.cs

27 lines
562 B
C#
Raw Normal View History

using System.Runtime.InteropServices;
2022-02-10 01:44:50 +00:00
namespace Shared.Packet.Packets;
2022-02-08 16:22:09 +00:00
[Packet(PacketType.Tag)]
public struct TagPacket : IPacket {
2022-03-13 11:14:01 +00:00
public TagUpdate UpdateType;
2022-02-10 01:44:50 +00:00
public bool IsIt;
2022-03-13 11:14:01 +00:00
public byte Seconds;
public ushort Minutes;
2022-02-10 01:44:50 +00:00
2022-03-13 11:14:01 +00:00
public short Size => 4;
public void Serialize(Span<byte> data) {
MemoryMarshal.Write(data, ref IsIt);
}
public void Deserialize(Span<byte> data) {
IsIt = MemoryMarshal.Read<bool>(data);
}
2022-03-13 11:14:01 +00:00
[Flags]
public enum TagUpdate : byte {
Time = 1,
State = 2
}
}