diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-01-02 14:19:35 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-10-04 00:19:38 +0200 |
commit | 9b924522d0549dd67b10e2cbdfc20297dd21e182 (patch) | |
tree | f0fcdf96902b7c497c1bc65db83621a8dfadf43a /src/server/game/Instances/InstanceLockMgr.cpp | |
parent | a131542855d23022714a97640be1c8d68a741c31 (diff) |
Core/Instances: Delete InstanceSaveMgr and replace most of its uses with new InstanceLockMgr
Diffstat (limited to 'src/server/game/Instances/InstanceLockMgr.cpp')
-rw-r--r-- | src/server/game/Instances/InstanceLockMgr.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/game/Instances/InstanceLockMgr.cpp b/src/server/game/Instances/InstanceLockMgr.cpp index 007d994133a..94cfd09706c 100644 --- a/src/server/game/Instances/InstanceLockMgr.cpp +++ b/src/server/game/Instances/InstanceLockMgr.cpp @@ -414,10 +414,12 @@ void InstanceLockMgr::OnSharedInstanceLockDataDelete(uint32 instanceId) TC_LOG_DEBUG("instance.locks", "Deleting instance %u as it is no longer referenced by any player", instanceId); } -void InstanceLockMgr::UpdateInstanceLockExtensionForPlayer(ObjectGuid const& playerGuid, MapDb2Entries const& entries, bool extended) +std::pair<InstanceResetTimePoint, InstanceResetTimePoint> InstanceLockMgr::UpdateInstanceLockExtensionForPlayer(ObjectGuid const& playerGuid, + MapDb2Entries const& entries, bool extended) { if (InstanceLock* instanceLock = FindActiveInstanceLock(playerGuid, entries, true, false)) { + InstanceResetTimePoint oldExpiryTime = instanceLock->GetEffectiveExpiryTime(); instanceLock->SetExtended(extended); CharacterDatabase.PExecute("UPDATE character_instance_lock SET extended = %d WHERE guid = " UI64FMTD " AND mapId = %u AND lockId = %d", extended ? 1 : 0, @@ -429,7 +431,11 @@ void InstanceLockMgr::UpdateInstanceLockExtensionForPlayer(ObjectGuid const& pla entries.Map->ID, entries.Map->MapName[sWorld->GetDefaultDbcLocale()], uint32(entries.MapDifficulty->DifficultyID), sDifficultyStore.AssertEntry(entries.MapDifficulty->DifficultyID)->Name[sWorld->GetDefaultDbcLocale()], playerGuid.ToString().c_str(), extended ? "now" : "no longer"); + + return { oldExpiryTime, instanceLock->GetEffectiveExpiryTime() }; } + + return { InstanceResetTimePoint::min(), InstanceResetTimePoint::min() }; } #include "Config.h" |