From d9ee0d8950882997170a7e82c14e8ca4c6c44cf8 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 1 Jan 2017 02:33:55 -0600 Subject: [PATCH] is it a length issue? --- .../LoginServer/src/shared/LoginServer.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/LoginServer.cpp b/engine/server/application/LoginServer/src/shared/LoginServer.cpp index afa12138..2082af76 100755 --- a/engine/server/application/LoginServer/src/shared/LoginServer.cpp +++ b/engine/server/application/LoginServer/src/shared/LoginServer.cpp @@ -1416,20 +1416,17 @@ 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 = sessSize + sizeof(StationId); - memcpy(keyBufferPointer, sessionKey, sessSize); - keyBufferPointer += len; - memcpy(keyBufferPointer, &suid, sizeof(StationId)); + len = apiSessionIdWidth + sizeof(StationId); + memcpy(keyBufferPointer, sessionKey, apiSessionIdWidth); + keyBufferPointer += apiSessionIdWidth; // if LoginServer did session login, send the session key back to the client; // the client normally gets the session key from the LaunchPad, but in this mode // 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); }