diff --git a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp index 05f26635..82de2250 100755 --- a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp @@ -338,6 +338,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) { if (apiUser.length() > MAX_ACCOUNT_NAME_LENGTH) { apiUser.resize(MAX_ACCOUNT_NAME_LENGTH); } + apiSuid = std::hash < std::string > {}(apiUser.c_str()); } @@ -379,7 +380,6 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) { account.resize(15); } - account = trim(account); m_suid = std::hash < std::string > {}(account.c_str()); } } diff --git a/engine/server/application/ConnectionServer/src/shared/ClientConnection.h b/engine/server/application/ConnectionServer/src/shared/ClientConnection.h index 5321321d..9d0cfead 100755 --- a/engine/server/application/ConnectionServer/src/shared/ClientConnection.h +++ b/engine/server/application/ConnectionServer/src/shared/ClientConnection.h @@ -196,18 +196,6 @@ private: bool sendToGameServer(GameConnection *c); }; -// stolen from http://www.codeproject.com/Articles/10880/A-trim-implementation-for-std-string -// i'm rusty and haven't gotten to lambdas yet -inline const std::string trim(std::string str) -{ - - str.erase(str.begin(), std::find_if(str.begin(), str.end(), - [](char& ch)->bool { return !isspace(ch); })); - str.erase(std::find_if(str.rbegin(), str.rend(), - [](char& ch)->bool { return !isspace(ch); }).base(), str.end()); - return str; -} - //----------------------------------------------------------------------- inline const std::string & ClientConnection::getAccountName() const diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index c9a2b47a..9610e931 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -176,7 +176,6 @@ void ClientConnection::validateClient(const std::string &id, const std::string & uname.resize(MAX_ACCOUNT_NAME_LENGTH); } - uname = trim(uname); user_id = std::hash < std::string > {}(uname.c_str()); } @@ -258,7 +257,6 @@ void ClientConnection::validateClient(const std::string &id, const std::string & uname.resize(MAX_ACCOUNT_NAME_LENGTH); } - uname = trim(uname); user_id = std::hash < std::string > {}(uname.c_str()); } diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.h b/engine/server/application/LoginServer/src/shared/ClientConnection.h index 8f92f68f..cc8cac60 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.h +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.h @@ -74,20 +74,6 @@ private: //----------------------------------------------------------------------- -// stolen from http://www.codeproject.com/Articles/10880/A-trim-implementation-for-std-string -// i'm rusty and haven't gotten to lambdas yet -inline const std::string trim(std::string str) -{ - - str.erase(str.begin(), std::find_if(str.begin(), str.end(), - [](char& ch)->bool { return !isspace(ch); })); - str.erase(std::find_if(str.rbegin(), str.rend(), - [](char& ch)->bool { return !isspace(ch); }).base(), str.end()); - return str; -} - -//----------------------------------------------------------------------- - inline const StationId ClientConnection::getStationId() const { return m_stationId;