style: move code to onBloodwebClient
This commit is contained in:
@@ -530,6 +530,13 @@ void Spoofer::onMessageList(std::string& body)
|
|||||||
#endif
|
#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)
|
void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
|
||||||
{
|
{
|
||||||
json doc = json::parse(body, nullptr, false);
|
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);
|
json req = json::parse(body, nullptr, false);
|
||||||
if (req.is_discarded()) return Log::error("JSON parse error for bloodweb request handler");
|
if (req.is_discarded()) return Log::error("JSON parse error for bloodweb request handler");
|
||||||
if (req.contains("characterName")) this->_lastBloodWebChar = req["characterName"];
|
if (req.contains("characterName")) this->_lastBloodWebChar = req["characterName"];
|
||||||
}
|
return onBloodwebClient(body);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class Spoofer
|
|||||||
void onGetAll(std::string& body);
|
void onGetAll(std::string& body);
|
||||||
void onInventoryAll(std::string& body);
|
void onInventoryAll(std::string& body);
|
||||||
void onMessageList(std::string& body);
|
void onMessageList(std::string& body);
|
||||||
|
void onBloodwebClient(std::string& body);
|
||||||
void onBloodweb(std::string& body, std::string& respHeaders);
|
void onBloodweb(std::string& body, std::string& respHeaders);
|
||||||
|
|
||||||
void serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);
|
void serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);
|
||||||
|
|||||||
Reference in New Issue
Block a user