using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
{
public class CharacterRenamePacket : Packet
{
public enum RenameRequestStatus : uint
{
///
/// Renaming allowed.
///
Allowed = 0,
///
/// Renaming permit needed.
///
PermitNeeded = 1,
///
/// Renaming privileges suspended.
///
PrivilegesSuspended = 2,
///
/// System error has occurred.
///
SystemError = 3,
///
/// Renaming cooldown hasn't yet expired.
///
TooEarly = 4
}
///
/// Renaming availability status.
///
public RenameRequestStatus Status { get; set; }
///
/// AC price for a rename pass.
///
public uint AcPrice { get; set; }
///
/// Rename cooldown expiry timestamp.
///
public uint CooldownExpires { get; set; }
///
/// Seconds until the rename cooldown expires.
///
public uint CooldownSecs { get; set; }
public CharacterRenamePacket()
{
Status = RenameRequestStatus.Allowed;
AcPrice = 0;
CooldownExpires = 0;
CooldownSecs = 0;
}
#region implemented abstract members of Packet
public override byte[] Build()
{
var pkt = new PacketWriter();
pkt.Write((uint)Status);
pkt.Write(AcPrice);
pkt.Write(CooldownExpires);
pkt.Write(CooldownSecs);
return pkt.ToArray();
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x11, 0x98, PacketFlags.None);
}
#endregion
}
}