PSO2SERVER/Server/Protocol/Handlers/1A-MailHandler/1A-00-MailListRequest.cs

39 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x1A, 0x00)]
public class MailListRequest : PacketHandler
{
public struct MailListRequestPacket
{
public uint unk1;
public MailType unk2;//mail type
public uint unk3;
}
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);
var pkt = reader.ReadStruct<MailListRequestPacket>();
Logger.WriteObj(pkt);
List<MailHeader> Headers = new List<MailHeader>
{
new MailHeader(1234, 5678, 1001, new byte[0x14], 1111, 2222, TimeSpan.FromDays(1), 3333, "SenderName", "MailSubject")
};
MailListPacket packet = new MailListPacket(1, 2, 3, 4, new byte[0x4], 100, "PlayerName", "CharacterName", Headers);
context.SendPacket(packet);
}
}
}