From e222cbbc0a19abe407cbb8df1fc8e04ddde19d16 Mon Sep 17 00:00:00 2001 From: ayase <137056643@qq.com> Date: Mon, 4 Jun 2018 03:56:02 +0800 Subject: [PATCH] Fix: Stuck at "Retrieving character list". (#880) @AyaseCore * fix: Stuck at "Retrieving character list". * change 2 to 1.1. * Use the rochet2 solution. @Rochet2 * Add more logic from InstanceSaveManager::Update In `InstanceSaveManager::Update` the `bool warn = event.type < 5;` affects how much time is added to the next reset schedule. This commit takes that into account to the next_reset calculation when skipping resets. * Simplify code and move it to data loading --- src/server/game/Instances/InstanceSaveMgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index eeba3749f..0fe54b8e4 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -290,6 +290,12 @@ void InstanceSaveManager::LoadResetTimes() SetResetTimeFor(mapid, difficulty, t); CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u', '%u', '%u')", mapid, difficulty, (uint32)t); } + else + { + // next reset should be in future. If its not, skip to future. + while (t < now) + t = uint32(((t + MINUTE) / DAY * DAY) + period + diff); + } SetExtendedResetTimeFor(mapid, difficulty, t + period); // schedule the global reset/warning