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 Character _character;
public GuildInfoPacket(Character character)
{
_character = character;
}
#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
2024-11-25 23:33:41 +08:00
writer.Write((uint) _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
2024-09-20 21:58:37 +08:00
writer.WriteFixedLengthUtf16(_character.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
2024-09-10 00:31:40 +08:00
writer.WriteFixedLengthUtf16(_character.Name, 16);
// 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
}
}