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>
This commit is contained in:
Aaron Kimbrell
2026-09-26 17:52:10 -05:00
parent 854d02f509
commit e213a7aeff
681 changed files with 88310 additions and 1321 deletions

62
dCommon/Locale.cpp Normal file
View File

@@ -0,0 +1,62 @@
#include "Locale.h"
#include "tinyxml2.h"
#include "Logger.h"
namespace {
std::unordered_map<std::string, std::string> g_Phrases;
bool g_Loaded = false;
const std::string g_Empty;
}
void Locale::LoadFromFile(const std::string& filepath, const std::string& locale) {
tinyxml2::XMLDocument doc;
if (doc.LoadFile(filepath.c_str()) != tinyxml2::XML_SUCCESS) {
LOG("Failed to load locale file: %s", filepath.c_str());
return;
}
auto* root = doc.FirstChildElement("localization");
if (!root) return;
auto* phrases = root->FirstChildElement("phrases");
if (!phrases) return;
for (auto* phrase = phrases->FirstChildElement("phrase"); phrase; phrase = phrase->NextSiblingElement("phrase")) {
const char* id = phrase->Attribute("id");
if (!id) continue;
for (auto* trans = phrase->FirstChildElement("translation"); trans; trans = trans->NextSiblingElement("translation")) {
const char* loc = trans->Attribute("locale");
if (loc && locale == loc) {
const char* text = trans->GetText();
if (text) {
g_Phrases[id] = text;
}
break;
}
}
}
g_Loaded = true;
LOG("Loaded %zu locale phrases from %s (locale: %s)", g_Phrases.size(), filepath.c_str(), locale.c_str());
}
const std::string& Locale::GetPhrase(const std::string& phraseId) {
auto it = g_Phrases.find(phraseId);
if (it != g_Phrases.end()) return it->second;
return g_Empty;
}
bool Locale::IsLoaded() {
return g_Loaded;
}
std::vector<std::string> Locale::GetPhraseIdsWithPrefix(const std::string& prefix) {
std::vector<std::string> result;
for (const auto& [key, _] : g_Phrases) {
if (key.compare(0, prefix.size(), prefix) == 0) {
result.push_back(key);
}
}
return result;
}