diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 3308ee7ad..cb8c5d9df 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -5798,3 +5798,11 @@ NLMISC_COMMAND(time, "Shows information about the current time", "") CInterfaceManager::getInstance()->displaySystemInfo(msg, "AROUND"); return true; } + +NLMISC_COMMAND(playedTime, "Display character played time", "") +{ + ucstring msg = CI18N::get("uiPlayedTime"); + strFindReplace(msg, "%time", NLMISC::secondsToHumanReadable(CharPlayedTime)); + CInterfaceManager::getInstance()->displaySystemInfo(msg, "AROUND"); + return true; +} diff --git a/code/ryzom/client/src/http_client_curl.cpp b/code/ryzom/client/src/http_client_curl.cpp index 322223f94..e19a435c9 100644 --- a/code/ryzom/client/src/http_client_curl.cpp +++ b/code/ryzom/client/src/http_client_curl.cpp @@ -261,11 +261,11 @@ bool CCurlHttpClient::receive(string &res, bool verbose) { if (verbose) { - nldebug("Receiving %u bytes", _ReceiveBuffer.size()); + nldebug("Receiving %u bytes", (uint)_ReceiveBuffer.size()); } res.clear(); - if (_ReceiveBuffer.size()) + if (!_ReceiveBuffer.empty()) res.assign((const char*)&(*(_ReceiveBuffer.begin())), _ReceiveBuffer.size()); _ReceiveBuffer.clear(); return true; diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 52e09afc3..68760e104 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -2798,7 +2798,7 @@ string checkLogin(const string &login, const string &password, const string &cli if (!login.empty()) { // ask server for salt - if(!HttpClient.sendGet(url + "?cmd=ask&login=" + login + "&lg=" + ClientCfg.LanguageCode, "", pPM->isVerboseLog())) + if(!HttpClient.sendGet(url + "?cmd=ask&cp=2&login=" + login + "&lg=" + ClientCfg.LanguageCode, "", pPM->isVerboseLog())) return "Can't send (error code 60)"; if(pPM->isVerboseLog()) nlinfo("Sent request for password salt"); @@ -2828,7 +2828,7 @@ string checkLogin(const string &login, const string &password, const string &cli return res; } - // send login + crypted password + client app and cp=1 (as crypted password) + // send login + crypted password + client app and cp=2 (as crypted password) if(!HttpClient.connectToLogin()) return "Can't connect (error code 63)"; @@ -2843,13 +2843,13 @@ string checkLogin(const string &login, const string &password, const string &cli { std::string cryptedPassword = CCrypt::crypt(password, Salt); - if(!HttpClient.sendGet(url + "?cmd=login&login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=1" + "&lg=" + ClientCfg.LanguageCode + customParameters)) + if(!HttpClient.sendGet(url + "?cmd=login&login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=2" + "&lg=" + ClientCfg.LanguageCode + customParameters)) return "Can't send (error code 2)"; } else { // don't send login and password if empty - if(!HttpClient.sendGet(url + "?cmd=login&clientApplication=" + clientApp + "&cp=1" + "&lg=" + ClientCfg.LanguageCode + customParameters)) + if(!HttpClient.sendGet(url + "?cmd=login&clientApplication=" + clientApp + "&cp=2" + "&lg=" + ClientCfg.LanguageCode + customParameters)) return "Can't send (error code 2)"; } @@ -2930,7 +2930,7 @@ 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(url + "?login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=1")) + if(!HttpClient.sendGet(url + "?login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=2")) return "Can't send (error code 2)"; /* if(!send(ClientCfg.ConfigFile.getVar("StartupPage").asString()+"?login="+login+"&password="+password+"&clientApplication="+clientApp)) @@ -3034,12 +3034,12 @@ string selectShard(uint32 shardId, string &cookie, string &addr) if(LoginPassword.empty()) return "Empty Password (error code 9)"; if(ClientApp.empty()) return "Empty Client Application (error code 10)"; - // send login + crypted password + client app and cp=1 (as crypted password) + // send login + crypted password + client app and cp=2 (as crypted password) std::string cryptedPassword = CCrypt::crypt(LoginPassword, Salt); 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")) + if(!HttpClient.sendGet(url + "?cmd=login&shardid=" + toString(shardId) + "&login=" + LoginLogin + "&password=" + cryptedPassword + "&clientApplication=" + ClientApp + "&cp=2")) return "Can't send (error code 11)"; string res; diff --git a/code/ryzom/common/src/game_share/http_client.cpp b/code/ryzom/common/src/game_share/http_client.cpp index d6a5fe360..3e100c762 100644 --- a/code/ryzom/common/src/game_share/http_client.cpp +++ b/code/ryzom/common/src/game_share/http_client.cpp @@ -193,14 +193,14 @@ bool CHttpClient::receive(string &res, bool verbose) if (_Sock.receive((uint8*)buf, size, false) == CSock::Ok) { - if (verbose) nlinfo("Received OK %d bytes", size); + if (verbose) nlinfo("Received OK %u bytes", size); buf[1023] = '\0'; res += (char*)buf; //nlinfo("block received '%s'", buf); } else { - if (verbose) nlinfo("Received CLOSE %d bytes", size); + if (verbose) nlinfo("Received CLOSE %u bytes", size); buf[size] = '\0'; res += (char*)buf; //nlwarning ("server connection closed");