getting closer, but no cigar

This commit is contained in:
DarthArgus
2017-01-01 06:23:47 +00:00
parent 0328338e8c
commit 2cd0af76e3
4 changed files with 12 additions and 34 deletions
@@ -312,6 +312,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) {
DEBUG_FATAL(m_hasSelectedCharacter, ("Trying to validate a client who already has a character selected.\n"));
bool result = false;
StationId apiSuid = 0;
char sessionId[apiSessionIdWidth];
m_gameBitsToClear = msg.getGameBitsToClear();
@@ -341,7 +342,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) {
if (status) {
printf("\tStatus ok....\n");
StationId apiSuid = api.getNullableValue<int>("user_id");
apiSuid = api.getNullableValue<int>("user_id");
int expired = api.getNullableValue<int>("expired");
std::string apiUser = api.getString("user_name");
std::string apiIP = api.getString("ip");
@@ -363,6 +364,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) {
printf("\tNo api submit :(\n");
}
} else { // assume local testing
printf("something isn't right or we're just testing...\n");
result = ConnectionServer::decryptToken(token, m_suid, m_isSecure, m_accountName);
}
@@ -405,29 +407,18 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) {
return;
}
if (ConfigConnectionServer::getValidateStationKey()) {
SessionApiClient *session = ConnectionServer::getSessionApiClient();
NOT_NULL(session);
if (session) {
session->validateClient(this, sessionId);
} else {
ConnectionServer::dropClient(this, "SessionApiClient is not available!");
disconnect();
}
} else {
if (!m_suid) {
m_suid = atoi(m_accountName.c_str());
if (m_suid == 0) {
if (!m_suid && !ConfigConnectionServer::getValidateStationKey()) {
m_suid = atoi(m_accountName.c_str());
if (m_suid == 0) {
std::hash<std::string> h;
m_suid = h(m_accountName.c_str());
}
}
onValidateClient(m_suid, m_accountName, m_isSecure, nullptr,
ConfigConnectionServer::getDefaultGameFeatures(),
ConfigConnectionServer::getDefaultSubscriptionFeatures(), 0, 0, 0, 0,
ConfigConnectionServer::getFakeBuddyPoints());
}
onValidateClient(m_suid, m_accountName, m_isSecure, nullptr,
ConfigConnectionServer::getDefaultGameFeatures(),
ConfigConnectionServer::getDefaultSubscriptionFeatures(), 0, 0, 0, 0,
ConfigConnectionServer::getFakeBuddyPoints());
} else {
// They sent us a token that was no good -- either a hack attempt, or
// possibly it was just too old.
@@ -119,11 +119,6 @@ ConnectionServer::ConnectionServer() :
Address a("", ConfigConnectionServer::getPingPort());
IGNORE_RETURN(pingSocket->bind(a));
if (ConfigConnectionServer::getValidateStationKey())
{
installSessionValidation();
}
}
//-----------------------------------------------------------------------
@@ -201,11 +201,6 @@ LoginServer::LoginServer() :
connectToMessage("FeatureIdTransactionRequest");
connectToMessage("FeatureIdTransactionSyncUpdate");
keyServer = new KeyServer;
/*if (ConfigLoginServer::getValidateStationKey() || ConfigLoginServer::getDoSessionLogin())
{
installSessionValidation();
}*/
}
//-----------------------------------------------------------------------
@@ -120,10 +120,7 @@ void PurgeManager::onGetAccountForPurge(StationId account, int purgePhase)
PurgeRecord record(account, static_cast<PurgePhase>(purgePhase));
m_purgeRecords.insert(std::make_pair(account,record));
if (ConfigLoginServer::getValidateStationKey())
NON_NULL(LoginServer::getInstance().getSessionApiClient())->checkStatusForPurge(account);
else
onCheckStatusForPurge(account, false);
onCheckStatusForPurge(account, false);
}
}