feat(world): the game client's level editor packets

A world server answers the client's level editor: it remembers per connection
whether the editor is on (and never sends such a client a zone load), takes and
gives up the zone's lock, says whether files may be sent, takes them, sends the
zone's files, and reloads the zone. Who may is the same as for the dashboard's zone
file API: the account's editor level against zone_publish_gm_level, the zone's
editors or an admin, and the lock's holder to send files. Files are unpacked,
checked, written and packed on a worker thread, and every request is in the audit
log.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 19:11:29 -06:00
parent e50a2255f8
commit b5de6cf2c9
12 changed files with 1076 additions and 6 deletions

View File

@@ -1146,4 +1146,55 @@ namespace ClientPackets {
}
return true;
}
void SlashPushMapResponse::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(result);
bitStream.Write(fileType);
bitStream.Write(levelFileId);
for (const char16_t character : lockedBy) {
if (character == u'\0') break;
bitStream.Write<uint16_t>(character);
}
bitStream.Write<uint16_t>(0);
}
bool SlashPushMapResponse::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(result));
VALIDATE_READ(bitStream.Read(fileType));
VALIDATE_READ(bitStream.Read(levelFileId));
lockedBy.clear();
for (uint16_t character = 0; ;) {
VALIDATE_READ(bitStream.Read(character));
if (character == 0) break;
lockedBy += static_cast<char16_t>(character);
}
return true;
}
void SlashPullMapResponse::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(fileType);
bitStream.Write(levelFileId);
bitStream.Write(packedFiles.data(), static_cast<uint32_t>(packedFiles.size()));
}
bool SlashPullMapResponse::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(fileType));
VALIDATE_READ(bitStream.Read(levelFileId));
packedFiles.resize(BITS_TO_BYTES(bitStream.GetNumberOfUnreadBits()));
if (!packedFiles.empty()) VALIDATE_READ(bitStream.Read(packedFiles.data(), static_cast<uint32_t>(packedFiles.size())));
return true;
}
void SlashLockMapResponse::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(result);
bitStream.Write(lockedBy);
bitStream.Write(locked);
}
bool SlashLockMapResponse::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(result));
VALIDATE_READ(bitStream.Read(lockedBy));
VALIDATE_READ(bitStream.Read(locked));
return true;
}
}