mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
feat(Core/Database): port TrinityCore database API (#5611)
This commit is contained in:
@@ -1687,7 +1687,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;
|
||||
@@ -1716,7 +1716,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid
|
||||
ObjectGuid linkedGuid = ObjectGuid::Create<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);
|
||||
@@ -1956,7 +1956,7 @@ void ObjectMgr::LoadCreatures()
|
||||
uint32 zoneId = sMapMgr->GetZoneId(data.mapid, data.posX, data.posY, data.posZ);
|
||||
uint32 areaId = sMapMgr->GetAreaId(data.mapid, data.posX, data.posY, data.posZ);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA);
|
||||
|
||||
stmt->setUInt32(0, zoneId);
|
||||
stmt->setUInt32(1, areaId);
|
||||
@@ -2257,7 +2257,7 @@ void ObjectMgr::LoadGameobjects()
|
||||
uint32 zoneId = sMapMgr->GetZoneId(data.mapid, data.posX, data.posY, data.posZ);
|
||||
uint32 areaId = sMapMgr->GetAreaId(data.mapid, data.posX, data.posY, data.posZ);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
||||
|
||||
stmt->setUInt32(0, zoneId);
|
||||
stmt->setUInt32(1, areaId);
|
||||
@@ -5192,7 +5192,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)
|
||||
@@ -5680,7 +5680,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
|
||||
time_t curTime = time(nullptr);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
|
||||
stmt->setUInt32(0, curTime);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
@@ -7628,7 +7628,7 @@ void ObjectMgr::AddReservedPlayerName(std::string const& name)
|
||||
|
||||
_reservedNamesStore.insert(wstr);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_RESERVED_PLAYER_NAME);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_RESERVED_PLAYER_NAME);
|
||||
stmt->setString(0, name);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -8142,7 +8142,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);
|
||||
@@ -8171,7 +8171,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);
|
||||
|
||||
@@ -8366,7 +8366,7 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32>* skip_vendors)
|
||||
{
|
||||
// find all items from the reference vendor
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF);
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF);
|
||||
stmt->setUInt32(0, uint32(item));
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
@@ -8569,7 +8569,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);
|
||||
@@ -8592,7 +8592,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= tru
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user