aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared')
-rw-r--r--src/server/shared/DataStores/DB2StorageLoader.cpp (renamed from src/server/shared/DataStores/DB2FileLoader.cpp)220
-rw-r--r--src/server/shared/DataStores/DB2StorageLoader.h (renamed from src/server/shared/DataStores/DB2FileLoader.h)12
-rw-r--r--src/server/shared/DataStores/DB2Store.h70
-rw-r--r--src/server/shared/Database/Implementation/HotfixDatabase.cpp3
-rw-r--r--src/server/shared/Database/Implementation/HotfixDatabase.h2
-rw-r--r--src/server/shared/Database/Implementation/LoginDatabase.cpp8
-rw-r--r--src/server/shared/Database/Implementation/LoginDatabase.h8
7 files changed, 225 insertions, 98 deletions
diff --git a/src/server/shared/DataStores/DB2FileLoader.cpp b/src/server/shared/DataStores/DB2StorageLoader.cpp
index 7a27072dd20..f716b9e805e 100644
--- a/src/server/shared/DataStores/DB2FileLoader.cpp
+++ b/src/server/shared/DataStores/DB2StorageLoader.cpp
@@ -16,11 +16,12 @@
*/
#include "Common.h"
+#include "DB2StorageLoader.h"
+#include "Database/DatabaseEnv.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "DB2FileLoader.h"
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
DB2FileLoader::DB2FileLoader()
{
@@ -221,10 +222,10 @@ uint32 DB2FileLoader::GetFormatRecordSize(const char * format, int32* index_pos)
return recordsize;
}
-uint32 DB2FileLoader::GetFormatStringsFields(const char * format)
+uint32 DB2FileLoader::GetFormatStringFieldCount(char const* format)
{
uint32 stringfields = 0;
- for (uint32 x=0; format[x]; ++x)
+ for (uint32 x = 0; format[x]; ++x)
if (format[x] == FT_STRING)
++stringfields;
@@ -233,23 +234,22 @@ uint32 DB2FileLoader::GetFormatStringsFields(const char * format)
char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable)
{
-
typedef char * ptr;
if (strlen(format) != fieldCount)
return NULL;
//get struct size and index pos
- int32 i;
- uint32 recordsize=GetFormatRecordSize(format, &i);
+ int32 indexField;
+ uint32 recordsize = GetFormatRecordSize(format, &indexField);
- if (i >= 0)
+ if (indexField >= 0)
{
uint32 maxi = 0;
//find max index
for (uint32 y = 0; y < recordCount; y++)
{
- uint32 ind=getRecord(y).getUInt(i);
- if (ind>maxi)
+ uint32 ind = getRecord(y).getUInt(indexField);
+ if (ind > maxi)
maxi = ind;
}
@@ -266,14 +266,12 @@ char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**
char* dataTable = new char[recordCount * recordsize];
- uint32 offset=0;
+ uint32 offset = 0;
- for (uint32 y =0; y < recordCount; y++)
+ for (uint32 y = 0; y < recordCount; y++)
{
- if (i>=0)
- {
- indexTable[getRecord(y).getUInt(i)] = &dataTable[offset];
- }
+ if (indexField >= 0)
+ indexTable[getRecord(y).getUInt(indexField)] = &dataTable[offset];
else
indexTable[y] = &dataTable[offset];
@@ -310,10 +308,13 @@ static char const* const nullStr = "";
char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* dataTable)
{
if (strlen(format) != fieldCount)
- return NULL;
+ return nullptr;
// we store flat holders pool as single memory block
- size_t stringFields = GetFormatStringsFields(format);
+ size_t stringFields = GetFormatStringFieldCount(format);
+ if (!stringFields)
+ return nullptr;
+
// each string field at load have array of string for each locale
size_t stringHolderSize = sizeof(char*) * TOTAL_LOCALES;
size_t stringHoldersRecordPoolSize = stringFields * stringHolderSize;
@@ -325,7 +326,7 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
for (size_t i = 0; i < stringHoldersPoolSize / sizeof(char*); ++i)
((char const**)stringHoldersPool)[i] = nullStr;
- uint32 offset=0;
+ uint32 offset = 0;
// assign string holders to string field slots
for (uint32 y = 0; y < recordCount; y++)
@@ -333,6 +334,7 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
uint32 stringFieldNum = 0;
for (uint32 x = 0; x < fieldCount; x++)
+ {
switch (format[x])
{
case FT_FLOAT:
@@ -357,7 +359,8 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
case FT_SORT:
break;
default:
- assert(false && "unknown format character");
+ ASSERT(false, "unknown format character %c", format[x]);
+ }
}
}
@@ -370,39 +373,172 @@ char* DB2FileLoader::AutoProduceStrings(const char* format, char* dataTable, uin
if (strlen(format) != fieldCount)
return NULL;
- char* stringPool= new char[stringSize];
+ char* stringPool = new char[stringSize];
memcpy(stringPool, stringTable, stringSize);
uint32 offset = 0;
- for (uint32 y =0; y < recordCount; y++)
+ for (uint32 y = 0; y < recordCount; y++)
{
for (uint32 x = 0; x < fieldCount; x++)
- switch (format[x])
{
- case FT_FLOAT:
- case FT_IND:
- case FT_INT:
- offset += 4;
- break;
- case FT_BYTE:
- offset += 1;
- break;
- case FT_STRING:
+ switch (format[x])
{
- // fill only not filled entries
- LocalizedString* db2str = *(LocalizedString**)(&dataTable[offset]);
- if (db2str->Str[locale] == nullStr)
+ case FT_FLOAT:
+ case FT_IND:
+ case FT_INT:
+ offset += 4;
+ break;
+ case FT_BYTE:
+ offset += 1;
+ break;
+ case FT_STRING:
{
- const char * st = getRecord(y).getString(x);
- db2str->Str[locale] = stringPool + (st - (const char*)stringTable);
- }
+ // fill only not filled entries
+ LocalizedString* db2str = *(LocalizedString**)(&dataTable[offset]);
+ if (db2str->Str[locale] == nullStr)
+ {
+ const char * st = getRecord(y).getString(x);
+ db2str->Str[locale] = stringPool + (st - (const char*)stringTable);
+ }
- offset += sizeof(char*);
- break;
+ offset += sizeof(char*);
+ break;
+ }
}
}
}
return stringPool;
}
+
+char* DB2DatabaseLoader::Load(const char* format, int32 preparedStatement, uint32& records, char**& indexTable, char*& stringHolders, std::list<char*>& stringPool)
+{
+ // Even though this query is executed only once, prepared statement is used to send data from mysql server in binary format
+ PreparedQueryResult result = HotfixDatabase.Query(HotfixDatabase.GetPreparedStatement(preparedStatement));
+ if (!result)
+ return nullptr;
+
+ // we store flat holders pool as single memory block
+ size_t stringFields = DB2FileLoader::GetFormatStringFieldCount(format);
+
+ size_t expectedFields = strlen(format) + 1 /*VerifiedBuild*/;
+ if (stringFields)
+ expectedFields += 1 /*ID*/ + stringFields * (TOTAL_LOCALES - 1) + 1 /*VerifiedBuild in locale table*/;
+
+ if (expectedFields != result->GetFieldCount())
+ return nullptr;
+
+ //get struct size and index pos
+ int32 indexField;
+ uint32 recordSize = DB2FileLoader::GetFormatRecordSize(format, &indexField);
+
+ // each string field at load have array of string for each locale
+ size_t stringHolderSize = sizeof(char*) * TOTAL_LOCALES;
+ size_t stringHoldersRecordPoolSize = stringFields * stringHolderSize;
+
+ if (stringFields)
+ {
+ size_t stringHoldersPoolSize = stringHoldersRecordPoolSize * result->GetRowCount();
+ stringHolders = new char[stringHoldersPoolSize];
+
+ // DB2 strings expected to have at least empty string
+ for (size_t i = 0; i < stringHoldersPoolSize / sizeof(char*); ++i)
+ ((char const**)stringHolders)[i] = nullStr;
+
+ }
+ else
+ stringHolders = nullptr;
+
+ std::unordered_map<uint32, char*> tempIndexTable;
+ tempIndexTable.reserve(result->GetRowCount());
+ char* dataTable = new char[result->GetRowCount() * recordSize];
+ uint32 offset = 0;
+
+ uint32 const fieldCount = strlen(format);
+ uint32 const localeFieldsOffset = fieldCount + 2 /*VerifiedBuild in main table, ID in locale table*/;
+ uint32 oldIndexSize = records;
+ uint32 rec = 0;
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 stringFieldNumInRecord = 0;
+
+ if (indexField >= 0)
+ {
+ uint32 indexValue = fields[indexField].GetUInt32();
+ tempIndexTable[indexValue] = &dataTable[offset];
+ if (records <= indexValue)
+ records = indexValue + 1;
+ }
+ else
+ tempIndexTable[records++] = &dataTable[offset];
+
+ for (uint32 f = 0; f < fieldCount; f++)
+ {
+ switch (format[f])
+ {
+ case FT_FLOAT:
+ *((float*)(&dataTable[offset])) = fields[f].GetFloat();
+ offset += 4;
+ break;
+ case FT_IND:
+ case FT_INT:
+ *((int32*)(&dataTable[offset])) = fields[f].GetInt32();
+ offset += 4;
+ break;
+ case FT_BYTE:
+ *((int8*)(&dataTable[offset])) = fields[f].GetInt8();
+ offset += 1;
+ break;
+ case FT_STRING:
+ {
+ LocalizedString** slot = (LocalizedString**)(&dataTable[offset]);
+ *slot = (LocalizedString*)(&stringHolders[stringHoldersRecordPoolSize * rec++ + stringHolderSize * stringFieldNumInRecord]);
+
+ // Value in database in main table field must be for enUS locale
+ if (char* str = AddLocaleString(*slot, LOCALE_enUS, fields[f].GetString()))
+ stringPool.push_back(str);
+
+ for (uint32 locale = LOCALE_koKR; locale < TOTAL_LOCALES; ++locale)
+ if (char* str = AddLocaleString(*slot, locale, fields[localeFieldsOffset + (locale - 1) + stringFields * stringFieldNumInRecord].GetString()))
+ stringPool.push_back(str);
+
+ ++stringFieldNumInRecord;
+ offset += sizeof(char*);
+ break;
+ }
+ }
+ }
+ } while (result->NextRow());
+
+ // Reallocate index if needed
+ if (records > oldIndexSize)
+ {
+ char** tmpIdxTable = new char*[records];
+ memset(tmpIdxTable, 0, records * sizeof(char*));
+ memcpy(tmpIdxTable, indexTable, oldIndexSize * sizeof(char*));
+ delete[] indexTable;
+ indexTable = tmpIdxTable;
+ }
+
+ // Merge new data into index
+ for (auto itr = tempIndexTable.begin(); itr != tempIndexTable.end(); ++itr)
+ indexTable[itr->first] = itr->second;
+
+ return dataTable;
+}
+
+char* DB2DatabaseLoader::AddLocaleString(LocalizedString* holder, uint32 locale, std::string const& value)
+{
+ if (!value.empty())
+ {
+ char* str = new char[value.length() + 1];
+ memcpy(str, value.c_str(), value.length());
+ str[value.length()] = '\0';
+ holder->Str[locale] = str;
+ return str;
+ }
+
+ return nullptr;
+}
diff --git a/src/server/shared/DataStores/DB2FileLoader.h b/src/server/shared/DataStores/DB2StorageLoader.h
index 86350ebf1d6..4254fcc1121 100644
--- a/src/server/shared/DataStores/DB2FileLoader.h
+++ b/src/server/shared/DataStores/DB2StorageLoader.h
@@ -82,7 +82,7 @@ class DB2FileLoader
char* AutoProduceStringsArrayHolders(const char* fmt, char* dataTable);
char* AutoProduceStrings(const char* fmt, char* dataTable, uint32 locale);
static uint32 GetFormatRecordSize(const char * format, int32 * index_pos = NULL);
- static uint32 GetFormatStringsFields(const char * format);
+ static uint32 GetFormatStringFieldCount(const char * format);
private:
uint32 recordSize;
@@ -104,4 +104,12 @@ private:
int unk5; // WDB2
};
-#endif \ No newline at end of file
+class DB2DatabaseLoader
+{
+public:
+
+ char* Load(const char* format, int32 preparedStatement, uint32& records, char**& indexTable, char*& stringHolders, std::list<char*>& stringPool);
+ static char* AddLocaleString(LocalizedString* holder, uint32 locale, std::string const& value);
+};
+
+#endif
diff --git a/src/server/shared/DataStores/DB2Store.h b/src/server/shared/DataStores/DB2Store.h
index 77d6c4144e5..c8f42d6d4e7 100644
--- a/src/server/shared/DataStores/DB2Store.h
+++ b/src/server/shared/DataStores/DB2Store.h
@@ -18,7 +18,7 @@
#ifndef DB2STORE_H
#define DB2STORE_H
-#include "DB2FileLoader.h"
+#include "DB2StorageLoader.h"
#include "Common.h"
#include "ByteBuffer.h"
#include <vector>
@@ -101,12 +101,11 @@ template<class T>
class DB2Storage : public DB2StorageBase
{
typedef std::list<char*> StringPoolList;
- typedef std::vector<T*> DataTableEx;
typedef bool(*EntryChecker)(DB2Storage<T> const&, uint32);
typedef void(*PacketWriter)(DB2Storage<T> const&, uint32, uint32, ByteBuffer&);
public:
- DB2Storage(char const* f, EntryChecker checkEntry = NULL, PacketWriter writePacket = NULL) :
- nCount(0), fieldCount(0), fmt(f), m_dataTable(NULL)
+ DB2Storage(char const* f, int32 preparedStmtIndex = -1, EntryChecker checkEntry = nullptr, PacketWriter writePacket = nullptr)
+ : nCount(0), fieldCount(0), fmt(f), m_dataTable(nullptr), m_dataTableEx(nullptr), _hotfixStatement(preparedStmtIndex)
{
indexTable.asT = NULL;
CheckEntry = checkEntry ? checkEntry : (EntryChecker)&DB2StorageHasEntry<T>;
@@ -125,30 +124,6 @@ public:
WritePacket(*this, id, locale, buffer);
}
- T* CreateEntry(uint32 id, bool evenIfExists = false)
- {
- if (evenIfExists && LookupEntry(id))
- return NULL;
-
- if (id >= nCount)
- {
- // reallocate index table
- char** tmpIdxTable = new char*[id + 1];
- memset(tmpIdxTable, 0, (id + 1) * sizeof(char*));
- memcpy(tmpIdxTable, indexTable.asChar, nCount * sizeof(char*));
- delete[] reinterpret_cast<char*>(indexTable.asT);
- nCount = id + 1;
- indexTable.asChar = tmpIdxTable;
- }
-
- T* entryDst = new T;
- m_dataTableEx.push_back(entryDst);
- indexTable.asT[id] = entryDst;
- return entryDst;
- }
-
- void EraseEntry(uint32 id) { indexTable.asT[id] = NULL; }
-
bool Load(char const* fn, uint32 locale)
{
DB2FileLoader db2;
@@ -163,10 +138,13 @@ public:
m_dataTable = reinterpret_cast<T*>(db2.AutoProduceData(fmt, nCount, indexTable.asChar));
// create string holders for loaded string fields
- m_stringPoolList.push_back(db2.AutoProduceStringsArrayHolders(fmt, (char*)m_dataTable));
+ if (char* stringHolders = db2.AutoProduceStringsArrayHolders(fmt, (char*)m_dataTable))
+ {
+ m_stringPoolList.push_back(stringHolders);
- // load strings from dbc data
- m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable, locale));
+ // load strings from dbc data
+ m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable, locale));
+ }
// error in dbc file at loading if NULL
return indexTable.asT != NULL;
@@ -184,25 +162,40 @@ public:
return false;
// load strings from another locale dbc data
- m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable, locale));
+ if (DB2FileLoader::GetFormatStringFieldCount(fmt))
+ m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable, locale));
return true;
}
+ void LoadSQLData()
+ {
+ if (_hotfixStatement == -1)
+ return;
+
+ DB2DatabaseLoader db2;
+ char* extraStringHolders = nullptr;
+ if (char* dataTable = db2.Load(fmt, _hotfixStatement, nCount, indexTable.asChar, extraStringHolders, m_stringPoolList))
+ {
+ m_dataTableEx = reinterpret_cast<T*>(dataTable);
+ if (extraStringHolders)
+ m_stringPoolList.push_back(extraStringHolders);
+ }
+ }
+
void Clear()
{
if (!indexTable.asT)
return;
delete[] reinterpret_cast<char*>(indexTable.asT);
- indexTable.asT = NULL;
+ indexTable.asT = nullptr;
delete[] reinterpret_cast<char*>(m_dataTable);
- m_dataTable = NULL;
+ m_dataTable = nullptr;
- for (typename DataTableEx::iterator itr = m_dataTableEx.begin(); itr != m_dataTableEx.end(); ++itr)
- delete *itr;
- m_dataTableEx.clear();
+ delete[] reinterpret_cast<char*>(m_dataTableEx);
+ m_dataTableEx = nullptr;
while (!m_stringPoolList.empty())
{
@@ -226,8 +219,9 @@ private:
char** asChar;
} indexTable;
T* m_dataTable;
- DataTableEx m_dataTableEx;
+ T* m_dataTableEx;
StringPoolList m_stringPoolList;
+ int32 _hotfixStatement;
};
#endif
diff --git a/src/server/shared/Database/Implementation/HotfixDatabase.cpp b/src/server/shared/Database/Implementation/HotfixDatabase.cpp
index f60287ef1a7..aa35580676e 100644
--- a/src/server/shared/Database/Implementation/HotfixDatabase.cpp
+++ b/src/server/shared/Database/Implementation/HotfixDatabase.cpp
@@ -21,4 +21,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
{
if (!m_reconnecting)
m_stmts.resize(MAX_HOTFIXDATABASE_STATEMENTS);
+
+ PrepareStatement(HOTFIX_SEL_BROADCAST_TEXT, "SELECT * FROM broadcast_text b LEFT JOIN locales_broadcast_text lb ON b.ID = lb.ID", CONNECTION_SYNCH);
+ PrepareStatement(HOTFIX_SEL_TAXI_PATH_NODE, "SELECT * FROM taxi_path_node", CONNECTION_SYNCH);
}
diff --git a/src/server/shared/Database/Implementation/HotfixDatabase.h b/src/server/shared/Database/Implementation/HotfixDatabase.h
index 13c3af6714e..56ab6b8c48a 100644
--- a/src/server/shared/Database/Implementation/HotfixDatabase.h
+++ b/src/server/shared/Database/Implementation/HotfixDatabase.h
@@ -42,6 +42,8 @@ enum HotfixDatabaseStatements
name for a suiting suffix.
*/
+ HOTFIX_SEL_BROADCAST_TEXT,
+ HOTFIX_SEL_TAXI_PATH_NODE,
MAX_HOTFIXDATABASE_STATEMENTS
};
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp
index 4d0d4df2003..d509939b2b5 100644
--- a/src/server/shared/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp
@@ -29,24 +29,16 @@ void LoginDatabaseConnection::DoPrepareStatements()
PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban')", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban', 1)", CONNECTION_ASYNC);
PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_CONTINUED_SESSION, "SELECT username, sessionkey FROM account WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.lock_country, a.last_ip, aa.gmlevel, a.v, a.s, a.token_key, a.battlenet_account FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_LOGON_COUNTRY, "SELECT country FROM ip2nation WHERE ip < ? ORDER BY ip DESC LIMIT 0,1", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC);
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h
index 3667b65e885..7da24b57781 100644
--- a/src/server/shared/Database/Implementation/LoginDatabase.h
+++ b/src/server/shared/Database/Implementation/LoginDatabase.h
@@ -47,24 +47,16 @@ enum LoginDatabaseStatements
LOGIN_UPD_EXPIRED_ACCOUNT_BANS,
LOGIN_SEL_IP_BANNED,
LOGIN_INS_IP_AUTO_BANNED,
- LOGIN_SEL_ACCOUNT_BANNED,
LOGIN_SEL_ACCOUNT_BANNED_ALL,
LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME,
- LOGIN_INS_ACCOUNT_AUTO_BANNED,
LOGIN_DEL_ACCOUNT_BANNED,
- LOGIN_SEL_SESSIONKEY,
LOGIN_SEL_ACCOUNT_INFO_CONTINUED_SESSION,
LOGIN_UPD_VS,
- LOGIN_UPD_LOGONPROOF,
- LOGIN_SEL_LOGONCHALLENGE,
LOGIN_SEL_LOGON_COUNTRY,
- LOGIN_UPD_FAILEDLOGINS,
- LOGIN_SEL_FAILEDLOGINS,
LOGIN_SEL_ACCOUNT_ID_BY_NAME,
LOGIN_SEL_ACCOUNT_LIST_BY_NAME,
LOGIN_SEL_ACCOUNT_INFO_BY_NAME,
LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL,
- LOGIN_SEL_NUM_CHARS_ON_REALM,
LOGIN_SEL_ACCOUNT_BY_IP,
LOGIN_INS_IP_BANNED,
LOGIN_DEL_IP_NOT_BANNED,