Core/DBLayer: Prevent using prepared statements on wrong database
This commit is contained in:
@@ -255,7 +255,7 @@ int32 LoginRESTService::HandleGetGameAccounts(std::shared_ptr<AsyncRequest> requ
|
||||
return 401;
|
||||
|
||||
request->SetCallback(Trinity::make_unique<QueryCallback>(LoginDatabase.AsyncQuery([&] {
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST);
|
||||
stmt->setString(0, request->GetClient()->userid);
|
||||
return stmt;
|
||||
}())
|
||||
@@ -341,7 +341,7 @@ int32 LoginRESTService::HandlePostLogin(std::shared_ptr<AsyncRequest> request)
|
||||
Utf8ToUpperOnlyLatin(login);
|
||||
Utf8ToUpperOnlyLatin(password);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_AUTHENTICATION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_AUTHENTICATION);
|
||||
stmt->setString(0, login);
|
||||
|
||||
std::string sentPasswordHash = CalculateShaPassHash(login, password);
|
||||
@@ -369,7 +369,7 @@ int32 LoginRESTService::HandlePostLogin(std::shared_ptr<AsyncRequest> request)
|
||||
loginTicket = "TC-" + ByteArrayToHexStr(ticket.AsByteArray(20).get(), 20);
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_AUTHENTICATION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_AUTHENTICATION);
|
||||
stmt->setString(0, loginTicket);
|
||||
stmt->setUInt32(1, time(nullptr) + _loginTicketDuration);
|
||||
stmt->setUInt32(2, accountId);
|
||||
@@ -393,7 +393,7 @@ int32 LoginRESTService::HandlePostLogin(std::shared_ptr<AsyncRequest> request)
|
||||
if (maxWrongPassword)
|
||||
{
|
||||
SQLTransaction trans = LoginDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_FAILED_LOGINS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_FAILED_LOGINS);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -446,7 +446,7 @@ int32 LoginRESTService::HandlePostRefreshLoginTicket(std::shared_ptr<AsyncReques
|
||||
return 401;
|
||||
|
||||
request->SetCallback(Trinity::make_unique<QueryCallback>(LoginDatabase.AsyncQuery([&] {
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_EXISTING_AUTHENTICATION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_EXISTING_AUTHENTICATION);
|
||||
stmt->setString(0, request->GetClient()->userid);
|
||||
return stmt;
|
||||
}())
|
||||
@@ -461,7 +461,7 @@ int32 LoginRESTService::HandlePostRefreshLoginTicket(std::shared_ptr<AsyncReques
|
||||
{
|
||||
loginRefreshResult.set_login_ticket_expiry(now + _loginTicketDuration);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_EXISTING_AUTHENTICATION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_EXISTING_AUTHENTICATION);
|
||||
stmt->setUInt32(0, uint32(now + _loginTicketDuration));
|
||||
stmt->setString(1, request->GetClient()->userid);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
@@ -91,7 +91,7 @@ void Battlenet::Session::Start()
|
||||
// Verify that this IP is not in the ip_banned table
|
||||
LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO);
|
||||
stmt->setString(0, ip_address);
|
||||
|
||||
_queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&Battlenet::Session::CheckIpCallback, this, std::placeholders::_1)));
|
||||
@@ -253,7 +253,7 @@ uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredential
|
||||
if (webCredentials.empty())
|
||||
return ERROR_DENIED;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_INFO);
|
||||
stmt->setString(0, webCredentials);
|
||||
|
||||
std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> asyncContinuation = std::move(continuation);
|
||||
@@ -276,7 +276,7 @@ uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredential
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID);
|
||||
stmt->setUInt32(0, accountInfo->Id);
|
||||
callback.SetNextQuery(LoginDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -293,7 +293,7 @@ uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredential
|
||||
} while (characterCountsResult->NextRow());
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_LAST_PLAYER_CHARACTERS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_LAST_PLAYER_CHARACTERS);
|
||||
stmt->setUInt32(0, accountInfo->Id);
|
||||
callback.SetNextQuery(LoginDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -536,7 +536,7 @@ uint32 Battlenet::Session::GetRealmListTicket(std::unordered_map<std::string, Va
|
||||
if (!clientInfoOk)
|
||||
return ERROR_WOW_SERVICES_DENIED_REALM_LIST_TICKET;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_LAST_LOGIN_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_LAST_LOGIN_INFO);
|
||||
stmt->setString(0, GetRemoteIpAddress().to_string());
|
||||
stmt->setUInt8(1, GetLocaleByName(_locale));
|
||||
stmt->setString(2, _os);
|
||||
|
||||
@@ -28,6 +28,9 @@ typedef std::shared_ptr<ResultSet> QueryResult;
|
||||
typedef std::future<QueryResult> QueryResultFuture;
|
||||
typedef std::promise<QueryResult> QueryResultPromise;
|
||||
|
||||
class PreparedStatementBase;
|
||||
|
||||
template<typename T>
|
||||
class PreparedStatement;
|
||||
|
||||
class PreparedResultSet;
|
||||
|
||||
@@ -162,7 +162,7 @@ QueryResult DatabaseWorkerPool<T>::Query(const char* sql, T* connection /*= null
|
||||
}
|
||||
|
||||
template <class T>
|
||||
PreparedQueryResult DatabaseWorkerPool<T>::Query(PreparedStatement* stmt)
|
||||
PreparedQueryResult DatabaseWorkerPool<T>::Query(PreparedStatement<T>* stmt)
|
||||
{
|
||||
auto connection = GetFreeConnection();
|
||||
PreparedResultSet* ret = connection->Query(stmt);
|
||||
@@ -191,7 +191,7 @@ QueryCallback DatabaseWorkerPool<T>::AsyncQuery(const char* sql)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
QueryCallback DatabaseWorkerPool<T>::AsyncQuery(PreparedStatement* stmt)
|
||||
QueryCallback DatabaseWorkerPool<T>::AsyncQuery(PreparedStatement<T>* stmt)
|
||||
{
|
||||
PreparedStatementTask* task = new PreparedStatementTask(stmt, true);
|
||||
// Store future result before enqueueing - task might get already processed and deleted before returning from this method
|
||||
@@ -269,9 +269,9 @@ void DatabaseWorkerPool<T>::DirectCommitTransaction(SQLTransaction& transaction)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
PreparedStatement* DatabaseWorkerPool<T>::GetPreparedStatement(PreparedStatementIndex index)
|
||||
PreparedStatement<T>* DatabaseWorkerPool<T>::GetPreparedStatement(PreparedStatementIndex index)
|
||||
{
|
||||
return new PreparedStatement(index);
|
||||
return new PreparedStatement<T>(index);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@@ -397,7 +397,7 @@ void DatabaseWorkerPool<T>::Execute(const char* sql)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::Execute(PreparedStatement* stmt)
|
||||
void DatabaseWorkerPool<T>::Execute(PreparedStatement<T>* stmt)
|
||||
{
|
||||
PreparedStatementTask* task = new PreparedStatementTask(stmt);
|
||||
Enqueue(task);
|
||||
@@ -415,7 +415,7 @@ void DatabaseWorkerPool<T>::DirectExecute(const char* sql)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::DirectExecute(PreparedStatement* stmt)
|
||||
void DatabaseWorkerPool<T>::DirectExecute(PreparedStatement<T>* stmt)
|
||||
{
|
||||
T* connection = GetFreeConnection();
|
||||
connection->Execute(stmt);
|
||||
@@ -435,7 +435,7 @@ void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, const char* s
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, PreparedStatement* stmt)
|
||||
void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, PreparedStatement<T>* stmt)
|
||||
{
|
||||
if (!trans)
|
||||
Execute(stmt);
|
||||
|
||||
@@ -83,7 +83,7 @@ class DatabaseWorkerPool
|
||||
|
||||
//! Enqueues a one-way SQL operation in prepared statement format that will be executed asynchronously.
|
||||
//! Statement must be prepared with CONNECTION_ASYNC flag.
|
||||
void Execute(PreparedStatement* stmt);
|
||||
void Execute(PreparedStatement<T>* stmt);
|
||||
|
||||
/**
|
||||
Direct synchronous one-way statement methods.
|
||||
@@ -106,7 +106,7 @@ class DatabaseWorkerPool
|
||||
|
||||
//! Directly executes a one-way SQL operation in prepared statement format, that will block the calling thread until finished.
|
||||
//! Statement must be prepared with the CONNECTION_SYNCH flag.
|
||||
void DirectExecute(PreparedStatement* stmt);
|
||||
void DirectExecute(PreparedStatement<T>* stmt);
|
||||
|
||||
/**
|
||||
Synchronous query (with resultset) methods.
|
||||
@@ -141,7 +141,7 @@ class DatabaseWorkerPool
|
||||
//! Directly executes an SQL query in prepared format that will block the calling thread until finished.
|
||||
//! Returns reference counted auto pointer, no need for manual memory management in upper level code.
|
||||
//! Statement must be prepared with CONNECTION_SYNCH flag.
|
||||
PreparedQueryResult Query(PreparedStatement* stmt);
|
||||
PreparedQueryResult Query(PreparedStatement<T>* stmt);
|
||||
|
||||
/**
|
||||
Asynchronous query (with resultset) methods.
|
||||
@@ -154,7 +154,7 @@ class DatabaseWorkerPool
|
||||
//! Enqueues a query in prepared format that will set the value of the PreparedQueryResultFuture return object as soon as the query is executed.
|
||||
//! The return value is then processed in ProcessQueryCallback methods.
|
||||
//! Statement must be prepared with CONNECTION_ASYNC flag.
|
||||
QueryCallback AsyncQuery(PreparedStatement* stmt);
|
||||
QueryCallback AsyncQuery(PreparedStatement<T>* stmt);
|
||||
|
||||
//! Enqueues a vector of SQL operations (can be both adhoc and prepared) that will set the value of the QueryResultHolderFuture
|
||||
//! return object as soon as the query is executed.
|
||||
@@ -183,7 +183,7 @@ class DatabaseWorkerPool
|
||||
|
||||
//! Method used to execute prepared statements in a diverse context.
|
||||
//! Will be wrapped in a transaction if valid object is present, otherwise executed standalone.
|
||||
void ExecuteOrAppend(SQLTransaction& trans, PreparedStatement* stmt);
|
||||
void ExecuteOrAppend(SQLTransaction& trans, PreparedStatement<T>* stmt);
|
||||
|
||||
/**
|
||||
Other
|
||||
@@ -194,7 +194,7 @@ class DatabaseWorkerPool
|
||||
//! Automanaged (internally) pointer to a prepared statement object for usage in upper level code.
|
||||
//! Pointer is deleted in this->DirectExecute(PreparedStatement*), this->Query(PreparedStatement*) or PreparedStatementTask::~PreparedStatementTask.
|
||||
//! This object is not tied to the prepared statement on the MySQL context yet until execution.
|
||||
PreparedStatement* GetPreparedStatement(PreparedStatementIndex index);
|
||||
PreparedStatement<T>* GetPreparedStatement(PreparedStatementIndex index);
|
||||
|
||||
//! Apply escape string'ing for current collation. (utf8)
|
||||
void EscapeString(std::string& str);
|
||||
|
||||
@@ -647,4 +647,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using CharacterDatabasePreparedStatement = PreparedStatement<CharacterDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -589,4 +589,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using HotfixDatabasePreparedStatement = PreparedStatement<HotfixDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -181,4 +181,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using LoginDatabasePreparedStatement = PreparedStatement<LoginDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -116,4 +116,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using WorldDatabasePreparedStatement = PreparedStatement<WorldDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -193,7 +193,7 @@ bool MySQLConnection::Execute(const char* sql)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MySQLConnection::Execute(PreparedStatement* stmt)
|
||||
bool MySQLConnection::Execute(PreparedStatementBase* stmt)
|
||||
{
|
||||
if (!m_Mysql)
|
||||
return false;
|
||||
@@ -243,7 +243,7 @@ bool MySQLConnection::Execute(PreparedStatement* stmt)
|
||||
}
|
||||
}
|
||||
|
||||
bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint64* pRowCount, uint32* pFieldCount)
|
||||
bool MySQLConnection::_Query(PreparedStatementBase* stmt, MYSQL_RES **pResult, uint64* pRowCount, uint32* pFieldCount)
|
||||
{
|
||||
if (!m_Mysql)
|
||||
return false;
|
||||
@@ -387,7 +387,7 @@ int MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
|
||||
{
|
||||
case SQL_ELEMENT_PREPARED:
|
||||
{
|
||||
PreparedStatement* stmt = data.element.stmt;
|
||||
PreparedStatementBase* stmt = data.element.stmt;
|
||||
ASSERT(stmt);
|
||||
if (!Execute(stmt))
|
||||
{
|
||||
@@ -490,7 +490,7 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
|
||||
}
|
||||
}
|
||||
|
||||
PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
|
||||
PreparedResultSet* MySQLConnection::Query(PreparedStatementBase* stmt)
|
||||
{
|
||||
MYSQL_RES *result = NULL;
|
||||
uint64 rowCount = 0;
|
||||
|
||||
@@ -70,11 +70,11 @@ class TC_DATABASE_API MySQLConnection
|
||||
|
||||
public:
|
||||
bool Execute(const char* sql);
|
||||
bool Execute(PreparedStatement* stmt);
|
||||
bool Execute(PreparedStatementBase* stmt);
|
||||
ResultSet* Query(const char* sql);
|
||||
PreparedResultSet* Query(PreparedStatement* stmt);
|
||||
PreparedResultSet* Query(PreparedStatementBase* stmt);
|
||||
bool _Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD **pFields, uint64* pRowCount, uint32* pFieldCount);
|
||||
bool _Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint64* pRowCount, uint32* pFieldCount);
|
||||
bool _Query(PreparedStatementBase* stmt, MYSQL_RES **pResult, uint64* pRowCount, uint32* pFieldCount);
|
||||
|
||||
void BeginTransaction();
|
||||
void RollbackTransaction();
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
#include <mysql.h>
|
||||
#include <sstream>
|
||||
|
||||
PreparedStatement::PreparedStatement(uint32 index) :
|
||||
PreparedStatementBase::PreparedStatementBase(uint32 index) :
|
||||
m_stmt(NULL),
|
||||
m_index(index) { }
|
||||
|
||||
PreparedStatement::~PreparedStatement() { }
|
||||
PreparedStatementBase::~PreparedStatementBase() { }
|
||||
|
||||
void PreparedStatement::BindParameters()
|
||||
void PreparedStatementBase::BindParameters()
|
||||
{
|
||||
ASSERT(m_stmt);
|
||||
|
||||
@@ -92,7 +92,7 @@ void PreparedStatement::BindParameters()
|
||||
}
|
||||
|
||||
//- Bind to buffer
|
||||
void PreparedStatement::setBool(const uint8 index, const bool value)
|
||||
void PreparedStatementBase::setBool(const uint8 index, const bool value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -101,7 +101,7 @@ void PreparedStatement::setBool(const uint8 index, const bool value)
|
||||
statement_data[index].type = TYPE_BOOL;
|
||||
}
|
||||
|
||||
void PreparedStatement::setUInt8(const uint8 index, const uint8 value)
|
||||
void PreparedStatementBase::setUInt8(const uint8 index, const uint8 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -110,7 +110,7 @@ void PreparedStatement::setUInt8(const uint8 index, const uint8 value)
|
||||
statement_data[index].type = TYPE_UI8;
|
||||
}
|
||||
|
||||
void PreparedStatement::setUInt16(const uint8 index, const uint16 value)
|
||||
void PreparedStatementBase::setUInt16(const uint8 index, const uint16 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -119,7 +119,7 @@ void PreparedStatement::setUInt16(const uint8 index, const uint16 value)
|
||||
statement_data[index].type = TYPE_UI16;
|
||||
}
|
||||
|
||||
void PreparedStatement::setUInt32(const uint8 index, const uint32 value)
|
||||
void PreparedStatementBase::setUInt32(const uint8 index, const uint32 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -128,7 +128,7 @@ void PreparedStatement::setUInt32(const uint8 index, const uint32 value)
|
||||
statement_data[index].type = TYPE_UI32;
|
||||
}
|
||||
|
||||
void PreparedStatement::setUInt64(const uint8 index, const uint64 value)
|
||||
void PreparedStatementBase::setUInt64(const uint8 index, const uint64 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -137,7 +137,7 @@ void PreparedStatement::setUInt64(const uint8 index, const uint64 value)
|
||||
statement_data[index].type = TYPE_UI64;
|
||||
}
|
||||
|
||||
void PreparedStatement::setInt8(const uint8 index, const int8 value)
|
||||
void PreparedStatementBase::setInt8(const uint8 index, const int8 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -146,7 +146,7 @@ void PreparedStatement::setInt8(const uint8 index, const int8 value)
|
||||
statement_data[index].type = TYPE_I8;
|
||||
}
|
||||
|
||||
void PreparedStatement::setInt16(const uint8 index, const int16 value)
|
||||
void PreparedStatementBase::setInt16(const uint8 index, const int16 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -155,7 +155,7 @@ void PreparedStatement::setInt16(const uint8 index, const int16 value)
|
||||
statement_data[index].type = TYPE_I16;
|
||||
}
|
||||
|
||||
void PreparedStatement::setInt32(const uint8 index, const int32 value)
|
||||
void PreparedStatementBase::setInt32(const uint8 index, const int32 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -164,7 +164,7 @@ void PreparedStatement::setInt32(const uint8 index, const int32 value)
|
||||
statement_data[index].type = TYPE_I32;
|
||||
}
|
||||
|
||||
void PreparedStatement::setInt64(const uint8 index, const int64 value)
|
||||
void PreparedStatementBase::setInt64(const uint8 index, const int64 value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -173,7 +173,7 @@ void PreparedStatement::setInt64(const uint8 index, const int64 value)
|
||||
statement_data[index].type = TYPE_I64;
|
||||
}
|
||||
|
||||
void PreparedStatement::setFloat(const uint8 index, const float value)
|
||||
void PreparedStatementBase::setFloat(const uint8 index, const float value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -182,7 +182,7 @@ void PreparedStatement::setFloat(const uint8 index, const float value)
|
||||
statement_data[index].type = TYPE_FLOAT;
|
||||
}
|
||||
|
||||
void PreparedStatement::setDouble(const uint8 index, const double value)
|
||||
void PreparedStatementBase::setDouble(const uint8 index, const double value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -191,7 +191,7 @@ void PreparedStatement::setDouble(const uint8 index, const double value)
|
||||
statement_data[index].type = TYPE_DOUBLE;
|
||||
}
|
||||
|
||||
void PreparedStatement::setString(const uint8 index, const std::string& value)
|
||||
void PreparedStatementBase::setString(const uint8 index, const std::string& value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -201,7 +201,7 @@ void PreparedStatement::setString(const uint8 index, const std::string& value)
|
||||
statement_data[index].type = TYPE_STRING;
|
||||
}
|
||||
|
||||
void PreparedStatement::setBinary(const uint8 index, const std::vector<uint8>& value)
|
||||
void PreparedStatementBase::setBinary(const uint8 index, const std::vector<uint8>& value)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index + 1);
|
||||
@@ -210,7 +210,7 @@ void PreparedStatement::setBinary(const uint8 index, const std::vector<uint8>& v
|
||||
statement_data[index].type = TYPE_BINARY;
|
||||
}
|
||||
|
||||
void PreparedStatement::setNull(const uint8 index)
|
||||
void PreparedStatementBase::setNull(const uint8 index)
|
||||
{
|
||||
if (index >= statement_data.size())
|
||||
statement_data.resize(index+1);
|
||||
@@ -472,7 +472,7 @@ std::string MySQLPreparedStatement::getQueryString(std::string const& sqlPattern
|
||||
}
|
||||
|
||||
//- Execution
|
||||
PreparedStatementTask::PreparedStatementTask(PreparedStatement* stmt, bool async) :
|
||||
PreparedStatementTask::PreparedStatementTask(PreparedStatementBase* stmt, bool async) :
|
||||
m_stmt(stmt), m_result(nullptr)
|
||||
{
|
||||
m_has_result = async; // If it's async, then there's a result
|
||||
|
||||
@@ -73,15 +73,15 @@ struct PreparedStatementData
|
||||
class MySQLPreparedStatement;
|
||||
|
||||
//- Upper-level class that is used in code
|
||||
class TC_DATABASE_API PreparedStatement
|
||||
class TC_DATABASE_API PreparedStatementBase
|
||||
{
|
||||
friend class PreparedStatementTask;
|
||||
friend class MySQLPreparedStatement;
|
||||
friend class MySQLConnection;
|
||||
|
||||
public:
|
||||
explicit PreparedStatement(uint32 index);
|
||||
~PreparedStatement();
|
||||
explicit PreparedStatementBase(uint32 index);
|
||||
virtual ~PreparedStatementBase();
|
||||
|
||||
void setBool(const uint8 index, const bool value);
|
||||
void setUInt8(const uint8 index, const uint8 value);
|
||||
@@ -106,8 +106,21 @@ class TC_DATABASE_API PreparedStatement
|
||||
uint32 m_index;
|
||||
std::vector<PreparedStatementData> statement_data; //- Buffer of parameters, not tied to MySQL in any way yet
|
||||
|
||||
PreparedStatement(PreparedStatement const& right) = delete;
|
||||
PreparedStatement& operator=(PreparedStatement const& right) = delete;
|
||||
PreparedStatementBase(PreparedStatementBase const& right) = delete;
|
||||
PreparedStatementBase& operator=(PreparedStatementBase const& right) = delete;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class PreparedStatement : public PreparedStatementBase
|
||||
{
|
||||
public:
|
||||
explicit PreparedStatement(uint32 index) : PreparedStatementBase(index)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
PreparedStatement(PreparedStatement const& right) = delete;
|
||||
PreparedStatement& operator=(PreparedStatement const& right) = delete;
|
||||
};
|
||||
|
||||
//- Class of which the instances are unique per MySQLConnection
|
||||
@@ -116,7 +129,7 @@ class TC_DATABASE_API PreparedStatement
|
||||
class TC_DATABASE_API MySQLPreparedStatement
|
||||
{
|
||||
friend class MySQLConnection;
|
||||
friend class PreparedStatement;
|
||||
friend class PreparedStatementBase;
|
||||
|
||||
public:
|
||||
MySQLPreparedStatement(MYSQL_STMT* stmt);
|
||||
@@ -139,7 +152,7 @@ class TC_DATABASE_API MySQLPreparedStatement
|
||||
protected:
|
||||
MYSQL_STMT* GetSTMT() { return m_Mstmt; }
|
||||
MYSQL_BIND* GetBind() { return m_bind; }
|
||||
PreparedStatement* m_stmt;
|
||||
PreparedStatementBase* m_stmt;
|
||||
void ClearParameters();
|
||||
void CheckValidIndex(uint8 index);
|
||||
std::string getQueryString(std::string const& sqlPattern) const;
|
||||
@@ -158,14 +171,14 @@ class TC_DATABASE_API MySQLPreparedStatement
|
||||
class TC_DATABASE_API PreparedStatementTask : public SQLOperation
|
||||
{
|
||||
public:
|
||||
PreparedStatementTask(PreparedStatement* stmt, bool async = false);
|
||||
PreparedStatementTask(PreparedStatementBase* stmt, bool async = false);
|
||||
~PreparedStatementTask();
|
||||
|
||||
bool Execute() override;
|
||||
PreparedQueryResultFuture GetFuture() { return m_result->get_future(); }
|
||||
|
||||
protected:
|
||||
PreparedStatement* m_stmt;
|
||||
PreparedStatementBase* m_stmt;
|
||||
bool m_has_result;
|
||||
PreparedQueryResultPromise* m_result;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "Log.h"
|
||||
#include "QueryResult.h"
|
||||
|
||||
bool SQLQueryHolder::SetPreparedQuery(size_t index, PreparedStatement* stmt)
|
||||
bool SQLQueryHolder::SetPreparedQuery(size_t index, PreparedStatementBase* stmt)
|
||||
{
|
||||
if (m_queries.size() <= index)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ bool SQLQueryHolderTask::Execute()
|
||||
|
||||
/// execute all queries in the holder and pass the results
|
||||
for (size_t i = 0; i < m_holder->m_queries.size(); i++)
|
||||
if (PreparedStatement* stmt = m_holder->m_queries[i].first)
|
||||
if (PreparedStatementBase* stmt = m_holder->m_queries[i].first)
|
||||
m_holder->SetPreparedResult(i, m_conn->Query(stmt));
|
||||
|
||||
m_result.set_value(m_holder);
|
||||
|
||||
@@ -24,11 +24,11 @@ class TC_DATABASE_API SQLQueryHolder
|
||||
{
|
||||
friend class SQLQueryHolderTask;
|
||||
private:
|
||||
std::vector<std::pair<PreparedStatement*, PreparedQueryResult>> m_queries;
|
||||
std::vector<std::pair<PreparedStatementBase*, PreparedQueryResult>> m_queries;
|
||||
public:
|
||||
SQLQueryHolder() { }
|
||||
virtual ~SQLQueryHolder();
|
||||
bool SetPreparedQuery(size_t index, PreparedStatement* stmt);
|
||||
bool SetPreparedQuery(size_t index, PreparedStatementBase* stmt);
|
||||
void SetSize(size_t size);
|
||||
PreparedQueryResult GetPreparedResult(size_t index);
|
||||
void SetPreparedResult(size_t index, PreparedResultSet* result);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
//- Union that holds element data
|
||||
union SQLElementUnion
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
PreparedStatementBase* stmt;
|
||||
const char* query;
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void Transaction::Append(const char* sql)
|
||||
}
|
||||
|
||||
//- Append a prepared statement to the transaction
|
||||
void Transaction::Append(PreparedStatement* stmt)
|
||||
void Transaction::Append(PreparedStatementBase* stmt)
|
||||
{
|
||||
SQLElementData data;
|
||||
data.type = SQL_ELEMENT_PREPARED;
|
||||
|
||||
@@ -38,7 +38,7 @@ class TC_DATABASE_API Transaction
|
||||
Transaction() : _cleanedUp(false) { }
|
||||
~Transaction() { Cleanup(); }
|
||||
|
||||
void Append(PreparedStatement* statement);
|
||||
void Append(PreparedStatementBase* statement);
|
||||
void Append(const char* sql);
|
||||
template<typename Format, typename... Args>
|
||||
void PAppend(Format&& sql, Args&&... args)
|
||||
|
||||
@@ -31,7 +31,7 @@ void AppenderDB::_write(LogMessage const* message)
|
||||
if (!enabled || (message->type.find("sql") != std::string::npos))
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
|
||||
stmt->setUInt64(0, message->mtime);
|
||||
stmt->setUInt32(1, realmId);
|
||||
stmt->setString(2, message->type);
|
||||
|
||||
@@ -43,7 +43,7 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
|
||||
waypoint_map.clear();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -112,7 +112,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
for (uint8 i = 0; i < SMART_SCRIPT_TYPE_MAX; i++)
|
||||
mEventMap[i].clear(); //Drop Existing SmartAI List
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMART_SCRIPTS);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMART_SCRIPTS);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -57,7 +57,7 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
|
||||
if (GetId(username))
|
||||
return AccountOpResult::AOR_NAME_ALREADY_EXIST; // username does already exist
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT);
|
||||
|
||||
stmt->setString(0, username);
|
||||
stmt->setString(1, CalculateShaPassHash(username, password));
|
||||
@@ -85,15 +85,15 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
|
||||
AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
|
||||
{
|
||||
// Check if accounts exists
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
LoginDatabasePreparedStatement* loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID);
|
||||
loginStmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(loginStmt);
|
||||
|
||||
if (!result)
|
||||
return AccountOpResult::AOR_NAME_NOT_EXIST;
|
||||
|
||||
// Obtain accounts characters
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID);
|
||||
|
||||
stmt->setUInt32(0, accountId);
|
||||
|
||||
@@ -132,25 +132,25 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
|
||||
|
||||
SQLTransaction trans = LoginDatabase.BeginTransaction();
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT);
|
||||
loginStmt->setUInt32(0, accountId);
|
||||
trans->Append(loginStmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
|
||||
loginStmt->setUInt32(0, accountId);
|
||||
trans->Append(loginStmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS);
|
||||
loginStmt->setUInt32(0, accountId);
|
||||
trans->Append(loginStmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_BANNED);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_BANNED);
|
||||
loginStmt->setUInt32(0, accountId);
|
||||
trans->Append(loginStmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_MUTED);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_MUTED);
|
||||
loginStmt->setUInt32(0, accountId);
|
||||
trans->Append(loginStmt);
|
||||
|
||||
LoginDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -160,7 +160,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
|
||||
AccountOpResult AccountMgr::ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword)
|
||||
{
|
||||
// Check if accounts exists
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -206,7 +206,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass
|
||||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(newPassword);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_PASSWORD);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_PASSWORD);
|
||||
|
||||
stmt->setString(0, CalculateShaPassHash(username, newPassword));
|
||||
stmt->setUInt32(1, accountId);
|
||||
@@ -244,7 +244,7 @@ AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail)
|
||||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(newEmail);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EMAIL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EMAIL);
|
||||
|
||||
stmt->setString(0, newEmail);
|
||||
stmt->setUInt32(1, accountId);
|
||||
@@ -274,7 +274,7 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai
|
||||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(newEmail);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_REG_EMAIL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_REG_EMAIL);
|
||||
|
||||
stmt->setString(0, newEmail);
|
||||
stmt->setUInt32(1, accountId);
|
||||
@@ -287,7 +287,7 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai
|
||||
|
||||
uint32 AccountMgr::GetId(std::string const& username)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ID_BY_USERNAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ID_BY_USERNAME);
|
||||
stmt->setString(0, username);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -296,7 +296,7 @@ uint32 AccountMgr::GetId(std::string const& username)
|
||||
|
||||
uint32 AccountMgr::GetSecurity(uint32 accountId)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -305,7 +305,7 @@ uint32 AccountMgr::GetSecurity(uint32 accountId)
|
||||
|
||||
uint32 AccountMgr::GetSecurity(uint32 accountId, int32 realmId)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
stmt->setInt32(1, realmId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
@@ -315,7 +315,7 @@ uint32 AccountMgr::GetSecurity(uint32 accountId, int32 realmId)
|
||||
|
||||
bool AccountMgr::GetName(uint32 accountId, std::string& name)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_USERNAME_BY_ID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_USERNAME_BY_ID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -330,7 +330,7 @@ bool AccountMgr::GetName(uint32 accountId, std::string& name)
|
||||
|
||||
bool AccountMgr::GetEmail(uint32 accountId, std::string& email)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_EMAIL_BY_ID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_EMAIL_BY_ID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -353,7 +353,7 @@ bool AccountMgr::CheckPassword(uint32 accountId, std::string password)
|
||||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(password);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD);
|
||||
stmt->setUInt32(0, accountId);
|
||||
stmt->setString(1, CalculateShaPassHash(username, password));
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
@@ -381,7 +381,7 @@ bool AccountMgr::CheckEmail(uint32 accountId, std::string newEmail)
|
||||
uint32 AccountMgr::GetCharactersCount(uint32 accountId)
|
||||
{
|
||||
// check character count
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -402,7 +402,7 @@ std::string AccountMgr::CalculateShaPassHash(std::string const& name, std::strin
|
||||
|
||||
bool AccountMgr::IsBannedAccount(std::string const& name)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -523,13 +523,13 @@ void AccountMgr::UpdateAccountAccess(rbac::RBACData* rbac, uint32 accountId, uin
|
||||
// Delete old security level from DB
|
||||
if (realmId == -1)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
|
||||
stmt->setUInt32(0, accountId);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM);
|
||||
stmt->setUInt32(0, accountId);
|
||||
stmt->setUInt32(1, realmId);
|
||||
trans->Append(stmt);
|
||||
@@ -538,7 +538,7 @@ void AccountMgr::UpdateAccountAccess(rbac::RBACData* rbac, uint32 accountId, uin
|
||||
// Add new security level
|
||||
if (securityLevel)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS);
|
||||
stmt->setUInt32(0, accountId);
|
||||
stmt->setUInt8(1, securityLevel);
|
||||
stmt->setInt32(2, realmId);
|
||||
|
||||
@@ -37,7 +37,7 @@ AccountOpResult Battlenet::AccountMgr::CreateBattlenetAccount(std::string email,
|
||||
if (GetId(email))
|
||||
return AccountOpResult::AOR_NAME_ALREADY_EXIST;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_ACCOUNT);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_ACCOUNT);
|
||||
stmt->setString(0, email);
|
||||
stmt->setString(1, CalculateShaPassHash(email, password));
|
||||
LoginDatabase.DirectExecute(stmt);
|
||||
@@ -65,7 +65,7 @@ AccountOpResult Battlenet::AccountMgr::ChangePassword(uint32 accountId, std::str
|
||||
if (utf8length(newPassword) > MAX_PASS_STR)
|
||||
return AccountOpResult::AOR_PASS_TOO_LONG;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_PASSWORD);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_PASSWORD);
|
||||
stmt->setString(0, CalculateShaPassHash(username, newPassword));
|
||||
stmt->setUInt32(1, accountId);
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -83,7 +83,7 @@ bool Battlenet::AccountMgr::CheckPassword(uint32 accountId, std::string password
|
||||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(password);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_CHECK_PASSWORD);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_CHECK_PASSWORD);
|
||||
stmt->setUInt32(0, accountId);
|
||||
stmt->setString(1, CalculateShaPassHash(username, password));
|
||||
|
||||
@@ -103,7 +103,7 @@ AccountOpResult Battlenet::AccountMgr::LinkWithGameAccount(std::string const& em
|
||||
if (GetIdByGameAccount(gameAccountId))
|
||||
return AccountOpResult::AOR_ACCOUNT_BAD_LINK;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_GAME_ACCOUNT_LINK);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_GAME_ACCOUNT_LINK);
|
||||
stmt->setUInt32(0, bnetAccountId);
|
||||
stmt->setUInt8(1, GetMaxIndex(bnetAccountId) + 1);
|
||||
stmt->setUInt32(2, gameAccountId);
|
||||
@@ -120,7 +120,7 @@ AccountOpResult Battlenet::AccountMgr::UnlinkGameAccount(std::string const& game
|
||||
if (!GetIdByGameAccount(gameAccountId))
|
||||
return AccountOpResult::AOR_ACCOUNT_BAD_LINK;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_GAME_ACCOUNT_LINK);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_GAME_ACCOUNT_LINK);
|
||||
stmt->setNull(0);
|
||||
stmt->setNull(1);
|
||||
stmt->setUInt32(2, gameAccountId);
|
||||
@@ -130,7 +130,7 @@ AccountOpResult Battlenet::AccountMgr::UnlinkGameAccount(std::string const& game
|
||||
|
||||
uint32 Battlenet::AccountMgr::GetId(std::string const& username)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_EMAIL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_EMAIL);
|
||||
stmt->setString(0, username);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
|
||||
return (*result)[0].GetUInt32();
|
||||
@@ -140,7 +140,7 @@ uint32 Battlenet::AccountMgr::GetId(std::string const& username)
|
||||
|
||||
bool Battlenet::AccountMgr::GetName(uint32 accountId, std::string& name)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_EMAIL_BY_ID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_EMAIL_BY_ID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
|
||||
{
|
||||
@@ -153,7 +153,7 @@ bool Battlenet::AccountMgr::GetName(uint32 accountId, std::string& name)
|
||||
|
||||
uint32 Battlenet::AccountMgr::GetIdByGameAccount(uint32 gameAccountId)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
|
||||
stmt->setUInt32(0, gameAccountId);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
|
||||
return (*result)[0].GetUInt32();
|
||||
@@ -163,7 +163,7 @@ uint32 Battlenet::AccountMgr::GetIdByGameAccount(uint32 gameAccountId)
|
||||
|
||||
uint8 Battlenet::AccountMgr::GetMaxIndex(uint32 accountId)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_MAX_ACCOUNT_INDEX);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_MAX_ACCOUNT_INDEX);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
if (result)
|
||||
|
||||
@@ -130,7 +130,7 @@ RBACCommandResult RBACData::DenyPermission(uint32 permissionId, int32 realmId /*
|
||||
|
||||
void RBACData::SavePermission(uint32 permission, bool granted, int32 realmId)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_RBAC_ACCOUNT_PERMISSION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_RBAC_ACCOUNT_PERMISSION);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setUInt32(1, permission);
|
||||
stmt->setBool(2, granted);
|
||||
@@ -156,7 +156,7 @@ RBACCommandResult RBACData::RevokePermission(uint32 permissionId, int32 realmId
|
||||
{
|
||||
TC_LOG_TRACE("rbac", "RBACData::RevokePermission [Id: %u Name: %s] (Permission %u, RealmId %d). Ok and DB updated",
|
||||
GetId(), GetName().c_str(), permissionId, realmId);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_RBAC_ACCOUNT_PERMISSION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_RBAC_ACCOUNT_PERMISSION);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setUInt32(1, permissionId);
|
||||
stmt->setInt32(2, realmId);
|
||||
@@ -177,7 +177,7 @@ void RBACData::LoadFromDB()
|
||||
|
||||
TC_LOG_DEBUG("rbac", "RBACData::LoadFromDB [Id: %u Name: %s]: Loading permissions", GetId(), GetName().c_str());
|
||||
// Load account permissions (granted and denied) that affect current realm
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setInt32(1, GetRealmId());
|
||||
|
||||
@@ -190,7 +190,7 @@ QueryCallback RBACData::LoadFromDBAsync()
|
||||
|
||||
TC_LOG_DEBUG("rbac", "RBACData::LoadFromDB [Id: %u Name: %s]: Loading permissions", GetId(), GetName().c_str());
|
||||
// Load account permissions (granted and denied) that affect current realm
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setInt32(1, GetRealmId());
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ void PlayerAchievementMgr::DeleteFromDB(ObjectGuid const& guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -272,7 +272,7 @@ void PlayerAchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pre
|
||||
// Removing non-existing criteria data for all characters
|
||||
TC_LOG_ERROR("criteria.achievement", "Non-existing achievement criteria %u data has been removed from the table `character_achievement_progress`.", id);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
|
||||
stmt->setUInt32(0, id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -299,7 +299,7 @@ void PlayerAchievementMgr::SaveToDB(SQLTransaction& trans)
|
||||
if (!iter->second.Changed)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||
stmt->setUInt32(0, iter->first);
|
||||
stmt->setUInt64(1, _owner->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -321,7 +321,7 @@ void PlayerAchievementMgr::SaveToDB(SQLTransaction& trans)
|
||||
if (!iter->second.Changed)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
|
||||
stmt->setUInt64(0, _owner->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, iter->first);
|
||||
trans->Append(stmt);
|
||||
@@ -662,7 +662,7 @@ void GuildAchievementMgr::DeleteFromDB(ObjectGuid const& guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -716,7 +716,7 @@ void GuildAchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Prep
|
||||
// we will remove not existed criteria for all guilds
|
||||
TC_LOG_ERROR("criteria.achievement", "Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD);
|
||||
stmt->setUInt32(0, id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
continue;
|
||||
@@ -736,7 +736,7 @@ void GuildAchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Prep
|
||||
|
||||
void GuildAchievementMgr::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
std::ostringstream guidstr;
|
||||
for (auto itr = _completedAchievements.begin(); itr != _completedAchievements.end(); ++itr)
|
||||
{
|
||||
@@ -1095,7 +1095,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
|
||||
// Remove non-existing achievements from all characters
|
||||
TC_LOG_ERROR("criteria.achievement", "Non-existing achievement %u data has been removed from the table `character_achievement`.", achievementId);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEVMENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEVMENT);
|
||||
stmt->setUInt32(0, achievementId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
{
|
||||
// set owner to bidder (to prevent delete item with sender char deleting)
|
||||
// owner in `data` will set at mail receive and item extracting
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
|
||||
stmt->setUInt64(0, auction->bidder);
|
||||
stmt->setUInt64(1, item->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -300,7 +300,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
||||
}
|
||||
|
||||
// data needs to be at first place for Item::LoadFromDB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_ITEMS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -344,7 +344,7 @@ void AuctionHouseMgr::LoadAuctions()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -864,14 +864,14 @@ uint64 AuctionEntry::GetAuctionOutBid() const
|
||||
|
||||
void AuctionEntry::DeleteFromDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AUCTION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AUCTION);
|
||||
stmt->setUInt32(0, Id);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
|
||||
void AuctionEntry::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AUCTION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AUCTION);
|
||||
stmt->setUInt32(0, Id);
|
||||
stmt->setUInt64(1, auctioneer);
|
||||
stmt->setUInt64(2, itemGUIDLow);
|
||||
|
||||
@@ -60,7 +60,7 @@ bool AuctionBotConfig::Initialize()
|
||||
if (uint32 ahBotAccId = GetConfig(CONFIG_AHBOT_ACCOUNT_ID))
|
||||
{
|
||||
// find account guids associated with ahbot account
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID);
|
||||
stmt->setUInt32(0, ahBotAccId);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
{
|
||||
|
||||
@@ -432,7 +432,7 @@ void AuctionBotBuyer::PlaceBidToEntry(AuctionEntry* auction, uint32 bidPrice)
|
||||
auction->bid = bidPrice;
|
||||
|
||||
// Update auction to DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||
stmt->setUInt64(0, auction->bidder);
|
||||
stmt->setUInt32(1, auction->bid);
|
||||
stmt->setUInt32(2, auction->Id);
|
||||
|
||||
@@ -239,7 +239,7 @@ void BattlePetMgr::LoadFromDB(PreparedQueryResult pets, PreparedQueryResult slot
|
||||
|
||||
void BattlePetMgr::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
LoginDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
for (auto itr = _pets.begin(); itr != _pets.end();)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ bool ArenaTeam::Create(ObjectGuid captainGuid, uint8 type, std::string const& te
|
||||
ObjectGuid::LowType captainLowGuid = captainGuid.GetCounter();
|
||||
|
||||
// Save arena team to db
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
|
||||
stmt->setUInt32(0, TeamId);
|
||||
stmt->setString(1, TeamName);
|
||||
stmt->setUInt64(2, captainLowGuid);
|
||||
@@ -130,7 +130,7 @@ bool ArenaTeam::AddMember(ObjectGuid playerGuid)
|
||||
personalRating = 1000;
|
||||
|
||||
// Try to get player's match maker rating from db and fall back to config setting if not found
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);
|
||||
stmt->setUInt64(0, playerGuid.GetCounter());
|
||||
stmt->setUInt8(1, GetSlot());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -274,7 +274,7 @@ bool ArenaTeam::SetName(std::string const& name)
|
||||
return false;
|
||||
|
||||
TeamName = name;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_NAME);
|
||||
stmt->setString(0, TeamName);
|
||||
stmt->setUInt32(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -292,7 +292,7 @@ void ArenaTeam::SetCaptain(ObjectGuid guid)
|
||||
CaptainGuid = guid;
|
||||
|
||||
// Update database
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
stmt->setUInt32(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -335,7 +335,7 @@ void ArenaTeam::DelMember(ObjectGuid guid, bool cleanDb)
|
||||
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
|
||||
if (cleanDb)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBER);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setUInt64(1, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -358,7 +358,7 @@ void ArenaTeam::Disband(WorldSession* session)
|
||||
// Update database
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);
|
||||
stmt->setUInt32(0, TeamId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -381,7 +381,7 @@ void ArenaTeam::Disband()
|
||||
// Update database
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);
|
||||
stmt->setUInt32(0, TeamId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -741,7 +741,7 @@ void ArenaTeam::SaveToDB()
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_STATS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_STATS);
|
||||
stmt->setUInt16(0, Stats.Rating);
|
||||
stmt->setUInt16(1, Stats.WeekGames);
|
||||
stmt->setUInt16(2, Stats.WeekWins);
|
||||
|
||||
@@ -723,7 +723,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
SetWinner(BG_TEAM_NEUTRAL);
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
uint64 battlegroundId = 1;
|
||||
if (isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ void BlackMarketMgr::LoadAuctions()
|
||||
_auctions.clear();
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BLACKMARKET_AUCTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BLACKMARKET_AUCTIONS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
@@ -447,7 +447,7 @@ bool BlackMarketEntry::LoadFromDB(Field* fields)
|
||||
|
||||
void BlackMarketEntry::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BLACKMARKET_AUCTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BLACKMARKET_AUCTIONS);
|
||||
|
||||
stmt->setInt32(0, _marketId);
|
||||
stmt->setUInt64(1, _currentBid);
|
||||
@@ -460,7 +460,7 @@ void BlackMarketEntry::SaveToDB(SQLTransaction& trans) const
|
||||
|
||||
void BlackMarketEntry::DeleteFromDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BLACKMARKET_AUCTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BLACKMARKET_AUCTIONS);
|
||||
stmt->setInt32(0, _marketId);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -495,7 +495,7 @@ void BlackMarketEntry::PlaceBid(uint64 bid, Player* player, SQLTransaction& tran
|
||||
player->ModifyMoney(-static_cast<int64>(bid));
|
||||
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_BLACKMARKET_AUCTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_BLACKMARKET_AUCTIONS);
|
||||
|
||||
stmt->setUInt64(0, _currentBid);
|
||||
stmt->setInt32(1, GetExpirationTime());
|
||||
|
||||
@@ -169,7 +169,7 @@ void CalendarMgr::RemoveEvent(uint64 eventId, ObjectGuid remover)
|
||||
SendCalendarEventRemovedAlert(*calendarEvent);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
MailDraft mail(calendarEvent->BuildCalendarMailSubject(remover), calendarEvent->BuildCalendarMailBody());
|
||||
|
||||
CalendarInviteStore& eventInvites = _invites[eventId];
|
||||
@@ -215,7 +215,7 @@ void CalendarMgr::RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid /*rem
|
||||
return;
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_INVITE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_INVITE);
|
||||
stmt->setUInt64(0, (*itr)->GetInviteId());
|
||||
trans->Append(stmt);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
@@ -236,7 +236,7 @@ void CalendarMgr::RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid /*rem
|
||||
|
||||
void CalendarMgr::UpdateEvent(CalendarEvent* calendarEvent)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_EVENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_EVENT);
|
||||
stmt->setUInt64(0, calendarEvent->GetEventId());
|
||||
stmt->setUInt64(1, calendarEvent->GetOwnerGUID().GetCounter());
|
||||
stmt->setString(2, calendarEvent->GetTitle());
|
||||
@@ -257,7 +257,7 @@ void CalendarMgr::UpdateInvite(CalendarInvite* invite)
|
||||
|
||||
void CalendarMgr::UpdateInvite(CalendarInvite* invite, SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_INVITE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_INVITE);
|
||||
stmt->setUInt64(0, invite->GetInviteId());
|
||||
stmt->setUInt64(1, invite->GetEventId());
|
||||
stmt->setUInt64(2, invite->GetInviteeGUID().GetCounter());
|
||||
|
||||
@@ -72,7 +72,7 @@ Channel::Channel(std::string const& name, uint32 team /*= 0*/) :
|
||||
// If storing custom channels in the db is enabled either load or save the channel
|
||||
if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL);
|
||||
stmt->setString(0, _channelName);
|
||||
stmt->setUInt32(1, _channelTeam);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) // load
|
||||
@@ -146,7 +146,7 @@ void Channel::UpdateChannelInDB() const
|
||||
for (ObjectGuid const& guid : _bannedStore)
|
||||
banlist << guid << ' ';
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL);
|
||||
stmt->setBool(0, _announceEnabled);
|
||||
stmt->setBool(1, _ownershipEnabled);
|
||||
stmt->setString(2, _channelPassword);
|
||||
@@ -161,7 +161,7 @@ void Channel::UpdateChannelInDB() const
|
||||
|
||||
void Channel::UpdateChannelUseageInDB() const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_USAGE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_USAGE);
|
||||
stmt->setString(0, _channelName);
|
||||
stmt->setUInt32(1, _channelTeam);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -171,7 +171,7 @@ void Channel::CleanOldChannelsInDB()
|
||||
{
|
||||
if (sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_CHANNELS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_CHANNELS);
|
||||
stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) * DAY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ std::vector<ChatCommand> const& ChatHandler::getCommandTable()
|
||||
// calls getCommandTable() recursively.
|
||||
commandTableCache = sScriptMgr->GetChatCommands();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -103,7 +103,7 @@ void LFGMgr::_SaveToDB(ObjectGuid guid, uint32 db_guid)
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
|
||||
stmt->setUInt32(0, db_guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void Corpse::SaveToDB()
|
||||
uint32 bytes2 = (uint32(*m_corpseData->FaceID)) | (uint32(*m_corpseData->HairStyleID) << 8) | (uint32(*m_corpseData->HairColorID) << 16) | (uint32(*m_corpseData->FacialHairStyleID) << 24);
|
||||
|
||||
uint16 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
|
||||
stmt->setUInt64(index++, GetOwnerGUID().GetCounter()); // guid
|
||||
stmt->setFloat (index++, GetPositionX()); // posX
|
||||
stmt->setFloat (index++, GetPositionY()); // posY
|
||||
@@ -143,7 +143,7 @@ void Corpse::DeleteFromDB(SQLTransaction& trans)
|
||||
|
||||
void Corpse::DeleteFromDB(ObjectGuid const& ownerGuid, SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE);
|
||||
stmt->setUInt64(0, ownerGuid.GetCounter());
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
|
||||
|
||||
@@ -1243,7 +1243,7 @@ void Creature::SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDiffic
|
||||
// update in DB
|
||||
SQLTransaction trans = WorldDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
stmt->setUInt64(0, m_spawnId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1637,7 +1637,7 @@ void Creature::DeleteFromDB()
|
||||
|
||||
SQLTransaction trans = WorldDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
stmt->setUInt64(0, m_spawnId);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -966,7 +966,7 @@ void GameObject::SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDiff
|
||||
|
||||
uint8 index = 0;
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
stmt->setUInt64(0, m_spawnId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void GameObject::DeleteFromDB()
|
||||
GetMap()->RemoveGORespawnTime(m_spawnId);
|
||||
sObjectMgr->DeleteGOData(m_spawnId);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
|
||||
stmt->setUInt64(0, m_spawnId);
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ void Item::SaveToDB(SQLTransaction& trans)
|
||||
case ITEM_CHANGED:
|
||||
{
|
||||
uint8 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(uState == ITEM_NEW ? CHAR_REP_ITEM_INSTANCE : CHAR_UPD_ITEM_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(uState == ITEM_NEW ? CHAR_REP_ITEM_INSTANCE : CHAR_UPD_ITEM_INSTANCE);
|
||||
stmt->setUInt32( index, GetEntry());
|
||||
stmt->setUInt64(++index, GetOwnerGUID().GetCounter());
|
||||
stmt->setUInt64(++index, GetCreator().GetCounter());
|
||||
@@ -566,7 +566,7 @@ void Item::SaveToDB(SQLTransaction& trans)
|
||||
}
|
||||
case ITEM_REMOVED:
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -778,7 +778,7 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid ownerGuid, Field* fie
|
||||
if (need_save) // normal item changed state set not work at loading
|
||||
{
|
||||
uint8 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD);
|
||||
stmt->setUInt32(index++, m_itemData->Expiration);
|
||||
stmt->setUInt32(index++, m_itemData->DynamicFlags);
|
||||
stmt->setUInt32(index++, m_itemData->Durability);
|
||||
@@ -877,7 +877,7 @@ void Item::CheckArtifactRelicSlotUnlock(Player const* owner)
|
||||
/*static*/
|
||||
void Item::DeleteFromDB(SQLTransaction& trans, ObjectGuid::LowType itemGuid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
|
||||
stmt->setUInt64(0, itemGuid);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -894,7 +894,7 @@ void Item::DeleteFromDB(SQLTransaction& trans)
|
||||
/*static*/
|
||||
void Item::DeleteFromInventoryDB(SQLTransaction& trans, ObjectGuid::LowType itemGuid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM);
|
||||
stmt->setUInt64(0, itemGuid);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -1488,7 +1488,7 @@ void Item::SaveRefundDataToDB()
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1506,7 +1506,7 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
|
||||
{
|
||||
if (trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
(*trans)->Append(stmt);
|
||||
|
||||
@@ -1592,7 +1592,7 @@ void Item::ClearSoulboundTradeable(Player* currentOwner)
|
||||
currentOwner->GetSession()->GetCollectionMgr()->AddItemAppearance(this);
|
||||
allowedGUIDs.clear();
|
||||
SetState(ITEM_CHANGED, currentOwner);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_BOP_TRADE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_BOP_TRADE);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -1956,7 +1956,7 @@ void Item::ItemContainerSaveLootToDB()
|
||||
// Save money
|
||||
if (loot.gold > 0)
|
||||
{
|
||||
PreparedStatement* stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
stmt_money->setUInt64(0, loot.containerID.GetCounter());
|
||||
trans->Append(stmt_money);
|
||||
|
||||
@@ -1969,7 +1969,7 @@ void Item::ItemContainerSaveLootToDB()
|
||||
// Save items
|
||||
if (!loot.isLooted())
|
||||
{
|
||||
PreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
stmt_items->setUInt64(0, loot.containerID.GetCounter());
|
||||
trans->Append(stmt_items);
|
||||
|
||||
@@ -2024,7 +2024,7 @@ bool Item::ItemContainerLoadLootFromDB()
|
||||
loot.containerID = GetGUID();
|
||||
|
||||
// First, see if there was any money loot. This gets added directly to the container.
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY);
|
||||
stmt->setUInt64(0, loot.containerID.GetCounter());
|
||||
PreparedQueryResult money_result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -2099,7 +2099,7 @@ bool Item::ItemContainerLoadLootFromDB()
|
||||
void Item::ItemContainerDeleteLootItemsFromDB()
|
||||
{
|
||||
// Deletes items associated with an openable item from the DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -2107,7 +2107,7 @@ void Item::ItemContainerDeleteLootItemsFromDB()
|
||||
void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID)
|
||||
{
|
||||
// Deletes a single item associated with an openable item from the DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, itemID);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -2116,7 +2116,7 @@ void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID)
|
||||
void Item::ItemContainerDeleteLootMoneyFromDB()
|
||||
{
|
||||
// Deletes the money loot associated with an openable item from the DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
|
||||
ObjectGuid::LowType ownerid = owner->GetGUID().GetCounter();
|
||||
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
PreparedQueryResult result;
|
||||
|
||||
if (petnumber)
|
||||
@@ -429,7 +429,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
trans = CharacterDatabase.BeginTransaction();
|
||||
// remove current data
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -490,7 +490,7 @@ void Pet::DeleteFromDB(uint32 guidlow)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID);
|
||||
stmt->setUInt32(0, guidlow);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1047,7 +1047,7 @@ uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel) const
|
||||
|
||||
void Pet::_LoadSpellCooldowns()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_COOLDOWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_COOLDOWN);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
PreparedQueryResult cooldownsResult = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void Pet::_LoadSpellCooldowns()
|
||||
|
||||
void Pet::_LoadSpells()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -1086,7 +1086,7 @@ void Pet::_SaveSpells(SQLTransaction& trans)
|
||||
if (itr->second.type == PETSPELL_FAMILY)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
switch (itr->second.state)
|
||||
{
|
||||
@@ -1134,7 +1134,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||
SELECT casterGuid, spell, effectMask, effectIndex, amount, baseAmount FROM pet_aura_effect WHERE guid = ?
|
||||
*/
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_AURA_EFFECT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_AURA_EFFECT);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
|
||||
ObjectGuid casterGuid, itemGuid;
|
||||
@@ -1231,7 +1231,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||
|
||||
void Pet::_SaveAuras(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURA_EFFECTS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURA_EFFECTS);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1296,7 +1296,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
{
|
||||
TC_LOG_ERROR("entities.pet", "Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_PET_SPELL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_PET_SPELL);
|
||||
|
||||
stmt->setUInt32(0, spellId);
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ void CollectionMgr::LoadAccountToys(PreparedQueryResult result)
|
||||
|
||||
void CollectionMgr::SaveAccountToys(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
LoginDatabasePreparedStatement* stmt = nullptr;
|
||||
for (auto const& toy : _toys)
|
||||
{
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_REP_ACCOUNT_TOYS);
|
||||
@@ -203,7 +203,7 @@ void CollectionMgr::LoadAccountHeirlooms(PreparedQueryResult result)
|
||||
|
||||
void CollectionMgr::SaveAccountHeirlooms(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
LoginDatabasePreparedStatement* stmt = nullptr;
|
||||
for (auto const& heirloom : _heirlooms)
|
||||
{
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_REP_ACCOUNT_HEIRLOOMS);
|
||||
@@ -399,7 +399,7 @@ void CollectionMgr::SaveAccountMounts(SQLTransaction& trans)
|
||||
{
|
||||
for (auto const& mount : _mounts)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_REP_ACCOUNT_MOUNTS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_REP_ACCOUNT_MOUNTS);
|
||||
stmt->setUInt32(0, _owner->GetBattlenetAccountId());
|
||||
stmt->setUInt32(1, mount.first);
|
||||
stmt->setUInt8(2, mount.second);
|
||||
@@ -558,7 +558,7 @@ void CollectionMgr::SaveAccountItemAppearances(SQLTransaction& trans)
|
||||
{
|
||||
if (blockValue) // this table is only appended/bits are set (never cleared) so don't save empty blocks
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_ITEM_APPEARANCES);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_ITEM_APPEARANCES);
|
||||
stmt->setUInt32(0, _owner->GetBattlenetAccountId());
|
||||
stmt->setUInt16(1, blockIndex);
|
||||
stmt->setUInt32(2, blockValue);
|
||||
@@ -568,7 +568,7 @@ void CollectionMgr::SaveAccountItemAppearances(SQLTransaction& trans)
|
||||
++blockIndex;
|
||||
}));
|
||||
|
||||
PreparedStatement* stmt;
|
||||
LoginDatabasePreparedStatement* stmt;
|
||||
for (auto itr = _favoriteAppearances.begin(); itr != _favoriteAppearances.end();)
|
||||
{
|
||||
switch (itr->second)
|
||||
|
||||
@@ -1080,7 +1080,7 @@ void Player::Update(uint32 p_time)
|
||||
if (GetSession()->m_muteTime && GetSession()->m_muteTime < now)
|
||||
{
|
||||
GetSession()->m_muteTime = 0;
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
stmt->setInt64(0, 0); // Set the mute time to 0
|
||||
stmt->setString(1, "");
|
||||
stmt->setString(2, "");
|
||||
@@ -2800,7 +2800,7 @@ void Player::AddNewMailDeliverTime(time_t deliver_time)
|
||||
|
||||
void DeleteSpellFromAllPlayers(uint32 spellId)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL_SPELLS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL_SPELLS);
|
||||
stmt->setUInt32(0, spellId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -3816,7 +3816,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
LeaveAllArenaTeams(playerguid);
|
||||
|
||||
// the player was uninvited already on logout so just remove from group
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
|
||||
stmt->setUInt64(0, guid);
|
||||
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -4209,7 +4209,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
|
||||
{
|
||||
TC_LOG_INFO("entities.player", "Player::DeleteOldCharacters: Deleting all characters which have been deleted %u days before...", keepDays);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS);
|
||||
stmt->setUInt32(0, uint32(time(nullptr) - time_t(keepDays * DAY)));
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -4408,7 +4408,7 @@ void Player::KillPlayer()
|
||||
void Player::OfflineResurrect(ObjectGuid const& guid, SQLTransaction& trans)
|
||||
{
|
||||
Corpse::DeleteFromDB(guid, trans);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_RESURRECT));
|
||||
stmt->setUInt64(1, guid.GetCounter());
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
@@ -6613,7 +6613,7 @@ void Player::_LoadCurrency(PreparedQueryResult result)
|
||||
|
||||
void Player::_SaveCurrency(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
for (PlayerCurrenciesMap::iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr)
|
||||
{
|
||||
CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first);
|
||||
@@ -6949,7 +6949,7 @@ void Player::SetInArenaTeam(uint32 ArenaTeamId, uint8 slot, uint8 type)
|
||||
uint32 Player::GetZoneIdFromDB(ObjectGuid guid)
|
||||
{
|
||||
ObjectGuid::LowType guidLow = guid.GetCounter();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_ZONE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_ZONE);
|
||||
stmt->setUInt64(0, guidLow);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -11783,7 +11783,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& pos, uint32 itemId, bool updat
|
||||
for (++itr; itr != allowedLooters.end(); ++itr)
|
||||
ss << ' ' << *itr;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE);
|
||||
stmt->setUInt64(0, item->GetGUID().GetCounter());
|
||||
stmt->setString(1, ss.str());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -12368,7 +12368,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
|
||||
if (pItem->HasItemFlag(ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
|
||||
stmt->setUInt64(0, pItem->GetGUID().GetCounter());
|
||||
|
||||
@@ -15152,7 +15152,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_TRACK);
|
||||
stmt->setUInt32(0, quest_id);
|
||||
stmt->setUInt64(1, GetGUID().GetCounter());
|
||||
stmt->setString(2, GitRevision::GetHash());
|
||||
@@ -15184,7 +15184,7 @@ void Player::CompleteQuest(uint32 quest_id)
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
|
||||
{
|
||||
// prepare Quest Tracker data
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_COMPLETE_TIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_COMPLETE_TIME);
|
||||
stmt->setUInt32(0, quest_id);
|
||||
stmt->setUInt64(1, GetGUID().GetCounter());
|
||||
|
||||
@@ -17473,7 +17473,7 @@ void Player::_LoadBGData(PreparedQueryResult result)
|
||||
|
||||
bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, ObjectGuid guid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -17499,7 +17499,7 @@ void Player::SetHomebind(WorldLocation const& loc, uint32 areaId)
|
||||
m_homebindAreaId = areaId;
|
||||
|
||||
// update sql homebind
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND);
|
||||
stmt->setUInt16(0, m_homebindMapId);
|
||||
stmt->setUInt16(1, m_homebindAreaId);
|
||||
stmt->setFloat (2, m_homebindX);
|
||||
@@ -17591,7 +17591,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
|
||||
if (ObjectMgr::CheckPlayerName(m_name, GetSession()->GetSessionDbcLocale()) != CHAR_NAME_SUCCESS ||
|
||||
(!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME) && sObjectMgr->IsReservedName(m_name)))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
|
||||
stmt->setUInt64(1, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -18801,7 +18801,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
item = NewItemOrBag(proto);
|
||||
if (item->LoadFromDB(itemGuid, GetGUID(), fields, itemEntry))
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
// Do not allow to have item limited to another map/zone in alive state
|
||||
if (IsAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
|
||||
@@ -18921,7 +18921,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
void Player::_LoadMailedItems(Mail* mail)
|
||||
{
|
||||
// data needs to be at first place for Item::LoadFromDB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS);
|
||||
stmt->setUInt32(0, mail->messageID);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
@@ -18992,7 +18992,7 @@ void Player::_LoadMail()
|
||||
{
|
||||
m_mail.clear();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -19437,7 +19437,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
|
||||
|
||||
if (deleteInstance)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID);
|
||||
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, instanceId);
|
||||
@@ -19521,7 +19521,7 @@ void Player::UnbindInstance(BoundInstancesMap::mapped_type::iterator& itr, Bound
|
||||
{
|
||||
if (!unload)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID);
|
||||
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, itr->second.save->GetInstanceId());
|
||||
@@ -19556,7 +19556,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, B
|
||||
// update the save when the group kills a boss
|
||||
if (permanent != bind.perm || save != bind.save || extendState != bind.extendState)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INSTANCE);
|
||||
|
||||
stmt->setUInt32(0, save->GetInstanceId());
|
||||
stmt->setBool(1, permanent);
|
||||
@@ -19569,7 +19569,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, B
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_INSTANCE);
|
||||
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, save->GetInstanceId());
|
||||
@@ -19844,7 +19844,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
|
||||
ok = true;
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -19858,7 +19858,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
|
||||
m_homebindY = info->positionY;
|
||||
m_homebindZ = info->positionZ;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, m_homebindMapId);
|
||||
stmt->setUInt16(2, m_homebindAreaId);
|
||||
@@ -19900,7 +19900,7 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
sScriptMgr->OnPlayerSave(this);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
uint8 index = 0;
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_FISHINGSTEPS);
|
||||
@@ -20260,21 +20260,21 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
GetSession()->GetCollectionMgr()->SaveAccountMounts(trans);
|
||||
GetSession()->GetCollectionMgr()->SaveAccountItemAppearances(trans);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_BNET_LAST_PLAYER_CHARACTERS);
|
||||
stmt->setUInt32(0, GetSession()->GetAccountId());
|
||||
stmt->setUInt8(1, realm.Id.Region);
|
||||
stmt->setUInt8(2, realm.Id.Site);
|
||||
trans->Append(stmt);
|
||||
LoginDatabasePreparedStatement* loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_BNET_LAST_PLAYER_CHARACTERS);
|
||||
loginStmt->setUInt32(0, GetSession()->GetAccountId());
|
||||
loginStmt->setUInt8(1, realm.Id.Region);
|
||||
loginStmt->setUInt8(2, realm.Id.Site);
|
||||
trans->Append(loginStmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_LAST_PLAYER_CHARACTERS);
|
||||
stmt->setUInt32(0, GetSession()->GetAccountId());
|
||||
stmt->setUInt8(1, realm.Id.Region);
|
||||
stmt->setUInt8(2, realm.Id.Site);
|
||||
stmt->setUInt32(3, realm.Id.Realm);
|
||||
stmt->setString(4, GetName());
|
||||
stmt->setUInt64(5, GetGUID().GetCounter());
|
||||
stmt->setUInt32(6, time(nullptr));
|
||||
trans->Append(stmt);
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_LAST_PLAYER_CHARACTERS);
|
||||
loginStmt->setUInt32(0, GetSession()->GetAccountId());
|
||||
loginStmt->setUInt8(1, realm.Id.Region);
|
||||
loginStmt->setUInt8(2, realm.Id.Site);
|
||||
loginStmt->setUInt32(3, realm.Id.Realm);
|
||||
loginStmt->setString(4, GetName());
|
||||
loginStmt->setUInt64(5, GetGUID().GetCounter());
|
||||
loginStmt->setUInt32(6, time(nullptr));
|
||||
trans->Append(loginStmt);
|
||||
|
||||
LoginDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -20293,7 +20293,7 @@ void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans)
|
||||
|
||||
void Player::SaveGoldToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_MONEY);
|
||||
stmt->setUInt64(0, GetMoney());
|
||||
stmt->setUInt64(1, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -20301,7 +20301,7 @@ void Player::SaveGoldToDB(SQLTransaction& trans) const
|
||||
|
||||
void Player::_SaveActions(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end();)
|
||||
{
|
||||
@@ -20349,7 +20349,7 @@ void Player::_SaveActions(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveAuras(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_EFFECT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_EFFECT);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20404,7 +20404,7 @@ void Player::_SaveAuras(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveInventory(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
// force items in buyback slots to new state
|
||||
// and remove those that aren't already
|
||||
for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i)
|
||||
@@ -20529,7 +20529,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveVoidStorage(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i)
|
||||
{
|
||||
@@ -20566,7 +20566,7 @@ void Player::_SaveVoidStorage(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveCUFProfiles(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i)
|
||||
{
|
||||
if (!_CUFProfiles[i]) // unused profile
|
||||
@@ -20605,7 +20605,7 @@ void Player::_SaveMail(SQLTransaction& trans)
|
||||
if (!m_mailsLoaded)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
|
||||
{
|
||||
@@ -20681,7 +20681,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans)
|
||||
|
||||
QuestStatusSaveMap::iterator saveItr;
|
||||
QuestStatusMap::iterator statusItr;
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
bool keepAbandoned = !(sWorld->GetCleaningFlags() & CharacterDatabaseCleaner::CLEANING_FLAG_QUESTSTATUS);
|
||||
|
||||
@@ -20766,7 +20766,7 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans)
|
||||
// save last daily quest time for all quests: we need only mostly reset time for reset check anyway
|
||||
|
||||
// we don't need transactions here.
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_DAILY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_DAILY);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20798,7 +20798,7 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans)
|
||||
return;
|
||||
|
||||
// we don't need transactions here.
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20821,7 +20821,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans)
|
||||
return;
|
||||
|
||||
// we don't need transactions here.
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_SEASONAL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_SEASONAL);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20850,7 +20850,7 @@ void Player::_SaveMonthlyQuestStatus(SQLTransaction& trans)
|
||||
return;
|
||||
|
||||
// we don't need transactions here.
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_MONTHLY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_MONTHLY);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20869,7 +20869,7 @@ void Player::_SaveMonthlyQuestStatus(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveSkills(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
// we don't need transactions here.
|
||||
for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end();)
|
||||
{
|
||||
@@ -20917,7 +20917,7 @@ void Player::_SaveSkills(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveSpells(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();)
|
||||
{
|
||||
@@ -20961,7 +20961,7 @@ void Player::_SaveStats(SQLTransaction& trans) const
|
||||
if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_STATS);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
@@ -21060,7 +21060,7 @@ bool Player::CanSpeak() const
|
||||
|
||||
void Player::SavePositionInDB(WorldLocation const& loc, uint16 zoneId, ObjectGuid guid, SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION);
|
||||
|
||||
stmt->setFloat(0, loc.GetPositionX());
|
||||
stmt->setFloat(1, loc.GetPositionY());
|
||||
@@ -21966,7 +21966,7 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const
|
||||
|
||||
void Player::RemovePetitionsAndSigns(ObjectGuid guid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -26555,7 +26555,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
|
||||
for (EquipmentSetContainer::iterator itr = _equipmentSets.begin(); itr != _equipmentSets.end();)
|
||||
{
|
||||
EquipmentSetInfo& eqSet = itr->second;
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
uint8 j = 0;
|
||||
switch (eqSet.State)
|
||||
{
|
||||
@@ -26645,7 +26645,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveBGData(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
/* guid, bgInstanceID, bgTeam, x, y, z, o, map, taxi[0], taxi[1], mountSpell */
|
||||
@@ -26686,7 +26686,7 @@ void Player::RemoveAtLoginFlag(AtLoginFlags flags, bool persist /*= false*/)
|
||||
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_AT_LOGIN_FLAG);
|
||||
|
||||
stmt->setUInt16(0, uint16(flags));
|
||||
stmt->setUInt64(1, GetGUID().GetCounter());
|
||||
@@ -26738,7 +26738,7 @@ void Player::_LoadGlyphs(PreparedQueryResult result)
|
||||
|
||||
void Player::_SaveGlyphs(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -26785,7 +26785,7 @@ void Player::_LoadPvpTalents(PreparedQueryResult result)
|
||||
|
||||
void Player::_SaveTalents(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -26976,7 +26976,7 @@ void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
|
||||
|
||||
// load them asynchronously
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC);
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, GetActiveTalentGroup());
|
||||
|
||||
@@ -27306,7 +27306,7 @@ void Player::SetRandomWinner(bool isWinner)
|
||||
m_IsBGRandomWinner = isWinner;
|
||||
if (m_IsBGRandomWinner)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BATTLEGROUND_RANDOM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BATTLEGROUND_RANDOM);
|
||||
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
|
||||
@@ -27359,7 +27359,7 @@ void Player::_SaveInstanceTimeRestrictions(SQLTransaction& trans)
|
||||
if (_instanceResetTimes.empty())
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES);
|
||||
stmt->setUInt32(0, GetSession()->GetAccountId());
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag
|
||||
{
|
||||
itr->second.Flags |= flag;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS);
|
||||
|
||||
stmt->setUInt8(0, itr->second.Flags);
|
||||
stmt->setUInt64(1, GetPlayerGUID().GetCounter());
|
||||
@@ -58,7 +58,7 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag
|
||||
{
|
||||
_playerSocialMap[friendGuid].Flags |= flag;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL);
|
||||
|
||||
stmt->setUInt64(0, GetPlayerGUID().GetCounter());
|
||||
stmt->setUInt64(1, friendGuid.GetCounter());
|
||||
@@ -80,7 +80,7 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, SocialFlag
|
||||
|
||||
if (!itr->second.Flags)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SOCIAL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SOCIAL);
|
||||
|
||||
stmt->setUInt64(0, GetPlayerGUID().GetCounter());
|
||||
stmt->setUInt64(1, friendGuid.GetCounter());
|
||||
@@ -91,7 +91,7 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, SocialFlag
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS);
|
||||
|
||||
stmt->setUInt8(0, itr->second.Flags);
|
||||
stmt->setUInt64(1, GetPlayerGUID().GetCounter());
|
||||
@@ -110,7 +110,7 @@ void PlayerSocial::SetFriendNote(ObjectGuid const& friendGuid, std::string const
|
||||
itr->second.Note = note;
|
||||
utf8truncate(itr->second.Note, 48); // DB and client size limitation
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_NOTE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_NOTE);
|
||||
|
||||
stmt->setString(0, itr->second.Note);
|
||||
stmt->setUInt64(1, GetPlayerGUID().GetCounter());
|
||||
|
||||
@@ -203,7 +203,7 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
||||
itr->second.done = 0;
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE);
|
||||
stmt->setUInt8(0, uint8(event_id));
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1575,7 +1575,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id)
|
||||
// save the change to db
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_CONDITION_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_CONDITION_SAVE);
|
||||
stmt->setUInt8(0, uint8(event_id));
|
||||
stmt->setUInt32(1, condition);
|
||||
trans->Append(stmt);
|
||||
@@ -1620,7 +1620,7 @@ void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_SAVE);
|
||||
stmt->setUInt8(0, uint8(event_id));
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ void Garrison::SaveToDB(SQLTransaction trans)
|
||||
{
|
||||
DeleteFromDB(_owner->GetGUID().GetCounter(), trans);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_GARRISON);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_GARRISON);
|
||||
stmt->setUInt64(0, _owner->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, _siteLevel->ID);
|
||||
stmt->setUInt32(2, _followerActivationsRemainingToday);
|
||||
@@ -206,7 +206,7 @@ void Garrison::SaveToDB(SQLTransaction trans)
|
||||
|
||||
void Garrison::DeleteFromDB(ObjectGuid::LowType ownerGuid, SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_GARRISON);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_GARRISON);
|
||||
stmt->setUInt64(0, ownerGuid);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -1758,7 +1758,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid
|
||||
if (!linkedGuidLow) // we're removing the linking
|
||||
{
|
||||
_linkedRespawnStore.erase(guid);
|
||||
PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CRELINKED_RESPAWN);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CRELINKED_RESPAWN);
|
||||
stmt->setUInt64(0, guidLow);
|
||||
WorldDatabase.Execute(stmt);
|
||||
return true;
|
||||
@@ -1788,7 +1788,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid
|
||||
ObjectGuid linkedGuid = ObjectGuid::Create<HighGuid::Creature>(slave->mapid, slave->id, linkedGuidLow);
|
||||
|
||||
_linkedRespawnStore[guid] = linkedGuid;
|
||||
PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CREATURE_LINKED_RESPAWN);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CREATURE_LINKED_RESPAWN);
|
||||
stmt->setUInt64(0, guidLow);
|
||||
stmt->setUInt64(1, linkedGuidLow);
|
||||
WorldDatabase.Execute(stmt);
|
||||
@@ -2135,7 +2135,7 @@ void ObjectMgr::LoadCreatures()
|
||||
PhasingHandler::InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
sMapMgr->GetZoneAndAreaId(phaseShift, zoneId, areaId, data.mapid, data.posX, data.posY, data.posZ);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA);
|
||||
|
||||
stmt->setUInt32(0, zoneId);
|
||||
stmt->setUInt32(1, areaId);
|
||||
@@ -2504,7 +2504,7 @@ void ObjectMgr::LoadGameobjects()
|
||||
PhasingHandler::InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
sMapMgr->GetZoneAndAreaId(phaseShift, zoneId, areaId, data.mapid, data.posX, data.posY, data.posZ);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
||||
|
||||
stmt->setUInt32(0, zoneId);
|
||||
stmt->setUInt32(1, areaId);
|
||||
@@ -5328,7 +5328,7 @@ void ObjectMgr::LoadWaypointScripts()
|
||||
for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr)
|
||||
actionSet.insert(itr->first);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_ACTION);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_ACTION);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
@@ -5801,11 +5801,11 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
// Delete all old mails without item and without body immediately, if starting server
|
||||
if (!serverUp)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EMPTY_EXPIRED_MAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EMPTY_EXPIRED_MAIL);
|
||||
stmt->setUInt64(0, basetime);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
|
||||
stmt->setUInt64(0, basetime);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
@@ -6486,7 +6486,7 @@ bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool per
|
||||
// add link to DB
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GRAVEYARD_ZONE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GRAVEYARD_ZONE);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, zoneId);
|
||||
@@ -6537,7 +6537,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
|
||||
// remove link from DB
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GRAVEYARD_ZONE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GRAVEYARD_ZONE);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, zoneId);
|
||||
@@ -8486,7 +8486,7 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
|
||||
|
||||
_gameTeleStore[new_id] = tele;
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAME_TELE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAME_TELE);
|
||||
|
||||
stmt->setUInt32(0, new_id);
|
||||
stmt->setFloat(1, tele.position_x);
|
||||
@@ -8515,7 +8515,7 @@ bool ObjectMgr::DeleteGameTele(const std::string& name)
|
||||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_TELE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_TELE);
|
||||
|
||||
stmt->setString(0, itr->second.name);
|
||||
|
||||
@@ -8736,7 +8736,7 @@ void ObjectMgr::LoadCreatureDefaultTrainers()
|
||||
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
|
||||
{
|
||||
// find all items from the reference vendor
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF);
|
||||
stmt->setUInt32(0, uint32(item));
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
@@ -8988,7 +8988,7 @@ void ObjectMgr::AddVendorItem(uint32 entry, VendorItem const& vItem, bool persis
|
||||
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENDOR);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENDOR);
|
||||
|
||||
stmt->setUInt32(0, entry);
|
||||
stmt->setUInt32(1, vItem.item);
|
||||
@@ -9012,7 +9012,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool per
|
||||
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_NPC_VENDOR);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_NPC_VENDOR);
|
||||
|
||||
stmt->setUInt32(0, entry);
|
||||
stmt->setUInt32(1, item);
|
||||
|
||||
@@ -145,7 +145,7 @@ bool Group::Create(Player* leader)
|
||||
sGroupMgr->RegisterGroupDbStoreId(m_dbStoreId, this);
|
||||
|
||||
// Store group in database
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP);
|
||||
|
||||
uint8 index = 0;
|
||||
|
||||
@@ -219,7 +219,7 @@ void Group::LoadMemberFromDB(ObjectGuid::LowType guidLow, uint8 memberFlags, uin
|
||||
// skip non-existed member
|
||||
if (!sCharacterCache->GetCharacterNameAndClassByGUID(member.guid, member.name, member._class))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt64(0, guidLow);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return;
|
||||
@@ -244,7 +244,7 @@ void Group::ConvertToLFG()
|
||||
m_lootMethod = GROUP_LOOT;
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_groupFlags));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -263,7 +263,7 @@ void Group::ConvertToRaid()
|
||||
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_groupFlags));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -294,7 +294,7 @@ void Group::ConvertToGroup()
|
||||
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_groupFlags));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -437,7 +437,7 @@ bool Group::AddMember(Player* player)
|
||||
// insert into the table if we're not a battleground group
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER);
|
||||
|
||||
stmt->setUInt32(0, m_dbStoreId);
|
||||
stmt->setUInt64(1, member.guid.GetCounter());
|
||||
@@ -586,7 +586,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
|
||||
// Remove player from group in DB
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
DelinkMember(guid);
|
||||
@@ -703,7 +703,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid, int8 partyIndex)
|
||||
// forcing a new instance with another leader requires group disbanding (confirmed on retail)
|
||||
if (itr->second.perm && !sMapMgr->FindMap(itr->first, itr->second.save->GetInstanceId()))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_PERM_BINDING);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_PERM_BINDING);
|
||||
stmt->setUInt32(0, m_dbStoreId);
|
||||
stmt->setUInt32(1, itr->second.save->GetInstanceId());
|
||||
trans->Append(stmt);
|
||||
@@ -720,7 +720,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid, int8 partyIndex)
|
||||
Group::ConvertLeaderInstancesToGroup(newLeader, this, true);
|
||||
|
||||
// Update the group leader
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEADER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEADER);
|
||||
|
||||
stmt->setUInt64(0, newLeader->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -827,7 +827,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP);
|
||||
stmt->setUInt32(0, m_dbStoreId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1611,7 +1611,7 @@ bool Group::_setMembersGroup(ObjectGuid guid, uint8 group)
|
||||
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
|
||||
stmt->setUInt8(0, group);
|
||||
stmt->setUInt64(1, guid.GetCounter());
|
||||
@@ -1662,7 +1662,7 @@ void Group::ChangeMembersGroup(ObjectGuid guid, uint8 group)
|
||||
// Preserve new sub group in database for non-raid groups
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
|
||||
stmt->setUInt8(0, group);
|
||||
stmt->setUInt64(1, guid.GetCounter());
|
||||
@@ -1710,7 +1710,7 @@ void Group::SwapMembersGroups(ObjectGuid firstGuid, ObjectGuid secondGuid)
|
||||
// Preserve new sub group in database for non-raid groups
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
|
||||
stmt->setUInt8(0, slots[i]->group);
|
||||
stmt->setUInt64(1, slots[i]->guid.GetCounter());
|
||||
@@ -1931,7 +1931,7 @@ void Group::SetDungeonDifficultyID(Difficulty difficulty)
|
||||
m_dungeonDifficulty = difficulty;
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_dungeonDifficulty));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -1955,7 +1955,7 @@ void Group::SetRaidDifficultyID(Difficulty difficulty)
|
||||
m_raidDifficulty = difficulty;
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_raidDifficulty));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -1979,7 +1979,7 @@ void Group::SetLegacyRaidDifficultyID(Difficulty difficulty)
|
||||
m_legacyRaidDifficulty = difficulty;
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEGACY_RAID_DIFFICULTY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEGACY_RAID_DIFFICULTY);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_legacyRaidDifficulty));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -2093,7 +2093,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, bool isLegacy, Player* Sen
|
||||
instanceSave->DeleteFromDB();
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE);
|
||||
|
||||
stmt->setUInt32(0, instanceSave->GetInstanceId());
|
||||
|
||||
@@ -2156,7 +2156,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, boo
|
||||
InstanceGroupBind& bind = m_boundInstances[save->GetDifficultyID()][save->GetMapId()];
|
||||
if (!load && (!bind.save || permanent != bind.perm || save != bind.save))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GROUP_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GROUP_INSTANCE);
|
||||
|
||||
stmt->setUInt32(0, m_dbStoreId);
|
||||
stmt->setUInt32(1, save->GetInstanceId());
|
||||
@@ -2192,7 +2192,7 @@ void Group::UnbindInstance(uint32 mapid, uint8 difficulty, bool unload)
|
||||
{
|
||||
if (!unload)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_GUID);
|
||||
|
||||
stmt->setUInt32(0, m_dbStoreId);
|
||||
stmt->setUInt32(1, itr->second.save->GetInstanceId());
|
||||
@@ -2587,7 +2587,7 @@ void Group::SetGroupMemberFlag(ObjectGuid guid, bool apply, GroupMemberFlags fla
|
||||
ToggleGroupMemberFlag(slot, flag, apply);
|
||||
|
||||
// Preserve the new setting in the db
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG);
|
||||
|
||||
stmt->setUInt8(0, slot->flags);
|
||||
stmt->setUInt64(1, guid.GetCounter());
|
||||
|
||||
@@ -122,7 +122,7 @@ inline uint32 Guild::LogHolder::GetNextGUID()
|
||||
// EventLogEntry
|
||||
void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt32(1, m_guid);
|
||||
trans->Append(stmt);
|
||||
@@ -158,7 +158,7 @@ void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
uint8 index = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_EVENTLOG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_EVENTLOG);
|
||||
stmt->setUInt64( index, m_guildId);
|
||||
stmt->setUInt32(++index, m_guid);
|
||||
stmt->setUInt8 (++index, m_bankTabId);
|
||||
@@ -212,7 +212,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPackets::Guild:: GuildBankLogQue
|
||||
void Guild::NewsLogEntry::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
uint8 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_NEWS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_NEWS);
|
||||
stmt->setUInt64( index, m_guildId);
|
||||
stmt->setUInt32(++index, GetGUID());
|
||||
stmt->setUInt8 (++index, GetType());
|
||||
@@ -260,7 +260,7 @@ void Guild::RankInfo::LoadFromDB(Field* fields)
|
||||
|
||||
void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_RANK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_RANK);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt8 (1, m_rankId);
|
||||
stmt->setString(2, m_name);
|
||||
@@ -284,7 +284,7 @@ void Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 tabs, SQLTransaction& tran
|
||||
if (logOnCreate)
|
||||
TC_LOG_ERROR("guild", "Guild " UI64FMTD " has broken Tab %u for rank %u. Created default tab.", m_guildId, i, m_rankId);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt8(1, i);
|
||||
stmt->setUInt8(2, m_rankId);
|
||||
@@ -301,7 +301,7 @@ void Guild::RankInfo::SetName(std::string const& name)
|
||||
|
||||
m_name = name;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_NAME);
|
||||
stmt->setString(0, m_name);
|
||||
stmt->setUInt8 (1, m_rankId);
|
||||
stmt->setUInt64(2, m_guildId);
|
||||
@@ -318,7 +318,7 @@ void Guild::RankInfo::SetRights(uint32 rights)
|
||||
|
||||
m_rights = rights;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_RIGHTS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_RIGHTS);
|
||||
stmt->setUInt32(0, m_rights);
|
||||
stmt->setUInt8 (1, m_rankId);
|
||||
stmt->setUInt64(2, m_guildId);
|
||||
@@ -332,7 +332,7 @@ void Guild::RankInfo::SetBankMoneyPerDay(uint32 money)
|
||||
|
||||
m_bankMoneyPerDay = money;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_BANK_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_BANK_MONEY);
|
||||
stmt->setUInt32(0, money);
|
||||
stmt->setUInt8 (1, m_rankId);
|
||||
stmt->setUInt64(2, m_guildId);
|
||||
@@ -349,7 +349,7 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAnd
|
||||
|
||||
if (saveToDB)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt8 (1, guildBR.GetTabId());
|
||||
stmt->setUInt8 (2, m_rankId);
|
||||
@@ -395,7 +395,7 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields)
|
||||
{
|
||||
TC_LOG_ERROR("guild", "Item (GUID " UI64FMTD ", id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt8 (1, m_tabId);
|
||||
stmt->setUInt8 (2, slotId);
|
||||
@@ -434,7 +434,7 @@ void Guild::BankTab::SetInfo(std::string const& name, std::string const& icon)
|
||||
m_name = name;
|
||||
m_icon = icon;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_TAB_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_TAB_INFO);
|
||||
stmt->setString(0, m_name);
|
||||
stmt->setString(1, m_icon);
|
||||
stmt->setUInt64(2, m_guildId);
|
||||
@@ -450,7 +450,7 @@ void Guild::BankTab::SetText(std::string const& text)
|
||||
m_text = text;
|
||||
utf8truncate(m_text, MAX_GUILD_BANK_TAB_TEXT_LEN); // DB and client size limitation
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_TAB_TEXT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_TAB_TEXT);
|
||||
stmt->setString(0, m_text);
|
||||
stmt->setUInt64(1, m_guildId);
|
||||
stmt->setUInt8 (2, m_tabId);
|
||||
@@ -466,7 +466,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item)
|
||||
|
||||
m_items[slotId] = item;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_ITEM);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt8 (1, m_tabId);
|
||||
stmt->setUInt8 (2, slotId);
|
||||
@@ -560,7 +560,7 @@ void Guild::Member::SetPublicNote(std::string const& publicNote)
|
||||
|
||||
m_publicNote = publicNote;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_PNOTE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_PNOTE);
|
||||
stmt->setString(0, publicNote);
|
||||
stmt->setUInt64(1, m_guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -573,7 +573,7 @@ void Guild::Member::SetOfficerNote(std::string const& officerNote)
|
||||
|
||||
m_officerNote = officerNote;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_OFFNOTE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_OFFNOTE);
|
||||
stmt->setString(0, officerNote);
|
||||
stmt->setUInt64(1, m_guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -587,7 +587,7 @@ void Guild::Member::ChangeRank(SQLTransaction& trans, uint8 newRank)
|
||||
if (Player* player = FindConnectedPlayer())
|
||||
player->SetGuildRank(newRank);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK);
|
||||
stmt->setUInt8 (0, newRank);
|
||||
stmt->setUInt64(1, m_guid.GetCounter());
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
@@ -595,7 +595,7 @@ void Guild::Member::ChangeRank(SQLTransaction& trans, uint8 newRank)
|
||||
|
||||
void Guild::Member::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER);
|
||||
stmt->setUInt64(0, m_guildId);
|
||||
stmt->setUInt64(1, m_guid.GetCounter());
|
||||
stmt->setUInt8 (2, m_rankId);
|
||||
@@ -671,7 +671,7 @@ void Guild::Member::UpdateBankTabWithdrawValue(SQLTransaction& trans, uint8 tabI
|
||||
{
|
||||
m_bankWithdraw[tabId] += amount;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW_TABS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW_TABS);
|
||||
stmt->setUInt64(0, m_guid.GetCounter());
|
||||
for (uint8 i = 0; i < GUILD_BANK_MAX_TABS;)
|
||||
{
|
||||
@@ -687,7 +687,7 @@ void Guild::Member::UpdateBankMoneyWithdrawValue(SQLTransaction& trans, uint64 a
|
||||
{
|
||||
m_bankWithdrawMoney += amount;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW_MONEY);
|
||||
stmt->setUInt64(0, m_guid.GetCounter());
|
||||
stmt->setUInt64(1, m_bankWithdrawMoney);
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
@@ -748,7 +748,7 @@ bool EmblemInfo::LoadFromDB(Field* fields)
|
||||
|
||||
void EmblemInfo::SaveToDB(ObjectGuid::LowType guildId) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_EMBLEM_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_EMBLEM_INFO);
|
||||
stmt->setUInt32(0, m_style);
|
||||
stmt->setUInt32(1, m_color);
|
||||
stmt->setUInt32(2, m_borderStyle);
|
||||
@@ -1155,7 +1155,7 @@ bool Guild::Create(Player* pLeader, std::string const& name)
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBERS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBERS);
|
||||
stmt->setUInt64(0, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1209,7 +1209,7 @@ void Guild::Disband()
|
||||
DeleteMember(trans, itr->second->GetGUID(), true);
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD);
|
||||
stmt->setUInt64(0, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1295,7 +1295,7 @@ bool Guild::SetName(std::string const& name)
|
||||
return false;
|
||||
|
||||
m_name = name;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_NAME);
|
||||
stmt->setString(0, m_name);
|
||||
stmt->setUInt64(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -1465,7 +1465,7 @@ void Guild::HandleSetMOTD(WorldSession* session, std::string const& motd)
|
||||
|
||||
sScriptMgr->OnGuildMOTDChanged(this, motd);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MOTD);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MOTD);
|
||||
stmt->setString(0, motd);
|
||||
stmt->setUInt64(1, m_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -1486,7 +1486,7 @@ void Guild::HandleSetInfo(WorldSession* session, std::string const& info)
|
||||
|
||||
sScriptMgr->OnGuildInfoChanged(this, info);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_INFO);
|
||||
stmt->setString(0, info);
|
||||
stmt->setUInt64(1, m_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -1924,7 +1924,7 @@ void Guild::HandleRemoveRank(WorldSession* session, uint8 rankId)
|
||||
return;
|
||||
|
||||
// Delete bank rights for rank
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK);
|
||||
stmt->setUInt64(0, m_id);
|
||||
stmt->setUInt8(1, rankId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -2674,7 +2674,7 @@ bool Guild::AddMember(SQLTransaction& trans, ObjectGuid guid, uint8 rankId)
|
||||
|
||||
bool ok = false;
|
||||
// Player must exist
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD);
|
||||
stmt->setUInt64(0, lowguid);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
{
|
||||
@@ -2851,7 +2851,7 @@ bool Guild::_HasRankRight(Player const* player, uint32 right) const
|
||||
|
||||
void Guild::_DeleteMemberFromDB(SQLTransaction& trans, ObjectGuid::LowType lowguid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
|
||||
stmt->setUInt64(0, lowguid);
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
}
|
||||
@@ -2872,7 +2872,7 @@ void Guild::_CreateNewBankTab()
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_TAB);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_TAB);
|
||||
stmt->setUInt64(0, m_id);
|
||||
stmt->setUInt8 (1, tabId);
|
||||
trans->Append(stmt);
|
||||
@@ -2893,7 +2893,7 @@ void Guild::_CreateDefaultGuildRanks(SQLTransaction& trans, LocaleConstant loc)
|
||||
{
|
||||
ASSERT(trans);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANKS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANKS);
|
||||
stmt->setUInt64(0, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -2978,7 +2978,7 @@ bool Guild::_ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add)
|
||||
m_bankMoney -= amount;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_MONEY);
|
||||
stmt->setUInt64(0, m_bankMoney);
|
||||
stmt->setUInt64(1, m_id);
|
||||
trans->Append(stmt);
|
||||
@@ -2997,7 +2997,7 @@ void Guild::_SetLeader(SQLTransaction& trans, Member* leader)
|
||||
m_leaderGuid = leader->GetGUID();
|
||||
leader->ChangeRank(trans, GR_GUILDMASTER);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
|
||||
stmt->setUInt64(0, m_leaderGuid.GetCounter());
|
||||
stmt->setUInt64(1, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -133,7 +133,7 @@ void GuildFinderMgr::AddMembershipRequest(ObjectGuid const& guildGuid, Membershi
|
||||
_membershipRequestsByPlayer[request.GetPlayerGUID()][guildGuid] = request;
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt64(0, request.GetGuildGuid().GetCounter());
|
||||
stmt->setUInt64(1, request.GetPlayerGUID().GetCounter());
|
||||
stmt->setUInt8(2, request.GetAvailability());
|
||||
@@ -162,7 +162,7 @@ void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(ObjectGuid const& pla
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
for (auto& guildRequestPair : playerItr->second)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt64(0, guildRequestPair.first.GetCounter());
|
||||
stmt->setUInt64(1, playerId.GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -205,7 +205,7 @@ void GuildFinderMgr::RemoveMembershipRequest(ObjectGuid const& playerId, ObjectG
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt64(0, guildId.GetCounter());
|
||||
stmt->setUInt64(1, playerId.GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -287,7 +287,7 @@ void GuildFinderMgr::SetGuildSettings(ObjectGuid const& guildGuid, LFGuildSettin
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_GUILD_SETTINGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_GUILD_SETTINGS);
|
||||
stmt->setUInt64(0, settings.GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, settings.GetAvailability());
|
||||
stmt->setUInt8(2, settings.GetClassRoles());
|
||||
@@ -308,7 +308,7 @@ void GuildFinderMgr::DeleteGuild(ObjectGuid const& guildId)
|
||||
{
|
||||
for (auto playerRequestPair : guildItr->second)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt64(0, guildId.GetCounter());
|
||||
stmt->setUInt64(1, playerRequestPair.first.GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -327,7 +327,7 @@ void GuildFinderMgr::DeleteGuild(ObjectGuid const& guildId)
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS);
|
||||
stmt->setUInt64(0, guildId.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ void GuildMgr::LoadGuilds()
|
||||
PreparedQueryResult criteriaResult;
|
||||
for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT);
|
||||
stmt->setUInt64(0, itr->first);
|
||||
achievementResult = CharacterDatabase.Query(stmt);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA);
|
||||
@@ -530,7 +530,7 @@ void GuildMgr::LoadGuildRewards()
|
||||
continue;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS);
|
||||
stmt->setUInt32(0, reward.ItemID);
|
||||
PreparedQueryResult reqAchievementResult = WorldDatabase.Query(stmt);
|
||||
if (reqAchievementResult)
|
||||
|
||||
@@ -457,7 +457,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPackets::AuctionHouse::AuctionPlac
|
||||
auction->bid = packet.BidAmount;
|
||||
GetPlayer()->UpdateCriteria(CRITERIA_TYPE_HIGHEST_AUCTION_BID, packet.BidAmount);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||
stmt->setUInt64(0, auction->bidder);
|
||||
stmt->setUInt64(1, auction->bid);
|
||||
stmt->setUInt32(2, auction->Id);
|
||||
|
||||
@@ -83,7 +83,7 @@ bool LoginQueryHolder::Initialize()
|
||||
bool res = true;
|
||||
ObjectGuid::LowType lowGuid = m_guid.GetCounter();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_FROM, stmt);
|
||||
|
||||
@@ -322,7 +322,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
|
||||
|
||||
if (!(charInfo.CustomizationFlag == CHAR_CUSTOMIZE_FLAG_CUSTOMIZE))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
|
||||
stmt->setUInt64(1, charInfo.Guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -368,7 +368,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
|
||||
void WorldSession::HandleCharEnumOpcode(WorldPackets::Character::EnumCharacters& /*enumCharacters*/)
|
||||
{
|
||||
// remove expired bans
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
/// get all the data necessary for loading all characters (along with their pets) on the account
|
||||
@@ -414,7 +414,7 @@ void WorldSession::HandleCharUndeleteEnum(PreparedQueryResult result)
|
||||
void WorldSession::HandleCharUndeleteEnumOpcode(WorldPackets::Character::EnumCharacters& /*enumCharacters*/)
|
||||
{
|
||||
/// get all the data necessary for loading all undeleted characters (along with their pets) on the account
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_UNDELETE_ENUM_DECLINED_NAME);
|
||||
else
|
||||
@@ -549,7 +549,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
}
|
||||
|
||||
std::shared_ptr<WorldPackets::Character::CharacterCreateInfo> createInfo = charCreate.CreateInfo;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
stmt->setString(0, charCreate.CreateInfo->Name);
|
||||
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -561,7 +561,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SUM_REALM_CHARACTERS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SUM_REALM_CHARACTERS);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
queryCallback.SetNextQuery(LoginDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -580,7 +580,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
queryCallback.SetNextQuery(CharacterDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -722,7 +722,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
|
||||
SQLTransaction trans = LoginDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
stmt->setUInt32(1, realm.Id.Realm);
|
||||
trans->Append(stmt);
|
||||
@@ -750,7 +750,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CREATE_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CREATE_INFO);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
stmt->setUInt32(1, (skipCinematics == 1 || createInfo->Class == CLASS_DEMON_HUNTER) ? 12 : 1);
|
||||
queryCallback.WithPreparedCallback(std::move(finalizeCharacterCreation)).SetNextQuery(CharacterDatabase.AsyncQuery(stmt));
|
||||
@@ -1022,13 +1022,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
|
||||
pCurrChar->SendInitialPacketsAfterAddToMap();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE);
|
||||
stmt->setUInt64(0, pCurrChar->GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_ONLINE);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
LoginDatabase.Execute(stmt);
|
||||
LoginDatabasePreparedStatement* loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_ONLINE);
|
||||
loginStmt->setUInt32(0, GetAccountId());
|
||||
LoginDatabase.Execute(loginStmt);
|
||||
|
||||
pCurrChar->SetInGameTime(getMSTime());
|
||||
|
||||
@@ -1065,12 +1065,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
|
||||
{
|
||||
// Delete all of the player's pet spells
|
||||
PreparedStatement* stmtSpells = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PET_SPELLS_BY_OWNER);
|
||||
CharacterDatabasePreparedStatement* stmtSpells = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PET_SPELLS_BY_OWNER);
|
||||
stmtSpells->setUInt64(0, pCurrChar->GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmtSpells);
|
||||
|
||||
// Then reset all of the player's pet specualizations
|
||||
PreparedStatement* stmtSpec = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PET_SPECS_BY_OWNER);
|
||||
CharacterDatabasePreparedStatement* stmtSpec = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PET_SPECS_BY_OWNER);
|
||||
stmtSpec->setUInt64(0, pCurrChar->GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmtSpec);
|
||||
}
|
||||
@@ -1271,7 +1271,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPackets::Character::CharacterRena
|
||||
}
|
||||
|
||||
// Ensure that there is no character with the desired new name
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_FREE_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_FREE_NAME);
|
||||
stmt->setUInt64(0, request.RenameInfo->Guid.GetCounter());
|
||||
stmt->setString(1, request.RenameInfo->NewName);
|
||||
|
||||
@@ -1304,7 +1304,7 @@ void WorldSession::HandleCharRenameCallBack(std::shared_ptr<WorldPackets::Charac
|
||||
ObjectGuid::LowType lowGuid = renameInfo->Guid.GetCounter();
|
||||
|
||||
// Update name and at_login flag in the db
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN);
|
||||
stmt->setString(0, renameInfo->NewName);
|
||||
stmt->setUInt16(1, atLoginFlags);
|
||||
stmt->setUInt64(2, lowGuid);
|
||||
@@ -1370,7 +1370,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPackets::Character::SetPlay
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
stmt->setUInt64(0, packet.Player.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1481,7 +1481,7 @@ void WorldSession::HandleCharCustomizeOpcode(WorldPackets::Character::CharCustom
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUSTOMIZE_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUSTOMIZE_INFO);
|
||||
stmt->setUInt64(0, packet.CustomizeInfo->CharGUID.GetCounter());
|
||||
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -1559,7 +1559,7 @@ void WorldSession::HandleCharCustomizeCallback(std::shared_ptr<WorldPackets::Cha
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
ObjectGuid::LowType lowGuid = customizeInfo->CharGUID.GetCounter();
|
||||
@@ -1766,7 +1766,7 @@ void WorldSession::HandleCharRaceOrFactionChangeOpcode(WorldPackets::Character::
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS);
|
||||
stmt->setUInt64(0, packet.RaceOrFactionChangeInfo->Guid.GetCounter());
|
||||
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -1882,7 +1882,7 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr<WorldPa
|
||||
// All checks are fine, deal with race change now
|
||||
ObjectGuid::LowType lowGuid = factionChangeInfo->Guid.GetCounter();
|
||||
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
// resurrect the character in case he's dead
|
||||
@@ -2325,7 +2325,7 @@ void WorldSession::HandleReorderCharacters(WorldPackets::Character::ReorderChara
|
||||
|
||||
for (WorldPackets::Character::ReorderCharacters::ReorderInfo const& reorderInfo : reorderChars.Entries)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_LIST_SLOT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_LIST_SLOT);
|
||||
stmt->setUInt8(0, reorderInfo.NewPosition);
|
||||
stmt->setUInt64(1, reorderInfo.PlayerGUID.GetCounter());
|
||||
stmt->setUInt32(2, GetAccountId());
|
||||
@@ -2352,7 +2352,7 @@ void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic&
|
||||
|
||||
void WorldSession::HandleGetUndeleteCooldownStatus(WorldPackets::Character::GetUndeleteCharacterCooldownStatus& /*getCooldown*/)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LAST_CHAR_UNDELETE);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LAST_CHAR_UNDELETE);
|
||||
stmt->setUInt32(0, GetBattlenetAccountId());
|
||||
|
||||
_queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&WorldSession::HandleUndeleteCooldownStatusCallback, this, std::placeholders::_1)));
|
||||
@@ -2381,7 +2381,7 @@ void WorldSession::HandleCharUndeleteOpcode(WorldPackets::Character::UndeleteCha
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LAST_CHAR_UNDELETE);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LAST_CHAR_UNDELETE);
|
||||
stmt->setUInt32(0, GetBattlenetAccountId());
|
||||
|
||||
std::shared_ptr<WorldPackets::Character::CharacterUndeleteInfo> undeleteInfo = undeleteCharacter.UndeleteInfo;
|
||||
@@ -2399,7 +2399,7 @@ void WorldSession::HandleCharUndeleteOpcode(WorldPackets::Character::UndeleteCha
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID);
|
||||
stmt->setUInt64(0, undeleteInfo->CharacterGuid.GetCounter());
|
||||
queryCallback.SetNextQuery(CharacterDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -2421,7 +2421,7 @@ void WorldSession::HandleCharUndeleteOpcode(WorldPackets::Character::UndeleteCha
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
stmt->setString(0, undeleteInfo->Name);
|
||||
queryCallback.SetNextQuery(CharacterDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -2439,7 +2439,7 @@ void WorldSession::HandleCharUndeleteOpcode(WorldPackets::Character::UndeleteCha
|
||||
/// * max demon hunter count
|
||||
/// * team violation
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
queryCallback.SetNextQuery(CharacterDatabase.AsyncQuery(stmt));
|
||||
})
|
||||
@@ -2456,15 +2456,15 @@ void WorldSession::HandleCharUndeleteOpcode(WorldPackets::Character::UndeleteCha
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
|
||||
stmt->setString(0, undeleteInfo->Name);
|
||||
stmt->setUInt32(1, GetAccountId());
|
||||
stmt->setUInt64(2, undeleteInfo->CharacterGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_CHAR_UNDELETE);
|
||||
stmt->setUInt32(0, GetBattlenetAccountId());
|
||||
LoginDatabase.Execute(stmt);
|
||||
LoginDatabasePreparedStatement* loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_CHAR_UNDELETE);
|
||||
loginStmt->setUInt32(0, GetBattlenetAccountId());
|
||||
LoginDatabase.Execute(loginStmt);
|
||||
|
||||
sCharacterCache->UpdateCharacterInfoDeleted(undeleteInfo->CharacterGuid, false, &undeleteInfo->Name);
|
||||
|
||||
|
||||
@@ -861,7 +861,7 @@ void WorldSession::HandleWrapItem(WorldPackets::Item::WrapItem& packet)
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT);
|
||||
stmt->setUInt64(0, item->GetOwnerGUID().GetCounter());
|
||||
stmt->setUInt64(1, item->GetGUID().GetCounter());
|
||||
stmt->setUInt32(2, item->GetEntry());
|
||||
|
||||
@@ -167,7 +167,7 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& packet)
|
||||
receiverAccountId = characterInfo->AccountId;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT);
|
||||
stmt->setUInt64(0, receiverGuid.GetCounter());
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -392,7 +392,7 @@ void WorldSession::HandleMailReturnToSender(WorldPackets::Mail::MailReturnToSend
|
||||
//we can return mail now, so firstly delete the old one
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID);
|
||||
stmt->setUInt32(0, packet.MailID);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -775,7 +775,7 @@ void WorldSession::HandleWhoIsOpcode(WorldPackets::Who::WhoIsRequest& packet)
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_WHOIS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_WHOIS);
|
||||
stmt->setUInt32(0, player->GetSession()->GetAccountId());
|
||||
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -370,7 +370,7 @@ void WorldSession::HandleRequestStabledPets(WorldPackets::NPC::RequestStabledPet
|
||||
|
||||
void WorldSession::SendStablePet(ObjectGuid guid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS_DETAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS_DETAIL);
|
||||
|
||||
stmt->setUInt64(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, PET_SAVE_FIRST_STABLE_SLOT);
|
||||
@@ -469,7 +469,7 @@ void WorldSession::HandleStablePet(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS);
|
||||
|
||||
stmt->setUInt64(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, PET_SAVE_FIRST_STABLE_SLOT);
|
||||
@@ -528,7 +528,7 @@ void WorldSession::HandleUnstablePet(WorldPacket& recvData)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY);
|
||||
|
||||
stmt->setUInt64(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, petnumber);
|
||||
@@ -654,7 +654,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket& recvData)
|
||||
|
||||
// Find swapped pet slot in stable
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOT_BY_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOT_BY_ID);
|
||||
|
||||
stmt->setUInt64(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, petId);
|
||||
|
||||
@@ -560,7 +560,7 @@ void WorldSession::HandlePetRename(WorldPackets::Pet::PetRename& packet)
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
if (declinedname)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME);
|
||||
stmt->setUInt32(0, pet->GetCharmInfo()->GetPetNumber());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -574,7 +574,7 @@ void WorldSession::HandlePetRename(WorldPackets::Pet::PetRename& packet)
|
||||
trans->Append(stmt);
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_NAME);
|
||||
stmt->setString(0, name);
|
||||
stmt->setUInt64(1, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt32(2, pet->GetCharmInfo()->GetPetNumber());
|
||||
|
||||
@@ -104,7 +104,7 @@ void WorldSession::HandlePetitionBuy(WorldPackets::Petition::PetitionBuy& packet
|
||||
// a petition is invalid, if both the owner and the type matches
|
||||
// we checked above, if this player is in an arenateam, so this must be
|
||||
// datacorruption
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_BY_OWNER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_BY_OWNER);
|
||||
stmt->setUInt64(0, _player->GetGUID().GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -145,7 +145,7 @@ void WorldSession::HandlePetitionShowSignatures(WorldPackets::Petition::Petition
|
||||
if (_player->GetGuildId())
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
|
||||
|
||||
stmt->setUInt64(0, packet.Item.GetCounter());
|
||||
|
||||
@@ -197,7 +197,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionGUID)
|
||||
WorldPackets::Petition::QueryPetitionResponse responsePacket;
|
||||
responsePacket.PetitionID = uint32(petitionGUID.GetCounter()); // PetitionID (in Trinity always same as GUID_LOPART(petition guid))
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
|
||||
stmt->setUInt64(0, petitionGUID.GetCounter());
|
||||
|
||||
@@ -251,7 +251,7 @@ void WorldSession::HandlePetitionRenameGuild(WorldPackets::Petition::PetitionRen
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME);
|
||||
|
||||
stmt->setString(0, packet.NewGuildName);
|
||||
stmt->setUInt64(1, packet.PetitionGuid.GetCounter());
|
||||
@@ -268,7 +268,7 @@ void WorldSession::HandlePetitionRenameGuild(WorldPackets::Petition::PetitionRen
|
||||
|
||||
void WorldSession::HandleSignPetition(WorldPackets::Petition::SignPetition& packet)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES);
|
||||
|
||||
stmt->setUInt64(0, packet.PetitionGUID.GetCounter());
|
||||
stmt->setUInt64(1, packet.PetitionGUID.GetCounter());
|
||||
@@ -363,7 +363,7 @@ void WorldSession::HandleDeclinePetition(WorldPackets::Petition::DeclinePetition
|
||||
{
|
||||
TC_LOG_DEBUG("network", "Petition %s declined by %s", packet.PetitionGUID.ToString().c_str(), _player->GetGUID().ToString().c_str());
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
|
||||
stmt->setUInt64(0, packet.PetitionGUID.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -411,7 +411,7 @@ void WorldSession::HandleOfferPetition(WorldPackets::Petition::OfferPetition& pa
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
|
||||
stmt->setUInt64(0, packet.ItemGUID.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -458,7 +458,7 @@ void WorldSession::HandleTurnInPetition(WorldPackets::Petition::TurnInPetition&
|
||||
ObjectGuid ownerguid;
|
||||
std::string name;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
stmt->setUInt64(0, packet.Item.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemove
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_ABANDON_TIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_ABANDON_TIME);
|
||||
stmt->setUInt32(0, questId);
|
||||
stmt->setUInt64(1, _player->GetGUID().GetCounter());
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPackets::Spells::OpenItem& packet)
|
||||
|
||||
if (item->HasItemFlag(ITEM_FIELD_FLAG_WRAPPED))// wrapped?
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM);
|
||||
stmt->setUInt64(0, item->GetGUID().GetCounter());
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
.WithPreparedCallback(std::bind(&WorldSession::HandleOpenWrappedItemCallback, this, item->GetPos(), item->GetGUID(), std::placeholders::_1)));
|
||||
@@ -233,7 +233,7 @@ void WorldSession::HandleOpenWrappedItemCallback(uint16 pos, ObjectGuid itemGuid
|
||||
|
||||
GetPlayer()->SaveInventoryAndGoldToDB(trans);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
stmt->setUInt64(0, itemGuid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void WorldSession::HandleBugReportOpcode(WorldPackets::Ticket::BugReport& bugRep
|
||||
if (!sSupportMgr->GetBugSystemStatus())
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
|
||||
stmt->setString(0, bugReport.Text);
|
||||
stmt->setString(1, bugReport.DiagInfo);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -139,7 +139,7 @@ void InstanceSaveManager::DeleteInstanceFromDB(uint32 instanceid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_INSTANCE);
|
||||
stmt->setUInt32(0, instanceid);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -167,7 +167,7 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
|
||||
// save the resettime for normal instances only when they get unloaded
|
||||
if (time_t resettime = itr->second->GetResetTimeForDB())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_RESETTIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_RESETTIME);
|
||||
|
||||
stmt->setUInt32(0, uint32(resettime));
|
||||
stmt->setUInt32(1, InstanceId);
|
||||
@@ -220,7 +220,7 @@ void InstanceSave::SaveToDB()
|
||||
scenario->SaveToDB();
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_INSTANCE_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_INSTANCE_SAVE);
|
||||
stmt->setUInt32(0, m_instanceid);
|
||||
stmt->setUInt16(1, GetMapId());
|
||||
stmt->setUInt32(2, uint32(GetResetTimeForDB()));
|
||||
@@ -666,7 +666,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
||||
// delete/promote instance binds from the DB, even if not loaded
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_CHAR_INSTANCE_BY_MAP_DIFF);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_CHAR_INSTANCE_BY_MAP_DIFF);
|
||||
stmt->setUInt16(0, uint16(mapid));
|
||||
stmt->setUInt8(1, uint8(difficulty));
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -71,7 +71,7 @@ void InstanceScript::SaveToDB()
|
||||
if (data.empty())
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_DATA);
|
||||
stmt->setUInt32(0, GetCompletedEncounterMask());
|
||||
stmt->setString(1, data);
|
||||
stmt->setUInt32(2, _entranceId);
|
||||
|
||||
@@ -108,7 +108,7 @@ Loot::~Loot()
|
||||
void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
|
||||
{
|
||||
// Deletes a single item associated with an openable item from the DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
|
||||
stmt->setUInt64(0, containerID.GetCounter());
|
||||
stmt->setUInt32(1, itemID);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -127,7 +127,7 @@ void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
|
||||
void Loot::DeleteLootMoneyFromContainerItemDB()
|
||||
{
|
||||
// Deletes money loot associated with an openable item from the DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
stmt->setUInt64(0, containerID.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void MailDraft::deleteIncludedItems(SQLTransaction& trans, bool inDB /*= false*/
|
||||
|
||||
if (inDB)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
|
||||
stmt->setUInt64(0, item->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, ObjectGuid::LowType sender
|
||||
Item* item = mailItemIter->second;
|
||||
item->SaveToDB(trans); // item not in inventory and can be save standalone
|
||||
// owner in data will set at mail receive and item extracting
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
|
||||
stmt->setUInt64(0, receiver_guid);
|
||||
stmt->setUInt64(1, item->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -215,7 +215,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver,
|
||||
|
||||
// Add to DB
|
||||
uint8 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL);
|
||||
stmt->setUInt32( index, mailId);
|
||||
stmt->setUInt8 (++index, uint8(sender.GetMailMessageType()));
|
||||
stmt->setInt8 (++index, int8(sender.GetStationery()));
|
||||
|
||||
@@ -3570,7 +3570,7 @@ void InstanceMap::CreateInstanceData(bool load)
|
||||
if (load)
|
||||
{
|
||||
/// @todo make a global storage for this
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_INSTANCE);
|
||||
stmt->setUInt16(0, uint16(GetId()));
|
||||
stmt->setUInt32(1, i_InstanceId);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -3819,7 +3819,7 @@ bool Map::GetEntrancePos(int32 &mapid, float &x, float &y)
|
||||
|
||||
bool InstanceMap::HasPermBoundPlayers() const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE);
|
||||
stmt->setUInt16(0,GetInstanceId());
|
||||
return !!CharacterDatabase.Query(stmt);
|
||||
}
|
||||
@@ -3981,7 +3981,7 @@ void Map::SaveCreatureRespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime
|
||||
|
||||
_creatureRespawnTimes[dbGuid] = respawnTime;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
|
||||
stmt->setUInt64(0, dbGuid);
|
||||
stmt->setUInt32(1, uint32(respawnTime));
|
||||
stmt->setUInt16(2, GetId());
|
||||
@@ -3993,7 +3993,7 @@ void Map::RemoveCreatureRespawnTime(ObjectGuid::LowType dbGuid)
|
||||
{
|
||||
_creatureRespawnTimes.erase(dbGuid);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
|
||||
stmt->setUInt64(0, dbGuid);
|
||||
stmt->setUInt16(1, GetId());
|
||||
stmt->setUInt32(2, GetInstanceId());
|
||||
@@ -4011,7 +4011,7 @@ void Map::SaveGORespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime)
|
||||
|
||||
_goRespawnTimes[dbGuid] = respawnTime;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
|
||||
stmt->setUInt64(0, dbGuid);
|
||||
stmt->setUInt32(1, uint32(respawnTime));
|
||||
stmt->setUInt16(2, GetId());
|
||||
@@ -4023,7 +4023,7 @@ void Map::RemoveGORespawnTime(ObjectGuid::LowType dbGuid)
|
||||
{
|
||||
_goRespawnTimes.erase(dbGuid);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN);
|
||||
stmt->setUInt64(0, dbGuid);
|
||||
stmt->setUInt16(1, GetId());
|
||||
stmt->setUInt32(2, GetInstanceId());
|
||||
@@ -4032,7 +4032,7 @@ void Map::RemoveGORespawnTime(ObjectGuid::LowType dbGuid)
|
||||
|
||||
void Map::LoadRespawnTimes()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS);
|
||||
stmt->setUInt16(0, GetId());
|
||||
stmt->setUInt32(1, GetInstanceId());
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
@@ -4073,7 +4073,7 @@ void Map::DeleteRespawnTimes()
|
||||
|
||||
void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE);
|
||||
stmt->setUInt16(0, mapId);
|
||||
stmt->setUInt32(1, instanceId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -4104,7 +4104,7 @@ void Map::LoadCorpseData()
|
||||
{
|
||||
std::unordered_map<ObjectGuid::LowType, std::unordered_set<uint32>> phases;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSE_PHASES);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSE_PHASES);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setUInt32(1, GetInstanceId());
|
||||
|
||||
@@ -4163,7 +4163,7 @@ void Map::LoadCorpseData()
|
||||
void Map::DeleteCorpseData()
|
||||
{
|
||||
// DELETE cp, c FROM corpse_phases cp INNER JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? AND c.instanceId = ?
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSES_FROM_MAP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSES_FROM_MAP);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setUInt32(1, GetInstanceId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -94,7 +94,7 @@ void WaypointMgr::ReloadPath(uint32 id)
|
||||
_waypointStore.erase(itr);
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
|
||||
//if (Map* map = sMapMgr->FindMap(cr->GetMapId()))
|
||||
// map->Remove(cr, false);
|
||||
// delete respawn time for this creature
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
|
||||
stmt->setUInt64(0, spawnId);
|
||||
stmt->setUInt16(1, m_PvP->GetMap()->GetId());
|
||||
stmt->setUInt32(2, 0); // instance id, always 0 for world maps
|
||||
|
||||
@@ -455,7 +455,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint64
|
||||
// load state from db
|
||||
if (!triggerFrom)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_POOL_QUEST_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_POOL_QUEST_SAVE);
|
||||
|
||||
stmt->setUInt32(0, poolId);
|
||||
|
||||
@@ -812,7 +812,7 @@ void PoolMgr::LoadFromDB()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_QUEST_POOLS);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_QUEST_POOLS);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -958,7 +958,7 @@ void PoolMgr::SaveQuestsToDB()
|
||||
{
|
||||
if (itr->second.isEmpty())
|
||||
continue;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_POOL_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_POOL_SAVE);
|
||||
stmt->setUInt32(0, itr->second.GetPoolId());
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -967,7 +967,7 @@ void PoolMgr::SaveQuestsToDB()
|
||||
{
|
||||
if (IsSpawnedObject<Quest>(itr->first))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_POOL_SAVE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_POOL_SAVE);
|
||||
stmt->setUInt32(0, itr->second);
|
||||
stmt->setUInt32(1, itr->first);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -55,7 +55,7 @@ void QuestObjectiveCriteriaMgr::DeleteFromDB(ObjectGuid const& guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -99,7 +99,7 @@ void QuestObjectiveCriteriaMgr::LoadFromDB(PreparedQueryResult objectiveResult,
|
||||
// Removing non-existing criteria data for all characters
|
||||
TC_LOG_ERROR("criteria.quest", "Non-existing quest objective criteria %u data has been removed from the table `character_queststatus_objectives_criteria_progress`.", criteriaId);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_QUEST_PROGRESS_CRITERIA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_QUEST_PROGRESS_CRITERIA);
|
||||
stmt->setUInt32(0, criteriaId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -119,7 +119,7 @@ void QuestObjectiveCriteriaMgr::LoadFromDB(PreparedQueryResult objectiveResult,
|
||||
|
||||
void QuestObjectiveCriteriaMgr::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||
stmt->setUInt64(0, _owner->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
if (itr->second.needSave)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION);
|
||||
stmt->setUInt64(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, uint16(itr->second.ID));
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -69,7 +69,7 @@ void InstanceScenario::SaveToDB()
|
||||
|
||||
if (iter->second.Counter)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_SCENARIO_INSTANCE_CRITERIA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_SCENARIO_INSTANCE_CRITERIA);
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, iter->first);
|
||||
trans->Append(stmt);
|
||||
@@ -90,7 +90,7 @@ void InstanceScenario::SaveToDB()
|
||||
|
||||
void InstanceScenario::LoadInstanceData(uint32 instanceId)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SCENARIO_INSTANCE_CRITERIA_FOR_INSTANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SCENARIO_INSTANCE_CRITERIA_FOR_INSTANCE);
|
||||
stmt->setUInt32(0, instanceId);
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -625,7 +625,7 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
TC_LOG_DEBUG("network", "SESSION: Sent SMSG_LOGOUT_COMPLETE Message");
|
||||
|
||||
//! Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_ONLINE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_ONLINE);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -772,7 +772,7 @@ void WorldSession::SetAccountData(AccountDataType type, uint32 time, std::string
|
||||
{
|
||||
if ((1 << type) & GLOBAL_CACHE_MASK)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_ACCOUNT_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_ACCOUNT_DATA);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
stmt->setUInt8(1, type);
|
||||
stmt->setUInt32(2, time);
|
||||
@@ -785,7 +785,7 @@ void WorldSession::SetAccountData(AccountDataType type, uint32 time, std::string
|
||||
if (!m_GUIDLow)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_ACCOUNT_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_ACCOUNT_DATA);
|
||||
stmt->setUInt64(0, m_GUIDLow);
|
||||
stmt->setUInt8(1, type);
|
||||
stmt->setUInt32(2, time);
|
||||
@@ -824,7 +824,7 @@ void WorldSession::SaveTutorialsData(SQLTransaction& trans)
|
||||
return;
|
||||
|
||||
bool const hasTutorialsInDB = (_tutorialsChanged & TUTORIALS_FLAG_LOADED_FROM_DB) != 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(hasTutorialsInDB ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(hasTutorialsInDB ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
|
||||
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
|
||||
stmt->setUInt32(i, _tutorials[i]);
|
||||
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());
|
||||
@@ -947,7 +947,7 @@ public:
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_DATA);
|
||||
stmt->setUInt32(0, accountId);
|
||||
ok = SetPreparedQuery(GLOBAL_ACCOUNT_DATA, stmt) && ok;
|
||||
|
||||
@@ -982,7 +982,7 @@ public:
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOYS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOYS);
|
||||
stmt->setUInt32(0, battlenetAccountId);
|
||||
ok = SetPreparedQuery(GLOBAL_ACCOUNT_TOYS, stmt) && ok;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ WorldSocket::~WorldSocket()
|
||||
void WorldSocket::Start()
|
||||
{
|
||||
std::string ip_address = GetRemoteIpAddress().to_string();
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO);
|
||||
stmt->setString(0, ip_address);
|
||||
|
||||
_queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&WorldSocket::CheckIpCallback, this, std::placeholders::_1)));
|
||||
@@ -653,7 +653,7 @@ struct AccountInfo
|
||||
void WorldSocket::HandleAuthSession(std::shared_ptr<WorldPackets::Auth::AuthSession> authSession)
|
||||
{
|
||||
// Get the account information from the auth database
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME);
|
||||
stmt->setInt32(0, int32(realm.Id.Realm));
|
||||
stmt->setString(1, authSession->RealmJoinTicket);
|
||||
|
||||
@@ -725,7 +725,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth::
|
||||
memcpy(_encryptKey, encryptKeyGen.GetDigest(), 16);
|
||||
|
||||
// As we don't know if attempted login process by ip works, we update last_attempt_ip right away
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_ATTEMPT_IP);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_ATTEMPT_IP);
|
||||
stmt->setString(0, address);
|
||||
stmt->setString(1, authSession->RealmJoinTicket);
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -873,7 +873,7 @@ void WorldSocket::HandleAuthContinuedSession(std::shared_ptr<WorldPackets::Auth:
|
||||
}
|
||||
|
||||
uint32 accountId = uint32(key.Fields.AccountId);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_CONTINUED_SESSION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_CONTINUED_SESSION);
|
||||
stmt->setUInt32(0, accountId);
|
||||
|
||||
_queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&WorldSocket::HandleAuthContinuedSessionCallback, this, authSession, std::placeholders::_1)));
|
||||
|
||||
@@ -39,7 +39,7 @@ struct SpellHistory::PersistenceHelper<Player>
|
||||
static CharacterDatabaseStatements const ChargesDeleteStatement = CHAR_DEL_CHAR_SPELL_CHARGES;
|
||||
static CharacterDatabaseStatements const ChargesInsertStatement = CHAR_INS_CHAR_SPELL_CHARGES;
|
||||
|
||||
static void SetIdentifier(PreparedStatement* stmt, uint8 index, Unit* owner) { stmt->setUInt64(index, owner->GetGUID().GetCounter()); }
|
||||
static void SetIdentifier(PreparedStatementBase* stmt, uint8 index, Unit* owner) { stmt->setUInt64(index, owner->GetGUID().GetCounter()); }
|
||||
|
||||
static bool ReadCooldown(Field* fields, uint32* spellId, CooldownEntry* cooldownEntry)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ struct SpellHistory::PersistenceHelper<Player>
|
||||
return true;
|
||||
}
|
||||
|
||||
static void WriteCooldown(PreparedStatement* stmt, uint8& index, CooldownStorageType::value_type const& cooldown)
|
||||
static void WriteCooldown(PreparedStatementBase* stmt, uint8& index, CooldownStorageType::value_type const& cooldown)
|
||||
{
|
||||
stmt->setUInt32(index++, cooldown.first);
|
||||
stmt->setUInt32(index++, cooldown.second.ItemId);
|
||||
@@ -75,7 +75,7 @@ struct SpellHistory::PersistenceHelper<Player>
|
||||
stmt->setUInt32(index++, uint32(Clock::to_time_t(cooldown.second.CategoryEnd)));
|
||||
}
|
||||
|
||||
static void WriteCharge(PreparedStatement* stmt, uint8& index, uint32 chargeCategory, ChargeEntry const& charge)
|
||||
static void WriteCharge(PreparedStatementBase* stmt, uint8& index, uint32 chargeCategory, ChargeEntry const& charge)
|
||||
{
|
||||
stmt->setUInt32(index++, chargeCategory);
|
||||
stmt->setUInt32(index++, uint32(Clock::to_time_t(charge.RechargeStart)));
|
||||
@@ -91,7 +91,7 @@ struct SpellHistory::PersistenceHelper<Pet>
|
||||
static CharacterDatabaseStatements const ChargesDeleteStatement = CHAR_DEL_PET_SPELL_CHARGES;
|
||||
static CharacterDatabaseStatements const ChargesInsertStatement = CHAR_INS_PET_SPELL_CHARGES;
|
||||
|
||||
static void SetIdentifier(PreparedStatement* stmt, uint8 index, Unit* owner) { stmt->setUInt32(index, owner->GetCharmInfo()->GetPetNumber()); }
|
||||
static void SetIdentifier(PreparedStatementBase* stmt, uint8 index, Unit* owner) { stmt->setUInt32(index, owner->GetCharmInfo()->GetPetNumber()); }
|
||||
|
||||
static bool ReadCooldown(Field* fields, uint32* spellId, CooldownEntry* cooldownEntry)
|
||||
{
|
||||
@@ -118,7 +118,7 @@ struct SpellHistory::PersistenceHelper<Pet>
|
||||
return true;
|
||||
}
|
||||
|
||||
static void WriteCooldown(PreparedStatement* stmt, uint8& index, CooldownStorageType::value_type const& cooldown)
|
||||
static void WriteCooldown(PreparedStatementBase* stmt, uint8& index, CooldownStorageType::value_type const& cooldown)
|
||||
{
|
||||
stmt->setUInt32(index++, cooldown.first);
|
||||
stmt->setUInt32(index++, uint32(Clock::to_time_t(cooldown.second.CooldownEnd)));
|
||||
@@ -126,7 +126,7 @@ struct SpellHistory::PersistenceHelper<Pet>
|
||||
stmt->setUInt32(index++, uint32(Clock::to_time_t(cooldown.second.CategoryEnd)));
|
||||
}
|
||||
|
||||
static void WriteCharge(PreparedStatement* stmt, uint8& index, uint32 chargeCategory, ChargeEntry const& charge)
|
||||
static void WriteCharge(PreparedStatementBase* stmt, uint8& index, uint32 chargeCategory, ChargeEntry const& charge)
|
||||
{
|
||||
stmt->setUInt32(index++, chargeCategory);
|
||||
stmt->setUInt32(index++, uint32(Clock::to_time_t(charge.RechargeStart)));
|
||||
@@ -175,7 +175,7 @@ void SpellHistory::SaveToDB(SQLTransaction& trans)
|
||||
typedef PersistenceHelper<OwnerType> StatementInfo;
|
||||
|
||||
uint8 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(StatementInfo::CooldownsDeleteStatement);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(StatementInfo::CooldownsDeleteStatement);
|
||||
StatementInfo::SetIdentifier(stmt, index++, _owner);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ void BugTicket::LoadFromDB(Field* fields)
|
||||
void BugTicket::SaveToDB() const
|
||||
{
|
||||
uint8 idx = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_BUG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_BUG);
|
||||
stmt->setUInt32(idx, _id);
|
||||
stmt->setUInt64(++idx, _playerGuid.GetCounter());
|
||||
stmt->setString(++idx, _note);
|
||||
@@ -148,7 +148,7 @@ void BugTicket::SaveToDB() const
|
||||
|
||||
void BugTicket::DeleteFromDB()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_BUG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_BUG);
|
||||
stmt->setUInt32(0, _id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void ComplaintTicket::SaveToDB() const
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
uint8 idx = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_COMPLAINT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_COMPLAINT);
|
||||
stmt->setUInt32(idx, _id);
|
||||
stmt->setUInt64(++idx, _playerGuid.GetCounter());
|
||||
stmt->setString(++idx, _note);
|
||||
@@ -267,7 +267,7 @@ void ComplaintTicket::SaveToDB() const
|
||||
|
||||
void ComplaintTicket::DeleteFromDB()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_COMPLAINT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_COMPLAINT);
|
||||
stmt->setUInt32(0, _id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -339,7 +339,7 @@ void SuggestionTicket::LoadFromDB(Field* fields)
|
||||
void SuggestionTicket::SaveToDB() const
|
||||
{
|
||||
uint8 idx = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_SUGGESTION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_SUGGESTION);
|
||||
stmt->setUInt32(idx, _id);
|
||||
stmt->setUInt64(++idx, _playerGuid.GetCounter());
|
||||
stmt->setString(++idx, _note);
|
||||
@@ -357,7 +357,7 @@ void SuggestionTicket::SaveToDB() const
|
||||
|
||||
void SuggestionTicket::DeleteFromDB()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_SUGGESTION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_SUGGESTION);
|
||||
stmt->setUInt32(0, _id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -476,7 +476,7 @@ void SupportMgr::LoadBugTickets()
|
||||
_lastBugId = 0;
|
||||
_openBugTicketCount = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_BUGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_BUGS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
@@ -516,7 +516,7 @@ void SupportMgr::LoadComplaintTickets()
|
||||
_lastComplaintId = 0;
|
||||
_openComplaintTicketCount = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_COMPLAINTS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_COMPLAINTS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
@@ -525,7 +525,7 @@ void SupportMgr::LoadComplaintTickets()
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
PreparedStatement* chatLogStmt;
|
||||
CharacterDatabasePreparedStatement* chatLogStmt;
|
||||
PreparedQueryResult chatLogResult;
|
||||
do
|
||||
{
|
||||
@@ -571,7 +571,7 @@ void SupportMgr::LoadSuggestionTickets()
|
||||
_lastSuggestionId = 0;
|
||||
_openSuggestionTicketCount = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_SUGGESTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_SUGGESTIONS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
@@ -705,7 +705,7 @@ TC_GAME_API void SupportMgr::ResetTickets<BugTicket>()
|
||||
|
||||
_lastBugId = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_BUGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_BUGS);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ TC_GAME_API void SupportMgr::ResetTickets<SuggestionTicket>()
|
||||
|
||||
_lastSuggestionId = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_SUGGESTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_SUGGESTIONS);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
mTextMap.clear(); // for reload case
|
||||
//all currently used temp texts are NOT reset
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEXT);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEXT);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -472,7 +472,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
bool incHighest = true;
|
||||
if (guid && guid < sObjectMgr->GetGenerator<HighGuid::Player>().GetNextAfterMaxUsed())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_GUID);
|
||||
stmt->setUInt64(0, guid);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -490,7 +490,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
|
||||
if (ObjectMgr::CheckPlayerName(name, sWorld->GetDefaultDbcLocale(), true) == CHAR_NAME_SUCCESS)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -598,7 +598,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
// check if the original name already exists
|
||||
name = GetNth(line, GetColNumber(tn, "name"));
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -2258,7 +2258,7 @@ void World::LoadAutobroadcasts()
|
||||
|
||||
m_Autobroadcasts.clear();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_AUTOBROADCAST);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_AUTOBROADCAST);
|
||||
stmt->setInt32(0, realm.Id.Realm);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -2413,7 +2413,7 @@ void World::Update(uint32 diff)
|
||||
|
||||
m_timers[WUPDATE_UPTIME].Reset();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS);
|
||||
|
||||
stmt->setUInt32(0, tmpDiff);
|
||||
stmt->setUInt16(1, uint16(maxOnlinePlayers));
|
||||
@@ -2430,7 +2430,7 @@ void World::Update(uint32 diff)
|
||||
{
|
||||
m_timers[WUPDATE_CLEANDB].Reset();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS);
|
||||
|
||||
stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME));
|
||||
stmt->setUInt32(1, uint32(time(0)));
|
||||
@@ -2747,7 +2747,6 @@ BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, std::stri
|
||||
BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 duration_secs, std::string const& reason, std::string const& author)
|
||||
{
|
||||
PreparedQueryResult resultAccounts = PreparedQueryResult(NULL); //used for kicking
|
||||
PreparedStatement* stmt = NULL;
|
||||
|
||||
// Prevent banning an already banned account
|
||||
if (mode == BAN_ACCOUNT && AccountMgr::IsBannedAccount(nameOrIP))
|
||||
@@ -2757,8 +2756,9 @@ BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 du
|
||||
switch (mode)
|
||||
{
|
||||
case BAN_IP:
|
||||
{
|
||||
// No SQL injection with prepared statements
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
|
||||
stmt->setString(0, nameOrIP);
|
||||
resultAccounts = LoginDatabase.Query(stmt);
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_BANNED);
|
||||
@@ -2768,18 +2768,23 @@ BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 du
|
||||
stmt->setString(3, reason);
|
||||
LoginDatabase.Execute(stmt);
|
||||
break;
|
||||
}
|
||||
case BAN_ACCOUNT:
|
||||
{
|
||||
// No SQL injection with prepared statements
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
|
||||
stmt->setString(0, nameOrIP);
|
||||
resultAccounts = LoginDatabase.Query(stmt);
|
||||
break;
|
||||
}
|
||||
case BAN_CHARACTER:
|
||||
{
|
||||
// No SQL injection with prepared statements
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_NAME);
|
||||
stmt->setString(0, nameOrIP);
|
||||
resultAccounts = CharacterDatabase.Query(stmt);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return BAN_SYNTAX_ERROR;
|
||||
}
|
||||
@@ -2802,7 +2807,7 @@ BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 du
|
||||
if (mode != BAN_IP)
|
||||
{
|
||||
// make sure there is only one active ban
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED);
|
||||
stmt->setUInt32(0, account);
|
||||
trans->Append(stmt);
|
||||
// No SQL injection with prepared statements
|
||||
@@ -2827,7 +2832,7 @@ BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 du
|
||||
/// Remove a ban from an account or IP address
|
||||
bool World::RemoveBanAccount(BanMode mode, std::string const& nameOrIP)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
LoginDatabasePreparedStatement* stmt = NULL;
|
||||
if (mode == BAN_IP)
|
||||
{
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_IP_NOT_BANNED);
|
||||
@@ -2874,7 +2879,7 @@ BanReturn World::BanCharacter(std::string const& name, std::string const& durati
|
||||
//Use transaction in order to ensure the order of the queries
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
// make sure there is only one active ban
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -2908,7 +2913,7 @@ bool World::RemoveBanCharacter(std::string const& name)
|
||||
else
|
||||
guid = banned->GetGUID();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return true;
|
||||
@@ -3111,7 +3116,7 @@ void World::SendAutoBroadcast()
|
||||
|
||||
void World::UpdateRealmCharCount(uint32 accountId)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_COUNT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_COUNT);
|
||||
stmt->setUInt32(0, accountId);
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&World::_UpdateRealmCharCount, this, std::placeholders::_1)));
|
||||
}
|
||||
@@ -3126,7 +3131,7 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount)
|
||||
|
||||
SQLTransaction trans = LoginDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM);
|
||||
stmt->setUInt32(0, accountId);
|
||||
stmt->setUInt32(1, realm.Id.Realm);
|
||||
trans->Append(stmt);
|
||||
@@ -3280,7 +3285,7 @@ void World::DailyReset()
|
||||
{
|
||||
TC_LOG_INFO("misc", "Daily quests reset for all characters.");
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_DAILY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_DAILY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_GARRISON_FOLLOWER_ACTIVATIONS);
|
||||
@@ -3309,7 +3314,7 @@ void World::ResetCurrencyWeekCap()
|
||||
|
||||
void World::LoadDBAllowedSecurityLevel()
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL);
|
||||
stmt->setInt32(0, int32(realm.Id.Realm));
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -3330,7 +3335,7 @@ void World::ResetWeeklyQuests()
|
||||
{
|
||||
TC_LOG_INFO("misc", "Weekly quests reset for all characters.");
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
@@ -3348,7 +3353,7 @@ void World::ResetMonthlyQuests()
|
||||
{
|
||||
TC_LOG_INFO("misc", "Monthly quests reset for all characters.");
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_MONTHLY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_MONTHLY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
@@ -3392,7 +3397,7 @@ void World::ResetEventSeasonalQuests(uint16 event_id)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Seasonal quests reset for all characters.");
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_SEASONAL_BY_EVENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_SEASONAL_BY_EVENT);
|
||||
stmt->setUInt16(0, event_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -3405,7 +3410,7 @@ void World::ResetRandomBG()
|
||||
{
|
||||
TC_LOG_INFO("misc", "Random BG status reset for all characters.");
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BATTLEGROUND_RANDOM_ALL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BATTLEGROUND_RANDOM_ALL);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
@@ -3507,7 +3512,7 @@ void World::setWorldState(uint32 index, uint32 value)
|
||||
if (it->second == value)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_WORLDSTATE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_WORLDSTATE);
|
||||
|
||||
stmt->setUInt32(0, uint32(value));
|
||||
stmt->setUInt32(1, index);
|
||||
@@ -3516,7 +3521,7 @@ void World::setWorldState(uint32 index, uint32 value)
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_WORLDSTATE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_WORLDSTATE);
|
||||
|
||||
stmt->setUInt32(0, index);
|
||||
stmt->setUInt32(1, uint32(value));
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
|
||||
|
||||
stmt->setUInt8(0, uint8(expansion));
|
||||
stmt->setUInt32(1, accountId);
|
||||
@@ -232,9 +232,7 @@ public:
|
||||
static bool HandleAccountOnlineListCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
///- Get the list of accounts ID logged to the realm
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE);
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE));
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -256,7 +254,7 @@ public:
|
||||
|
||||
///- Get the username, last IP and GM level of each account
|
||||
// No SQL injection. account is uint32.
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO);
|
||||
stmt->setUInt32(0, account);
|
||||
PreparedQueryResult resultLogin = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -293,7 +291,7 @@ public:
|
||||
{
|
||||
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(handler->GetSession()->GetRemoteAddress()))
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
|
||||
stmt->setString(0, location->CountryCode);
|
||||
stmt->setUInt32(1, handler->GetSession()->GetAccountId());
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -307,7 +305,7 @@ public:
|
||||
}
|
||||
else if (param == "off")
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
|
||||
stmt->setString(0, "00");
|
||||
stmt->setUInt32(1, handler->GetSession()->GetAccountId());
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -333,7 +331,7 @@ public:
|
||||
|
||||
if (!param.empty())
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
|
||||
|
||||
if (param == "on")
|
||||
{
|
||||
@@ -560,7 +558,7 @@ public:
|
||||
std::string emailoutput;
|
||||
uint32 accountId = handler->GetSession()->GetAccountId();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_EMAIL_BY_ID);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_EMAIL_BY_ID);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -627,7 +625,7 @@ public:
|
||||
if (expansion > sWorld->getIntConfig(CONFIG_EXPANSION))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
|
||||
|
||||
stmt->setUInt8(0, expansion);
|
||||
stmt->setUInt32(1, accountId);
|
||||
@@ -710,7 +708,7 @@ public:
|
||||
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
|
||||
if (gmRealmID == -1 && !AccountMgr::IsConsoleAccount(playerSecurity))
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST);
|
||||
|
||||
stmt->setUInt32(0, targetAccountId);
|
||||
stmt->setUInt8(1, uint8(gm));
|
||||
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
else
|
||||
targetGuid = target->GetGUID();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
|
||||
stmt->setUInt64(0, targetGuid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
|
||||
static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
LoginDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -508,7 +508,7 @@ public:
|
||||
return false;
|
||||
|
||||
std::string filter(filterStr);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
|
||||
stmt->setString(0, filter);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
@@ -525,7 +525,7 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
|
||||
stmt2->setUInt64(0, fields[0].GetUInt64());
|
||||
PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
|
||||
if (banResult)
|
||||
@@ -547,7 +547,7 @@ public:
|
||||
|
||||
std::string char_name = fields[1].GetString();
|
||||
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
|
||||
stmt2->setUInt64(0, fields[0].GetUInt64());
|
||||
PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
|
||||
if (banInfo)
|
||||
@@ -588,7 +588,7 @@ public:
|
||||
|
||||
static bool HandleBanListIPCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
char* filterStr = strtok((char*)args, " ");
|
||||
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
{
|
||||
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(handler->GetSession()->GetRemoteAddress()))
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
|
||||
stmt->setString(0, location->CountryCode);
|
||||
stmt->setUInt32(1, handler->GetSession()->GetBattlenetAccountId());
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
}
|
||||
else if (param == "off")
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
|
||||
stmt->setString(0, "00");
|
||||
stmt->setUInt32(1, handler->GetSession()->GetBattlenetAccountId());
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
|
||||
if (!param.empty())
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK);
|
||||
|
||||
if (param == "on")
|
||||
{
|
||||
@@ -471,7 +471,7 @@ public:
|
||||
return false;
|
||||
|
||||
char* battlenetAccountName = strtok((char*)args, " ");
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST_SMALL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST_SMALL);
|
||||
stmt->setString(0, battlenetAccountName);
|
||||
if (PreparedQueryResult accountList = LoginDatabase.Query(stmt))
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
|
||||
{
|
||||
PreparedQueryResult result;
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
if (!searchString.empty())
|
||||
{
|
||||
// search by GUID
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
|
||||
stmt->setString(0, delInfo.name);
|
||||
stmt->setUInt32(1, delInfo.accountId);
|
||||
stmt->setUInt64(2, delInfo.guid.GetCounter());
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
else
|
||||
{
|
||||
// Update level and reset XP, everything else will be updated at login
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
|
||||
stmt->setUInt8(0, uint8(newLevel));
|
||||
stmt->setUInt64(1, playerGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
stmt->setString(0, newName);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (result)
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
std::string oldNameLink = handler->playerLink(targetName);
|
||||
handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), targetGuid.ToString().c_str());
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
|
||||
stmt->setUInt64(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -477,7 +477,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
|
||||
if (target)
|
||||
{
|
||||
@@ -505,7 +505,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
|
||||
if (target)
|
||||
{
|
||||
@@ -532,7 +532,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
|
||||
if (target)
|
||||
{
|
||||
@@ -585,7 +585,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
|
||||
stmt->setString(0, accountName);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
|
||||
newAccountId = (*result)[0].GetUInt32();
|
||||
@@ -610,10 +610,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_BY_GUID);
|
||||
stmt->setUInt32(0, newAccountId);
|
||||
stmt->setUInt32(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.DirectExecute(stmt);
|
||||
CharacterDatabasePreparedStatement* charStmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_BY_GUID);
|
||||
charStmt->setUInt32(0, newAccountId);
|
||||
charStmt->setUInt32(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.DirectExecute(charStmt);
|
||||
|
||||
sWorld->UpdateRealmCharCount(oldAccountId);
|
||||
sWorld->UpdateRealmCharCount(newAccountId);
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
|
||||
stmt->setUInt32(0, entry);
|
||||
stmt->setUInt8(1, disableType);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
@@ -313,7 +313,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
|
||||
stmt->setUInt32(0, entry);
|
||||
stmt->setUInt8(1, disableType);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
///- Get the accounts with GM Level >0
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
|
||||
stmt->setUInt8(0, uint8(SEC_MODERATOR));
|
||||
stmt->setInt32(1, int32(realm.Id.Realm));
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -538,7 +538,7 @@ public:
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GAMEOBJECT_NEAREST);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GAMEOBJECT_NEAREST);
|
||||
stmt->setFloat(0, player->GetPositionX());
|
||||
stmt->setFloat(1, player->GetPositionY());
|
||||
stmt->setFloat(2, player->GetPositionZ());
|
||||
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
// If not, we extract it from the SQL.
|
||||
if (!groupTarget)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
|
||||
stmt->setUInt64(0, guidTarget.GetCounter());
|
||||
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
|
||||
if (resultGroup)
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
groupTarget = playerTarget->GetGroup();
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
|
||||
stmt->setUInt64(0, guidTarget.GetCounter());
|
||||
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
|
||||
if (resultGroup)
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
// inventory case
|
||||
uint32 inventoryCount = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM);
|
||||
stmt->setUInt32(0, itemId);
|
||||
result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -473,7 +473,7 @@ public:
|
||||
Player* target;
|
||||
ObjectGuid targetGuid;
|
||||
std::string targetName;
|
||||
PreparedStatement* stmt = NULL;
|
||||
CharacterDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -1306,7 +1306,7 @@ public:
|
||||
limit = limitStr ? atoi(limitStr) : -1;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
|
||||
stmt->setString(0, ip);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -1325,7 +1325,7 @@ public:
|
||||
if (!Utf8ToUpperOnlyLatin(account))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
|
||||
stmt->setString(0, account);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -1341,7 +1341,7 @@ public:
|
||||
char* limitStr = strtok(NULL, " ");
|
||||
int32 limit = limitStr ? atoi(limitStr) : -1;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
|
||||
stmt->setString(0, email);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -1373,7 +1373,7 @@ public:
|
||||
uint32 accountId = fields[0].GetUInt32();
|
||||
std::string accountName = fields[1].GetString();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result2 = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
if (channel)
|
||||
channel->SetOwnership(true);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
|
||||
stmt->setUInt8 (0, 1);
|
||||
stmt->setString(1, channelStr);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
if (channel)
|
||||
channel->SetOwnership(false);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
|
||||
stmt->setUInt8 (0, 0);
|
||||
stmt->setString(1, channelStr);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
{
|
||||
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PVPSTATS_FACTIONS_OVERALL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PVPSTATS_FACTIONS_OVERALL);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
@@ -1000,7 +1000,7 @@ public:
|
||||
|
||||
if (!player)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
|
||||
stmt->setUInt64(0, targetGUID.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (result)
|
||||
@@ -1594,7 +1594,7 @@ public:
|
||||
Player* target;
|
||||
ObjectGuid targetGuid;
|
||||
std::string targetName;
|
||||
PreparedStatement* stmt = NULL;
|
||||
CharacterDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
// To make sure we get a target, we convert our guid to an omniversal...
|
||||
ObjectGuid parseGUID = ObjectGuid::Create<HighGuid::Player>(strtoull(args, nullptr, 10));
|
||||
@@ -1748,10 +1748,10 @@ public:
|
||||
}
|
||||
|
||||
// Query the prepared statement for login data
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
|
||||
stmt->setInt32(0, int32(realm.Id.Realm));
|
||||
stmt->setUInt32(1, accId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
LoginDatabasePreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
|
||||
stmt2->setInt32(0, int32(realm.Id.Realm));
|
||||
stmt2->setUInt32(1, accId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt2);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1794,7 +1794,7 @@ public:
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
|
||||
// Returns banType, banTime, bannedBy, banreason
|
||||
PreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
|
||||
stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
|
||||
stmt2->setUInt32(0, accId);
|
||||
PreparedQueryResult result2 = LoginDatabase.Query(stmt2);
|
||||
if (!result2)
|
||||
@@ -1814,9 +1814,9 @@ public:
|
||||
}
|
||||
|
||||
// Can be used to query data from Characters database
|
||||
stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
|
||||
stmt2->setUInt64(0, lowguid);
|
||||
PreparedQueryResult result4 = CharacterDatabase.Query(stmt2);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
|
||||
stmt->setUInt64(0, lowguid);
|
||||
PreparedQueryResult result4 = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result4)
|
||||
{
|
||||
@@ -1828,9 +1828,9 @@ public:
|
||||
if (gguid)
|
||||
{
|
||||
// Guild Data - an own query, because it may not happen.
|
||||
PreparedStatement* stmt3 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED);
|
||||
stmt3->setUInt64(0, lowguid);
|
||||
PreparedQueryResult result5 = CharacterDatabase.Query(stmt3);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED);
|
||||
stmt->setUInt64(0, lowguid);
|
||||
PreparedQueryResult result5 = CharacterDatabase.Query(stmt);
|
||||
if (result5)
|
||||
{
|
||||
Field* fields5 = result5->Fetch();
|
||||
@@ -1932,9 +1932,9 @@ public:
|
||||
|
||||
// Mail Data - an own query, because it may or may not be useful.
|
||||
// SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?"
|
||||
PreparedStatement* stmt4 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
|
||||
stmt4->setUInt64(0, lowguid);
|
||||
PreparedQueryResult result6 = CharacterDatabase.Query(stmt4);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
|
||||
stmt->setUInt64(0, lowguid);
|
||||
PreparedQueryResult result6 = CharacterDatabase.Query(stmt);
|
||||
if (result6)
|
||||
{
|
||||
Field* fields = result6->Fetch();
|
||||
@@ -2009,7 +2009,7 @@ public:
|
||||
if (handler->HasLowerSecurity (target, targetGuid, true))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
std::string muteBy = "";
|
||||
if (handler->GetSession())
|
||||
muteBy = handler->GetSession()->GetPlayerName();
|
||||
@@ -2088,7 +2088,7 @@ public:
|
||||
target->GetSession()->m_muteTime = 0;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
stmt->setInt64(0, 0);
|
||||
stmt->setString(1, "");
|
||||
stmt->setString(2, "");
|
||||
@@ -2136,7 +2136,7 @@ public:
|
||||
// helper for mutehistory
|
||||
static bool HandleMuteInfoHelper(uint32 accountId, char const* accountName, ChatHandler *handler)
|
||||
{
|
||||
PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
|
||||
LoginDatabasePreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
|
||||
stmt->setUInt32(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -2630,7 +2630,7 @@ public:
|
||||
}
|
||||
|
||||
// If player found: delete his freeze aura
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -2650,7 +2650,7 @@ public:
|
||||
static bool HandleListFreezeCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
// Get names from DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
wait = 0;
|
||||
|
||||
// Update movement type
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
|
||||
|
||||
stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
|
||||
stmt->setUInt64(1, lowGuid);
|
||||
@@ -615,7 +615,7 @@ public:
|
||||
const_cast<CreatureTemplate*>(cinfo)->faction = factionId;
|
||||
|
||||
// ..and DB
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_FACTION);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_FACTION);
|
||||
|
||||
stmt->setUInt16(0, uint16(factionId));
|
||||
stmt->setUInt32(1, creature->GetEntry());
|
||||
@@ -647,7 +647,7 @@ public:
|
||||
creature->SetNpcFlags(NPCFlags(raw[0]));
|
||||
creature->SetNpcFlags2(NPCFlags2(raw[1]));
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
|
||||
|
||||
stmt->setUInt64(0, npcFlags);
|
||||
stmt->setUInt32(1, creature->GetEntry());
|
||||
@@ -799,7 +799,7 @@ public:
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_NEAREST);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_NEAREST);
|
||||
stmt->setFloat(0, player->GetPositionX());
|
||||
stmt->setFloat(1, player->GetPositionY());
|
||||
stmt->setFloat(2, player->GetPositionZ());
|
||||
@@ -900,7 +900,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
|
||||
|
||||
stmt->setFloat(0, x);
|
||||
stmt->setFloat(1, y);
|
||||
@@ -1193,7 +1193,7 @@ public:
|
||||
creature->Respawn();
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE);
|
||||
|
||||
stmt->setFloat(0, option);
|
||||
stmt->setUInt8(1, uint8(mtype));
|
||||
@@ -1224,7 +1224,7 @@ public:
|
||||
|
||||
ObjectGuid::LowType guidLow = creature->GetSpawnId();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
|
||||
stmt->setUInt32(0, spawnTime);
|
||||
stmt->setUInt64(1, guidLow);
|
||||
|
||||
@@ -1566,7 +1566,7 @@ public:
|
||||
sFormationMgr->CreatureGroupMap[lowguid] = group_member;
|
||||
creature->SearchFormation();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION);
|
||||
|
||||
stmt->setUInt64(0, leaderGUID);
|
||||
stmt->setUInt64(1, lowguid);
|
||||
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
|
||||
stmt->setUInt32(0, quest->GetQuestId());
|
||||
stmt->setUInt64(1, player->GetGUID().GetCounter());
|
||||
|
||||
|
||||
@@ -432,7 +432,7 @@ public:
|
||||
{
|
||||
uint32 entry = atoul(*itr);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEMPLATE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEMPLATE);
|
||||
stmt->setUInt32(0, entry);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
|
||||
stmt->setUInt64(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
}
|
||||
else if (!targetGuid.IsEmpty())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
|
||||
stmt->setUInt64(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
|
||||
stmt->setUInt16(0, uint16(atLogin));
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation());
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
|
||||
stmt->setUInt64(0, target_guid.GetCounter());
|
||||
PreparedQueryResult resultDB = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
pathid = target->GetWaypointPath();
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID);
|
||||
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT);
|
||||
stmt->setUInt32(0, pathid);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
|
||||
guidLow = target->GetSpawnId();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID);
|
||||
|
||||
stmt->setUInt64(0, guidLow);
|
||||
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
{
|
||||
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
WorldDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
if (!target)
|
||||
{
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
|
||||
char* show_str = strtok((char*)args, " ");
|
||||
std::string show = show_str;
|
||||
PreparedStatement* stmt = NULL;
|
||||
WorldDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
// Check
|
||||
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid"))
|
||||
@@ -572,7 +572,7 @@ public:
|
||||
uint32 pathid = 0;
|
||||
uint32 point = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
WorldDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
// User did select a visual waypoint?
|
||||
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
|
||||
@@ -736,7 +736,7 @@ public:
|
||||
|
||||
uint32 pathid = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
WorldDatabasePreparedStatement* stmt = NULL;
|
||||
|
||||
// Did player provide a PathID?
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ class AccountActionIpLogger : public AccountScript
|
||||
{
|
||||
// As we can assume most account actions are NOT failed login, so this is the more accurate check.
|
||||
// For those, we need last_ip...
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING);
|
||||
|
||||
stmt->setUInt32(0, playerGuid);
|
||||
stmt->setUInt32(1, 0);
|
||||
@@ -147,7 +147,7 @@ class AccountActionIpLogger : public AccountScript
|
||||
}
|
||||
else // ... but for failed login, we query last_attempt_ip from account table. Which we do with an unique query
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FACL_IP_LOGGING);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FACL_IP_LOGGING);
|
||||
|
||||
stmt->setUInt32(0, playerGuid);
|
||||
stmt->setUInt32(1, 0);
|
||||
@@ -228,7 +228,7 @@ class CharacterActionIpLogger : public PlayerScript
|
||||
}
|
||||
|
||||
// Once we have done everything, we can insert the new log.
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_CHAR_IP_LOGGING);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_CHAR_IP_LOGGING);
|
||||
|
||||
stmt->setUInt32(0, playerGuid);
|
||||
stmt->setUInt64(1, player->GetGUID().GetCounter());
|
||||
@@ -286,7 +286,7 @@ public:
|
||||
}
|
||||
|
||||
// Once we have done everything, we can insert the new log.
|
||||
PreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING);
|
||||
LoginDatabasePreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING);
|
||||
|
||||
stmt2->setUInt32(0, playerGuid);
|
||||
stmt2->setUInt64(1, guid.GetCounter());
|
||||
|
||||
@@ -202,7 +202,7 @@ char* DB2DatabaseLoader::Load(uint32& records, char**& indexTable, char*& string
|
||||
|
||||
void DB2DatabaseLoader::LoadStrings(uint32 locale, uint32 records, char** indexTable, std::vector<char*>& stringPool)
|
||||
{
|
||||
PreparedStatement* stmt = HotfixDatabase.GetPreparedStatement(HotfixDatabaseStatements(_loadInfo->Statement + 1));
|
||||
HotfixDatabasePreparedStatement* stmt = HotfixDatabase.GetPreparedStatement(HotfixDatabaseStatements(_loadInfo->Statement + 1));
|
||||
stmt->setString(0, localeNames[locale]);
|
||||
PreparedQueryResult result = HotfixDatabase.Query(stmt);
|
||||
if (!result)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user