wire: guild packets and DisplayGuildCreateBox as structs

The guild packets of the 1.10.64 client (docs/Guilds.md) as Serialize/Deserialize structs, laid out the way the client's
packet handlers read them: GUILD_CREATE_RESPONSE, GUILD_INVITE, GUILD_INVITE_INITIAL_RESPONSE, _FINAL_RESPONSE,
_CONFIRM, GUILD_ADD_PLAYER, GUILD_REMOVE_PLAYER, GUILD_LOGIN_LOGOUT and GUILD_DATA (ClientPackets), the world packet
TMP_GUILD_CREATE the create box sends, the chat packets the client sends through its world (GUILD_INVITE,
GUILD_INVITE_RESPONSE, GUILD_LEAVE, GUILD_GET_ALL), DLU's world <-> chat packets (GUILD_CREATE, GUILD_KICK,
GUILD_GET_STATUS as the chat server's guild update to a world, and GUILD_SET_RANK and GUILD_DISBAND appended to
MessageType::Chat after CREATE_TEAM) and the game message DisplayGuildCreateBox (626). Fixed-size names always keep a
NUL, since the client reads them as C strings. Enums eGuildCreateResponse, eGuildInviteResponse,
eGuildInviteFinalResponse, eGuildRank and eGuildLeaveReason. Nothing sends them yet.

Check: GuildPacketsTests compares every packet with the bytes at the client's offsets. Nothing to check in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 05:40:53 -05:00
parent 88ebdf685e
commit 130f3566cc
14 changed files with 905 additions and 0 deletions

View File

@@ -375,6 +375,104 @@ namespace ChatPackets {
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// Guilds (docs/Guilds.md). The client sends GUILD_INVITE, GUILD_INVITE_RESPONSE, GUILD_LEAVE and GUILD_GET_ALL
// (routed like the ones above); the others are DLU's world <-> chat packets.
// Invite a player (by name) to the sender's guild
struct GuildInvite : public LUBitStream {
LWOOBJID playerID{};
uint32_t unknown{};
LUWString invitedPlayer{ 33 };
GuildInvite() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_INVITE) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// The answer to the invite in the message box (button 1 accepts: declined 0)
struct GuildInviteResponse : public LUBitStream {
LWOOBJID playerID{};
uint32_t unknown{};
uint8_t declined{};
GuildInviteResponse() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_INVITE_RESPONSE) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// Leave the guild. The client sends 66 more bytes of whatever was on its stack; they are not read.
struct GuildLeave : public LUBitStream {
LWOOBJID playerID{};
uint32_t unknown{};
GuildLeave() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_LEAVE) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// The player's guild and its members (answered with ClientPackets::GuildData)
struct GuildGetAll : public LUBitStream {
LWOOBJID playerID{};
uint32_t unknown{};
GuildGetAll() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_GET_ALL) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// World -> chat: the name from the client's TMP_GUILD_CREATE
struct GuildCreate : public LUBitStream {
LWOOBJID playerID{};
LUWString guildName{ 31 };
GuildCreate() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_CREATE) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// World -> chat: /gkick (the client never sends GUILD_KICK; the layout is the team kick's)
struct GuildKick : public LUBitStream {
LWOOBJID playerID{};
uint32_t unknown{};
LUWString kickedPlayer{ 33 };
GuildKick() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_KICK) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// World -> chat: change a member's rank (eGuildRank; LEADER hands the guild over)
struct GuildSetRank : public LUBitStream {
LWOOBJID playerID{};
LUWString targetPlayer{ 33 };
uint8_t rank{};
GuildSetRank() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_SET_RANK) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// World -> chat: the leader disbands the guild
struct GuildDisband : public LUBitStream {
LWOOBJID playerID{};
GuildDisband() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_DISBAND) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
// Chat -> the character's world: its guild changed; the world puts it in the character component (guild 0: none).
// guildName is what other players may see (empty while the name waits for moderation).
struct GuildStatus : public LUBitStream {
LWOOBJID characterID{};
LWOOBJID guildID{};
LUWString guildName{ 31 };
GuildStatus() : LUBitStream(ServiceType::CHAT, MessageType::Chat::GUILD_GET_STATUS) {}
void Serialize(RakNet::BitStream& bitStream) const override;
bool Deserialize(RakNet::BitStream& bitStream) override;
};
/**
* Chat-service packets the client receives, from the chat server (routed through the player's world) or from its world.
*/