mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Address some fo the feedback
This commit is contained in:
@@ -133,3 +133,12 @@ void ChatWebAPI::Listen() {
|
||||
void ChatWebAPI::ReceiveRequests() {
|
||||
mg_mgr_poll(&mgr, 15);
|
||||
}
|
||||
|
||||
std::optional<json> ChatWebAPI::ParseJSON(char* data) {
|
||||
try {
|
||||
return std::make_optional<json>(json::parse(data));
|
||||
} catch (const std::exception& e) {
|
||||
LOG_DEBUG("Failed to parse JSON: %s", e.what());
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user