This commit is contained in:
DarthArgus
2016-12-27 03:49:14 +00:00
parent 9904f2e271
commit 892390b1b8
2 changed files with 13 additions and 18 deletions
@@ -209,8 +209,6 @@ void ClientConnection::validateClient(const std::string & id, const std::string
parentAccount = api.getString("mainAccount");
childAccounts = api.getStringVector("subAccounts");
WARNING(true, ("Raw: %s", api.getRaw().c_str()));
}
else
{
@@ -250,28 +248,26 @@ void ClientConnection::validateClient(const std::string & id, const std::string
suid = h(uname.c_str());
}
// if (childAccounts.size() == 0) {
std::hash<std::string> h;
StationId parent = h(parentAccount);
std::hash<std::string> h;
StationId parent = h(parentAccount);
WARNING(true, ("Parent account is %s", parentAccount.c_str()));
WARNING(true, ("Parent account is %s", parentAccount.c_str()));
for (auto i : childAccounts) {
WARNING(true, ("Found child account %s", i.c_str()));
for (auto i : childAccounts) {
WARNING(true, ("Found child account %s %llu", i.c_str(), h(i)));
if (i.length() > MAX_ACCOUNT_NAME_LENGTH) {
i.resize(MAX_ACCOUNT_NAME_LENGTH);
}
if (i.length() > MAX_ACCOUNT_NAME_LENGTH) {
i.resize(MAX_ACCOUNT_NAME_LENGTH);
}
// insert all related accounts, if not already there, into the db
DatabaseConnection::getInstance().upsertAccountRelationship(parent, h(i));
}
//}
// insert all related accounts, if not already there, into the db
DatabaseConnection::getInstance().upsertAccountRelationship(parent, h(i));
}
LOG("LoginClientConnection", ("validateClient() for stationId (%lu) at IP (%s), id (%s)", m_stationId, getRemoteAddress().c_str(), uname.c_str()));
LoginServer::getInstance().onValidateClient(suid, uname, this, true, NULL, 0xFFFFFFFF, 0xFFFFFFFF);
}
}
}
// ----------------------------------------------------------------------------