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

[TF2] Server UpTime Restarter


Post New Thread Reply   
 
Thread Tools Display Modes
Author
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Plugin ID:
8141
Plugin Version:
1.0.1
Plugin Category:
Server Management
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Automatically restarts the server if inactive for some time. This will prevent server jitters.
    Old 08-03-2022 , 01:13   [TF2] Server UpTime Restarter
    Reply With Quote #1

    Server UpTime Restarter

    This plugin will automatically restart your server after a set period of no activity.
    Solves the jitter problem.


    If a server runs for long enough, then a detrimental jitter effect can take place. I theorize this is due to floating point errors and is a rather nasty bug. It is really quite bad for server reputation when new players join a low (or empty) population of players in a server, only to encounter this.

    I originally wrote this plugin back in 2017, but only now updated it in 2022 and I am making it public. I welcome new features if anyone wishes to do so.

    -

    Installation:
    Just put the .smx file into your "..\tf\addons\sourcemod\plugins" folder and either restart your server, restart the map or just run the command "sm plugins load server_uptime_restarter" via the rcon console.

    Default behavior:
    Server will run for an hour, then when the server becomes completely empty it will perform a restart. The plugin will wait until the server is completely empty.
    There is a grace period of 1 minutes when loading a new map, so that players can join in if they exist, thus preventing an unwarranted restart.

    In the case of a server actually having at least 1 player for a whole day, a server restart will be forced anyway.

    If set to restart with a minimum number of players instead, then a warning countdown will be shown in chat to warn all players before restarting.

    Cvars:
    PHP Code:
    // Use this if you wish to stop plugin functions temporarily.
    // -
    // Default: "1"
    // Minimum: "0"
    SUR_Enable

    // Minimum time in seconds before restart attempt.
    // -
    // Default: "3600"
    // Minimum: "60.0"
    SUR_UpTime_Min

    // Time in seconds before server restart is forced, regardless of player count.
    // -
    // Default: "86400"
    // Minimum: "60.0"
    SUR_UpTime_Max

    // At least this many players will cause the restart to be delayed. Spectators are not counted.
    // -
    // Default: "1"
    // Minimum: "1.0"
    SUR_MinPlayers

    // Display restart warning message in chat.
    // -
    // Default: "1"
    // Minimum: "0"
    SUR_Warn_ShowChat 
    Note:
    This version does not use a custom config file, so should any cvar changes be desired, these configuration lines must be placed in your server.cfg file if you wish for them to be permanent.

    Changelog:
    6th May 2017 - v1.0.0
    • Created plugin

    15th July 2022 - v1.0.1
    • Modified default values
    • Fixed some spelling mistakes

    -
    Attached Files
    File Type: sp Get Plugin or Get Source (server_uptime_restarter.sp - 241 views - 4.8 KB)
    CoolJosh3k 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 01:43.


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