mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-04 00:02:24 +00:00
Add a fail-safe for dynamic zone shutdown timers
This commit is contained in:
parent
4d2825d817
commit
5a9744b429
@ -541,6 +541,9 @@ int main(int argc, char** argv) {
|
|||||||
if (previous_loaded && !current_loaded) {
|
if (previous_loaded && !current_loaded) {
|
||||||
process_timer.Stop();
|
process_timer.Stop();
|
||||||
process_timer.Start(1000, true);
|
process_timer.Start(1000, true);
|
||||||
|
|
||||||
|
uint32 shutdown_timer = database.getZoneShutDownDelay(zone->GetZoneID(), zone->GetInstanceVersion());
|
||||||
|
zone->StartShutdownTimer(shutdown_timer);
|
||||||
}
|
}
|
||||||
else if (!previous_loaded && current_loaded) {
|
else if (!previous_loaded && current_loaded) {
|
||||||
process_timer.Stop();
|
process_timer.Stop();
|
||||||
|
|||||||
@ -1414,11 +1414,11 @@ bool Zone::HasWeather()
|
|||||||
|
|
||||||
void Zone::StartShutdownTimer(uint32 set_time) {
|
void Zone::StartShutdownTimer(uint32 set_time) {
|
||||||
if (set_time > autoshutdown_timer.GetRemainingTime()) {
|
if (set_time > autoshutdown_timer.GetRemainingTime()) {
|
||||||
if (set_time == (RuleI(Zone, AutoShutdownDelay)))
|
if (set_time == (RuleI(Zone, AutoShutdownDelay))) {
|
||||||
{
|
|
||||||
set_time = database.getZoneShutDownDelay(GetZoneID(), GetInstanceVersion());
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user