PSO2SERVER/Server/Protocol/Packets/1C-AlliancePacket/1C-1F-GuildInfoPacket.cs

68 lines
1.8 KiB
C#
Raw Normal View History

2024-12-02 20:43:28 +08:00
using PSO2SERVER.Database;
using PSO2SERVER.Models;
2024-09-10 00:31:40 +08:00
namespace PSO2SERVER.Protocol.Packets
2024-09-10 00:31:40 +08:00
{
internal class GuildInfoPacket : Packet
{
private readonly Client Client;
2024-09-10 00:31:40 +08:00
public GuildInfoPacket(Client client)
2024-09-10 00:31:40 +08:00
{
Client = client;
2024-09-10 00:31:40 +08:00
}
#region implemented abstract members of Packet
public override byte[] Build()
{
var writer = new PacketWriter();
writer.Write((byte) 1); // Always 1? 可能是公会ID uint 涵盖下面3字节
2024-09-10 00:31:40 +08:00
// Padding? Or the above is actually a uint
for (var i = 0; i < 3; i++)
writer.Write((byte) 0);
// Character ID
writer.Write((uint)Client.Character.CharacterID);
2024-09-10 00:31:40 +08:00
// Padding?
for (var i = 0; i < 4; i++)
writer.Write((byte) 0);
// Nickname
// TODO: The above and below may be switched around, need more data
writer.WriteFixedLengthUtf16(Client._account.Nickname, 16);
2024-09-10 00:31:40 +08:00
// Padding?
for (var i = 0; i < 36; i++)
writer.Write((byte) 0);
// Accounts name
writer.WriteFixedLengthUtf16(Client.Character.Name, 16);
2024-09-10 00:31:40 +08:00
// Unknown?
for (var i = 0; i < 24; i++)
writer.Write((byte) 0);
2024-12-08 11:33:06 +08:00
// Team name
2024-09-10 00:31:40 +08:00
// We don't actually have team names anywhere, just dump a test here
writer.WriteFixedLengthUtf16("TEAMNAME", 16);
2024-09-10 00:31:40 +08:00
// Unknown
// Somewhere in here is likely a Team ID
for (var i = 0; i < 32; i++)
writer.Write((byte) 0);
return writer.ToArray();
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x1C, 0x1F, PacketFlags.None);
2024-09-10 00:31:40 +08:00
}
#endregion
}
}