style: move code to onBloodwebClient

This commit is contained in:
2026-04-12 13:12:24 -03:00
parent 45431e29f1
commit 698ac445e0
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -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);
}
+1
View File
@@ -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);