From 72c5466ce61280607fb4248b77d0ce02a21611f8 Mon Sep 17 00:00:00 2001 From: neru Date: Sun, 12 Apr 2026 20:57:57 -0300 Subject: [PATCH] feat: add accessKey and keyId to config --- src/unlocker/spoofing.cpp | 12 +++++++----- src/unlocker/spoofing.h | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/unlocker/spoofing.cpp b/src/unlocker/spoofing.cpp index 7e74bf2..0eddef6 100644 --- a/src/unlocker/spoofing.cpp +++ b/src/unlocker/spoofing.cpp @@ -147,6 +147,8 @@ void Spoofer::loadConfig() configJson.value("spoofCharacterOwnership", _config.spoofCharacterOwnership); _config.spoofInventory = configJson.value("spoofInventory", _config.spoofInventory); _config.spoofCustomization = configJson.value("spoofCustomization", _config.spoofCustomization); + _config.accessKey = configJson.value("accessKey", _config.accessKey); + _config.keyId = configJson.value("keyId", _config.keyId); } catch (...) { @@ -158,13 +160,14 @@ void Spoofer::loadConfig() Log::info("config.json not found, using default settings"); json defaultConfig = {{"spoofCharacterOwnership", _config.spoofCharacterOwnership}, {"spoofInventory", _config.spoofInventory}, - {"spoofCustomization", _config.spoofCustomization}}; + {"spoofCustomization", _config.spoofCustomization}, + {"accessKey", _config.accessKey}, {"keyId", _config.keyId}}; std::ofstream out(configPath); out << defaultConfig.dump(4); } - Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}", _config.spoofCharacterOwnership, - _config.spoofInventory, _config.spoofCustomization); + Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}, AccessKey={}, keyId={}", + _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 (std::find(jsonList.begin(), jsonList.end(), charName) == jsonList.end()) - jsonList.push_back(charName); + if (std::find(jsonList.begin(), jsonList.end(), charName) == jsonList.end()) jsonList.push_back(charName); } body = doc.dump(); diff --git a/src/unlocker/spoofing.h b/src/unlocker/spoofing.h index a0aa923..089c6ea 100644 --- a/src/unlocker/spoofing.h +++ b/src/unlocker/spoofing.h @@ -9,11 +9,15 @@ #include +#include "dbdcrypt.h" + struct SpooferConfig { bool spoofCharacterOwnership = false; bool spoofInventory = true; bool spoofCustomization = true; + std::string accessKey = ACCESS_KEY; + std::string keyId = KEY_ID; }; class Spoofer