mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
The NexusDashboard-parity dashboard (dDashboardServer) and everything built on it on the experimental branch: accounts, characters, properties and moderation tools, permissions shared with in-game slash commands, economy reports, World 3D and property 3D views with client scenery, scheduled events (features, vanity changes, live events, announcements, restarts), vanity files and events, the CDClient browser, the message inspector with saved captures, chat filter tools, community challenges, live ops, the AI moderator helper, and the server-side changes they need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#ifndef __ICHARACTERSNAPSHOTS__H__
|
|
#define __ICHARACTERSNAPSHOTS__H__
|
|
|
|
#include <cstdint>
|
|
#include <map>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
/**
|
|
* Earlier versions of characters' XML, taken before the dashboard changes a character and once a day for characters
|
|
* that changed, so staff can see what changed and put a character back. The XML is stored zlib-compressed.
|
|
*/
|
|
class ICharacterSnapshots {
|
|
public:
|
|
struct CharacterSnapshot {
|
|
uint64_t id{};
|
|
LWOOBJID characterId{};
|
|
int64_t takenAt{};
|
|
std::string reason;
|
|
std::string actor;
|
|
uint32_t size{}; // uncompressed bytes
|
|
std::string hash; // sha256 of the XML, to skip unchanged characters
|
|
std::string compressed;
|
|
};
|
|
|
|
virtual void InsertCharacterSnapshot(const CharacterSnapshot& snapshot) = 0;
|
|
|
|
// Newest first, without the XML
|
|
virtual std::vector<CharacterSnapshot> GetCharacterSnapshots(LWOOBJID characterId) = 0;
|
|
|
|
virtual std::optional<CharacterSnapshot> GetCharacterSnapshot(uint64_t id) = 0;
|
|
|
|
// The newest snapshot's hash for every character that has one
|
|
virtual std::map<LWOOBJID, std::string> GetLatestSnapshotHashes() = 0;
|
|
|
|
// Delete snapshots older than beforeTime, always keeping each character's newest `keep`
|
|
virtual uint32_t PruneCharacterSnapshots(int64_t beforeTime, uint32_t keep) = 0;
|
|
};
|
|
|
|
#endif //!__ICHARACTERSNAPSHOTS__H__
|