lastGames restored after login
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ struct DBPlayerData {
|
|||||||
std::string secret;
|
std::string secret;
|
||||||
std::string country;
|
std::string country;
|
||||||
std::string last_login;
|
std::string last_login;
|
||||||
std::vector<long> lastGames;
|
std::string lastGames;
|
||||||
std::string lastIp;
|
std::string lastIp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ ServerDBThread::EstablishDBConnection()
|
|||||||
*/
|
*/
|
||||||
prepareNick
|
prepareNick
|
||||||
<< "PREPARE " QUERY_NICK_PREPARE " FROM " << mysqlpp::quote
|
<< "PREPARE " QUERY_NICK_PREPARE " FROM " << mysqlpp::quote
|
||||||
<< "SELECT " DB_TABLE_PLAYER_COL_ID ", AES_DECRYPT(" DB_TABLE_PLAYER_COL_PASSWORD ", ?), " DB_TABLE_PLAYER_COL_VALID ", TRIM(" DB_TABLE_PLAYER_COL_COUNTRY "), " DB_TABLE_PLAYER_COL_LASTLOGIN ", " DB_TABLE_PLAYER_COL_ACTIVE " FROM " DB_TABLE_PLAYER " WHERE " DB_TABLE_PLAYER_COL_USERNAME " = ?";
|
<< "SELECT " DB_TABLE_PLAYER_COL_ID ", AES_DECRYPT(" DB_TABLE_PLAYER_COL_PASSWORD ", ?), " DB_TABLE_PLAYER_COL_VALID ", TRIM(" DB_TABLE_PLAYER_COL_COUNTRY "), " DB_TABLE_PLAYER_COL_LASTLOGIN ", " DB_TABLE_PLAYER_COL_LASTGAMES ", " DB_TABLE_PLAYER_COL_LASTIP " FROM " DB_TABLE_PLAYER " WHERE " DB_TABLE_PLAYER_COL_USERNAME " = ?";
|
||||||
|
|
||||||
mysqlpp::Query prepareAvatarBlacklist = m_connData->conn.query();
|
mysqlpp::Query prepareAvatarBlacklist = m_connData->conn.query();
|
||||||
prepareAvatarBlacklist
|
prepareAvatarBlacklist
|
||||||
|
|||||||
@@ -1811,6 +1811,16 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData
|
|||||||
if (tmpSession && tmpSession->GetPlayerData()) {
|
if (tmpSession && tmpSession->GetPlayerData()) {
|
||||||
tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id);
|
tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id);
|
||||||
tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country);
|
tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country);
|
||||||
|
LOG_ERROR("lastGames from db = " << dbPlayerData.lastGames);
|
||||||
|
std::vector<int> lastGames;
|
||||||
|
std::stringstream ss(dbPlayerData.lastGames);
|
||||||
|
for (int i; ss >> i;) {
|
||||||
|
lastGames.push_back(i);
|
||||||
|
if (ss.peek() == ',')
|
||||||
|
ss.ignore();
|
||||||
|
}
|
||||||
|
tmpSession->GetPlayerData()->SetPlayerLastGames(lastGames);
|
||||||
|
LOG_ERROR("lastGames first from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames());
|
||||||
this->AuthChallenge(tmpSession, dbPlayerData.secret);
|
this->AuthChallenge(tmpSession, dbPlayerData.secret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user