PSO2SERVER/Server/Protocol/Packets/11-ClientPacket/11-9C-CharacterNewNamePacket.cs
2024-11-27 18:05:53 +08:00

46 lines
1.1 KiB
C#

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
}
}