2023-11-21 20:37:50 +00:00
|
|
|
// Copyright (c) 2023 Timothy Schenk. Subject to 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
|
|
|
{
|
|
|
|
public byte Slot { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public uint Unknown { get; set; }
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|