Files
DarkflameServer/dDashboardServer/routes/CharacterTools.h
Aaron Kimbrell e213a7aeff feat: web dashboard and playground work
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>
2026-09-28 22:30:43 -05:00

34 lines
1.4 KiB
C++

#pragma once
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include "dCommonVars.h"
#include "PlayerActions.h"
#include "ICharacterSnapshots.h"
/**
* Character support tools: the character editor, snapshots (history, compare, restore) and the character_snapshots
* scheduled task that keeps a copy of every changed character.
*/
void RegisterCharacterToolRoutes();
// Before Scheduler::Initialize
void RegisterCharacterTasks();
// A snapshot's character XML, or nullopt if it can't be read
std::optional<std::string> SnapshotXml(const ICharacterSnapshots::CharacterSnapshot& snapshot);
/**
* Change a character's saved data safely: the owner is disconnected first (so their world saves and lets go), then
* `change` turns the current XML into the new one (or returns nullopt with an error), a snapshot of the current
* version is kept, and the change is audited with `describe`'s text. Returns a PlayerActions request id; `done` also
* gets the outcome (for work that reports under a request id of its own).
*/
uint32_t WriteCharacterXml(LWOOBJID characterId, uint32_t ownerAccountId, const std::string& actor, uint32_t actorId, const std::string& reason,
std::function<std::optional<std::string>(const std::string& current, std::string& error)> change,
std::function<std::string(const std::string& before, const std::string& after)> describe = nullptr,
std::function<void(const PlayerActions::Outcome& outcome)> done = nullptr);