PSO2SERVER/Server/Protocol/Packets/11-ClientPacket/11-98-CharacterRenamePacket.cs

86 lines
2.1 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 CharacterRenamePacket : Packet
2024-09-16 17:09:36 +08:00
{
2024-11-24 23:40:50 +08:00
public enum RenameRequestStatus : uint
{
/// <summary>
/// Renaming allowed.
/// </summary>
Allowed = 0,
/// <summary>
/// Renaming permit needed.
/// </summary>
PermitNeeded = 1,
/// <summary>
/// Renaming privileges suspended.
/// </summary>
PrivilegesSuspended = 2,
/// <summary>
/// System error has occurred.
/// </summary>
SystemError = 3,
/// <summary>
/// Renaming cooldown hasn't yet expired.
/// </summary>
TooEarly = 4
}
/// <summary>
/// Renaming availability status.
/// </summary>
public RenameRequestStatus Status { get; set; }
/// <summary>
/// AC price for a rename pass.
/// </summary>
public uint AcPrice { get; set; }
/// <summary>
/// Rename cooldown expiry timestamp.
/// </summary>
public uint CooldownExpires { get; set; }
/// <summary>
/// Seconds until the rename cooldown expires.
/// </summary>
public uint CooldownSecs { get; set; }
2024-09-16 17:09:36 +08:00
2024-09-18 04:21:17 +08:00
public CharacterRenamePacket()
2024-09-16 17:09:36 +08:00
{
2024-11-24 23:40:50 +08:00
Status = RenameRequestStatus.Allowed;
AcPrice = 0;
CooldownExpires = 0;
CooldownSecs = 0;
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-11-24 23:40:50 +08:00
pkt.Write((uint)Status);
pkt.Write(AcPrice);
pkt.Write(CooldownExpires);
pkt.Write(CooldownSecs);
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-18 04:21:17 +08:00
return new PacketHeader(0x11, 0x98, PacketFlags.None);
2024-09-16 17:09:36 +08:00
}
#endregion
}
}