continuity/Wonderking/Packets/Incoming/CharacterDeletePacket.cs

22 lines
675 B
C#

// Licensed to Timothy Schenk under the GNU AGPL Version 3 License.
using System.Text;
using Rai.PacketMediator;
namespace Wonderking.Packets.Incoming;
[WonderkingPacketId(OperationCode.CharacterDeletion)]
public class CharacterDeletePacket : IIncomingPacket
{
public required byte Slot { get; set; }
public required string Name { get; set; }
public required 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));
}
}