PSO2SERVER/Server/Protocol/Packets/23-FlagPackets/23-04-ServerSetFlagPacket.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2024-09-18 01:50:29 +08:00
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
2024-09-21 12:35:09 +08:00
using static PSO2SERVER.Models.Flags;
2024-09-18 01:50:29 +08:00
namespace PSO2SERVER.Protocol.Packets
2024-09-18 01:50:29 +08:00
{
public class ServerSetFlagPacket : Packet
{
2024-09-21 12:35:09 +08:00
/// Flag type.
public FlagType _flag_type { get; set; }
/// Flag ID.
public uint _id { get; set; }
/// Flag value.
public uint _value { get; set; }
public uint _unk { get; set; }
2024-09-21 15:40:13 +08:00
public ServerSetFlagPacket(uint flag, uint value)
2024-09-18 01:50:29 +08:00
{
2024-09-21 12:35:09 +08:00
_flag_type = FlagType.Account;
_id = flag;
2024-09-21 15:40:13 +08:00
_value = value;
2024-09-21 12:35:09 +08:00
_unk = 0; // 设定未知字段的默认值
2024-09-18 01:50:29 +08:00
}
#region implemented abstract members of Packet
public override byte[] Build()
{
var pkt = new PacketWriter();
2024-09-21 12:35:09 +08:00
pkt.Write((uint)_flag_type);
pkt.Write((uint)_id);
pkt.Write((uint)_value);
pkt.Write((uint)_unk);
2024-09-18 01:50:29 +08:00
return pkt.ToArray();
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x23, 0x04, PacketFlags.None);
}
#endregion
}
}