is it a length issue?

This commit is contained in:
DarthArgus
2017-01-01 02:33:55 -06:00
parent cb5a50ebf6
commit d9ee0d8950

View File

@@ -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<std::string> const msg("SetSessionKey", strSessionKey);
conn->send(msg, true);
}