PSO2SERVER/Server/Protocol/Packets/0E-PartyPacket/0E-1B-PartyInfoPacket.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2024-09-16 17:09:36 +08:00
using PSO2SERVER.Models;
2024-12-11 14:07:19 +08:00
using PSO2SERVER.Party;
2024-09-16 17:09:36 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
2024-09-16 17:09:36 +08:00
{
2024-09-18 04:21:17 +08:00
public class PartyInfoPacket : Packet
2024-09-16 17:09:36 +08:00
{
2024-12-11 14:07:19 +08:00
/// Number of populated party infos.
public uint num_of_infos { get; set; } = 0;
public PartyInfo[] partyInfos { get; set; } = new PartyInfo[10];
2024-09-16 17:09:36 +08:00
2024-12-11 14:07:19 +08:00
public PartyInfoPacket(PartyInfo[] partyInfos)
2024-09-16 17:09:36 +08:00
{
2024-12-11 14:07:19 +08:00
num_of_infos = (uint)partyInfos.Length;
this.partyInfos = partyInfos;
2024-09-16 17:09:36 +08:00
}
#region implemented abstract members of Packet
public override byte[] Build()
{
2024-09-17 11:29:41 +08:00
var pkt = new PacketWriter();
2024-12-11 14:07:19 +08:00
pkt.WriteMagic(num_of_infos, 0xE7E8, 0xFF);
pkt.WriteStructArray(partyInfos);
2024-09-17 11:29:41 +08:00
return pkt.ToArray();
2024-09-16 17:09:36 +08:00
}
public override PacketHeader GetHeader()
{
2024-12-11 14:07:19 +08:00
return new PacketHeader(0x0E, 0x1B, PacketFlags.PACKED);
2024-09-16 17:09:36 +08:00
}
#endregion
}
}