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

[ANY] Restart Empty Server (or Map)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Plugin ID:
6495
Plugin Version:
2.6
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    334 
    Plugin Description:
    Restart server (or change the map) as soon as all human players are disconnected
    Old 04-04-2019 , 12:40   [ANY] Restart Empty Server (or Map)
    Reply With Quote #1

    Description:
    Restarts the server (or changes the map) when all players leave the game / or optionally, by the scheduled hours.
    Features:
    - 3 methods of server restart: using "crash", using "_restart", or just change the map.
    - Grace period - plugin waits some time for a new player to connect before actually decide to restart.
    - unloads the "Accelerator" extension to prevent false crash reports.
    - correctly free resources by unloading all plugins before actual restarting
    - Able to remove the false crash log in the "CRASH" folder - some servers create it
    - Control sv_hibernate_when_empty ConVar. Some admins (hosters) setup it, so many similar plugins cannot perform a restart due to plugin freeze.
    - (optionally) start-end hours where restart allowed
    - (optionally) start-end hours to force restart (with kicking the players)
    - (optionally) restrict the frequency of restarting
    - the restart time is logged to file: addons/sourcemod/logs/restart.log
    Recommended for:
    - prophylaxis
    - fixing the bug related to resetting all ConVars to defaults (seen on some servers). The source of the problem is unknown.
    Requirements:
    - Regexp extension (included in SourceMod).
    Settings (ConVars):
    see: cfg/sourcemod/sm_restart_empty.cfg:

    - sm_restart_empty_enable - def.: 1 - Enable plugin (1 - On / 0 - Off)
    - sm_restart_empty_method - def.: 2 - When server is empty, what to do? 1 - _restart, 2 - crash (use if method # 1 is not work), 3 - just change map
    - sm_restart_empty_delay - def.: 1.0 - Grace period (in sec.) waiting for new player to join until actually decide to restart the server
    - sm_restart_empty_unload_ext_num - def.: 0 - If you have Accelerator extension, you need specify here order number of this extension in the list: sm exts list
    - sm_restart_empty_min_period - def.: 0 - Minimum period (in hours) this plugin should wait before the next restarting is allowed (0 - disable, 24 - allow once per day)
    - sm_restart_empty_limit_hour_start - def.: 0 - Allow rebooting to be started from this hour only (paired with "*_end" ConVar)
    - sm_restart_empty_limit_hour_end - def.: 24 - Allow rebooting until this hour only (paired with "*_start" ConVar)
    - sm_restart_empty_force_hour_start - def.: -1 - Start hour for force rebooting (if last reboot happened > 24 hours ago) and somebody leaves during this hour (paired with "*_end" ConVar) (-1 to disable)
    - sm_restart_empty_force_hour_end - def.: -1 - End hour for force rebooting (if last reboot happened > 24 hours ago) and somebody leaves during this hour (paired with "*_start" ConVar) (-1 to disable)
    - sm_restart_empty_utc_delta - def.: 0.0 - If your server has incorrect time, you can set UTC correction hours here (they will be appended to a server time)
    - sm_restart_empty_server_start_changemap - def.: 0 - When server restarted, change map to the random one from the file: data/restart_empty_maps.txt (1 - Yes / 0 - No)
    Commands: (both intended for plugin setup stage)
    sm_restarter_ctime - Check the server time taking into account UTC delta ConVar
    sm_restarter_accelerator - Show auto-detected order number of Accelerator extension
    Installation
    1. Unpack the archive and place its contents to addons/sourcemod
    2. If you plan to use map change features, edit file "addons/sourcemod/data/restart_empty_maps.txt" inserting your own map list (one per line) you want to randomly change map to.
    3. Change the map.
    4. See Suggestions on Setup section
    5.
    If you have "Accelerator" extension, do this:

    Suggestions on Setup
    Spoiler


    Credits:
    - @Luckylock - for alternative way of reboot, "crash" command.
    - @Forgetest - for coding auto-detection of Accelerator extension order number.
    Related plugins:
    [ANY] Vote server restart
    ChangeLog
    Spoiler


    Donate
    Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
    - Patreon (Paypal)
    - BitCoin
    - Ю.Money
    Attached Files
    File Type: zip RestartEmpty_v2.6.zip (17.9 KB, 659 views)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 01-07-2023 at 10:28.
    Dragokas is offline
    Ejziponken
    AlliedModders Donor
    Join Date: Apr 2008
    Old 04-04-2019 , 12:55   Re: [ANY] Restart empty server
    Reply With Quote #2

    Does this keep restarting all night if there are no players?
    Ejziponken is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 04-04-2019 , 12:59   Re: [ANY] Restart empty server
    Reply With Quote #3

    No, only once It track "player_disconnect" event.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    PwnK
    Junior Member
    Join Date: Aug 2018
    Old 04-04-2019 , 13:18   Re: [ANY] Restart empty server
    Reply With Quote #4

    Looks good

    I need to test this on my server because some people always complain about auto restart in the night.
    PwnK is offline
    Zuby24
    Member
    Join Date: Apr 2017
    Location: Romania/Bucharest
    Old 04-04-2019 , 14:02   Re: [ANY] Restart empty server
    Reply With Quote #5

    Nice plugin!
    Wait to see if it works (see on tonight )
    __________________
    Zuby24 is offline
    Ejziponken
    AlliedModders Donor
    Join Date: Apr 2008
    Old 04-04-2019 , 14:05   Re: [ANY] Restart empty server
    Reply With Quote #6

    We are using a plugin to restart the server every night. Now this plugin wont just restart the server at set time, it will wait until the server is empty, like this plugin..

    The problem is that sometimes a server never actually gets empty, and then the server wont restart and it will start to perform worse over time.

    It would be nice if the plugin could keep track if it did restart after the set time, and if not, it could force an restart at a second specified time with some warning in the chat before it goes down. like when its 5 min left and when its 30 seconds left or something.

    For example:
    DM #3 is set to restart at 5am. But since its a popular server, the players stay on it all night and and it wont actually have a chance to restart again until 5am next morning. So with this new idea, the server would force a restart at maybe 2pm and then again at 5am if the server is empty. :p
    Ejziponken is offline
    AK978
    Senior Member
    Join Date: Jun 2018
    Old 04-04-2019 , 14:15   Re: [ANY] Restart empty server
    Reply With Quote #7

    Does server sleep not affect the timer?
    AK978 is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 04-04-2019 , 14:57   Re: [ANY] Restart empty server
    Reply With Quote #8

    Ejziponken, ok, I will add such feature later.

    Quote:
    Originally Posted by AK978 View Post
    Does server sleep not affect the timer?
    It should be compatible.
    Quote:
    Originally Posted by Dragokas
    - Control sv_hibernate_when_empty ConVar. Some admins (hosters) setup it, so many similar plugins cannot perform a restart.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 04-04-2019 at 14:58.
    Dragokas is offline
    DabberDoug
    Member
    Join Date: Feb 2016
    Location: USA
    Old 04-06-2019 , 16:29   Re: [ANY] Restart empty server
    Reply With Quote #9

    Is there a way to make this restart the server when the match ends
    DabberDoug is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 04-06-2019 , 16:53   Re: [ANY] Restart empty server
    Reply With Quote #10

    Is it really necessary and why? What game is it for? I'm unsure about how to catch that event.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Reply


    Thread Tools
    Display Modes

    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 06:01.


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