PSO2SERVER/Server/Protocol/Handlers/0B-QuestHandler/0B-20-AcceptQuest.cs

37 lines
1.3 KiB
C#
Raw Normal View History

using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0x20)]
2024-12-03 13:18:58 +08:00
public class AcceptQuest : PacketHandler
{
public ObjectHeader quest_obj { get; set; }
public ushort diff { get; set; }
public ushort unk1 { get; set; }
public uint[] unk2 { get; set; } = new uint[7];
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 reader = new PacketReader(data, position, size);
try
{
quest_obj = reader.ReadObjectHeader();
diff = reader.ReadUInt16();
unk1 = reader.ReadUInt16();
for (int i = 0; i < 7; i++) { unk2[i] = reader.ReadUInt32(); }
}
catch (Exception ex)
{
Logger.WriteError("Error while processing AcceptQuest packet: " + ex.Message);
}
Logger.Write($"PartyQuest Object: {quest_obj}, Difficulty: {diff}, unk1: {unk1}, unk2: {string.Join(", ", unk2)}");
}
}
}