refactor(json): migrate from nlohmann to rapidjson

Replace nlohmann::json with rapidjson across localization, hitbox manager, server world, and sensitive filter. Add json_utils helper for converting rapidjson documents to maps, and improve parse error handling.
This commit is contained in:
2026-08-04 13:17:45 +08:00
parent ef3be12b64
commit 5e7c6ec891
8 changed files with 132 additions and 33 deletions

View File

@@ -0,0 +1,8 @@
#include <rapidjson/document.h>
#include <string>
#include <unordered_map>
namespace Tools {
std::unordered_map<std::string, std::string>
doc_to_map(const rapidjson::Document& doc);
}

View File

@@ -1,11 +1,13 @@
#pragma once
#include <nlohmann/json.hpp>
#include <rapidjson/document.h>
#include <unordered_map>
#include <vector>
namespace Cubed {
class SensitiveFilter {
public:
SensitiveFilter();
void load(const nlohmann::json& j);
void load(const rapidjson::Document& doc);
std::string filter(std::string_view text);
private: