using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PSO2SERVER.Protocol.Packets
{
    public class CharacterNewNamePacket : Packet
    {
        public enum NewNameStatus : uint
        {
            Success = 0,
            Failure = 1
        }

        public NewNameStatus status { get; set; }
        public uint player_id { get; set; }
        public string Name { get; set; }

        public CharacterNewNamePacket(NewNameStatus Status, uint Player_id, string Newname)
        {
            status = Status;
            player_id = Player_id;
            Name = Newname;
        }

        #region implemented abstract members of Packet

        public override byte[] Build()
        {
            var pkt = new PacketWriter();
            pkt.Write((uint)status);
            pkt.Write(player_id);
            pkt.WriteFixedLengthUtf16(Name, 16);
            return pkt.ToArray();
        }

        public override PacketHeader GetHeader()
        {
            return new PacketHeader(0x11, 0x9C, PacketFlags.None);
        }

        #endregion
    }
}