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"10000);
    
SetTimer("CheckBalon"1500true);
    
SetTimer("ObnovaBalicku"7200000true);
    
SetTimer("ObnovaWantedu"600000true);
    
SetTimer("Pocasi"3600000true);
    
SetTimer("Bedny"1800000true);
    
SetTimer("CheckBrana"1500true);
    
SetTimer("CheckKartac"150true);
    
SetTimer("CheckMicky"1500true);
    
SetTimer("DespawnVehicles"3000true);
    
SetTimer("ExportVeh"3600000true);
    
SetTimer("StartExportVeh"1500false);
    
SetTimer("Vysilac"30000true);
    
SetTimer("RandomZpravy"600000true);
    
SetTimer("SmazaniBodcu"300000true);
    
SetTimer("burglarcheck"1500true);
    
SetTimer("UzemiCheck"1500true);
    
SetTimer("CheckPlane"1500true);
    
SetTimer("CheckTime"1500true);
    
SetTimer("Check82"1500true);
    
SetTimer("Check83"1500true);
    
SetTimer("CheckCar"10000true);
    
SetTimer("SetCas"1000true);
    
SetTimer("AfkKick"1500true);
    
SetTimer("Vezeni2"1500true);
    
SetTimer("Timer"1000true);
    
SetTimer("FlasherFunc"200true);
    
SetTimer("MizeniPlosin"1500true); 
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: 2 Guest(s)