From 40224a85f662dbd5ab077b9a2fc84951f3993a80 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 11 Aug 2014 21:56:13 +1000 Subject: [PATCH] For old server change actions change-password to change_password and 'recover' to 'recovery'. Removed unused API::VERSION. --- src/online/http_request.cpp | 12 ++++++++---- src/online/http_request.hpp | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/online/http_request.cpp b/src/online/http_request.cpp index 8ea638d95..6a97a5182 100644 --- a/src/online/http_request.cpp +++ b/src/online/http_request.cpp @@ -30,7 +30,6 @@ namespace Online { - const std::string API::VERSION = "v2"; const std::string API::USER_PATH = "user/"; const std::string API::SERVER_PATH = "server/"; @@ -112,14 +111,19 @@ namespace Online { setURL( (std::string)UserConfigParams::m_server_multiplayer + "client-user.php" ); - addParameter("action", action); + if(action=="change-password") + addParameter("action", "change_password"); + else if(action=="recover") + addParameter("action", "recovery"); + else + addParameter("action", action); } else { setURL( (std::string)UserConfigParams::m_server_multiplayer + - API::VERSION + "/" + // eg: v1, v2, etc - path + // eg: user/, server/ + +"v"+StringUtils::toString(UserConfigParams::m_server_version) + + "/" + path + // eg: /user/, /server/ action + "/" // eg: connect/, pool/, get-server-list/ ); } diff --git a/src/online/http_request.hpp b/src/online/http_request.hpp index 3e94bdff4..faba9f49d 100644 --- a/src/online/http_request.hpp +++ b/src/online/http_request.hpp @@ -37,7 +37,6 @@ namespace Online class API { public: - static const std::string VERSION; static const std::string USER_PATH; static const std::string SERVER_PATH; };