Add a fail-safe for dynamic zone shutdown timers

This commit is contained in:
Akkadius 2017-06-28 21:23:02 -05:00
parent 4d2825d817
commit 5a9744b429
2 changed files with 6 additions and 3 deletions

View File

@ -541,6 +541,9 @@ int main(int argc, char** argv) {
if (previous_loaded && !current_loaded) {
process_timer.Stop();
process_timer.Start(1000, true);
uint32 shutdown_timer = database.getZoneShutDownDelay(zone->GetZoneID(), zone->GetInstanceVersion());
zone->StartShutdownTimer(shutdown_timer);
}
else if (!previous_loaded && current_loaded) {
process_timer.Stop();

View File

@ -1414,11 +1414,11 @@ bool Zone::HasWeather()
void Zone::StartShutdownTimer(uint32 set_time) {
if (set_time > autoshutdown_timer.GetRemainingTime()) {
if (set_time == (RuleI(Zone, AutoShutdownDelay)))
{
if (set_time == (RuleI(Zone, AutoShutdownDelay))) {
set_time = database.getZoneShutDownDelay(GetZoneID(), GetInstanceVersion());
}
autoshutdown_timer.Start(set_time, false);
autoshutdown_timer.SetTimer(set_time);
Log(Logs::General, Logs::Zone_Server, "Zone::StartShutdownTimer set to %u", set_time);
}
}