mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-24 13:42:50 +00:00
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:
@@ -7,6 +7,7 @@
|
||||
|
||||
// C++
|
||||
#include <map>
|
||||
#include <ranges>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <sstream>
|
||||
@@ -297,6 +298,41 @@ struct LwoNameValue {
|
||||
return this->values.find(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* All values as "key=type:value" lines, for storing outside the game (e.g. mail attachments).
|
||||
* Backslashes and line breaks inside a value are escaped (\\ and \n) so every value comes back out.
|
||||
*/
|
||||
std::string ToLines() const {
|
||||
std::string lines;
|
||||
for (const auto& value : this->values | std::views::values) {
|
||||
if (!lines.empty()) lines += '\n';
|
||||
for (const char c : value->GetString()) {
|
||||
if (c == '\\') lines += "\\\\";
|
||||
else if (c == '\n') lines += "\\n";
|
||||
else lines += c;
|
||||
}
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
// Inverse of ToLines; lines that do not parse are skipped
|
||||
void InsertLines(const std::string_view lines) {
|
||||
for (const auto& escaped : GeneralUtils::SplitString(lines, '\n')) {
|
||||
if (escaped.empty()) continue;
|
||||
std::string line;
|
||||
for (size_t i = 0; i < escaped.size(); i++) {
|
||||
if (escaped[i] == '\\' && i + 1 < escaped.size()) {
|
||||
const char next = escaped[++i];
|
||||
line += next == 'n' ? '\n' : next;
|
||||
} else {
|
||||
line += escaped[i];
|
||||
}
|
||||
}
|
||||
LDFPtr parsed(LDFBaseData::DataFromString(line));
|
||||
if (parsed) this->values.insert_or_assign(parsed->GetKey(), std::move(parsed));
|
||||
}
|
||||
}
|
||||
|
||||
LwoNameValue() = default;
|
||||
|
||||
LwoNameValue(const LwoNameValue& other) {
|
||||
|
||||
Reference in New Issue
Block a user