PSO2SERVER/Server/Protocol/Handlers/11-ClientHandler/11-DC-CharacterSurvey.cs
2024-11-29 10:01:28 +08:00

32 lines
987 B
C#

using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
using static PSO2SERVER.Protocol.Handlers.CharacterNewNameRequest;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0xDC)]
class CharacterSurvey : PacketHandler
{
public struct CharacterSurveyPacket
{
public uint choice { get; set; }
}
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
// 创建一个结构体实例
var packet = new CharacterSurveyPacket();
// 读取数据并填充到结构体中
var reader = new PacketReader(data, position, size);
packet.choice = reader.ReadUInt32();
context.SendPacket(new NoPayloadPacket(0x11, 0xDD));
}
}
}