aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-11 23:57:29 -0300
committerariel- <ariel-@users.noreply.github.com>2017-04-12 02:19:55 -0300
commit4c593f12caa162c1bfb831bdbed934bb39155ddb (patch)
tree57dfc52e6a0f38e2f9a1a382ea8722d6764e5505 /src/server/game/Maps/Map.cpp
parente32a4f26aaa51fba2647aeb8ef751dd398bc09d8 (diff)
Core/Instance: stop updating the instance resettimes based on creature respawns
- Rather update normal instance reset time to 2 hours after last creature kill - This fixes yet another integer overflow due to the possibility of having time_t max showing up - Also change respawntime and resettime fields to bigint on respawn/instance related tables - Start using prepared statements on the InstanceSaveMgr
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 943f4bd759b..b3eb7fa275d 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -3565,7 +3565,7 @@ void Map::SaveCreatureRespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
stmt->setUInt32(0, dbGuid);
- stmt->setUInt32(1, uint32(respawnTime));
+ stmt->setUInt64(1, uint64(respawnTime));
stmt->setUInt16(2, GetId());
stmt->setUInt32(3, GetInstanceId());
CharacterDatabase.Execute(stmt);
@@ -3595,7 +3595,7 @@ void Map::SaveGORespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
stmt->setUInt32(0, dbGuid);
- stmt->setUInt32(1, uint32(respawnTime));
+ stmt->setUInt64(1, uint64(respawnTime));
stmt->setUInt16(2, GetId());
stmt->setUInt32(3, GetInstanceId());
CharacterDatabase.Execute(stmt);
@@ -3623,7 +3623,7 @@ void Map::LoadRespawnTimes()
{
Field* fields = result->Fetch();
ObjectGuid::LowType loguid = fields[0].GetUInt32();
- uint32 respawnTime = fields[1].GetUInt32();
+ uint64 respawnTime = fields[1].GetUInt64();
_creatureRespawnTimes[loguid] = time_t(respawnTime);
} while (result->NextRow());
@@ -3638,7 +3638,7 @@ void Map::LoadRespawnTimes()
{
Field* fields = result->Fetch();
ObjectGuid::LowType loguid = fields[0].GetUInt32();
- uint32 respawnTime = fields[1].GetUInt32();
+ uint64 respawnTime = fields[1].GetUInt64();
_goRespawnTimes[loguid] = time_t(respawnTime);
} while (result->NextRow());