mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
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
(cherry picked from commit 4c593f12ca)
This commit is contained in:
@@ -3982,7 +3982,7 @@ void Map::SaveCreatureRespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
|
||||
stmt->setUInt64(0, dbGuid);
|
||||
stmt->setUInt32(1, uint32(respawnTime));
|
||||
stmt->setUInt64(1, uint64(respawnTime));
|
||||
stmt->setUInt16(2, GetId());
|
||||
stmt->setUInt32(3, GetInstanceId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -4012,7 +4012,7 @@ void Map::SaveGORespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime)
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
|
||||
stmt->setUInt64(0, dbGuid);
|
||||
stmt->setUInt32(1, uint32(respawnTime));
|
||||
stmt->setUInt64(1, uint64(respawnTime));
|
||||
stmt->setUInt16(2, GetId());
|
||||
stmt->setUInt32(3, GetInstanceId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -4040,7 +4040,7 @@ void Map::LoadRespawnTimes()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid::LowType loguid = fields[0].GetUInt64();
|
||||
uint32 respawnTime = fields[1].GetUInt32();
|
||||
uint64 respawnTime = fields[1].GetUInt64();
|
||||
|
||||
_creatureRespawnTimes[loguid] = time_t(respawnTime);
|
||||
} while (result->NextRow());
|
||||
@@ -4055,7 +4055,7 @@ void Map::LoadRespawnTimes()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid::LowType loguid = fields[0].GetUInt64();
|
||||
uint32 respawnTime = fields[1].GetUInt32();
|
||||
uint64 respawnTime = fields[1].GetUInt64();
|
||||
|
||||
_goRespawnTimes[loguid] = time_t(respawnTime);
|
||||
} while (result->NextRow());
|
||||
|
||||
Reference in New Issue
Block a user