Raised This Month: $51 Target: $400
 12% 

Is it possible to keep a timer alive during server hibernation?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 05-22-2018 , 09:46   Is it possible to keep a timer alive during server hibernation?
Reply With Quote #1

well this really gets to me when my server hibernates and everything stops working, i actually disabled server hibernation but that consume too much of my server's CPU i also have thought about other options like write an outside program which send and check whatever i have on timer side via rcon protocol, anyway is it possible to keep a timer alive during server hibernation? like flag or so?
__________________
ambn is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-22-2018 , 10:32   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #2

What is the the timer doing..?
Mitchell is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 05-22-2018 , 10:43   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #3

well there are 2 timers which one of them count server's up time (in days) and the other one handles a simple local ban system which loop each minute to perform actions like removing a minute or remove a user ban, anyway is there a way for this?
__________________
ambn is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-22-2018 , 10:49   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #4

When handling time it's best to just use GetTime() to retrieve the current time and use a little math to determine the server's uptime and to determine if a user has been banned for his given time.
Mitchell is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 05-22-2018 , 11:20   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #5

well you're right but that's not the point, that stuff won't even happen when server is in hibernation what i'm lookin for is a sourcemod way to make it right, so do you suggest anything?
__________________
ambn is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-22-2018 , 11:41   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #6

Timers will only ever currently tick while the server is running game frames. It's probably possible to alter SM to tick on something else (like Think, maybe), but no one has done work towards it.
Fyren is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-22-2018 , 11:57   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #7

Quote:
Originally Posted by ambn View Post
what i'm lookin for is a sourcemod way to make it right, so do you suggest anything?
GetTime() is a sourcemod function: https://sm.alliedmods.net/new-api/sourcemod/GetTime
From what you explained you really don't need to have a timer do +1 to a variable every day when you can have the start time of the server save to a variable and subtract it from the current time to get the current uptime in seconds.
Mitchell is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 15:07   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #8

ambn, you can try GetSysTickCount() instead.
Not reliable. See explanation why.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-22-2018 at 19:25.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-23-2018 , 10:45   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #9

I read this topic again, and don't understant why you need a working timer during hybernation.
Your ban-plugin will not work in hybernation state because all processes will be freezed regardless of timer. Am I not right?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-23-2018 at 10:45.
Dragokas is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 05-23-2018 , 10:58   Re: Is it possible to keep a timer alive during server hibernation?
Reply With Quote #10

It's like nothing works during hibernation on sourcemod yeah you got it right the hibernation wont let the timer work.

EDIT: i can possibly tick the server every minute with an outside program but what's the point of waking a server every minute?
__________________

Last edited by ambn; 05-23-2018 at 11:01.
ambn is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode