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

Dailyconfig plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Milo|
Member
Join Date: Jan 2009
Location: Netherlands
Plugin ID:
744
Plugin Version:
1.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    Adds the ability for loading daily configfiles (monday.cfg, tuesday.cfg etc) based on system time
    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
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 01-30-2009 , 21:52   Re: Dailyconfig plugin
    Reply With Quote #2

    Not a bad idea, but why couldn't you just use the crontab plugin?
    __________________
    msleeper is offline
    Milo|
    Member
    Join Date: Jan 2009
    Location: Netherlands
    Old 01-30-2009 , 22:05   Re: Dailyconfig plugin
    Reply With Quote #3

    The plugin was a request, the crontab plugin can indeed do anything this plugin does (and much much more).

    Consider this the lean and mean version for people who just want straight up daily config files without having to deal with a plugin that has multiple configuration files and features/terms many people aren't familiar with.

    If you want more freedom and options, go for the excellent Server crontab plugin. If all you need is a monday.cfg this might be the simpler choice.
    Milo| is offline
    Billiam
    Member
    Join Date: Jan 2009
    Old 01-30-2009 , 23:17   Re: Dailyconfig plugin
    Reply With Quote #4

    Awesome, thank you!
    Billiam is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 01-31-2009 , 01:06   Re: Dailyconfig plugin
    Reply With Quote #5

    Last time I used crontab it didnt work.
    __________________

    DontWannaName is offline
    liam12360
    Member
    Join Date: Jul 2008
    Old 01-31-2009 , 01:38   Re: Dailyconfig plugin
    Reply With Quote #6

    Dude! this is a good idea! you could have themed nights; program the day.cfg with a new hostname and enable/disable plugins. so you could set it up like 'Monday - low gravity, Tuesday - custom maps, etc.
    __________________
    liam12360 is offline
    Sexual Harassment Panda
    Veteran Member
    Join Date: Dec 2008
    Location: San Diego, CA
    Old 04-01-2009 , 01:52   Re: Dailyconfig plugin
    Reply With Quote #7

    I made a long and hard effort to make the server crontab plugin work a while back, but it would never fully implement everything in my config files. This is a godsend.
    __________________
    Sexual Harassment Panda is offline
    Faust_mateo
    Senior Member
    Join Date: Nov 2007
    Old 04-04-2009 , 08:53   Re: Dailyconfig plugin
    Reply With Quote #8

    Anyone running this on a updated DOD:S with SM 1.2 ? This would be great!
    Faust_mateo is offline
    Milo|
    Member
    Join Date: Jan 2009
    Location: Netherlands
    Old 04-04-2009 , 21:16   Re: Dailyconfig plugin
    Reply With Quote #9

    I haven't tested it, but it should work fine if you compile it yourself using the webcompiler or your own compiler.
    __________________
    A few small plugins i released for the general public:
    Milo| is offline
    Drummerx
    Junior Member
    Join Date: Jul 2008
    Old 04-05-2009 , 01:48   Re: Dailyconfig plugin
    Reply With Quote #10

    This is very interesting and usefull.

    In a later version can you make it so you can load up a new config such as sm_config tournament for a tournament.cfg instead of having to load up one by replacing the server.cfg.

    so a "sm_config" that would change to specified .cfg that would stay active untill another config file is set.
    Drummerx 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 11:56.


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