PSO2SERVER/Server/Protocol/Packets/11-ClientPacket/11-2C-BlockBalancePacket.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2024-09-16 17:09:36 +08:00
using PSO2SERVER.Models;
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 BlockBalancePacket : Packet
2024-09-16 17:09:36 +08:00
{
2024-12-02 11:27:14 +08:00
public byte[] unk1 { get; set; } = new byte[0x20];
public string blockname { get; set; } = string.Empty; //0x20 wide
public byte[] ip { get; set; } = new byte[4];
public ushort port { get; set; }
public byte[] data { get; set; } = new byte[0x11A];
2024-09-16 17:09:36 +08:00
2024-12-06 19:47:18 +08:00
public BlockBalancePacket(string blockname, ushort port)
2024-09-16 17:09:36 +08:00
{
2024-12-06 19:47:18 +08:00
this.blockname = blockname;
2024-12-02 11:27:14 +08:00
ip = ServerApp.BindAddress.GetAddressBytes();
2024-12-06 19:47:18 +08:00
this.port = port;
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-02 11:27:14 +08:00
pkt.Write(unk1);
pkt.WriteFixedLengthUtf16(blockname, 0x20);
pkt.Write(ip);
2024-12-06 19:47:18 +08:00
pkt.Write(port);
pkt.Write(new byte[0x11A]);
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(0x11, 0x2C, PacketFlags.None);
2024-09-16 17:09:36 +08:00
}
#endregion
}
}