continuity/Wonderking/Packets/Incoming/CharacterDeletePacket.cs
Timothy Schenk 3a24dabdf2
chore: formatting and slnx
Signed-off-by: Timothy Schenk <admin@rainote.dev>
2025-01-16 14:30:40 +01:00

20 lines
675 B
C#

// Licensed to Timothy Schenk under the GNU AGPL Version 3 License.
using System.Text;
using RaiNote.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));
}
}