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-02-04 18:52:45 +00:00
|
|
|
using Rai.PacketMediator;
|
2023-11-16 16:55:36 +00:00
|
|
|
|
|
|
|
namespace Wonderking.Packets.Incoming;
|
|
|
|
|
2024-02-04 18:52:45 +00:00
|
|
|
[WonderkingPacketId(OperationCode.CharacterDeletion)]
|
|
|
|
public class CharacterDeletePacket : IIncomingPacket
|
2023-11-16 16:55:36 +00:00
|
|
|
{
|
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)
|
|
|
|
{
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|