View Single Post
Author Message
Milo|
Member
Join Date: Jan 2009
Location: Netherlands
Old 01-30-2009 , 21:48   Dailyconfig plugin
Reply With Quote #1

Summary

This plugin was requested on the forum by Billiam. It gives any server running a source mod (CS:S, TF2, L4D, many more) the ability to load daily config files. That is to say: monday.cfg will be loaded at every mapchange on monday, tuesday.cfg on tuesday, etc.


Supported games

The game should work on nearly every game using the source or orangebox engine, which would include:
  • Team Fortress 2
  • Counter-strike : Source
  • Day of Defeat : Source
  • Left 4 Dead
  • Insurgency
  • Garry's Mod

Commands and CVars:
  • sm_dailyconfig_offset - Time difference to apply to the server clock when determining today's config.
  • sm_dailyconfig_clock - This command allows you to see the current time on the server both with and without sm_dailyconfig_offset applied.
  • dailyconfig_version - Shows the version of this plugin.

Installation:
  1. Copy dailyconfig.smx to the Sourcemod plugins directory (default: <gamedir>/addons/sourcemod/plugins/)
  2. Change the map on your server (or restart it) to force the plugin to load.
  3. Empty configfiles for each day will automaticly be created (if possible and if they didn't already exist)

Usage:


The plugin will attempt to load one of the following files from the cfg/dailyconfig/ directory:
  • monday.cfg
  • tuesday.cfg
  • wednesday.cfg
  • thursday.cfg
  • friday.cfg
  • saturday.cfg
  • sunday.cfg
If the configfile for the current day is not available, no additional configfiles will be loaded. The serverconsole will notify the administrator by the following line:
exec: couldn't exec saturday.cfg
No additional errors, warnings or logentries are created.


Notes:
  • The daily configfile is loaded on every mapchange, similar to the server.cfg file.
  • The daily configfile is loaded after the game is done loading the usual configfiles (such as server.cfg). Because of this, any setting you put in the dailyconfig, will overrule the settings preset in server.cfg
  • The daily config plugin uses the date and time of your server, so make sure the time is set correctly. If you wanna use another timezone than the server machine itself, change sm_dailyconfig_offset to "-2" or "+4" or similar values. Use sm_dailyconfig_clock to see/test your settings
  • The sm_dailyconfig_offset cvar is relative to the server time, not relative to GMT. sm_dailyconfig_offset "+1" means the time will be seen as servertime+1hour , not GMT+1.

Possible features to be added in future versions:
  • Adding a cvar sm_dailyconfig_enable <0/1> to effectively enable/disable the plugin (only if people should want this)
  • Adding cvars holding the filenames of the configfiles to be loaded, eg: sm_dailyconfig_saturday "saturday.cfg" (only if people should want this)

Version history
  • Version 1.2
    • Added: The sm_dailyconfig_offset cvar to effectively allow you to change the timezone.
    • Added: The sm_dailyconfig_clock command to debug/test the timezone offset.
    • Changed: webcompiler to sourcemod version 1.2
  • Version 1.1
    • Added: Automatic creation of configfiles
    • Changed: the daily config files are now inside a separate directory within the cfg directory.
    • Changed webcompiler to sourcemod version 1.1
  • Version 1.0 (initial release)
    • Initial version
    • Tested in Team Fortress 2
Attached Files
File Type: sp Get Plugin or Get Source (dailyconfig.sp - 2022 views - 5.6 KB)
File Type: smx dailyconfig.smx (4.2 KB, 703 views)

Last edited by Milo|; 04-17-2009 at 02:55.
Milo| is offline