Core/DBLayer: Prevent using prepared statements on wrong database

This commit is contained in:
Shauren authored and Ovahlord committed 2020-04-15 19:18:58 +02:00
1 parent eaee7b3cfa
commit d003ebd8e4
98 files changed
+569 -541

No files matched your search

+4 -4
View File
@@ -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);