All global timers stop working while longer server uptime
#1

Hello, I have bunch of "global" timers in my gamemode, but there's a bug that appeared few days ago. When my server is up for 5-10 hours, all the "SetTimer" timers suddenly stop, even though "SetTimerEx" timers keep on working properly. There are no warnings/errors in compiler or serverlog. Someone who knows why this happens?

Timers in OnGameModeInIt:
PHP код:
    SetTimer("afkcheck", 1000, 0);
    
SetTimer("CheckBalon", 1500, true);
    
SetTimer("ObnovaBalicku", 7200000, true);
    
SetTimer("ObnovaWantedu", 600000, true);
    
SetTimer("Pocasi", 3600000, true);
    
SetTimer("Bedny", 1800000, true);
    
SetTimer("CheckBrana", 1500, true);
    
SetTimer("CheckKartac", 150, true);
    
SetTimer("CheckMicky", 1500, true);
    
SetTimer("DespawnVehicles", 3000, true);
    
SetTimer("ExportVeh", 3600000, true);
    
SetTimer("StartExportVeh", 1500, false);
    
SetTimer("Vysilac", 30000, true);
    
SetTimer("RandomZpravy", 600000, true);
    
SetTimer("SmazaniBodcu", 300000, true);
    
SetTimer("burglarcheck", 1500, true);
    
SetTimer("UzemiCheck", 1500, true);
    
SetTimer("CheckPlane", 1500, true);
    
SetTimer("CheckTime", 1500, true);
    
SetTimer("Check82", 1500, true);
    
SetTimer("Check83", 1500, true);
    
SetTimer("CheckCar", 10000, true);
    
SetTimer("SetCas", 1000, true);
    
SetTimer("AfkKick", 1500, true);
    
SetTimer("Vezeni2", 1500, true);
    
SetTimer("Timer", 1000, true);
    
SetTimer("FlasherFunc", 200, true);
    
SetTimer("MizeniPlosin", 1500, true); 
There are few more "global" timers in my gamemode, but not different than these in OnGameModeInIt.
Reply
#2

How many of them are used to loop through players? You can easily merge a few together to reduce the amount of timers.
Reply
#3

Around 11 of them use loop, I'll try it.
Reply
#4

Why do you need so many global timers? The timer "Timer" is very self explanatory.
Reply
#5

Alright, I've merged most of the global timers together.

Quote:

The timer "Timer" is very self explanatory.

Well, I don't really get what this explains.
Reply
#6

It's probably because all of them will at one time converge because they're all multiples of 100. If possible, use primes for timer intervals.
Reply
#7

Quote:

It's probably because all of them will at one time converge because they're all multiples of 100. If possible, use primes for timer intervals.

Ok, thanks for advice.
Reply
#8

Many timers will cause a huge lag in the server
Reply
#9

Quote:
Originally Posted by Daveosss
Посмотреть сообщение
Well, I don't really get what this explains.
What does "Timer" do? You're the first I've seen that calls a timer, Timer. It doesn't really explain what it does. But the real question is, why do you have so much timers? What are they all for?
Reply
#10

Quote:

Many timers will cause a huge lag in the server

I've already decreased the number of global timers.

Quote:

What does "Timer" do? You're the first I've seen that calls a timer, Timer. It doesn't really explain what it does. But the real question is, why do you have so much timers? What are they all for?

Timer "Timer" was controling server time. I had a lot of timers, because I liked when the every single piece of code was seperated and put in its own public. Gamemode looked cleaner.

Anyway, I did everything you guys recommended to me and server is running for 7 hours without any bugged timer. Hopefully, it's going to work now. Thanks for your time (rep+)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)