PSO2SERVER/Server/Protocol/Packets/11-ClientPacket/11-08-CharacterDeletionPacket.cs

92 lines
2.2 KiB
C#
Raw Normal View History

2024-09-16 17:09:36 +08:00
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
2024-09-16 17:09:36 +08:00
{
2024-09-18 04:21:17 +08:00
public class CharacterDeletionPacket : Packet
2024-09-16 17:09:36 +08:00
{
2024-09-20 16:10:43 +08:00
public DeletionStatus Status { get; }
2024-09-16 17:09:36 +08:00
2024-09-20 16:10:43 +08:00
public enum DeletionStatus : uint
2024-09-16 17:09:36 +08:00
{
2024-09-20 16:10:43 +08:00
/// <summary>
/// Character has items which prevent deletion.
/// </summary>
UndeletableItems,
/// <summary>
/// Character has been scheduled for deletion.
/// </summary>
Success
}
public struct ItemId
{
/// <summary>
/// Item type.
/// </summary>
public ushort ItemType { get; set; }
/// <summary>
/// Item category.
/// </summary>
public ushort Id { get; set; }
/// <summary>
/// Item ID after appraisal.
/// </summary>
public ushort Unk3 { get; set; }
/// <summary>
/// Item ID.
/// </summary>
public ushort SubId { get; set; }
}
public struct CharacterDeletePacket
{
/// <summary>
/// Deletion request status.
/// </summary>
public DeletionStatus Status { get; set; }
public uint Unk1 { get; set; }
public List<ItemId> Unk2 { get; set; }
public List<ItemId> Unk3 { get; set; }
public List<ItemId> Unk4 { get; set; }
public List<ItemId> Unk5 { get; set; }
public List<ItemId> Unk6 { get; set; }
}
public CharacterDeletionPacket(DeletionStatus status)
{
Status = status;
2024-09-16 17:09:36 +08:00
}
#region implemented abstract members of Packet
public override byte[] Build()
{
2024-09-17 11:29:41 +08:00
var pkt = new PacketWriter();
2024-09-20 16:10:43 +08:00
pkt.Write((uint)Status);
pkt.Write((uint)0);
pkt.WriteMagic(0, 0x33D4, 0xC4);
2024-09-17 11:29:41 +08:00
return pkt.ToArray();
2024-09-16 17:09:36 +08:00
}
public override PacketHeader GetHeader()
{
2024-09-20 16:10:43 +08:00
return new PacketHeader(0x11, 0x08, PacketFlags.PACKED);
2024-09-16 17:09:36 +08:00
}
#endregion
}
}