From d4a8cd1dc9c3f4b5499a0edda2d283c2cc3f1adb Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 1 Jan 2017 04:45:34 +0000 Subject: [PATCH] this may make more sense --- .../application/LoginServer/src/shared/LoginServer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/LoginServer.cpp b/engine/server/application/LoginServer/src/shared/LoginServer.cpp index 6908638a..9ac8266d 100755 --- a/engine/server/application/LoginServer/src/shared/LoginServer.cpp +++ b/engine/server/application/LoginServer/src/shared/LoginServer.cpp @@ -1421,9 +1421,12 @@ void LoginServer::onValidateClient(StationId suid, const std::string & username, if (ConfigLoginServer::getDoConsumption() || ConfigLoginServer::getDoSessionLogin()) { + std::string const strSessionKey(sessionKey); + size_t sessSize = sizeof(strSessionKey.c_str()); + // pass the sessionkey - len = apiSessionIdWidth + sizeof(StationId); - memcpy(keyBufferPointer, sessionKey, apiSessionIdWidth); + len = sessSize + sizeof(StationId); + memcpy(keyBufferPointer, sessionKey, sessSize); keyBufferPointer += len; memcpy(keyBufferPointer, &suid, sizeof(StationId)); @@ -1432,7 +1435,6 @@ void LoginServer::onValidateClient(StationId suid, const std::string & username, // where the LoginServer does the session login, it will get it from the LoginServer if (ConfigLoginServer::getDoSessionLogin()) { - std::string const strSessionKey(sessionKey, apiSessionIdWidth); GenericValueTypeMessage const msg("SetSessionKey", strSessionKey); conn->send(msg, true); }