From 9904f2e2710b3c3ef2a9a0f3ad38528f5920eb81 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Tue, 27 Dec 2016 02:38:50 +0000 Subject: [PATCH] cleanups --- .../src/shared/ClientConnection.cpp | 28 +++++++++++-------- .../LoginServer/src/shared/TaskMapAccount.cpp | 1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index 7d799bfd..7b505ebc 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -207,8 +207,10 @@ void ClientConnection::validateClient(const std::string & id, const std::string { authOK = true; - parentAccount = api.getString("mainAccount"); - childAccounts = api.getStringVector("subAccounts"); + parentAccount = api.getString("mainAccount"); + childAccounts = api.getStringVector("subAccounts"); + + WARNING(true, ("Raw: %s", api.getRaw().c_str())); } else { @@ -245,24 +247,26 @@ void ClientConnection::validateClient(const std::string & id, const std::string } std::hash h; - suid = h(uname.c_str()); + suid = h(uname.c_str()); } - if (childAccounts.size() == 0) { + // if (childAccounts.size() == 0) { std::hash h; StationId parent = h(parentAccount); - for (auto i = childAccounts.begin(); i != childAccounts.end(); ++i) { - if (!i->empty()) { - if (i->length() > MAX_ACCOUNT_NAME_LENGTH) { - i->resize(MAX_ACCOUNT_NAME_LENGTH); - } + WARNING(true, ("Parent account is %s", parentAccount.c_str())); - // insert all related accounts, if not already there, into the db - DatabaseConnection::getInstance().upsertAccountRelationship(parent, h(*i)); + for (auto i : childAccounts) { + WARNING(true, ("Found child account %s", i.c_str())); + + 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)); } - } + //} LOG("LoginClientConnection", ("validateClient() for stationId (%lu) at IP (%s), id (%s)", m_stationId, getRemoteAddress().c_str(), uname.c_str())); diff --git a/engine/server/application/LoginServer/src/shared/TaskMapAccount.cpp b/engine/server/application/LoginServer/src/shared/TaskMapAccount.cpp index 368d8131..5b87c3ba 100644 --- a/engine/server/application/LoginServer/src/shared/TaskMapAccount.cpp +++ b/engine/server/application/LoginServer/src/shared/TaskMapAccount.cpp @@ -55,6 +55,7 @@ TaskMapAccount::MapAccountQuery::MapAccountQuery() : void TaskMapAccount::MapAccountQuery::getSQL(std::string &sql) { sql = std::string("begin ")+DatabaseConnection::getInstance().getSchemaQualifier()+"login.upsert_account_map(:parentID, :childID); end;"; + WARNING(true, ("TaskRegisterNewCluster SQL: %s\n", sql.c_str())); } // ----------------------------------------------------------------------