From 3e658f1a1fc4a199df2c194a4b62efd444a23576 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 8 May 2016 13:31:08 +0200 Subject: [PATCH] Changed: Specify host too for login HTTP requests --- code/ryzom/client/src/login.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 987e50dd2..081d31a9d 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -2719,8 +2719,10 @@ string checkLogin(const string &login, const string &password, const string &cli string res; + std::string url = ClientCfg.ConfigFile.getVar("StartupHost").asString() + ClientCfg.ConfigFile.getVar("StartupPage").asString(); + // ask server for salt - if(!HttpClient.sendGet(ClientCfg.ConfigFile.getVar("StartupPage").asString()+"?cmd=ask&login="+login+"&lg="+ClientCfg.LanguageCode, "", pPM->isVerboseLog())) + if(!HttpClient.sendGet(url + "?cmd=ask&login=" + login + "&lg=" + ClientCfg.LanguageCode, "", pPM->isVerboseLog())) return "Can't send (error code 60)"; if(pPM->isVerboseLog()) nlinfo("Sent request for password salt"); @@ -2760,7 +2762,8 @@ string checkLogin(const string &login, const string &password, const string &cli { // R2 login sequence std::string cryptedPassword = CCrypt::crypt(password, Salt); - if(!HttpClient.sendGet(ClientCfg.ConfigFile.getVar("StartupPage").asString()+"?cmd=login&login="+login+"&password="+cryptedPassword+"&clientApplication="+clientApp+"&cp=1"+"&lg="+ClientCfg.LanguageCode)) + + if(!HttpClient.sendGet(url + "?cmd=login&login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=1" + "&lg=" + ClientCfg.LanguageCode)) return "Can't send (error code 2)"; // the response should contains the result code and the cookie value @@ -2839,7 +2842,8 @@ string checkLogin(const string &login, const string &password, const string &cli { // standard ryzom login sequence std::string cryptedPassword = CCrypt::crypt(password, Salt); - if(!HttpClient.sendGet(ClientCfg.ConfigFile.getVar("StartupPage").asString()+"?login="+login+"&password="+cryptedPassword+"&clientApplication="+clientApp+"&cp=1")) + + if(!HttpClient.sendGet(url + "?login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=1")) return "Can't send (error code 2)"; /* if(!send(ClientCfg.ConfigFile.getVar("StartupPage").asString()+"?login="+login+"&password="+password+"&clientApplication="+clientApp)) @@ -2944,7 +2948,10 @@ string selectShard(uint32 shardId, string &cookie, string &addr) // send login + crypted password + client app and cp=1 (as crypted password) std::string cryptedPassword = CCrypt::crypt(LoginPassword, Salt); - if(!HttpClient.sendGet(ClientCfg.ConfigFile.getVar("StartupPage").asString()+"?cmd=login&shardid="+toString(shardId)+"&login="+LoginLogin+"&password="+cryptedPassword+"&clientApplication="+ClientApp+"&cp=1")) + + std::string url = ClientCfg.ConfigFile.getVar("StartupHost").asString() + ClientCfg.ConfigFile.getVar("StartupPage").asString(); + + if(!HttpClient.sendGet(url + "?cmd=login&shardid=" + toString(shardId) + "&login=" + LoginLogin + "&password=" + cryptedPassword + "&clientApplication=" + ClientApp + "&cp=1")) return "Can't send (error code 11)"; string res;