2024-09-16 17:09:36 +08:00
|
|
|
|
using PSO2SERVER.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2024-11-27 18:05:53 +08:00
|
|
|
|
namespace PSO2SERVER.Protocol.Packets
|
2024-09-16 17:09:36 +08:00
|
|
|
|
{
|
2024-09-18 04:21:17 +08:00
|
|
|
|
public class MinimapRevealPacket : Packet
|
2024-09-16 17:09:36 +08:00
|
|
|
|
{
|
2024-12-06 19:47:18 +08:00
|
|
|
|
/// World object where revealing was done.
|
|
|
|
|
private ObjectHeader world { get; set; }
|
|
|
|
|
/// Receivers party object (?).
|
2024-11-26 00:07:24 +08:00
|
|
|
|
private ObjectHeader party { get; set; }
|
|
|
|
|
private uint zone_id { get; set; }
|
2024-12-06 19:47:18 +08:00
|
|
|
|
/// Bitset of revealed regions.
|
|
|
|
|
private RevealedRegions revealed_zones { get; set; } = new RevealedRegions();
|
2024-11-26 00:07:24 +08:00
|
|
|
|
|
|
|
|
|
// 构造函数,允许在创建时初始化字段
|
2024-12-06 19:47:18 +08:00
|
|
|
|
public MinimapRevealPacket(ObjectHeader world, ObjectHeader party, uint zone_id, byte[] revealed_zones)
|
2024-11-26 00:07:24 +08:00
|
|
|
|
{
|
2024-12-06 19:47:18 +08:00
|
|
|
|
this.world = world;
|
2024-11-26 00:07:24 +08:00
|
|
|
|
this.party = party;
|
|
|
|
|
this.zone_id = zone_id;
|
2024-12-06 19:47:18 +08:00
|
|
|
|
this.revealed_zones = new RevealedRegions(revealed_zones);
|
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-06 19:47:18 +08:00
|
|
|
|
pkt.WriteStruct(world);
|
2024-11-26 00:07:24 +08:00
|
|
|
|
pkt.WriteStruct(party);
|
|
|
|
|
pkt.Write(zone_id);
|
2024-12-06 19:47:18 +08:00
|
|
|
|
revealed_zones.Write(pkt);
|
2024-09-17 11:29:41 +08:00
|
|
|
|
return pkt.ToArray();
|
2024-09-16 17:09:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override PacketHeader GetHeader()
|
|
|
|
|
{
|
2024-09-18 04:21:17 +08:00
|
|
|
|
return new PacketHeader(0x0B, 0x13, PacketFlags.None);
|
2024-09-16 17:09:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|