feat: add accessKey and keyId to config

This commit is contained in:
2026-04-12 20:57:57 -03:00
parent 8a828db908
commit 72c5466ce6
2 changed files with 11 additions and 5 deletions
+7 -5
View File
@@ -147,6 +147,8 @@ void Spoofer::loadConfig()
configJson.value("spoofCharacterOwnership", _config.spoofCharacterOwnership); configJson.value("spoofCharacterOwnership", _config.spoofCharacterOwnership);
_config.spoofInventory = configJson.value("spoofInventory", _config.spoofInventory); _config.spoofInventory = configJson.value("spoofInventory", _config.spoofInventory);
_config.spoofCustomization = configJson.value("spoofCustomization", _config.spoofCustomization); _config.spoofCustomization = configJson.value("spoofCustomization", _config.spoofCustomization);
_config.accessKey = configJson.value("accessKey", _config.accessKey);
_config.keyId = configJson.value("keyId", _config.keyId);
} }
catch (...) catch (...)
{ {
@@ -158,13 +160,14 @@ void Spoofer::loadConfig()
Log::info("config.json not found, using default settings"); Log::info("config.json not found, using default settings");
json defaultConfig = {{"spoofCharacterOwnership", _config.spoofCharacterOwnership}, json defaultConfig = {{"spoofCharacterOwnership", _config.spoofCharacterOwnership},
{"spoofInventory", _config.spoofInventory}, {"spoofInventory", _config.spoofInventory},
{"spoofCustomization", _config.spoofCustomization}}; {"spoofCustomization", _config.spoofCustomization},
{"accessKey", _config.accessKey}, {"keyId", _config.keyId}};
std::ofstream out(configPath); std::ofstream out(configPath);
out << defaultConfig.dump(4); out << defaultConfig.dump(4);
} }
Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}", _config.spoofCharacterOwnership, Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}, AccessKey={}, keyId={}",
_config.spoofInventory, _config.spoofCustomization); _config.spoofCharacterOwnership, _config.spoofInventory, _config.spoofCustomization, _config.accessKey, _config.keyId);
} }
/* /*
@@ -418,8 +421,7 @@ void Spoofer::onGetAllClient(std::string& body)
{ {
if (charName == "K25") continue; if (charName == "K25") continue;
if (std::find(jsonList.begin(), jsonList.end(), charName) == jsonList.end()) if (std::find(jsonList.begin(), jsonList.end(), charName) == jsonList.end()) jsonList.push_back(charName);
jsonList.push_back(charName);
} }
body = doc.dump(); body = doc.dump();
+4
View File
@@ -9,11 +9,15 @@
#include <nlohmann/json_fwd.hpp> #include <nlohmann/json_fwd.hpp>
#include "dbdcrypt.h"
struct SpooferConfig struct SpooferConfig
{ {
bool spoofCharacterOwnership = false; bool spoofCharacterOwnership = false;
bool spoofInventory = true; bool spoofInventory = true;
bool spoofCustomization = true; bool spoofCustomization = true;
std::string accessKey = ACCESS_KEY;
std::string keyId = KEY_ID;
}; };
class Spoofer class Spoofer