aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-07-27 01:00:37 +0200
committerShauren <shauren.trinity@gmail.com>2019-07-27 01:00:37 +0200
commite8e89f58fb800014f53341f12505f60ee2b5fb6f (patch)
tree2b63800163e2026be75621a36ddf1218bdbf9dab /src/server/game/Maps/Map.cpp
parent1dcbceba81002ba6ff83129d403763df398f9736 (diff)
Core/DBLayer: Prevent using prepared statements on wrong database
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 4a5ce244c56..70d24ca194f 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -3570,7 +3570,7 @@ void InstanceMap::CreateInstanceData(bool load)
if (load)
{
/// @todo make a global storage for this
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_INSTANCE);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_INSTANCE);
stmt->setUInt16(0, uint16(GetId()));
stmt->setUInt32(1, i_InstanceId);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -3819,7 +3819,7 @@ bool Map::GetEntrancePos(int32 &mapid, float &x, float &y)
bool InstanceMap::HasPermBoundPlayers() const
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE);
stmt->setUInt16(0,GetInstanceId());
return !!CharacterDatabase.Query(stmt);
}
@@ -3981,7 +3981,7 @@ void Map::SaveCreatureRespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime
_creatureRespawnTimes[dbGuid] = respawnTime;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
stmt->setUInt64(0, dbGuid);
stmt->setUInt32(1, uint32(respawnTime));
stmt->setUInt16(2, GetId());
@@ -3993,7 +3993,7 @@ void Map::RemoveCreatureRespawnTime(ObjectGuid::LowType dbGuid)
{
_creatureRespawnTimes.erase(dbGuid);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
stmt->setUInt64(0, dbGuid);
stmt->setUInt16(1, GetId());
stmt->setUInt32(2, GetInstanceId());
@@ -4011,7 +4011,7 @@ void Map::SaveGORespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime)
_goRespawnTimes[dbGuid] = respawnTime;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
stmt->setUInt64(0, dbGuid);
stmt->setUInt32(1, uint32(respawnTime));
stmt->setUInt16(2, GetId());
@@ -4023,7 +4023,7 @@ void Map::RemoveGORespawnTime(ObjectGuid::LowType dbGuid)
{
_goRespawnTimes.erase(dbGuid);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN);
stmt->setUInt64(0, dbGuid);
stmt->setUInt16(1, GetId());
stmt->setUInt32(2, GetInstanceId());
@@ -4032,7 +4032,7 @@ void Map::RemoveGORespawnTime(ObjectGuid::LowType dbGuid)
void Map::LoadRespawnTimes()
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS);
stmt->setUInt16(0, GetId());
stmt->setUInt32(1, GetInstanceId());
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
@@ -4073,7 +4073,7 @@ void Map::DeleteRespawnTimes()
void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE);
stmt->setUInt16(0, mapId);
stmt->setUInt32(1, instanceId);
CharacterDatabase.Execute(stmt);
@@ -4104,7 +4104,7 @@ void Map::LoadCorpseData()
{
std::unordered_map<ObjectGuid::LowType, std::unordered_set<uint32>> phases;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSE_PHASES);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSE_PHASES);
stmt->setUInt32(0, GetId());
stmt->setUInt32(1, GetInstanceId());
@@ -4163,7 +4163,7 @@ void Map::LoadCorpseData()
void Map::DeleteCorpseData()
{
// DELETE cp, c FROM corpse_phases cp INNER JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? AND c.instanceId = ?
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSES_FROM_MAP);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSES_FROM_MAP);
stmt->setUInt32(0, GetId());
stmt->setUInt32(1, GetInstanceId());
CharacterDatabase.Execute(stmt);