continuity/Wonderking/Packets/Incoming/CharacterDeletePacket.cs

21 lines
675 B
C#
Raw Normal View History

2024-02-07 15:40:36 +00:00
// Licensed to Timothy Schenk under the GNU AGPL Version 3 License.
2023-11-20 18:58:30 +00:00
2023-11-16 16:55:36 +00:00
using System.Text;
2024-04-04 14:57:42 +00:00
using RaiNote.PacketMediator;
2023-11-16 16:55:36 +00:00
namespace Wonderking.Packets.Incoming;
[WonderkingPacketId(OperationCode.CharacterDeletion)]
public class CharacterDeletePacket : IIncomingPacket {
2024-03-02 12:02:36 +00:00
public required byte Slot { get; set; }
public required string Name { get; set; }
public required uint Unknown { get; set; }
2023-11-16 16:55:36 +00:00
public void Deserialize(byte[] data) {
2023-11-16 16:55:36 +00:00
Span<byte> span = data;
Slot = span[0];
Name = Encoding.ASCII.GetString(span.Slice(1, 20)).TrimEnd('\0').TrimEnd('\n').TrimEnd('\0');
Unknown = BitConverter.ToUInt32(span.Slice(21, 4));
}
}