View Single Post
Author Message
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 10-26-2011 , 01:09   [TF2] Automatic Steam Update
Reply With Quote #1

[TF2] Automatic Steam Update

v1.9.1

Description:
Once the master server notifies the server that there is an update available, and requests a restart, this plugin begins a five minute (default, customizable via cvar) timer, after which the server is restarted (by means of the _restart command). This only works on Linux SRCDS with the -autoupdate parameter added to the command line, or on Windows running a batch file that automatically runs SteamCMD when the server is restarted. The server must actually check for updates each run, or this plugin is pointless. The timer can be cancelled by an admin command, and the plugin will ignore any additional restart requests for a predefined period of time (defined via cvar). Every minute, a hint box appears and a sound is played (TF2 only). The timer itself is displayed for the duration of the countdown as HUD text in the top-left of the screen.

Commands:
sm_postponeupdate - postpone the update for a predefined period of time (default flag is ADMFLAG_RCON)
sm_updatetimer - force the update timer to begin immediately (default flag is ADMFLAG_RCON)

Cvars:
  • auto_steam_update_version - plugin version
  • auto_steam_update_timer - (default 5) how long in minutes the timer lasts until the server is restarted
  • auto_steam_update_message_display_time - (default 5) no notifications will be shown to clients until the timer is below this threshold (in minutes)
  • auto_steam_update_delay - (default 5) how long in minutes the plugin will ignore restart requests after an update is postponed
  • auto_steam_update_lock - (default 0) 0 = don't lock the server during the restart timer / 1 = change sv_password during the restart timer / 2 = kick new clients (except admins) during the restart timer
  • auto_steam_update_password - (default "") the string to change sv_password to if auto_steam_update_lock = 1
  • auto_steam_update_kickmessage - (default "The server will shut down soon to acquire Steam updates, so no new connections are allowed") the message to display when kicking clients if auto_steam_update_lock = 2
  • auto_steam_update_shutdown_message - (default "Server shutting down for Steam update") the message shown to clients when they are kicked as the server is shutting down
  • auto_steam_update_hud_text_x_pos - (default 0.01) X-position for HUD timer (only on supported games) -1.0 = center
  • auto_steam_update_hud_text_y_pos - (default 0.01) Y-position for HUD timer (only on supported games) -1.0 = center
  • auto_steam_update_hud_text_red - (default 0) Amount of red for HUD timer (only on supported games)
  • auto_steam_update_hud_text_green - (default 255) Amount of green for HUD timer (only on supported games)
  • auto_steam_update_hud_text_blue - (default 0) Amount of blue for HUD timer (only on supported games)
  • auto_steam_update_auto_update - (default 1) enables automatic plugin updating (has no effect if Updater is not installed)

Plugin creates and loads /cfg/sourcemod/plugin.autosteamupdate.cfg

The advantage of using 1 in auto_steam_update_lock is that clients will be denied before attempting to connect. The advantage of using 2 is that admins will be able to bypass it without knowing a password.

Installation:
Put auto_steam_update.smx into /addons/sourcemod/plugins and reboot your server or type "sm plugins load auto_steam_update" into your console or rcon.

Overrides:
BypassAutoSteamUpdateDisallow - admins with this override will be allowed on the server during the timer if auto_steam_update_lock = 2 (defaults to ADMFLAG_GENERIC)

Requirements:
This plugin requires SteamTools.

Auto Update:
Install Updater. The plugin will be autoupdated according to your Updater settings. It'll work without Updater.

Changelog:
  • v1.9.0 (9/28/12)
    • Added auto_steam_update_hud_text_x_pos cvar
    • Added auto_steam_update_hud_text_y_pos cvar
    • Added auto_steam_update_hud_text_red cvar
    • Added auto_steam_update_hud_text_green cvar
    • Added auto_steam_update_hud_text_blue cvar
  • v1.8.0 (8/15/12)
    • Removed HUD text errors on mods that don't support HUD text
    • Various code improvements and optimizations
  • v1.7.0 (7/12/12)
    • Added ability to disable automatic plugin updating
  • v1.6.0 (6/20/12)
    • Added auto_steam_update_message_display_time cvar
  • v1.5.0 (5/20/12)
    • Fixed harmless error messages
    • Added sound effects in TF2
    • Added a constant countdown timer as HUD text in the top-left corner of the screen
  • v1.4.0 (12/17/11)
    • Added auto_steam_update_shutdown_message convar
    • Added sm_updatetimer to force an update timer to start
    • If auto_steam_update_lock is set to 1 and the timer is postponed, the password will be changed back to the original
    • Other miscellaneous fixes and improvements
  • v1.3.0 (11/18/11)
    • Timer callback now returns Plugin_Continue instead of Plugin_Handled
  • v1.2.0 (11/2/11)
    • The plugin now properly checks if the server is populated with actual human players or just bots when a restart is requested
  • v1.1.0 (11/2/11)
    • Added auto_steam_update_lock and related functionality
  • v1.0.0 (10/25/11)
    • Initial Release

Download Plugin (auto_steam_update.smx)
View Source (auto_steam_update.sp)
__________________

Last edited by Dr. McKay; 07-14-2020 at 04:18.
Dr. McKay is offline