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

@@ -539,3 +539,112 @@ bool ChatPackets::RoutedFromClient::Deserialize(RakNet::BitStream& bitStream) {
if (!data.empty()) VALIDATE_READ(bitStream.ReadBits(data.data(), BYTES_TO_BITS(data.size()), true));
return true;
}
// ---- Guilds ----
void ChatPackets::GuildInvite::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(unknown);
bitStream.Write(invitedPlayer);
}
bool ChatPackets::GuildInvite::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(unknown));
VALIDATE_READ(bitStream.Read(invitedPlayer));
return true;
}
void ChatPackets::GuildInviteResponse::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(unknown);
bitStream.Write(declined);
}
bool ChatPackets::GuildInviteResponse::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(unknown));
VALIDATE_READ(bitStream.Read(declined));
return true;
}
void ChatPackets::GuildLeave::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(unknown);
}
bool ChatPackets::GuildLeave::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(unknown));
return true;
}
void ChatPackets::GuildGetAll::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(unknown);
}
bool ChatPackets::GuildGetAll::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(unknown));
return true;
}
void ChatPackets::GuildCreate::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(guildName);
}
bool ChatPackets::GuildCreate::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(guildName));
return true;
}
void ChatPackets::GuildKick::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(unknown);
bitStream.Write(kickedPlayer);
}
bool ChatPackets::GuildKick::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(unknown));
VALIDATE_READ(bitStream.Read(kickedPlayer));
return true;
}
void ChatPackets::GuildSetRank::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
bitStream.Write(targetPlayer);
bitStream.Write(rank);
}
bool ChatPackets::GuildSetRank::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
VALIDATE_READ(bitStream.Read(targetPlayer));
VALIDATE_READ(bitStream.Read(rank));
return true;
}
void ChatPackets::GuildDisband::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(playerID);
}
bool ChatPackets::GuildDisband::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(playerID));
return true;
}
void ChatPackets::GuildStatus::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(characterID);
bitStream.Write(guildID);
bitStream.Write(guildName);
}
bool ChatPackets::GuildStatus::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(characterID));
VALIDATE_READ(bitStream.Read(guildID));
VALIDATE_READ(bitStream.Read(guildName));
return true;
}