adaptions for new ranking-login-system - avatar queries disabled
This commit is contained in:
@@ -51,9 +51,9 @@ AsyncDBAuth::HandleResult(mysqlpp::Query &/*query*/, DBIdManager& /*idManager*/,
|
||||
if (result.num_rows() != 1) {
|
||||
service.post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &cb, GetId()));
|
||||
} else {
|
||||
int valid = result[0][2];
|
||||
int blocked = result[0][2];
|
||||
int active = result[0][5];
|
||||
if ((valid != 1) || (active != 1)) {
|
||||
if ((active != 1) || (blocked != 0)) {
|
||||
service.post(boost::bind(&ServerDBCallback::PlayerLoginBlocked, &cb, GetId()));
|
||||
} else {
|
||||
mysqlpp::String secret(result[0][1]);
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
#ifndef _DB_TABLE_DEFS_H_
|
||||
#define _DB_TABLE_DEFS_H_
|
||||
|
||||
#define DB_TABLE_PLAYER "player_login"
|
||||
#define DB_TABLE_PLAYER_COL_ID "id"
|
||||
#define DB_TABLE_PLAYER "player"
|
||||
#define DB_TABLE_PLAYER_COL_ID "player_id"
|
||||
#define DB_TABLE_PLAYER_COL_USERNAME "username"
|
||||
#define DB_TABLE_PLAYER_COL_PASSWORD "password"
|
||||
#define DB_TABLE_PLAYER_COL_VALID "valid"
|
||||
#define DB_TABLE_PLAYER_COL_COUNTRY "country"
|
||||
#define DB_TABLE_PLAYER_COL_VALID "blocked"
|
||||
#define DB_TABLE_PLAYER_COL_COUNTRY "country_iso"
|
||||
#define DB_TABLE_PLAYER_COL_LASTLOGIN "last_login"
|
||||
#define DB_TABLE_PLAYER_COL_ACTIVE "aktivator"
|
||||
#define DB_TABLE_PLAYER_COL_ACTIVE "active"
|
||||
#define DB_TABLE_PLAYER_COL_AVATARHASH "avatar_hash"
|
||||
#define DB_TABLE_PLAYER_COL_AVATARTYPE "avatar_type"
|
||||
#define DB_TABLE_PLAYER_COL_AVATARTYPE "avatar_mime"
|
||||
|
||||
#define DB_TABLE_GAME "game"
|
||||
#define DB_TABLE_GAME_COL_ID "idgame"
|
||||
|
||||
@@ -425,13 +425,20 @@ ServerDBThread::EstablishDBConnection()
|
||||
Msleep(250);
|
||||
} else {
|
||||
mysqlpp::Query prepareNick = m_connData->conn.query();
|
||||
/*
|
||||
prepareNick
|
||||
<< "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 BINARY " DB_TABLE_PLAYER_COL_USERNAME " = ?";
|
||||
*/
|
||||
prepareNick
|
||||
<< "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 " = ?";
|
||||
/*
|
||||
mysqlpp::Query prepareAvatarBlacklist = m_connData->conn.query();
|
||||
prepareAvatarBlacklist
|
||||
<< "PREPARE " QUERY_AVATAR_BLACKLIST_PREPARE " FROM " << mysqlpp::quote
|
||||
<< "SELECT " DB_TABLE_AVATAR_BLACKLIST_COL_ID " FROM " DB_TABLE_AVATAR_BLACKLIST " WHERE BINARY " DB_TABLE_AVATAR_BLACKLIST_COL_AVATAR_HASH " = ?";
|
||||
*/
|
||||
mysqlpp::Query prepareLogin = m_connData->conn.query();
|
||||
prepareLogin
|
||||
<< "PREPARE " QUERY_LOGIN_PREPARE " FROM " << mysqlpp::quote
|
||||
@@ -452,10 +459,12 @@ ServerDBThread::EstablishDBConnection()
|
||||
prepareScore
|
||||
<< "PREPARE " QUERY_UPDATE_SCORE_PREPARE " FROM " << mysqlpp::quote
|
||||
<< "CALL updatePointsForGame(?)";
|
||||
/*
|
||||
mysqlpp::Query prepareReportAvatar = m_connData->conn.query();
|
||||
prepareReportAvatar
|
||||
<< "PREPARE " QUERY_REPORT_AVATAR_PREPARE " FROM " << mysqlpp::quote
|
||||
<< "INSERT INTO " DB_TABLE_REP_AVATAR " (" DB_TABLE_REP_AVATAR_COL_PLAYERID ", " DB_TABLE_REP_AVATAR_COL_AVATARHASH ", " DB_TABLE_REP_AVATAR_COL_AVATARTYPE ", " DB_TABLE_REP_AVATAR_COL_BY_PLAYERID ", " DB_TABLE_REP_AVATAR_COL_TIMESTAMP ") VALUES (?, ?, ?, ?, ?)";
|
||||
*/
|
||||
mysqlpp::Query prepareReportGame = m_connData->conn.query();
|
||||
prepareReportGame
|
||||
<< "PREPARE " QUERY_REPORT_GAME_PREPARE " FROM " << mysqlpp::quote
|
||||
@@ -468,15 +477,25 @@ ServerDBThread::EstablishDBConnection()
|
||||
prepareBlockPlayer
|
||||
<< "PREPARE " QUERY_BLOCK_PLAYER_PREPARE " FROM " << mysqlpp::quote
|
||||
<< "UPDATE " DB_TABLE_PLAYER " SET " DB_TABLE_PLAYER_COL_VALID " = ?, " DB_TABLE_PLAYER_COL_ACTIVE " = ? WHERE " DB_TABLE_PLAYER_COL_ID " = ?";
|
||||
|
||||
/*
|
||||
if (!prepareNick.exec() || !prepareAvatarBlacklist.exec() || !prepareLogin.exec() || !prepareCreateGame.exec()
|
||||
|| !prepareEndGame.exec() || !prepareRelation.exec() || !prepareScore.exec() || !prepareReportAvatar.exec()
|
||||
|| !prepareReportGame.exec() || !prepareAdminPlayer.exec() || !prepareBlockPlayer.exec()) {
|
||||
*/
|
||||
if (!prepareNick.exec() || !prepareLogin.exec() || !prepareCreateGame.exec()
|
||||
|| !prepareEndGame.exec() || !prepareRelation.exec() || !prepareScore.exec()
|
||||
|| !prepareReportGame.exec() || !prepareAdminPlayer.exec() || !prepareBlockPlayer.exec()) {
|
||||
m_connData->conn.disconnect();
|
||||
/*
|
||||
m_ioService->post(boost::bind(&ServerDBCallback::ConnectFailed, &m_callback,
|
||||
string(prepareNick.error()) + prepareAvatarBlacklist.error() + prepareLogin.error() + prepareCreateGame.error()
|
||||
+ prepareEndGame.error() + prepareRelation.error() + prepareScore.error() + prepareReportAvatar.error()
|
||||
+ prepareReportGame.error() + prepareAdminPlayer.error() + prepareBlockPlayer.error()));
|
||||
*/
|
||||
m_ioService->post(boost::bind(&ServerDBCallback::ConnectFailed, &m_callback,
|
||||
string(prepareNick.error()) prepareLogin.error() + prepareCreateGame.error()
|
||||
+ prepareEndGame.error() + prepareRelation.error() + prepareScore.error()
|
||||
+ prepareReportGame.error() + prepareAdminPlayer.error() + prepareBlockPlayer.error()));
|
||||
m_permanentError = true;
|
||||
} else {
|
||||
m_ioService->post(boost::bind(&ServerDBCallback::ConnectSuccess, &m_callback));
|
||||
|
||||
Reference in New Issue
Block a user