Core/DBLayer: Prevent using prepared statements on wrong database
This commit is contained in:
1 parent
eaee7b3cfa
commit
d003ebd8e4
98 files changed
+569
-541
No files matched your search
@@ -112,7 +112,7 @@ void BNetRealmList::UpdateRealms(boost::system::error_code const& error)
|
||||
|
||||
TC_LOG_DEBUG("server.authserver", "Updating Realm List...");
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
// Circle through results and add them to the realm map
|
||||
|
||||
@@ -116,7 +116,7 @@ void Battlenet::Session::_SetVSFields(std::string const& pstr)
|
||||
x.SetBinary(sha.GetDigest(), sha.GetLength());
|
||||
v = g.ModExp(x, N);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_VS_FIELDS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_VS_FIELDS);
|
||||
stmt->setString(0, v.AsHexStr());
|
||||
stmt->setString(1, s.AsHexStr());
|
||||
stmt->setString(2, _accountInfo->Login);
|
||||
@@ -196,7 +196,7 @@ void Battlenet::Session::HandleLogonRequest(Authentication::LogonRequest const&
|
||||
_os = logonRequest.Platform;
|
||||
|
||||
Utf8ToUpperOnlyLatin(login);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_INFO);
|
||||
stmt->setString(0, login);
|
||||
|
||||
_queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&Battlenet::Session::HandleLogonRequestCallback, this, std::placeholders::_1)));
|
||||
@@ -334,7 +334,7 @@ void Battlenet::Session::HandleResumeRequest(Authentication::ResumeRequest const
|
||||
_build = baseComponent->Build;
|
||||
|
||||
Utf8ToUpperOnlyLatin(login);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_RECONNECT_INFO);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_RECONNECT_INFO);
|
||||
stmt->setString(0, login);
|
||||
stmt->setString(1, resumeRequest.GameAccountName);
|
||||
|
||||
@@ -421,7 +421,7 @@ void Battlenet::Session::HandleEnableEncryption(Connection::EnableEncryption& en
|
||||
|
||||
void Battlenet::Session::HandleLogoutRequest(Connection::LogoutRequest const& /*logoutRequest*/)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_SESSION_KEY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_SESSION_KEY);
|
||||
stmt->setString(0, "");
|
||||
stmt->setBool(1, false);
|
||||
stmt->setUInt32(2, _accountInfo->Id);
|
||||
@@ -434,7 +434,7 @@ void Battlenet::Session::HandleConnectionClosing(Connection::ConnectionClosing c
|
||||
|
||||
void Battlenet::Session::HandleListSubscribeRequest(WoWRealm::ListSubscribeRequest const& /*listSubscribeRequest*/)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_CHARACTER_COUNTS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_CHARACTER_COUNTS);
|
||||
stmt->setUInt32(0, _gameAccountInfo->Id);
|
||||
|
||||
_queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&Battlenet::Session::HandleListSubscribeRequestCallback, this, std::placeholders::_1)));
|
||||
@@ -498,7 +498,7 @@ void Battlenet::Session::HandleJoinRequestV2(WoWRealm::JoinRequestV2 const& join
|
||||
|
||||
memcpy(sessionKey + hmac.GetLength(), hmac2.GetDigest(), hmac2.GetLength());
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
|
||||
stmt->setString(0, ByteArrayToHexStr(sessionKey, 40, true).c_str());
|
||||
stmt->setString(1, GetRemoteIpAddress().to_string());
|
||||
stmt->setUInt32(2, GetLocaleByName(_locale));
|
||||
@@ -606,7 +606,7 @@ void Battlenet::Session::Start()
|
||||
std::string ip_address = GetRemoteIpAddress().to_string();
|
||||
TC_LOG_TRACE("session", "Accepted connection from %s", ip_address.c_str());
|
||||
|
||||
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)));
|
||||
@@ -801,7 +801,7 @@ bool Battlenet::Session::HandlePasswordModule(BitStream* dataStream, ServerPacke
|
||||
|
||||
if (memcmp(M1.AsByteArray().get(), clientM1.AsByteArray().get(), 32))
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_FAILED_LOGINS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_FAILED_LOGINS);
|
||||
stmt->setString(0, _accountInfo->Login);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
@@ -971,7 +971,7 @@ bool Battlenet::Session::HandleRiskFingerprintModule(BitStream* dataStream, Serv
|
||||
|
||||
SQLTransaction trans = LoginDatabase.BeginTransaction();
|
||||
|
||||
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);
|
||||
@@ -1040,7 +1040,7 @@ bool Battlenet::Session::HandleResumeModule(BitStream* dataStream, ServerPacket*
|
||||
|
||||
if (memcmp(proof.GetDigest(), clientProof.get(), serverPart.GetLength()))
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_FAILED_LOGINS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_FAILED_LOGINS);
|
||||
stmt->setString(0, _accountInfo->Login);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
@@ -1051,7 +1051,7 @@ bool Battlenet::Session::HandleResumeModule(BitStream* dataStream, ServerPacket*
|
||||
return false;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_SESSION_KEY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_SESSION_KEY);
|
||||
stmt->setString(0, K.AsHexStr());
|
||||
stmt->setBool(1, true);
|
||||
stmt->setUInt32(2, _accountInfo->Id);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -184,7 +184,7 @@ QueryResult DatabaseWorkerPool<T>::Query(char const* 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);
|
||||
@@ -213,7 +213,7 @@ QueryCallback DatabaseWorkerPool<T>::AsyncQuery(char const* 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
|
||||
@@ -292,9 +292,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, _preparedStatementSize[index]);
|
||||
return new PreparedStatement<T>(index, _preparedStatementSize[index]);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@@ -419,7 +419,7 @@ void DatabaseWorkerPool<T>::Execute(char const* sql)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::Execute(PreparedStatement* stmt)
|
||||
void DatabaseWorkerPool<T>::Execute(PreparedStatement<T>* stmt)
|
||||
{
|
||||
PreparedStatementTask* task = new PreparedStatementTask(stmt);
|
||||
Enqueue(task);
|
||||
@@ -437,7 +437,7 @@ void DatabaseWorkerPool<T>::DirectExecute(char const* sql)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::DirectExecute(PreparedStatement* stmt)
|
||||
void DatabaseWorkerPool<T>::DirectExecute(PreparedStatement<T>* stmt)
|
||||
{
|
||||
T* connection = GetFreeConnection();
|
||||
connection->Execute(stmt);
|
||||
@@ -457,7 +457,7 @@ void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, char const* 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);
|
||||
|
||||
@@ -585,4 +585,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using CharacterDatabasePreparedStatement = PreparedStatement<CharacterDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
@@ -56,4 +56,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using HotfixDatabasePreparedStatement = PreparedStatement<HotfixDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
@@ -149,4 +149,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using LoginDatabasePreparedStatement = PreparedStatement<LoginDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
@@ -116,4 +116,6 @@ public:
|
||||
void DoPrepareStatements() override;
|
||||
};
|
||||
|
||||
using WorldDatabasePreparedStatement = PreparedStatement<WorldDatabaseConnection>;
|
||||
|
||||
#endif
|
||||
@@ -192,7 +192,7 @@ bool MySQLConnection::Execute(char const* sql)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MySQLConnection::Execute(PreparedStatement* stmt)
|
||||
bool MySQLConnection::Execute(PreparedStatementBase* stmt)
|
||||
{
|
||||
if (!m_Mysql)
|
||||
return false;
|
||||
@@ -240,7 +240,7 @@ bool MySQLConnection::Execute(PreparedStatement* stmt)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MySQLConnection::_Query(PreparedStatement* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount)
|
||||
bool MySQLConnection::_Query(PreparedStatementBase* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount)
|
||||
{
|
||||
if (!m_Mysql)
|
||||
return false;
|
||||
@@ -381,7 +381,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, std::string const& sql, Con
|
||||
}
|
||||
}
|
||||
|
||||
PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
|
||||
PreparedResultSet* MySQLConnection::Query(PreparedStatementBase* stmt)
|
||||
{
|
||||
MySQLResult* result = nullptr;
|
||||
uint64 rowCount = 0;
|
||||
|
||||
@@ -67,11 +67,11 @@ class TC_DATABASE_API MySQLConnection
|
||||
bool PrepareStatements();
|
||||
|
||||
bool Execute(char const* sql);
|
||||
bool Execute(PreparedStatement* stmt);
|
||||
bool Execute(PreparedStatementBase* stmt);
|
||||
ResultSet* Query(char const* sql);
|
||||
PreparedResultSet* Query(PreparedStatement* stmt);
|
||||
PreparedResultSet* Query(PreparedStatementBase* stmt);
|
||||
bool _Query(char const* sql, MySQLResult** pResult, MySQLField** pFields, uint64* pRowCount, uint32* pFieldCount);
|
||||
bool _Query(PreparedStatement* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount);
|
||||
bool _Query(PreparedStatementBase* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount);
|
||||
|
||||
void BeginTransaction();
|
||||
void RollbackTransaction();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <vector>
|
||||
|
||||
class MySQLConnection;
|
||||
class PreparedStatement;
|
||||
class PreparedStatementBase;
|
||||
|
||||
//- Class of which the instances are unique per MySQLConnection
|
||||
//- access to these class objects is only done when a prepared statement task
|
||||
@@ -58,7 +58,7 @@ class TC_DATABASE_API MySQLPreparedStatement
|
||||
protected:
|
||||
MySQLStmt* GetSTMT() { return m_Mstmt; }
|
||||
MySQLBind* GetBind() { return m_bind; }
|
||||
PreparedStatement* m_stmt;
|
||||
PreparedStatementBase* m_stmt;
|
||||
void ClearParameters();
|
||||
void AssertValidIndex(uint8 index);
|
||||
std::string getQueryString() const;
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
#include "Log.h"
|
||||
#include "MySQLWorkaround.h"
|
||||
|
||||
PreparedStatement::PreparedStatement(uint32 index, uint8 capacity) :
|
||||
PreparedStatementBase::PreparedStatementBase(uint32 index, uint8 capacity) :
|
||||
m_stmt(nullptr), m_index(index), statement_data(capacity) { }
|
||||
|
||||
PreparedStatement::~PreparedStatement() { }
|
||||
PreparedStatementBase::~PreparedStatementBase() { }
|
||||
|
||||
void PreparedStatement::BindParameters(MySQLPreparedStatement* stmt)
|
||||
void PreparedStatementBase::BindParameters(MySQLPreparedStatement* stmt)
|
||||
{
|
||||
ASSERT(stmt);
|
||||
m_stmt = stmt;
|
||||
@@ -89,84 +89,84 @@ void PreparedStatement::BindParameters(MySQLPreparedStatement* stmt)
|
||||
}
|
||||
|
||||
//- Bind to buffer
|
||||
void PreparedStatement::setBool(const uint8 index, const bool value)
|
||||
void PreparedStatementBase::setBool(const uint8 index, const bool value)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.boolean = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.ui8 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.ui16 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.ui32 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.ui64 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.i8 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.i16 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.i32 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.i64 = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.f = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].data.d = 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].binary.resize(value.length() + 1);
|
||||
@@ -174,21 +174,21 @@ 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)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].binary = value;
|
||||
statement_data[index].type = TYPE_BINARY;
|
||||
}
|
||||
|
||||
void PreparedStatement::setNull(const uint8 index)
|
||||
void PreparedStatementBase::setNull(const uint8 index)
|
||||
{
|
||||
ASSERT(index < statement_data.size());
|
||||
statement_data[index].type = TYPE_NULL;
|
||||
}
|
||||
|
||||
//- 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:
|
||||
PreparedStatement(uint32 index, uint8 capacity);
|
||||
~PreparedStatement();
|
||||
explicit PreparedStatementBase(uint32 index, uint8 capacity);
|
||||
virtual ~PreparedStatementBase();
|
||||
|
||||
void setNull(uint8 index);
|
||||
void setBool(uint8 index, bool value);
|
||||
@@ -109,22 +109,35 @@ class TC_DATABASE_API PreparedStatement
|
||||
//- Buffer of parameters, not tied to MySQL in any way yet
|
||||
std::vector<PreparedStatementData> statement_data;
|
||||
|
||||
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, uint8 capacity) : PreparedStatementBase(index, capacity)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
PreparedStatement(PreparedStatement const& right) = delete;
|
||||
PreparedStatement& operator=(PreparedStatement const& right) = delete;
|
||||
};
|
||||
|
||||
//- Lower-level class, enqueuable operation
|
||||
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,12 +24,12 @@ 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;
|
||||
char const* query;
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void Transaction::Append(char const* 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(char const* 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);
|
||||
|
||||
@@ -44,7 +44,7 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
|
||||
_waypointStore.clear();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -114,7 +114,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)
|
||||
|
||||
@@ -56,7 +56,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));
|
||||
@@ -84,15 +84,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);
|
||||
|
||||
@@ -131,25 +131,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);
|
||||
|
||||
@@ -159,7 +159,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);
|
||||
|
||||
@@ -205,7 +205,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);
|
||||
@@ -243,7 +243,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);
|
||||
@@ -270,7 +270,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);
|
||||
@@ -283,7 +283,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);
|
||||
|
||||
@@ -292,7 +292,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);
|
||||
|
||||
@@ -301,7 +301,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);
|
||||
@@ -311,7 +311,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);
|
||||
|
||||
@@ -326,7 +326,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);
|
||||
|
||||
@@ -349,7 +349,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);
|
||||
@@ -377,7 +377,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);
|
||||
|
||||
@@ -398,7 +398,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);
|
||||
|
||||
@@ -519,13 +519,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);
|
||||
@@ -534,7 +534,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());
|
||||
|
||||
|
||||
@@ -523,7 +523,7 @@ void AchievementMgr<Player>::DeleteFromDB(ObjectGuid guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -539,7 +539,7 @@ void AchievementMgr<Guild>::DeleteFromDB(ObjectGuid guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -565,7 +565,7 @@ void AchievementMgr<Player>::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->setUInt16(0, iter->first);
|
||||
stmt->setUInt32(1, GetOwner()->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -587,7 +587,7 @@ void AchievementMgr<Player>::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->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
trans->Append(stmt);
|
||||
@@ -610,7 +610,7 @@ void AchievementMgr<Player>::SaveToDB(SQLTransaction& trans)
|
||||
template<>
|
||||
void AchievementMgr<Guild>::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
std::ostringstream guidstr;
|
||||
for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr)
|
||||
{
|
||||
@@ -706,7 +706,7 @@ void AchievementMgr<Player>::LoadFromDB(PreparedQueryResult achievementResult, P
|
||||
// Removing non-existing criteria data for all characters
|
||||
TC_LOG_ERROR("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->setUInt16(0, uint16(id));
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -769,7 +769,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
|
||||
// we will remove not existed criteria for all guilds
|
||||
TC_LOG_ERROR("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->setUInt16(0, uint16(id));
|
||||
CharacterDatabase.Execute(stmt);
|
||||
continue;
|
||||
@@ -3445,7 +3445,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
|
||||
// Remove non-existing achievements from all characters
|
||||
TC_LOG_ERROR("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->setUInt16(0, uint16(achievementId));
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ void LoadFromDB()
|
||||
|
||||
void SaveAddon(std::string const& name, uint32 publicKeyCrc)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ADDON);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ADDON);
|
||||
|
||||
stmt->setString(0, name);
|
||||
stmt->setUInt32(1, publicKeyCrc);
|
||||
|
||||
@@ -166,7 +166,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->setUInt32(0, auction->bidder);
|
||||
stmt->setUInt32(1, pItem->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -310,7 +310,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)
|
||||
@@ -356,7 +356,7 @@ void AuctionHouseMgr::LoadAuctions()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONS);
|
||||
PreparedQueryResult resultAuctions = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!resultAuctions)
|
||||
@@ -368,7 +368,7 @@ void AuctionHouseMgr::LoadAuctions()
|
||||
|
||||
// parse bidder list
|
||||
std::unordered_map<uint32, std::unordered_set<ObjectGuid>> biddersByAuction;
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_BIDDERS);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_BIDDERS);
|
||||
|
||||
uint32 countBidders = 0;
|
||||
if (PreparedQueryResult resultBidders = CharacterDatabase.Query(stmt2))
|
||||
@@ -876,7 +876,7 @@ uint32 AuctionEntry::GetAuctionOutBid() const
|
||||
|
||||
void AuctionEntry::DeleteFromDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AUCTION);
|
||||
stmt->setUInt32(0, Id);
|
||||
@@ -889,7 +889,7 @@ void AuctionEntry::DeleteFromDB(SQLTransaction& trans) const
|
||||
|
||||
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->setUInt8(1, houseId);
|
||||
stmt->setUInt32(2, itemGUIDLow);
|
||||
|
||||
@@ -67,7 +67,7 @@ bool AuctionBotConfig::Initialize()
|
||||
{
|
||||
// find account guids associated with ahbot account
|
||||
uint32 count = 0;
|
||||
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))
|
||||
{
|
||||
|
||||
@@ -430,7 +430,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->setUInt32(0, auction->bidder);
|
||||
stmt->setUInt32(1, auction->bid);
|
||||
stmt->setUInt32(2, auction->Id);
|
||||
|
||||
@@ -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->setUInt32(2, captainLowGuid);
|
||||
@@ -132,7 +132,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->setUInt32(0, playerGuid.GetCounter());
|
||||
stmt->setUInt8(1, GetSlot());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -276,7 +276,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);
|
||||
@@ -294,7 +294,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->setUInt32(0, guid.GetCounter());
|
||||
stmt->setUInt32(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -361,7 +361,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->setUInt32(1, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -385,7 +385,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);
|
||||
|
||||
@@ -408,7 +408,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);
|
||||
|
||||
@@ -869,7 +869,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);
|
||||
|
||||
@@ -325,7 +325,7 @@ inline void Battleground::_ProcessOfflineQueue()
|
||||
if (isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_TRACK_DESERTERS) &&
|
||||
(GetStatus() == STATUS_IN_PROGRESS || GetStatus() == STATUS_WAIT_JOIN))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
stmt->setUInt32(0, itr->first.GetCounter());
|
||||
stmt->setUInt8(1, BG_DESERTION_TYPE_OFFLINE);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -782,7 +782,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))
|
||||
{
|
||||
|
||||
@@ -1076,7 +1076,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
if (bg && bg->isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_TRACK_DESERTERS) &&
|
||||
(bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
stmt->setUInt32(0, player->GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, BG_DESERTION_TYPE_NO_ENTER_BUTTON);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -172,7 +172,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];
|
||||
@@ -218,7 +218,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);
|
||||
@@ -239,7 +239,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->setUInt32(1, calendarEvent->GetCreatorGUID().GetCounter());
|
||||
stmt->setString(2, calendarEvent->GetTitle());
|
||||
@@ -260,7 +260,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->setUInt32(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, name);
|
||||
stmt->setUInt32(1, _channelTeam);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) // load
|
||||
@@ -146,7 +146,7 @@ void Channel::UpdateChannelInDB() const
|
||||
|
||||
std::string banListStr = banlist.str();
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -48,7 +48,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)
|
||||
{
|
||||
|
||||
@@ -100,7 +100,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);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ void Corpse::SaveToDB()
|
||||
DeleteFromDB(trans);
|
||||
|
||||
uint16 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
|
||||
stmt->setUInt32(index++, GetOwnerGUID().GetCounter()); // guid
|
||||
stmt->setFloat (index++, GetPositionX()); // posX
|
||||
stmt->setFloat (index++, GetPositionY()); // posY
|
||||
@@ -139,7 +139,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->setUInt32(0, ownerGuid.GetCounter());
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
|
||||
|
||||
@@ -1256,7 +1256,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
|
||||
// update in DB
|
||||
SQLTransaction trans = WorldDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
stmt->setUInt32(0, m_spawnId);
|
||||
|
||||
trans->Append(stmt);
|
||||
@@ -1669,7 +1669,7 @@ bool Creature::hasInvolvedQuest(uint32 quest_id) const
|
||||
sObjectMgr->DeleteCreatureData(spawnId);
|
||||
|
||||
// ... and the database
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
stmt->setUInt32(0, spawnId);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -903,7 +903,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask)
|
||||
|
||||
uint8 index = 0;
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
stmt->setUInt32(0, m_spawnId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1023,7 +1023,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap
|
||||
|
||||
// delete data from memory
|
||||
sObjectMgr->DeleteGameObjectData(spawnId);
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
|
||||
stmt->setUInt32(0, spawnId);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -336,7 +336,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->setUInt32(++index, GetOwnerGUID().GetCounter());
|
||||
stmt->setUInt32(++index, GetGuidValue(ITEM_FIELD_CREATOR).GetCounter());
|
||||
@@ -379,7 +379,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->setUInt32(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -481,7 +481,7 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi
|
||||
|
||||
if (need_save) // normal item changed state set not work at loading
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD);
|
||||
stmt->setUInt32(0, GetUInt32Value(ITEM_FIELD_DURATION));
|
||||
stmt->setUInt32(1, GetUInt32Value(ITEM_FIELD_FLAGS));
|
||||
stmt->setUInt32(2, GetUInt32Value(ITEM_FIELD_DURABILITY));
|
||||
@@ -495,7 +495,7 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi
|
||||
/*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->setUInt32(0, itemGuid);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -512,7 +512,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->setUInt32(0, itemGuid);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -1052,7 +1052,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1070,7 +1070,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->setUInt32(0, GetGUID().GetCounter());
|
||||
(*trans)->Append(stmt);
|
||||
|
||||
@@ -1130,7 +1130,7 @@ void Item::ClearSoulboundTradeable(Player* currentOwner)
|
||||
|
||||
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->setUInt32(0, GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ bool Pet::LoadPetData(Player* owner, uint32 petEntry, uint32 petnumber, bool cur
|
||||
|
||||
if (getPetType() == HUNTER_PET)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_DECLINED_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_DECLINED_NAME);
|
||||
stmt->setUInt32(0, owner->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, GetCharmInfo()->GetPetNumber());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -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);
|
||||
|
||||
@@ -500,7 +500,7 @@ void Pet::DeleteFromDB(ObjectGuid::LowType 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);
|
||||
|
||||
@@ -1103,7 +1103,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);
|
||||
|
||||
@@ -1112,7 +1112,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);
|
||||
|
||||
@@ -1138,7 +1138,7 @@ void Pet::_SaveSpells(SQLTransaction& trans)
|
||||
if (itr->second.type == PETSPELL_FAMILY)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
switch (itr->second.state)
|
||||
{
|
||||
@@ -1181,7 +1181,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||
{
|
||||
TC_LOG_DEBUG("entities.pet", "Loading auras for pet %u", GetGUID().GetCounter());
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_AURA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_AURA);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -1253,7 +1253,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||
|
||||
void Pet::_SaveAuras(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURAS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURAS);
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1322,7 +1322,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);
|
||||
|
||||
|
||||
@@ -1059,7 +1059,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, "");
|
||||
@@ -2968,7 +2968,7 @@ void DeleteSpellFromAllPlayers(uint32 spellId)
|
||||
CharacterDatabaseStatements stmts[2] = {CHAR_DEL_INVALID_SPELL_SPELLS, CHAR_DEL_INVALID_SPELL_TALENTS};
|
||||
for (uint8 i = 0; i < 2; i++)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(stmts[i]);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(stmts[i]);
|
||||
|
||||
stmt->setUInt32(0, spellId);
|
||||
|
||||
@@ -4004,7 +4004,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->setUInt32(0, guid);
|
||||
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -4368,7 +4368,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(GameTime::GetGameTime() - time_t(keepDays * DAY)));
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -4566,7 +4566,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, AT_LOGIN_RESURRECT);
|
||||
stmt->setUInt32(1, guid.GetCounter());
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
@@ -6866,7 +6866,7 @@ void Player::_LoadCurrency(PreparedQueryResult result)
|
||||
|
||||
void Player::_SaveCurrency(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
for (PlayerCurrenciesMap::iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr)
|
||||
{
|
||||
CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first);
|
||||
@@ -7281,7 +7281,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->setUInt32(0, guidLow);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -11689,7 +11689,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
|
||||
for (++itr; itr != allowedLooters.end(); ++itr)
|
||||
ss << ' ' << itr->GetCounter();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE);
|
||||
stmt->setUInt32(0, pItem->GetGUID().GetCounter());
|
||||
stmt->setString(1, ss.str());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -12143,7 +12143,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
|
||||
stmt->setUInt32(0, pItem->GetGUID().GetCounter());
|
||||
|
||||
@@ -15007,7 +15007,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 data
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_TRACK);
|
||||
stmt->setUInt32(0, quest_id);
|
||||
stmt->setUInt32(1, GetGUID().GetCounter());
|
||||
stmt->setString(2, GitRevision::GetHash());
|
||||
@@ -15038,7 +15038,7 @@ void Player::CompleteQuest(uint32 quest_id)
|
||||
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_COMPLETE_TIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_COMPLETE_TIME);
|
||||
stmt->setUInt32(0, quest_id);
|
||||
stmt->setUInt32(1, GetGUID().GetCounter());
|
||||
|
||||
@@ -17054,7 +17054,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->setUInt32(0, guid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -17080,7 +17080,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);
|
||||
@@ -17162,7 +17162,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->setUInt32(1, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -18395,7 +18395,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))
|
||||
@@ -18515,7 +18515,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)
|
||||
@@ -18586,7 +18586,7 @@ void Player::_LoadMail()
|
||||
{
|
||||
m_mail.clear();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -19153,7 +19153,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->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, instanceId);
|
||||
@@ -19209,7 +19209,7 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu
|
||||
{
|
||||
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->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, itr->second.save->GetInstanceId());
|
||||
@@ -19244,7 +19244,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);
|
||||
@@ -19257,7 +19257,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->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, save->GetInstanceId());
|
||||
@@ -19590,7 +19590,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->setUInt32(0, GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -19604,7 +19604,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->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, m_homebindMapId);
|
||||
stmt->setUInt16(2, m_homebindAreaId);
|
||||
@@ -19646,7 +19646,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);
|
||||
@@ -19989,7 +19989,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->setUInt32(1, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -19997,7 +19997,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();)
|
||||
{
|
||||
@@ -20045,7 +20045,7 @@ void Player::_SaveActions(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveAuras(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20100,7 +20100,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)
|
||||
@@ -20241,7 +20241,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveVoidStorage(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
uint32 lowGuid = GetGUID().GetCounter();
|
||||
|
||||
for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i)
|
||||
@@ -20273,7 +20273,7 @@ void Player::_SaveVoidStorage(SQLTransaction& trans)
|
||||
|
||||
void Player::_SaveCUFProfiles(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
uint32 lowGuid = GetGUID().GetCounter();
|
||||
|
||||
for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i)
|
||||
@@ -20315,7 +20315,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)
|
||||
{
|
||||
@@ -20391,7 +20391,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans)
|
||||
|
||||
QuestStatusSaveMap::iterator saveItr;
|
||||
QuestStatusMap::iterator statusItr;
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
bool keepAbandoned = !(sWorld->GetCleaningFlags() & CharacterDatabaseCleaner::CLEANING_FLAG_QUESTSTATUS);
|
||||
|
||||
@@ -20467,7 +20467,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20490,7 +20490,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20513,7 +20513,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20545,7 +20545,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20568,7 +20568,7 @@ void Player::_SaveLFGRewardStatus(SQLTransaction& trans)
|
||||
return;
|
||||
|
||||
// we don't need transactions here.
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_REWARDSTATUS_LFG);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_REWARDSTATUS_LFG);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -20591,7 +20591,7 @@ void Player::_SaveLFGRewardStatus(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();)
|
||||
{
|
||||
@@ -20642,7 +20642,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();)
|
||||
{
|
||||
@@ -20687,7 +20687,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->setUInt32(0, GetGUID().GetCounter());
|
||||
@@ -20792,7 +20792,7 @@ void Player::SendAttackSwingNotInRange() 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());
|
||||
@@ -20818,7 +20818,7 @@ void Player::SetUInt32ValueInArray(Tokenizer& Tokenizer, uint16 index, uint32 va
|
||||
|
||||
void Player::Customize(CharacterCustomizeInfo const* customizeInfo, SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_AND_APPEARANCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_AND_APPEARANCE);
|
||||
|
||||
stmt->setUInt8(0, customizeInfo->Gender);
|
||||
stmt->setUInt8(1, customizeInfo->Skin);
|
||||
@@ -21738,7 +21738,7 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const
|
||||
|
||||
void Player::RemovePetitionsAndSigns(ObjectGuid guid, uint32 type)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
if (type == 10)
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID);
|
||||
@@ -23078,7 +23078,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
|
||||
if (bg->isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_TRACK_DESERTERS) &&
|
||||
(bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, BG_DESERTION_TYPE_LEAVE_BG);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -26740,7 +26740,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)
|
||||
{
|
||||
@@ -26787,7 +26787,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
/* guid, bgInstanceID, bgTeam, x, y, z, o, map, taxi[0], taxi[1], mountSpell */
|
||||
@@ -26828,7 +26828,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->setUInt32(1, GetGUID().GetCounter());
|
||||
@@ -26877,7 +26877,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->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -26911,7 +26911,7 @@ void Player::_LoadTalents(PreparedQueryResult result)
|
||||
|
||||
void Player::_SaveTalents(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i)
|
||||
{
|
||||
@@ -26959,7 +26959,7 @@ void Player::UpdateSpecCount(uint8 count)
|
||||
ActivateSpec(0);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
|
||||
// Copy spec data
|
||||
if (count > curCount)
|
||||
@@ -27167,7 +27167,7 @@ void Player::ActivateSpec(uint8 spec)
|
||||
|
||||
// load them asynchronously
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, GetActiveSpec());
|
||||
|
||||
@@ -27517,7 +27517,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->setUInt32(0, GetGUID().GetCounter());
|
||||
|
||||
@@ -27687,7 +27687,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);
|
||||
|
||||
|
||||
@@ -49,7 +49,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->setUInt32(1, GetPlayerGUID().GetCounter());
|
||||
@@ -61,7 +61,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->setUInt32(0, GetPlayerGUID().GetCounter());
|
||||
stmt->setUInt32(1, friendGuid.GetCounter());
|
||||
@@ -83,7 +83,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->setUInt32(0, GetPlayerGUID().GetCounter());
|
||||
stmt->setUInt32(1, friendGuid.GetCounter());
|
||||
@@ -94,7 +94,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->setUInt32(1, GetPlayerGUID());
|
||||
@@ -113,7 +113,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->setUInt32(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);
|
||||
|
||||
@@ -1624,7 +1624,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);
|
||||
@@ -1669,7 +1669,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);
|
||||
|
||||
|
||||
@@ -1805,7 +1805,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->setUInt32(0, guidLow);
|
||||
WorldDatabase.Execute(stmt);
|
||||
return true;
|
||||
@@ -1834,7 +1834,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid
|
||||
ObjectGuid linkedGuid(HighGuid::Unit, 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->setUInt32(0, guidLow);
|
||||
stmt->setUInt32(1, linkedGuidLow);
|
||||
WorldDatabase.Execute(stmt);
|
||||
@@ -2120,7 +2120,7 @@ void ObjectMgr::LoadCreatures()
|
||||
PhasingHandler::InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
sMapMgr->GetZoneAndAreaId(phaseShift, zoneId, areaId, data.spawnPoint);
|
||||
|
||||
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);
|
||||
@@ -2466,7 +2466,7 @@ void ObjectMgr::LoadGameObjects()
|
||||
PhasingHandler::InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
sMapMgr->GetZoneAndAreaId(phaseShift, zoneId, areaId, data.spawnPoint);
|
||||
|
||||
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);
|
||||
@@ -5270,7 +5270,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)
|
||||
@@ -5806,11 +5806,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)
|
||||
@@ -6537,7 +6537,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);
|
||||
@@ -6588,7 +6588,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);
|
||||
@@ -8541,7 +8541,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);
|
||||
@@ -8570,7 +8570,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);
|
||||
|
||||
@@ -8825,7 +8825,7 @@ void ObjectMgr::LoadCreatureDefaultTrainers()
|
||||
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, uint8 type, 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));
|
||||
stmt->setUInt8(1, type);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
@@ -9065,7 +9065,7 @@ void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32
|
||||
|
||||
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, item);
|
||||
@@ -9089,7 +9089,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);
|
||||
|
||||
@@ -133,7 +133,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;
|
||||
|
||||
@@ -216,7 +216,7 @@ void Group::LoadMemberFromDB(ObjectGuid::LowType guidLow, uint8 memberFlags, uin
|
||||
if (!sCharacterCache->GetCharacterNameByGuid(member.guid, member.name) ||
|
||||
!sCharacterCache->GetPlayerGuildIdByGUID(member.guid, member.guildId))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt32(0, guidLow);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return;
|
||||
@@ -239,7 +239,7 @@ void Group::ConvertToLFG()
|
||||
m_lootMethod = NEED_BEFORE_GREED;
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_groupType));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -259,7 +259,7 @@ void Group::ConvertToLFR()
|
||||
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
stmt->setUInt8(0, uint8(m_groupType));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -278,7 +278,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_groupType));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -309,7 +309,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_groupType));
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -448,7 +448,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->setUInt32(1, member.guid.GetCounter());
|
||||
@@ -611,7 +611,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->setUInt32(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
DelinkMember(guid);
|
||||
@@ -721,7 +721,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid)
|
||||
// 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);
|
||||
@@ -738,7 +738,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid)
|
||||
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->setUInt32(0, newLeader->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, m_dbStoreId);
|
||||
@@ -867,7 +867,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);
|
||||
|
||||
@@ -1880,7 +1880,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->setUInt32(1, guid.GetCounter());
|
||||
@@ -2042,7 +2042,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->setUInt32(1, guid.GetCounter());
|
||||
@@ -2234,7 +2234,7 @@ void Group::SetDungeonDifficulty(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);
|
||||
@@ -2258,7 +2258,7 @@ void Group::SetRaidDifficulty(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);
|
||||
@@ -2372,7 +2372,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
|
||||
{
|
||||
if (!ObjectAccessor::FindConnectedPlayer(member.guid))
|
||||
{
|
||||
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION_BY_MAPID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION_BY_MAPID);
|
||||
|
||||
stmt->setFloat(0, graveyardLocation->Loc.X);
|
||||
stmt->setFloat(1, graveyardLocation->Loc.Y);
|
||||
@@ -2393,7 +2393,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
|
||||
}
|
||||
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());
|
||||
|
||||
@@ -2456,7 +2456,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, boo
|
||||
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][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());
|
||||
@@ -2488,7 +2488,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());
|
||||
@@ -2747,7 +2747,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->setUInt32(1, guid.GetCounter());
|
||||
|
||||
@@ -193,7 +193,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->setUInt32(0, m_guildId);
|
||||
stmt->setUInt32(1, m_guid);
|
||||
trans->Append(stmt);
|
||||
@@ -267,7 +267,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->setUInt32( index, m_guildId);
|
||||
stmt->setUInt32(++index, m_guid);
|
||||
stmt->setUInt8 (++index, m_bankTabId);
|
||||
@@ -338,7 +338,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& conten
|
||||
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->setUInt32( index, m_guildId);
|
||||
stmt->setUInt32(++index, GetGUID());
|
||||
stmt->setUInt8 (++index, GetType());
|
||||
@@ -397,7 +397,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->setUInt32(0, m_guildId);
|
||||
stmt->setUInt8 (1, m_rankId);
|
||||
stmt->setString(2, m_name);
|
||||
@@ -421,7 +421,7 @@ void Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 tabs, SQLTransaction& tran
|
||||
if (logOnCreate)
|
||||
TC_LOG_ERROR("guild", "Guild %u 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->setUInt32(0, m_guildId);
|
||||
stmt->setUInt8(1, i);
|
||||
stmt->setUInt8(2, m_rankId);
|
||||
@@ -438,7 +438,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->setUInt32(2, m_guildId);
|
||||
@@ -455,7 +455,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->setUInt32(2, m_guildId);
|
||||
@@ -472,7 +472,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->setUInt32(2, m_guildId);
|
||||
@@ -489,7 +489,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->setUInt32(0, m_guildId);
|
||||
stmt->setUInt8 (1, guildBR.GetTabId());
|
||||
stmt->setUInt8 (2, m_rankId);
|
||||
@@ -535,7 +535,7 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields)
|
||||
{
|
||||
TC_LOG_ERROR("guild", "Item (GUID %u, 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->setUInt32(0, m_guildId);
|
||||
stmt->setUInt8 (1, m_tabId);
|
||||
stmt->setUInt8 (2, slotId);
|
||||
@@ -580,7 +580,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->setUInt32(2, m_guildId);
|
||||
@@ -596,7 +596,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->setUInt32(1, m_guildId);
|
||||
stmt->setUInt8 (2, m_tabId);
|
||||
@@ -612,7 +612,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->setUInt32(0, m_guildId);
|
||||
stmt->setUInt8 (1, m_tabId);
|
||||
stmt->setUInt8 (2, slotId);
|
||||
@@ -714,7 +714,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->setUInt32(1, m_guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -727,7 +727,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->setUInt32(1, m_guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -741,7 +741,7 @@ void Guild::Member::ChangeRank(SQLTransaction& trans, uint8 newRank)
|
||||
if (Player* player = FindPlayer())
|
||||
player->SetRank(newRank);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK);
|
||||
stmt->setUInt8 (0, newRank);
|
||||
stmt->setUInt32(1, m_guid.GetCounter());
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
@@ -752,7 +752,7 @@ void Guild::Member::AddActivity(uint64 activity)
|
||||
m_totalActivity += activity;
|
||||
m_weekActivity += activity;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_ACTIVITY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_ACTIVITY);
|
||||
stmt->setUInt64(0, m_totalActivity);
|
||||
stmt->setUInt64(1, m_weekActivity);
|
||||
stmt->setUInt32(2, m_guid.GetCounter());
|
||||
@@ -761,7 +761,7 @@ void Guild::Member::AddActivity(uint64 activity)
|
||||
|
||||
void Guild::Member::SaveToDB(SQLTransaction& trans) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER);
|
||||
stmt->setUInt32(0, m_guildId);
|
||||
stmt->setUInt32(1, m_guid.GetCounter());
|
||||
stmt->setUInt8 (2, m_rankId);
|
||||
@@ -813,7 +813,7 @@ bool Guild::Member::LoadFromDB(Field* fields)
|
||||
|
||||
void Guild::Member::LoadProfessionDataFromDB(ObjectGuid guid)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SKILLS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SKILLS);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
uint8 professionIndex = 0;
|
||||
@@ -836,7 +836,7 @@ void Guild::Member::LoadProfessionDataFromDB(ObjectGuid guid)
|
||||
profession.Rank = value;
|
||||
profession.RecipeUniqueBits.fill(0);
|
||||
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELL);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELL);
|
||||
stmt2->setUInt32(0, guid.GetCounter());
|
||||
PreparedQueryResult result2 = CharacterDatabase.Query(stmt2);
|
||||
|
||||
@@ -917,7 +917,7 @@ void Guild::Member::UpdateBankWithdrawValue(SQLTransaction& trans, uint8 tabId,
|
||||
{
|
||||
m_bankWithdraw[tabId] += amount;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW);
|
||||
stmt->setUInt32(0, m_guid.GetCounter());
|
||||
for (uint8 i = 0; i <= GUILD_BANK_MAX_TABS;)
|
||||
{
|
||||
@@ -946,7 +946,7 @@ void Guild::Member::AddReputation(uint32 rep, Player *player)
|
||||
m_weekReputation += rep;
|
||||
m_totalReputation = player->GetReputation(PLAYER_GUILD_REPUTATION);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_WEEK_REPUTATION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_WEEK_REPUTATION);
|
||||
stmt->setUInt32(0, m_weekReputation);
|
||||
stmt->setUInt32(1, m_guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -959,11 +959,11 @@ void Guild::Member::ResetWeekActivityAndReputation()
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_RESET_GUILD_MEMBER_WEEK_ACTIVITY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_RESET_GUILD_MEMBER_WEEK_ACTIVITY);
|
||||
stmt->setUInt32(0, m_guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_RESET_GUILD_MEMBER_WEEK_REPUTATION);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_RESET_GUILD_MEMBER_WEEK_REPUTATION);
|
||||
stmt2->setUInt32(0, m_guid.GetCounter());
|
||||
trans->Append(stmt2);
|
||||
|
||||
@@ -1036,7 +1036,7 @@ void 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);
|
||||
@@ -1455,7 +1455,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->setUInt32(0, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1505,7 +1505,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->setUInt32(0, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1547,7 +1547,7 @@ void Guild::SaveToDB()
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_EXPERIENCE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_EXPERIENCE);
|
||||
stmt->setUInt32(0, GetLevel());
|
||||
stmt->setUInt64(1, GetExperience());
|
||||
stmt->setUInt64(2, GetTodayExperience());
|
||||
@@ -1601,7 +1601,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->setUInt32(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -1772,7 +1772,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->setUInt32(1, m_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -1793,7 +1793,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->setUInt32(1, m_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -2228,7 +2228,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->setUInt32(0, m_id);
|
||||
stmt->setUInt8(1, rankId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -2931,7 +2931,7 @@ bool Guild::_HasRankRight(Player const* player, uint32 right) const
|
||||
|
||||
void Guild::_DeleteMemberFromDB(SQLTransaction& trans, ObjectGuid::LowType lowguid) const
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
}
|
||||
@@ -2964,7 +2964,7 @@ bool Guild::AddMember(SQLTransaction& trans, ObjectGuid guid, uint8 rankId)
|
||||
|
||||
/* Check if player can keep his guild reputation */
|
||||
bool keepGuildReputation = false;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_OLD_GUILD_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_OLD_GUILD_DATA);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
{
|
||||
@@ -2997,7 +2997,7 @@ bool Guild::AddMember(SQLTransaction& trans, ObjectGuid guid, uint8 rankId)
|
||||
|
||||
bool ok = false;
|
||||
// Player must exist
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD);
|
||||
stmt2->setUInt32(0, lowguid);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt2))
|
||||
{
|
||||
@@ -3105,7 +3105,7 @@ void Guild::DeleteMember(SQLTransaction& trans, ObjectGuid guid, bool isDisbandi
|
||||
{
|
||||
if (!isDisbanding)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LEAVE_GUILD_DATA);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LEAVE_GUILD_DATA);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
stmt->setUInt32(1, m_id);
|
||||
stmt->setUInt32(2, member->GetWeekReputation());
|
||||
@@ -3214,7 +3214,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->setUInt32(0, m_id);
|
||||
stmt->setUInt8 (1, tabId);
|
||||
trans->Append(stmt);
|
||||
@@ -3235,7 +3235,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->setUInt32(0, m_id);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -3320,7 +3320,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->setUInt32(1, m_id);
|
||||
trans->Append(stmt);
|
||||
@@ -3336,7 +3336,7 @@ void Guild::_SetLeaderGUID(Member* pLeader)
|
||||
m_leaderGuid = pLeader->GetGUID();
|
||||
pLeader->ChangeRank(trans, GR_GUILDMASTER);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
|
||||
stmt->setUInt32(0, m_leaderGuid.GetCounter());
|
||||
stmt->setUInt32(1, m_id);
|
||||
trans->Append(stmt);
|
||||
@@ -3878,7 +3878,7 @@ void Guild::CompleteChallenge(uint8 challengeType, Player* source)
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
_ModifyBankMoney(trans, uint64(gold * 10000), true);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_CHALLENGE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_CHALLENGE);
|
||||
stmt->setUInt32(0, _currChallengeCount[GUILD_CHALLENGE_TYPE_DUNGEON]);
|
||||
stmt->setUInt32(1, _currChallengeCount[GUILD_CHALLENGE_TYPE_RAID]);
|
||||
stmt->setUInt32(2, _currChallengeCount[GUILD_CHALLENGE_TYPE_RATED_BG]);
|
||||
@@ -4006,7 +4006,7 @@ void Guild::ResetTimes(bool weekly)
|
||||
{
|
||||
InitializeGuildChallengeRewards();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RESET_CHALLENGE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RESET_CHALLENGE);
|
||||
stmt->setInt32(0, m_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void GuildFinderMgr::AddMembershipRequest(uint32 guildGuid, MembershipRequest co
|
||||
_membershipRequests[guildGuid].push_back(request);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt32(0, request.GetGuildId());
|
||||
stmt->setUInt32(1, request.GetPlayerGUID());
|
||||
stmt->setUInt8(2, request.GetAvailability());
|
||||
@@ -181,7 +181,7 @@ void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(uint32 playerId)
|
||||
continue;
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt32(0, itr2->GetGuildId());
|
||||
stmt->setUInt32(1, itr2->GetPlayerGUID());
|
||||
trans->Append(stmt);
|
||||
@@ -207,7 +207,7 @@ void GuildFinderMgr::RemoveMembershipRequest(uint32 playerId, uint32 guildId)
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt32(0, itr->GetGuildId());
|
||||
stmt->setUInt32(1, itr->GetPlayerGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -301,7 +301,7 @@ void GuildFinderMgr::SetGuildSettings(uint32 guildGuid, LFGuildSettings const& s
|
||||
|
||||
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->setUInt32(0, settings.GetGUID());
|
||||
stmt->setUInt8(1, settings.GetAvailability());
|
||||
stmt->setUInt8(2, settings.GetClassRoles());
|
||||
@@ -323,7 +323,7 @@ void GuildFinderMgr::DeleteGuild(uint32 guildId)
|
||||
|
||||
uint32 applicant = itr->GetPlayerGUID();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT);
|
||||
stmt->setUInt32(0, itr->GetGuildId());
|
||||
stmt->setUInt32(1, applicant);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -453,7 +453,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->setUInt32(0, itr->first);
|
||||
achievementResult = CharacterDatabase.Query(stmt);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA);
|
||||
@@ -641,7 +641,7 @@ void GuildMgr::ResetTimes(bool week)
|
||||
CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER_WITHDRAW));
|
||||
|
||||
// Delete too old old guild member
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_OLD_GUILD_MEMBER);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_OLD_GUILD_MEMBER);
|
||||
stmt->setUInt32(0, uint32(GameTime::GetGameTime() - time_t(30 * DAY)));
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
|
||||
auction->bid = price;
|
||||
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||
stmt->setUInt32(0, auction->bidder);
|
||||
stmt->setUInt32(1, auction->bid);
|
||||
stmt->setUInt32(2, auction->Id);
|
||||
|
||||
@@ -600,7 +600,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
if (bg->isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_TRACK_DESERTERS) &&
|
||||
(bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
stmt->setUInt32(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, BG_DESERTION_TYPE_LEAVE_QUEUE);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -79,7 +79,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->setUInt32(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_FROM, stmt);
|
||||
|
||||
@@ -272,7 +272,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
|
||||
|
||||
if (!(charInfo.Flags2 == 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->setUInt32(1, charInfo.Guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -296,7 +296,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
|
||||
@@ -442,7 +442,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
|
||||
stmt->setString(0, createInfo->Name);
|
||||
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -454,7 +454,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
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));
|
||||
})
|
||||
@@ -473,7 +473,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
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));
|
||||
})
|
||||
@@ -623,7 +623,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
|
||||
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);
|
||||
@@ -651,7 +651,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
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_DEATH_KNIGHT) ? 10 : 1);
|
||||
queryCallback.WithPreparedCallback(std::move(finalizeCharacterCreation)).SetNextQuery(CharacterDatabase.AsyncQuery(stmt));
|
||||
@@ -974,13 +974,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->setUInt32(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(GameTime::GetGameTimeMS());
|
||||
|
||||
@@ -1276,7 +1276,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData)
|
||||
|
||||
// Ensure that the character belongs to the current account, that rename at login is enabled
|
||||
// and 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->setUInt32(0, renameInfo->Guid.GetCounter());
|
||||
stmt->setUInt32(1, GetAccountId());
|
||||
@@ -1311,7 +1311,7 @@ void WorldSession::HandleCharRenameCallback(std::shared_ptr<CharacterRenameInfo>
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
// 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->Name);
|
||||
stmt->setUInt16(1, atLoginFlags);
|
||||
@@ -1392,7 +1392,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData)
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1524,7 +1524,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
>> customizeInfo->FacialHair
|
||||
>> customizeInfo->Face;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUSTOMIZE_INFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUSTOMIZE_INFO);
|
||||
stmt->setUInt32(0, customizeInfo->Guid.GetCounter());
|
||||
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -1598,7 +1598,7 @@ void WorldSession::HandleCharCustomizeCallback(std::shared_ptr<CharacterCustomiz
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
ObjectGuid::LowType lowGuid = customizeInfo->Guid.GetCounter();
|
||||
@@ -1780,7 +1780,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
|
||||
factionChangeInfo->FactionChange = (recvData.GetOpcode() == CMSG_CHAR_FACTION_CHANGE);
|
||||
|
||||
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->setUInt32(0, factionChangeInfo->Guid.GetCounter());
|
||||
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -1890,7 +1890,7 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
|
||||
// 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();
|
||||
|
||||
@@ -2424,7 +2424,7 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData)
|
||||
recvData.ReadByteSeq(guids[i][2]);
|
||||
recvData.ReadByteSeq(guids[i][7]);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_LIST_SLOT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_LIST_SLOT);
|
||||
stmt->setUInt8(0, position);
|
||||
stmt->setUInt32(1, guids[i].GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -881,7 +881,7 @@ void WorldSession::HandleGuildRenameRequest(WorldPacket& recvPacket)
|
||||
|
||||
if(pGuild)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_NAME);
|
||||
|
||||
stmt->setUInt32(1, pGuild->GetId());
|
||||
stmt->setString(0, newName);
|
||||
|
||||
@@ -1049,7 +1049,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT);
|
||||
stmt->setUInt32(0, item->GetOwnerGUID().GetCounter());
|
||||
stmt->setUInt32(1, item->GetGUID().GetCounter());
|
||||
stmt->setUInt32(2, item->GetEntry());
|
||||
|
||||
@@ -224,7 +224,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
receiverAccountId = characterInfo->AccountId;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT);
|
||||
stmt->setUInt32(0, receiverGuid.GetCounter());
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -470,7 +470,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recvData)
|
||||
//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, mailId);
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ void WorldSession::HandleBugOpcode(WorldPacket& recvData)
|
||||
TC_LOG_DEBUG("network", "%s", type.c_str());
|
||||
TC_LOG_DEBUG("network", "%s", content.c_str());
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
|
||||
|
||||
stmt->setString(0, type);
|
||||
stmt->setString(1, content);
|
||||
@@ -1198,7 +1198,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recvData)
|
||||
|
||||
uint32 accid = player->GetSession()->GetAccountId();
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_WHOIS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_WHOIS);
|
||||
|
||||
stmt->setUInt32(0, accid);
|
||||
|
||||
|
||||
@@ -666,7 +666,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
if (isdeclined)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -679,7 +679,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
|
||||
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->setUInt32(1, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt32(2, pet->GetCharmInfo()->GetPetNumber());
|
||||
@@ -911,7 +911,7 @@ void WorldSession::UpdatePetSlot(uint32 petNumberA, uint8 oldPetSlot, uint8 newP
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_SLOT_BY_SLOT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_SLOT_BY_SLOT);
|
||||
stmt->setUInt32(0, oldPetSlot);
|
||||
stmt->setUInt64(1, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt32(2, newPetSlot);
|
||||
@@ -930,7 +930,7 @@ void WorldSession::UpdatePetSlot(uint32 petNumberA, uint8 oldPetSlot, uint8 newP
|
||||
}
|
||||
else
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_SLOT_BY_ID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_SLOT_BY_ID);
|
||||
stmt->setUInt32(0, newPetSlot);
|
||||
stmt->setUInt64(1, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt32(2, petNumberA);
|
||||
|
||||
@@ -205,7 +205,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
||||
// 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->setUInt32(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, type);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
@@ -250,7 +250,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
|
||||
|
||||
ObjectGuid::LowType petitionGuidLow = petitionguid.GetCounter();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
|
||||
|
||||
stmt->setUInt32(0, petitionGuidLow);
|
||||
|
||||
@@ -318,7 +318,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid)
|
||||
uint32 type;
|
||||
std::string name = "NO_NAME_FOR_GUID";
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
|
||||
stmt->setUInt32(0, petitionguid.GetCounter());
|
||||
|
||||
@@ -389,7 +389,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
|
||||
|
||||
stmt->setUInt32(0, petitionGuid.GetCounter());
|
||||
|
||||
@@ -457,7 +457,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
|
||||
recvData >> petitionGuid; // petition guid
|
||||
recvData >> unk;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES);
|
||||
|
||||
stmt->setUInt32(0, petitionGuid.GetCounter());
|
||||
stmt->setUInt32(1, petitionGuid.GetCounter());
|
||||
@@ -588,7 +588,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
|
||||
recvData >> petitionguid; // petition guid
|
||||
TC_LOG_DEBUG("network", "Petition %s declined by %u", petitionguid.ToString().c_str(), _player->GetGUID().GetCounter());
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
|
||||
|
||||
stmt->setUInt32(0, petitionguid.GetCounter());
|
||||
|
||||
@@ -625,7 +625,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
|
||||
|
||||
stmt->setUInt32(0, petitionguid.GetCounter());
|
||||
|
||||
@@ -740,7 +740,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
|
||||
uint32 type;
|
||||
std::string name;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
|
||||
stmt->setUInt32(0, petitionGuid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -416,7 +416,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->setUInt32(1, _player->GetGUID().GetCounter());
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if (item->HasFlag(ITEM_FIELD_FLAGS, 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->setUInt32(0, item->GetGUID().GetCounter());
|
||||
_queryProcessor.AddQuery(CharacterDatabase.AsyncQuery(stmt)
|
||||
@@ -308,7 +308,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->setUInt32(0, itemGuid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recvData)
|
||||
if (!surveyIds.insert(subSurveyId).second)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SUBSURVEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SUBSURVEY);
|
||||
stmt->setUInt32(0, nextSurveyID);
|
||||
stmt->setUInt32(1, subSurveyId);
|
||||
stmt->setUInt32(2, rank);
|
||||
@@ -220,7 +220,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recvData)
|
||||
std::string comment; // just a guess
|
||||
recvData >> comment;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SURVEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SURVEY);
|
||||
stmt->setUInt32(0, GetPlayer()->GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, nextSurveyID);
|
||||
stmt->setUInt32(2, mainSurvey);
|
||||
@@ -243,7 +243,7 @@ void WorldSession::HandleReportLag(WorldPacket& recvData)
|
||||
recvData >> y;
|
||||
recvData >> z;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LAG_REPORT);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LAG_REPORT);
|
||||
stmt->setUInt32(0, GetPlayer()->GetGUID().GetCounter());
|
||||
stmt->setUInt8 (1, lagType);
|
||||
stmt->setUInt16(2, mapId);
|
||||
|
||||
@@ -131,7 +131,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);
|
||||
|
||||
@@ -155,7 +155,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->setUInt64(0, uint64(resettime));
|
||||
stmt->setUInt32(1, InstanceId);
|
||||
@@ -208,7 +208,7 @@ void InstanceSave::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->setUInt64(2, uint64(GetResetTimeForDB()));
|
||||
@@ -360,7 +360,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GLOBAL_INSTANCE_RESETTIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GLOBAL_INSTANCE_RESETTIME);
|
||||
stmt->setUInt16(0, uint16(mapid));
|
||||
stmt->setUInt8(1, uint8(difficulty));
|
||||
CharacterDatabase.DirectExecute(stmt);
|
||||
@@ -371,7 +371,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
uint64 newresettime = (oldresettime / DAY) * DAY + diff;
|
||||
if (oldresettime != newresettime)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
|
||||
stmt->setUInt64(0, uint64(newresettime));
|
||||
stmt->setUInt16(1, uint16(mapid));
|
||||
stmt->setUInt8(2, uint8(difficulty));
|
||||
@@ -404,7 +404,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
// initialize the reset time
|
||||
t = today + period + diff;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GLOBAL_INSTANCE_RESETTIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GLOBAL_INSTANCE_RESETTIME);
|
||||
stmt->setUInt16(0, uint16(mapid));
|
||||
stmt->setUInt8(1, uint8(difficulty));
|
||||
stmt->setUInt64(2, uint64(t));
|
||||
@@ -418,7 +418,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
t = (t / DAY) * DAY;
|
||||
t += ((today - t) / period + 1) * period + diff;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
|
||||
stmt->setUInt64(0, uint64(t));
|
||||
stmt->setUInt16(1, uint16(mapid));
|
||||
stmt->setUInt8(2, uint8(difficulty));
|
||||
@@ -644,7 +644,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);
|
||||
|
||||
@@ -66,7 +66,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, instance->GetInstanceId());
|
||||
|
||||
@@ -60,7 +60,7 @@ void LootItemStorage::LoadStorageFromDB()
|
||||
uint32 count = 0;
|
||||
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (result)
|
||||
{
|
||||
@@ -209,7 +209,7 @@ void LootItemStorage::RemoveStoredLootForContainer(uint32 containerId)
|
||||
}
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
stmt->setUInt32(0, containerId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -256,7 +256,7 @@ void LootItemStorage::AddNewStoredLoot(Loot* loot, Player* player)
|
||||
if (loot->gold)
|
||||
container.AddMoney(loot->gold, trans);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
|
||||
stmt->setUInt32(0, loot->containerID);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -293,7 +293,7 @@ void StoredLootContainer::AddLootItem(LootItem const& lootItem, SQLTransaction&
|
||||
if (!trans)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS);
|
||||
|
||||
// container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix
|
||||
stmt->setUInt32(0, _containerId);
|
||||
@@ -316,7 +316,7 @@ void StoredLootContainer::AddMoney(uint32 money, SQLTransaction& trans)
|
||||
if (!trans)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
stmt->setUInt32(0, _containerId);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -330,7 +330,7 @@ void StoredLootContainer::RemoveMoney()
|
||||
{
|
||||
_money = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
|
||||
stmt->setUInt32(0, _containerId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -348,7 +348,7 @@ void StoredLootContainer::RemoveItem(uint32 itemId, uint32 count)
|
||||
}
|
||||
|
||||
// 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->setUInt32(0, _containerId);
|
||||
stmt->setUInt32(1, itemId);
|
||||
stmt->setUInt32(2, count);
|
||||
|
||||
@@ -125,7 +125,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->setUInt32(0, item->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -165,7 +165,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->setUInt32(0, receiver_guid);
|
||||
stmt->setUInt32(1, item->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
@@ -213,7 +213,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()));
|
||||
|
||||
@@ -3261,7 +3261,7 @@ void Map::DeleteRespawnInfo(RespawnInfo* info, SQLTransaction dbTrans)
|
||||
_respawnTimes.erase(info->handle);
|
||||
|
||||
// database
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESPAWN);
|
||||
stmt->setUInt16(0, info->type);
|
||||
stmt->setUInt32(1, info->spawnId);
|
||||
stmt->setUInt16(2, GetId());
|
||||
@@ -3977,7 +3977,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);
|
||||
@@ -4214,7 +4214,7 @@ bool Map::GetEntrancePos(int32& mapid, float& x, float& y) const
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -4428,7 +4428,7 @@ void Map::SaveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, uin
|
||||
|
||||
void Map::SaveRespawnInfoDB(RespawnInfo const& info, SQLTransaction dbTrans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_RESPAWN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_RESPAWN);
|
||||
stmt->setUInt16(0, info.type);
|
||||
stmt->setUInt32(1, info.spawnId);
|
||||
stmt->setUInt64(2, uint64(info.respawnTime));
|
||||
@@ -4439,7 +4439,7 @@ void Map::SaveRespawnInfoDB(RespawnInfo const& info, SQLTransaction dbTrans)
|
||||
|
||||
void Map::LoadRespawnTimes()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_RESPAWNS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_RESPAWNS);
|
||||
stmt->setUInt16(0, GetId());
|
||||
stmt->setUInt32(1, GetInstanceId());
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
@@ -4469,7 +4469,7 @@ void Map::LoadRespawnTimes()
|
||||
|
||||
/*static*/ void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_RESPAWNS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_RESPAWNS);
|
||||
stmt->setUInt16(0, mapId);
|
||||
stmt->setUInt32(1, instanceId);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -4495,7 +4495,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());
|
||||
|
||||
@@ -4552,7 +4552,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);
|
||||
|
||||
@@ -88,7 +88,7 @@ void WaypointMgr::ReloadPath(uint32 id)
|
||||
if (itr != _waypointStore.end())
|
||||
_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);
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
|
||||
// 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);
|
||||
|
||||
@@ -823,7 +823,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)
|
||||
@@ -968,7 +968,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);
|
||||
}
|
||||
@@ -977,7 +977,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);
|
||||
|
||||
@@ -575,7 +575,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->setUInt32(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, uint16(itr->second.ID));
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -568,7 +568,7 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
// track if player logs out after invited to join BG
|
||||
if (_player->IsInvitedForBattlegroundQueueType(bgQueueTypeId) && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_TRACK_DESERTERS))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);
|
||||
stmt->setUInt32(0, _player->GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, BG_DESERTION_TYPE_INVITE_LOGOUT);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -659,7 +659,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);
|
||||
}
|
||||
@@ -835,7 +835,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string c
|
||||
index = CHAR_REP_PLAYER_ACCOUNT_DATA;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(index);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(index);
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt8 (1, type);
|
||||
stmt->setUInt32(2, uint32(tm));
|
||||
@@ -886,7 +886,7 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans)
|
||||
return;
|
||||
|
||||
bool const hasTutorialsInDB = (m_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, m_Tutorials[i]);
|
||||
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());
|
||||
@@ -1185,7 +1185,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;
|
||||
|
||||
|
||||
@@ -71,7 +71,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)));
|
||||
@@ -537,7 +537,7 @@ void WorldSocket::SendPacket(WorldPacket const& packet)
|
||||
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->Account);
|
||||
|
||||
@@ -562,7 +562,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth::
|
||||
std::string address = GetRemoteIpAddress().to_string();
|
||||
|
||||
// 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->Account);
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -729,7 +729,7 @@ void WorldSocket::HandleAuthContinuedSession(std::shared_ptr<WorldPackets::Auth:
|
||||
_headerBuffer.Resize(sizeof(ClientPktHeader));
|
||||
|
||||
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)));
|
||||
|
||||
@@ -37,7 +37,7 @@ struct SpellHistory::PersistenceHelper<Player>
|
||||
static CharacterDatabaseStatements const CooldownsDeleteStatement = CHAR_DEL_CHAR_SPELL_COOLDOWNS;
|
||||
static CharacterDatabaseStatements const CooldownsInsertStatement = CHAR_INS_CHAR_SPELL_COOLDOWN;
|
||||
|
||||
static void SetIdentifier(PreparedStatement* stmt, uint8 index, Unit* owner) { stmt->setUInt32(index, owner->GetGUID().GetCounter()); }
|
||||
static void SetIdentifier(PreparedStatementBase* stmt, uint8 index, Unit* owner) { stmt->setUInt32(index, owner->GetGUID().GetCounter()); }
|
||||
|
||||
static bool ReadCooldown(Field* fields, uint32* spellId, CooldownEntry* cooldownEntry)
|
||||
{
|
||||
@@ -53,7 +53,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);
|
||||
@@ -69,7 +69,7 @@ struct SpellHistory::PersistenceHelper<Pet>
|
||||
static CharacterDatabaseStatements const CooldownsDeleteStatement = CHAR_DEL_PET_SPELL_COOLDOWNS;
|
||||
static CharacterDatabaseStatements const CooldownsInsertStatement = CHAR_INS_PET_SPELL_COOLDOWN;
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -85,7 +85,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)));
|
||||
@@ -122,7 +122,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);
|
||||
|
||||
|
||||
@@ -88,7 +88,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)
|
||||
|
||||
@@ -93,7 +93,7 @@ void GmTicket::SaveToDB(SQLTransaction& trans) const
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
// id, type, playerGuid, name, description, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, needMoreHelp, resolvedBy
|
||||
uint8 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET);
|
||||
stmt->setUInt32( index, _id);
|
||||
stmt->setUInt8 (++index, uint8(_type));
|
||||
stmt->setUInt32(++index, _playerGuid.GetCounter());
|
||||
@@ -120,7 +120,7 @@ void GmTicket::SaveToDB(SQLTransaction& trans) const
|
||||
|
||||
void GmTicket::DeleteFromDB()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_TICKET);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_TICKET);
|
||||
stmt->setUInt32(0, _id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -304,8 +304,7 @@ void TicketMgr::ResetTickets()
|
||||
|
||||
_lastTicketId = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_TICKETS);
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_TICKETS);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -326,7 +325,7 @@ void TicketMgr::LoadTickets()
|
||||
_lastTicketId = 0;
|
||||
_openTicketCount = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_TICKETS);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_TICKETS);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -775,7 +775,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->setUInt32(0, guid);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
guid = sObjectMgr->GetGenerator<HighGuid::Player>().GetNextAfterMaxUsed(); // use first free if exists
|
||||
@@ -791,7 +791,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);
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
name.clear(); // use the one from the dump
|
||||
@@ -935,7 +935,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
// check if the original name already exists
|
||||
name = GetColumn(ts, line, "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);
|
||||
|
||||
|
||||
@@ -2301,7 +2301,7 @@ void World::LoadAutobroadcasts()
|
||||
m_AutobroadcastsWeights.clear();
|
||||
|
||||
uint32 realmId = sConfigMgr->GetIntDefault("RealmID", 0);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_AUTOBROADCAST);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_AUTOBROADCAST);
|
||||
stmt->setInt32(0, realmId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -2430,7 +2430,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));
|
||||
@@ -2447,7 +2447,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)));
|
||||
@@ -2764,7 +2764,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(nullptr); //used for kicking
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// Prevent banning an already banned account
|
||||
if (mode == BAN_ACCOUNT && AccountMgr::IsBannedAccount(nameOrIP))
|
||||
@@ -2774,8 +2773,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);
|
||||
@@ -2785,18 +2785,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;
|
||||
}
|
||||
@@ -2819,7 +2824,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
|
||||
@@ -2844,7 +2849,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 = nullptr;
|
||||
LoginDatabasePreparedStatement* stmt = nullptr;
|
||||
if (mode == BAN_IP)
|
||||
{
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_IP_NOT_BANNED);
|
||||
@@ -2892,7 +2897,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->setUInt32(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -2931,7 +2936,7 @@ bool World::RemoveBanCharacter(std::string const& name)
|
||||
if (!guid)
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
stmt->setUInt32(0, guid);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return true;
|
||||
@@ -3172,7 +3177,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)));
|
||||
}
|
||||
@@ -3187,7 +3192,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);
|
||||
@@ -3341,7 +3346,7 @@ void World::ResetDailyQuestsAndRewards()
|
||||
TC_LOG_INFO("misc", "Daily quests and rewards reset for all characters.");
|
||||
|
||||
// Reset daily quest status
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_DAILY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_DAILY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
// Reset daily lfg rewards
|
||||
@@ -3375,7 +3380,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);
|
||||
|
||||
@@ -3397,7 +3402,7 @@ void World::ResetWeeklyQuestsAndRewards()
|
||||
TC_LOG_INFO("misc", "Weekly quests and rewards reset for all characters.");
|
||||
|
||||
// Reset weekly quests
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
// Reset weekly lfg rewards
|
||||
@@ -3424,7 +3429,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)
|
||||
@@ -3468,7 +3473,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);
|
||||
|
||||
@@ -3481,7 +3486,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)
|
||||
@@ -3582,7 +3587,7 @@ void World::setWorldState(uint32 index, uint64 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);
|
||||
@@ -3591,7 +3596,7 @@ void World::setWorldState(uint32 index, uint64 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));
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
|
||||
|
||||
stmt->setUInt8(0, expansion);
|
||||
stmt->setUInt32(1, handler->GetSession()->GetAccountId());
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
static bool HandleAccountOnlineListCommand(ChatHandler* handler)
|
||||
{
|
||||
///- Get the list of accounts ID logged to the realm
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE);
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -222,9 +222,9 @@ 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);
|
||||
stmt->setUInt32(0, account);
|
||||
PreparedQueryResult resultLogin = LoginDatabase.Query(stmt);
|
||||
LoginDatabasePreparedStatement* loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO);
|
||||
loginStmt->setUInt32(0, account);
|
||||
PreparedQueryResult resultLogin = LoginDatabase.Query(loginStmt);
|
||||
|
||||
if (resultLogin)
|
||||
{
|
||||
@@ -249,7 +249,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);
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
|
||||
static bool HandleAccountLockIpCommand(ChatHandler* handler, bool state)
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
|
||||
|
||||
if (state)
|
||||
{
|
||||
@@ -457,7 +457,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);
|
||||
|
||||
@@ -513,7 +513,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);
|
||||
@@ -573,7 +573,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 (realmId == -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, accountId);
|
||||
stmt->setUInt8(1, gmLevel);
|
||||
|
||||
@@ -329,7 +329,7 @@ public:
|
||||
else
|
||||
targetGuid = target->GetGUID().GetCounter();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
|
||||
stmt->setUInt32(0, targetGuid);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
@@ -390,7 +390,7 @@ public:
|
||||
|
||||
static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
PreparedStatement* stmt = nullptr;
|
||||
LoginDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
|
||||
LoginDatabase.Execute(stmt);
|
||||
@@ -512,7 +512,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)
|
||||
@@ -529,7 +529,7 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
|
||||
stmt2->setUInt32(0, fields[0].GetUInt32());
|
||||
PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
|
||||
if (banResult)
|
||||
@@ -551,7 +551,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->setUInt32(0, fields[0].GetUInt32());
|
||||
PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
|
||||
if (banInfo)
|
||||
@@ -592,7 +592,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_COUNTRY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_COUNTRY);
|
||||
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_COUNTRY);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_COUNTRY);
|
||||
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);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST);
|
||||
stmt->setString(0, battlenetAccountName);
|
||||
if (PreparedQueryResult accountList = LoginDatabase.Query(stmt))
|
||||
{
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
|
||||
{
|
||||
PreparedQueryResult result;
|
||||
PreparedStatement* stmt;
|
||||
CharacterDatabasePreparedStatement* stmt;
|
||||
if (!searchString.empty())
|
||||
{
|
||||
// search by GUID
|
||||
@@ -222,7 +222,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->setUInt32(2, delInfo.guid.GetCounter());
|
||||
@@ -255,7 +255,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->setUInt32(1, playerGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -359,7 +359,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)
|
||||
@@ -421,7 +421,7 @@ public:
|
||||
std::string oldNameLink = handler->playerLink(targetName);
|
||||
handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), targetGuid.GetCounter());
|
||||
|
||||
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->setUInt32(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -480,7 +480,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)
|
||||
{
|
||||
@@ -508,7 +508,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)
|
||||
{
|
||||
@@ -535,7 +535,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)
|
||||
{
|
||||
@@ -588,9 +588,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
|
||||
stmt->setString(0, accountName);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
|
||||
LoginDatabasePreparedStatement* loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
|
||||
loginStmt->setString(0, accountName);
|
||||
if (PreparedQueryResult result = LoginDatabase.Query(loginStmt))
|
||||
newAccountId = (*result)[0].GetUInt32();
|
||||
else
|
||||
{
|
||||
@@ -613,7 +613,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_BY_GUID);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_BY_GUID);
|
||||
stmt->setUInt32(0, newAccountId);
|
||||
stmt->setUInt32(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.DirectExecute(stmt);
|
||||
|
||||
@@ -187,7 +187,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);
|
||||
@@ -312,7 +312,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);
|
||||
|
||||
@@ -165,7 +165,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);
|
||||
|
||||
@@ -546,7 +546,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());
|
||||
|
||||
@@ -367,7 +367,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->setUInt32(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->setUInt32(0, guidTarget.GetCounter());
|
||||
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
|
||||
if (resultGroup)
|
||||
|
||||
@@ -203,7 +203,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);
|
||||
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
Player* target;
|
||||
ObjectGuid targetGuid;
|
||||
std::string targetName;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -1161,7 +1161,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);
|
||||
|
||||
@@ -1180,7 +1180,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);
|
||||
|
||||
@@ -1196,7 +1196,7 @@ public:
|
||||
char* limitStr = strtok(nullptr, " ");
|
||||
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);
|
||||
|
||||
@@ -1228,7 +1228,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);
|
||||
|
||||
|
||||
@@ -105,7 +105,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);
|
||||
@@ -115,7 +115,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);
|
||||
|
||||
@@ -121,7 +121,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)
|
||||
@@ -1532,7 +1532,7 @@ public:
|
||||
Player* target;
|
||||
ObjectGuid targetGuid;
|
||||
std::string targetName;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
// To make sure we get a target, we convert our guid to an omniversal...
|
||||
ObjectGuid parseGUID(HighGuid::Player, uint32(atoul(args)));
|
||||
@@ -1686,10 +1686,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)
|
||||
{
|
||||
@@ -1732,7 +1732,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)
|
||||
@@ -1754,9 +1754,9 @@ public:
|
||||
|
||||
|
||||
// Can be used to query data from Characters database
|
||||
stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
|
||||
stmt2->setUInt32(0, lowguid);
|
||||
PreparedQueryResult result4 = CharacterDatabase.Query(stmt2);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
PreparedQueryResult result4 = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result4)
|
||||
{
|
||||
@@ -1768,9 +1768,9 @@ public:
|
||||
if (gguid != 0)
|
||||
{
|
||||
// Guild Data - an own query, because it may not happen.
|
||||
PreparedStatement* stmt3 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED);
|
||||
stmt3->setUInt32(0, lowguid);
|
||||
PreparedQueryResult result5 = CharacterDatabase.Query(stmt3);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
PreparedQueryResult result5 = CharacterDatabase.Query(stmt);
|
||||
if (result5)
|
||||
{
|
||||
Field* fields5 = result5->Fetch();
|
||||
@@ -1872,9 +1872,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->setUInt32(0, lowguid);
|
||||
PreparedQueryResult result6 = CharacterDatabase.Query(stmt4);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
PreparedQueryResult result6 = CharacterDatabase.Query(stmt);
|
||||
if (result6)
|
||||
{
|
||||
Field* fields = result6->Fetch();
|
||||
@@ -1961,7 +1961,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();
|
||||
@@ -2040,7 +2040,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, "");
|
||||
@@ -2088,7 +2088,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);
|
||||
|
||||
@@ -2566,7 +2566,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->setUInt32(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -2586,7 +2586,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)
|
||||
{
|
||||
|
||||
@@ -475,7 +475,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->setUInt32(1, lowGuid);
|
||||
@@ -672,7 +672,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());
|
||||
@@ -701,7 +701,7 @@ public:
|
||||
|
||||
creature->SetUInt32Value(UNIT_NPC_FLAGS, npcFlags);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
|
||||
|
||||
stmt->setUInt32(0, npcFlags);
|
||||
stmt->setUInt32(1, creature->GetEntry());
|
||||
@@ -847,7 +847,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());
|
||||
@@ -927,7 +927,7 @@ public:
|
||||
// update position in memory
|
||||
const_cast<CreatureData*>(data)->spawnPoint.Relocate(*player);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
|
||||
|
||||
stmt->setFloat(0, player->GetPositionX());
|
||||
stmt->setFloat(1, player->GetPositionY());
|
||||
@@ -1229,7 +1229,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));
|
||||
@@ -1269,7 +1269,7 @@ public:
|
||||
else
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
|
||||
|
||||
stmt->setUInt32(0, uint32(spawnTime));
|
||||
stmt->setUInt32(1, guidLow);
|
||||
@@ -1701,7 +1701,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->setUInt32(0, leaderGUID);
|
||||
stmt->setUInt32(1, lowguid);
|
||||
|
||||
@@ -263,7 +263,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->setUInt32(1, player->GetGUID().GetCounter());
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ public:
|
||||
{
|
||||
uint32 entry = uint32(atoi(*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);
|
||||
|
||||
|
||||
@@ -175,7 +175,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->setUInt32(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
}
|
||||
else if (targetGuid)
|
||||
{
|
||||
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->setUInt32(1, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -295,7 +295,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);
|
||||
|
||||
|
||||
@@ -130,7 +130,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->setUInt32(0, target_guid.GetCounter());
|
||||
PreparedQueryResult resultDB = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -99,7 +99,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);
|
||||
|
||||
@@ -120,7 +120,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);
|
||||
|
||||
@@ -187,7 +187,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->setUInt32(0, guidLow);
|
||||
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
{
|
||||
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = nullptr;
|
||||
WorldDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
if (!target)
|
||||
{
|
||||
@@ -292,7 +292,7 @@ public:
|
||||
|
||||
char* show_str = strtok((char*)args, " ");
|
||||
std::string show = show_str;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
WorldDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
// Check
|
||||
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid"))
|
||||
@@ -573,7 +573,7 @@ public:
|
||||
uint32 pathid = 0;
|
||||
uint32 point = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = nullptr;
|
||||
WorldDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
// User did select a visual waypoint?
|
||||
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
|
||||
@@ -742,7 +742,7 @@ public:
|
||||
|
||||
uint32 pathid = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = nullptr;
|
||||
WorldDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
// Did player provide a PathID?
|
||||
|
||||
|
||||
@@ -138,7 +138,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, characterGuid);
|
||||
@@ -149,7 +149,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, characterGuid);
|
||||
@@ -231,7 +231,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->setUInt32(1, characterGuid);
|
||||
@@ -291,7 +291,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->setUInt32(1, characterGuid);
|
||||
|
||||
@@ -565,7 +565,7 @@ char* DB2DatabaseLoader::Load(const char* format, int32 preparedStatement, uint3
|
||||
|
||||
void DB2DatabaseLoader::LoadStrings(const char* format, int32 preparedStatement, uint32 locale, char**& indexTable, std::list<char*>& stringPool)
|
||||
{
|
||||
PreparedStatement* stmt = HotfixDatabase.GetPreparedStatement(HotfixDatabaseStatements(preparedStatement));
|
||||
HotfixDatabasePreparedStatement* stmt = HotfixDatabase.GetPreparedStatement(HotfixDatabaseStatements(preparedStatement));
|
||||
stmt->setString(0, localeNames[locale]);
|
||||
PreparedQueryResult result = HotfixDatabase.Query(stmt);
|
||||
if (!result)
|
||||
|
||||
@@ -123,7 +123,7 @@ bool RASession::CheckAccessLevel(const std::string& user)
|
||||
|
||||
Utf8ToUpperOnlyLatin(safeUser);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS);
|
||||
stmt->setString(0, safeUser);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -159,7 +159,7 @@ bool RASession::CheckPassword(const std::string& user, const std::string& pass)
|
||||
|
||||
std::string hash = AccountMgr::CalculateShaPassHash(safe_user, safe_pass);
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME);
|
||||
|
||||
stmt->setString(0, safe_user);
|
||||
stmt->setString(1, hash);
|
||||
|
||||
Reference in new issue
Block a user