From 3167f81fcd6e32893c7f75052a8e59f95efe3115 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Thu, 17 May 2018 17:53:19 +0000 Subject: [PATCH] Revert "this should make things display properly again" This reverts commit 9dffede072c191486483521551b68931a4aacba3. --- .../src/shared/ClientConnection.cpp | 6 ++--- external/3rd/library/webAPI/webAPI.cpp | 23 ++----------------- external/3rd/library/webAPI/webAPI.h | 7 ++---- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index 8b43f6d8..d955e5eb 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -161,7 +161,7 @@ void ClientConnection::validateClient(const std::string &id, const std::string & StationId user_id; StationId parent_id; - std::unordered_map childAccounts; + std::unordered_map childAccounts; if (!authURL.empty()) { // create the object @@ -184,8 +184,8 @@ void ClientConnection::validateClient(const std::string &id, const std::string & childAccounts = api.getStringMap("subAccounts"); if (!ConfigLoginServer::getUseOldSuidGenerator()) { - user_id = static_cast(api.getNullableValue("user_id")); - parent_id = static_cast(api.getNullableValue("parent_id")); + user_id = static_cast(api.getNullableValue("user_id")); + parent_id = static_cast(api.getNullableValue("parent_id")); } else { if (parentAccount.length() > MAX_ACCOUNT_NAME_LENGTH) { parentAccount.resize(MAX_ACCOUNT_NAME_LENGTH); diff --git a/external/3rd/library/webAPI/webAPI.cpp b/external/3rd/library/webAPI/webAPI.cpp index faf7d11b..b03ea28c 100644 --- a/external/3rd/library/webAPI/webAPI.cpp +++ b/external/3rd/library/webAPI/webAPI.cpp @@ -72,26 +72,7 @@ std::unordered_map webAPI::getStringMap(const std::string &slo return ret; } -std::unordered_map webAPI::getStringMap64(const std::string &slot) { - std::unordered_map ret = std::unordered_map(); - - if (!responseData.empty() && !slot.empty() && responseData.count(slot) && !responseData[slot].is_null()) { - - nlohmann::json j = responseData[slot]; - - for (nlohmann::json::iterator it = j.begin(); it != j.end(); ++it) { - std::string tmp(it.key()); - int64_t k = strtoll(tmp.c_str(), nullptr, 10); - std::string val = it.value(); - - ret.insert({k, val}); - } - } - - return ret; -} - -bool webAPI::submit(const int32_t &reqType, const int32_t &getPost, const int32_t &respType) { +bool webAPI::submit(const int &reqType, const int &getPost, const int &respType) { if (reqType == DTYPE::JSON) // json request { if (!requestData.empty()) { @@ -112,7 +93,7 @@ bool webAPI::submit(const int32_t &reqType, const int32_t &getPost, const int32_ return false; } -bool webAPI::fetch(const int32_t &getPost, const int32_t &mimeType) // 0 for json 1 for string +bool webAPI::fetch(const int &getPost, const int &mimeType) // 0 for json 1 for string { bool fetchStatus = false; diff --git a/external/3rd/library/webAPI/webAPI.h b/external/3rd/library/webAPI/webAPI.h index 2209b8f5..501c18cb 100644 --- a/external/3rd/library/webAPI/webAPI.h +++ b/external/3rd/library/webAPI/webAPI.h @@ -49,7 +49,7 @@ namespace StellaBellum { // submits the request bool - submit(const int32_t &reqType = DTYPE::JSON, const int32_t &getPost = HTTP::POST, const int32_t &respType = DTYPE::JSON); + submit(const int &reqType = DTYPE::JSON, const int &getPost = HTTP::POST, const int &respType = DTYPE::JSON); // set the endpoint after object creation...or change the target if needed bool setEndpoint(const std::string endpoint); @@ -66,9 +66,6 @@ namespace StellaBellum { // get a vector of strings from a given slot std::unordered_map getStringMap(const std::string &slot); - // get a 64 bit keyed vector of strings from a given slot - std::unordered_map getStringMap64(const std::string &slot); - // set json key and value for request template bool addJsonData(const std::string &key, const T &value) { if (!key.empty() && @@ -107,7 +104,7 @@ namespace StellaBellum { std::string uri; // fetcher - returns raw response direct from remote - bool fetch(const int32_t &getPost = HTTP::POST, const int32_t &mimeType = DTYPE::JSON); + bool fetch(const int &getPost = HTTP::POST, const int &mimeType = DTYPE::JSON); // cURL writeback callback static size_t writeCallback(void *contents, size_t size, size_t nmemb, void *userp);