PSO2SERVER/Server/Protocol/Packets/4A-ARKSMissionPacket/4A-01-ARKSMissionListPacket.cs

48 lines
1.4 KiB
C#
Raw Normal View History

2024-09-22 00:08:44 +08:00
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
2024-09-22 00:08:44 +08:00
{
public class ARKSMissionListPacket : Packet
{
2024-12-11 03:39:12 +08:00
public uint Unk1 { get; set; } = new uint();
public List<Mission> Missions { get; set; } = new List<Mission>();
public uint DailyUpdate { get; set; } = new uint();
public uint WeeklyUpdate { get; set; } = new uint();
public uint TierUpdate { get; set; } = new uint();
2024-09-22 00:08:44 +08:00
2024-12-11 03:39:12 +08:00
public ARKSMissionListPacket(List<Mission> mission)
2024-09-22 00:08:44 +08:00
{
2024-12-11 03:39:12 +08:00
Unk1 = 0;
Missions = mission;
DailyUpdate = 1689272266;
WeeklyUpdate = 1689273267;
TierUpdate = 1689273267;
2024-09-22 00:08:44 +08:00
}
#region implemented abstract members of Packet
public override byte[] Build()
{
2024-12-11 03:39:12 +08:00
var pkt = new PacketWriter();
pkt.Write(Unk1);
pkt.WriteMagic(Missions.Count, 0xC691, 0x47);
foreach (var mission in Missions) {pkt.WriteStruct(mission);}
pkt.Write(DailyUpdate);
pkt.Write(WeeklyUpdate);
pkt.Write(TierUpdate);
return pkt.ToArray();
2024-09-22 00:08:44 +08:00
}
public override PacketHeader GetHeader()
{
2024-12-11 03:39:12 +08:00
return new PacketHeader(0x4A, 0x01, PacketFlags.PACKED);
2024-09-22 00:08:44 +08:00
}
#endregion
}
}