continuity/Wonderking/Packets/Incoming/CharacterDeletePacket.cs

23 lines
661 B
C#
Raw Normal View History

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;
using Rai.PacketMediator;
2023-11-16 16:55:36 +00:00
namespace Wonderking.Packets.Incoming;
[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));
}
}