diff --git a/src/unlocker/spoofing.cpp b/src/unlocker/spoofing.cpp index 371533b..5c74178 100644 --- a/src/unlocker/spoofing.cpp +++ b/src/unlocker/spoofing.cpp @@ -530,6 +530,13 @@ void Spoofer::onMessageList(std::string& body) #endif } +void Spoofer::onBloodwebClient(std::string& body) +{ + json req = json::parse(body, nullptr, false); + if (req.is_discarded()) return Log::error("JSON parse error for bloodweb request handler"); + if (req.contains("characterName")) this->_lastBloodWebChar = req["characterName"]; +} + void Spoofer::onBloodweb(std::string& body, std::string& respHeaders) { json doc = json::parse(body, nullptr, false); @@ -636,5 +643,5 @@ void Spoofer::clientRequestHandler(std::string& url, const std::string& body, st json req = json::parse(body, nullptr, false); if (req.is_discarded()) return Log::error("JSON parse error for bloodweb request handler"); if (req.contains("characterName")) this->_lastBloodWebChar = req["characterName"]; - } + return onBloodwebClient(body); } diff --git a/src/unlocker/spoofing.h b/src/unlocker/spoofing.h index c0cc716..5b62c46 100644 --- a/src/unlocker/spoofing.h +++ b/src/unlocker/spoofing.h @@ -39,6 +39,7 @@ class Spoofer void onGetAll(std::string& body); void onInventoryAll(std::string& body); void onMessageList(std::string& body); + void onBloodwebClient(std::string& body); void onBloodweb(std::string& body, std::string& respHeaders); void serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);