2010-10-07 15:54:07 +02:00
|
|
|
/*
|
2014-01-01 00:07:53 +01:00
|
|
|
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
|
2010-10-07 15:54:07 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
|
* option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-09-02 17:56:49 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _LOGINDATABASE_H
|
|
|
|
|
#define _LOGINDATABASE_H
|
|
|
|
|
|
|
|
|
|
#include "DatabaseWorkerPool.h"
|
|
|
|
|
#include "MySQLConnection.h"
|
|
|
|
|
|
|
|
|
|
class LoginDatabaseConnection : public MySQLConnection
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
//- Constructors for sync and async connections
|
2013-10-27 22:27:46 +01:00
|
|
|
LoginDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) { }
|
|
|
|
|
LoginDatabaseConnection(ACE_Activation_Queue* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) { }
|
2010-09-02 17:56:49 +02:00
|
|
|
|
2011-01-26 00:41:55 +01:00
|
|
|
//- Loads database type specific prepared statements
|
2011-04-07 15:30:38 +06:00
|
|
|
void DoPrepareStatements();
|
2010-09-02 17:56:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef DatabaseWorkerPool<LoginDatabaseConnection> LoginDatabaseWorkerPool;
|
|
|
|
|
|
|
|
|
|
enum LoginDatabaseStatements
|
|
|
|
|
{
|
2010-09-03 09:21:28 +02:00
|
|
|
/* Naming standard for defines:
|
2011-12-31 20:14:38 +01:00
|
|
|
{DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
|
2010-09-03 09:21:28 +02:00
|
|
|
When updating more than one field, consider looking at the calling function
|
|
|
|
|
name for a suiting suffix.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_SEL_REALMLIST,
|
|
|
|
|
LOGIN_DEL_EXPIRED_IP_BANS,
|
|
|
|
|
LOGIN_UPD_EXPIRED_ACCOUNT_BANS,
|
|
|
|
|
LOGIN_SEL_IP_BANNED,
|
|
|
|
|
LOGIN_INS_IP_AUTO_BANNED,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_BANNED,
|
2012-03-24 01:25:08 +01:00
|
|
|
LOGIN_SEL_ACCOUNT_BANNED_ALL,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_INS_ACCOUNT_AUTO_BANNED,
|
2012-05-06 02:37:31 +02:00
|
|
|
LOGIN_DEL_ACCOUNT_BANNED,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_SEL_SESSIONKEY,
|
|
|
|
|
LOGIN_UPD_VS,
|
|
|
|
|
LOGIN_UPD_LOGONPROOF,
|
|
|
|
|
LOGIN_SEL_LOGONCHALLENGE,
|
2013-04-15 14:56:00 +03:00
|
|
|
LOGIN_SEL_LOGON_COUNTRY,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_UPD_FAILEDLOGINS,
|
|
|
|
|
LOGIN_SEL_FAILEDLOGINS,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_ID_BY_NAME,
|
2012-03-24 01:25:08 +01:00
|
|
|
LOGIN_SEL_ACCOUNT_LIST_BY_NAME,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_INFO_BY_NAME,
|
2014-05-12 17:57:35 +02:00
|
|
|
LOGIN_SEL_ACCOUNT_INFO_BY_BNET,
|
2012-03-24 01:25:08 +01:00
|
|
|
LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_SEL_NUM_CHARS_ON_REALM,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_BY_IP,
|
|
|
|
|
LOGIN_INS_IP_BANNED,
|
|
|
|
|
LOGIN_DEL_IP_NOT_BANNED,
|
2012-03-24 01:25:08 +01:00
|
|
|
LOGIN_SEL_IP_BANNED_ALL,
|
|
|
|
|
LOGIN_SEL_IP_BANNED_BY_IP,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_BY_ID,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_INS_ACCOUNT_BANNED,
|
|
|
|
|
LOGIN_UPD_ACCOUNT_NOT_BANNED,
|
2012-03-25 16:22:24 +02:00
|
|
|
LOGIN_DEL_REALM_CHARACTERS_BY_REALM,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_DEL_REALM_CHARACTERS,
|
|
|
|
|
LOGIN_INS_REALM_CHARACTERS,
|
|
|
|
|
LOGIN_SEL_SUM_REALM_CHARACTERS,
|
|
|
|
|
LOGIN_INS_ACCOUNT,
|
|
|
|
|
LOGIN_INS_REALM_CHARACTERS_INIT,
|
|
|
|
|
LOGIN_UPD_EXPANSION,
|
|
|
|
|
LOGIN_UPD_ACCOUNT_LOCK,
|
2013-04-15 14:56:00 +03:00
|
|
|
LOGIN_UPD_ACCOUNT_LOCK_CONTRY,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_INS_LOG,
|
|
|
|
|
LOGIN_UPD_USERNAME,
|
|
|
|
|
LOGIN_UPD_PASSWORD,
|
2013-07-25 01:49:04 +02:00
|
|
|
LOGIN_UPD_EMAIL,
|
|
|
|
|
LOGIN_UPD_REG_EMAIL,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_UPD_MUTE_TIME,
|
2013-01-30 13:09:41 +02:00
|
|
|
LOGIN_UPD_MUTE_TIME_LOGIN,
|
2011-12-31 20:14:38 +01:00
|
|
|
LOGIN_UPD_LAST_IP,
|
|
|
|
|
LOGIN_UPD_ACCOUNT_ONLINE,
|
|
|
|
|
LOGIN_UPD_UPTIME_PLAYERS,
|
2011-12-31 00:32:05 +01:00
|
|
|
LOGIN_DEL_OLD_LOGS,
|
|
|
|
|
LOGIN_DEL_ACCOUNT_ACCESS,
|
|
|
|
|
LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM,
|
|
|
|
|
LOGIN_INS_ACCOUNT_ACCESS,
|
2012-03-24 01:25:08 +01:00
|
|
|
LOGIN_GET_ACCOUNT_ID_BY_USERNAME,
|
|
|
|
|
LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL,
|
|
|
|
|
LOGIN_GET_GMLEVEL_BY_REALMID,
|
|
|
|
|
LOGIN_GET_USERNAME_BY_ID,
|
|
|
|
|
LOGIN_SEL_CHECK_PASSWORD,
|
|
|
|
|
LOGIN_SEL_CHECK_PASSWORD_BY_NAME,
|
|
|
|
|
LOGIN_SEL_PINFO,
|
|
|
|
|
LOGIN_SEL_PINFO_BANS,
|
|
|
|
|
LOGIN_SEL_GM_ACCOUNTS,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_INFO,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_ACCESS,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_RECRUITER,
|
|
|
|
|
LOGIN_SEL_BANS,
|
|
|
|
|
LOGIN_SEL_ACCOUNT_WHOIS,
|
|
|
|
|
LOGIN_SEL_REALMLIST_SECURITY_LEVEL,
|
2012-03-25 16:22:24 +02:00
|
|
|
LOGIN_DEL_ACCOUNT,
|
2013-04-15 14:56:00 +03:00
|
|
|
LOGIN_SEL_IP2NATION_COUNTRY,
|
2013-04-25 19:10:10 +02:00
|
|
|
LOGIN_SEL_AUTOBROADCAST,
|
2013-07-25 01:49:04 +02:00
|
|
|
LOGIN_GET_EMAIL_BY_ID,
|
2010-09-12 11:06:26 +02:00
|
|
|
|
2013-02-04 08:21:25 +01:00
|
|
|
LOGIN_SEL_ACCOUNT_ACCESS_BY_ID,
|
|
|
|
|
LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS,
|
|
|
|
|
LOGIN_INS_RBAC_ACCOUNT_PERMISSION,
|
|
|
|
|
LOGIN_DEL_RBAC_ACCOUNT_PERMISSION,
|
2014-05-13 22:02:51 +02:00
|
|
|
|
|
|
|
|
LOGIN_SEL_BNET_ACCOUNT_INFO,
|
|
|
|
|
LOGIN_DEL_BNET_EXPIRED_BANS,
|
|
|
|
|
LOGIN_SEL_BNET_ACTIVE_ACCOUNT_BAN,
|
2014-06-01 13:03:30 +02:00
|
|
|
LOGIN_UPD_BNET_VS_FIELDS,
|
2014-06-01 13:56:36 +02:00
|
|
|
LOGIN_UPD_BNET_SESSION_KEY,
|
|
|
|
|
LOGIN_SEL_BNET_RECONNECT_INFO,
|
2014-05-13 22:02:51 +02:00
|
|
|
LOGIN_SEL_BNET_GAME_ACCOUNTS,
|
|
|
|
|
LOGIN_SEL_BNET_GAME_ACCOUNT,
|
|
|
|
|
LOGIN_UPD_BNET_LAST_LOGIN_INFO,
|
|
|
|
|
LOGIN_SEL_BNET_CHARACTER_COUNTS,
|
2014-05-13 23:33:02 +02:00
|
|
|
LOGIN_INS_BNET_ACCOUNT,
|
|
|
|
|
LOGIN_SEL_BNET_ACCOUNT_EMAIL_BY_ID,
|
|
|
|
|
LOGIN_SEL_BNET_ACCOUNT_ID_BY_EMAIL,
|
|
|
|
|
LOGIN_UPD_BNET_PASSWORD,
|
|
|
|
|
LOGIN_SEL_BNET_CHECK_PASSWORD,
|
2014-06-08 17:58:28 +02:00
|
|
|
LOGIN_UPD_BNET_ACCOUNT_LOCK,
|
|
|
|
|
LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY,
|
2014-05-13 22:02:51 +02:00
|
|
|
|
2012-09-10 13:03:38 +02:00
|
|
|
MAX_LOGINDATABASE_STATEMENTS
|
2010-09-02 17:56:49 +02:00
|
|
|
};
|
|
|
|
|
|
2010-09-02 20:22:19 +02:00
|
|
|
#endif
|