From 46e985f72a1a5c3f218e9df5c1c4c6d0209ecd4f Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Thu, 4 Aug 2016 21:49:12 +0000 Subject: [PATCH] reposition a sanity check --- .../LoginServer/src/shared/ClientConnection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index bb92df9f..f2493d57 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -200,16 +200,16 @@ void ClientConnection::validateClient(const std::string & id, const std::string // test mode authOK = 1; uname = id; - - if (uname.length() > MAX_ACCOUNT_NAME_LENGTH) { - uname.resize(MAX_ACCOUNT_NAME_LENGTH); - } } if (authOK) { if (suid == 0) { + if (uname.length() > MAX_ACCOUNT_NAME_LENGTH) { + uname.resize(MAX_ACCOUNT_NAME_LENGTH); + } + std::hash h; suid = h(uname.c_str()); }