bug enclosing

This commit is contained in:
Kai Philipp
2019-09-13 15:42:35 +02:00
parent 2b15e8536c
commit cab243d978
12 changed files with 40 additions and 38 deletions
+8 -6
View File
@@ -52,23 +52,25 @@ AsyncDBAuth::HandleResult(mysqlpp::Query &/*query*/, DBIdManager& /*idManager*/,
service.post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &cb, GetId()));
} else {
int blocked = result[0][2];
int active = result[0][5];
if ((active != 1) || (blocked != 0)) {
//int active = result[0][5];
if (/*(active != 1) ||*/ (blocked != 0)) {
service.post(boost::bind(&ServerDBCallback::PlayerLoginBlocked, &cb, GetId()));
} else {
mysqlpp::String secret(result[0][1]);
mysqlpp::String country(result[0][3]);
mysqlpp::String last_login(result[0][4]);
mysqlpp::String lastGames(result[0][5]);
mysqlpp::String lastIp(result[0][6]);
mysqlpp::String last_games(result[0][5]);
mysqlpp::String last_ip(result[0][6]);
boost::shared_ptr<DBPlayerData> tmpData(new DBPlayerData);
tmpData->id = result[0][0];
secret.to_string(tmpData->secret);
if (!country.is_null())
country.to_string(tmpData->country);
last_login.to_string(tmpData->last_login);
lastGames.to_string(tmpData->lastGames);
lastIp.to_string(tmpData->lastIp);
if (!last_games.is_null())
last_games.to_string(tmpData->last_games);
if (!last_ip.is_null())
last_ip.to_string(tmpData->last_ip);
service.post(boost::bind(&ServerDBCallback::PlayerLoginSuccess, &cb, GetId(), tmpData));
}