continuity/Wonderking/Packets/Outgoing/CharacterNameCheckPacketResponse.cs

22 lines
549 B
C#
Raw Normal View History

2023-11-20 18:58:30 +00:00
// // Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License.
namespace Wonderking.Packets.Outgoing;
[PacketId(OperationCode.CharacterNameCheckResponse)]
public class CharacterNameCheckPacketResponse : IPacket
{
public required bool IsTaken { get; set; }
public void Deserialize(byte[] data)
{
throw new NotSupportedException();
}
public byte[] Serialize()
{
Span<byte> data = stackalloc byte[1];
2023-11-19 16:07:28 +00:00
data[0] = IsTaken ? (byte)1 : (byte)0;
return data.ToArray();
}
}