mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 09:45:28 +00:00
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:
@@ -705,6 +705,53 @@ namespace ClientPackets {
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* Answers to the client's level editor (docs/ZonePublish.md). result: 0 allowed, 1 the account's editor level is
|
||||
* too low, 2 the account is not one of the zone's editors, 3 another account holds the zone's lock (lockedBy
|
||||
* says who), 4 nothing changed (lock answers only).
|
||||
*/
|
||||
|
||||
// Server -> client. The zone is about to be reloaded from its files. No payload.
|
||||
struct ImpendingReloadNotify : public LUBitStream {
|
||||
ImpendingReloadNotify() : LUBitStream(ServiceType::CLIENT, MessageType::Client::IMPENDING_RELOAD_NOTIFY) {}
|
||||
};
|
||||
|
||||
// Server -> client. Whether the client may send the files it asked to (it then sends them when result is 0).
|
||||
struct SlashPushMapResponse : public LUBitStream {
|
||||
uint8_t result{};
|
||||
uint8_t fileType{}; // as asked
|
||||
int32_t levelFileId{}; // as asked
|
||||
// Written as UTF-16 characters and a null
|
||||
std::u16string lockedBy{};
|
||||
|
||||
SlashPushMapResponse() : LUBitStream(ServiceType::CLIENT, MessageType::Client::SLASH_PUSH_MAP_RESPONSE) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
};
|
||||
|
||||
// Server -> client. The zone's files the client asked for (ZoneFilePack).
|
||||
struct SlashPullMapResponse : public LUBitStream {
|
||||
uint8_t fileType{};
|
||||
int32_t levelFileId{};
|
||||
// Everything after the level file ID
|
||||
std::string packedFiles{};
|
||||
|
||||
SlashPullMapResponse() : LUBitStream(ServiceType::CLIENT, MessageType::Client::SLASH_PULL_MAP_RESPONSE) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
};
|
||||
|
||||
// Server -> client. How taking or giving up the zone's lock went, and whether the client holds it now.
|
||||
struct SlashLockMapResponse : public LUBitStream {
|
||||
uint8_t result{};
|
||||
LUWString lockedBy{ 33 };
|
||||
uint8_t locked{};
|
||||
|
||||
SlashLockMapResponse() : LUBitStream(ServiceType::CLIENT, MessageType::Client::SLASH_LOCK_MAP_RESPONSE) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // CLIENTPACKETS_H
|
||||
|
||||
Reference in New Issue
Block a user