For old server change actions change-password to change_password

and 'recover' to 'recovery'. Removed unused API::VERSION.
This commit is contained in:
hiker 2014-08-11 21:56:13 +10:00
parent 3f5ab358df
commit 40224a85f6
2 changed files with 8 additions and 5 deletions

View File

@ -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/
);
}

View File

@ -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;
};