mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
feat(Core/Database): port TrinityCore database API (#5611)
This commit is contained in:
@@ -450,7 +450,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);
|
||||
|
||||
@@ -816,7 +816,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)
|
||||
@@ -956,7 +956,7 @@ void PoolMgr::LoadQuestPools()
|
||||
|
||||
void PoolMgr::SaveQuestsToDB(bool daily, bool weekly, bool other)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
// pussywizard: mysql thread races, change only what is meant to be changed
|
||||
std::set<uint32> deletedPools;
|
||||
@@ -973,7 +973,7 @@ void PoolMgr::SaveQuestsToDB(bool daily, bool weekly, bool other)
|
||||
if (!other && !quest->IsDaily() && !quest->IsWeekly())
|
||||
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);
|
||||
deletedPools.insert(itr->second.GetPoolId());
|
||||
@@ -983,7 +983,7 @@ void PoolMgr::SaveQuestsToDB(bool daily, bool weekly, bool other)
|
||||
if (deletedPools.find(itr->second) != deletedPools.end())
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user