AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Dailyconfig plugin (https://forums.alliedmods.net/showthread.php?t=84720)

Milo| 01-30-2009 21:48

Dailyconfig plugin
 
2 Attachment(s)
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

msleeper 01-30-2009 21:52

Re: Dailyconfig plugin
 
Not a bad idea, but why couldn't you just use the crontab plugin?

Milo| 01-30-2009 22:05

Re: Dailyconfig plugin
 
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.

Billiam 01-30-2009 23:17

Re: Dailyconfig plugin
 
Awesome, thank you!

DontWannaName 01-31-2009 01:06

Re: Dailyconfig plugin
 
Last time I used crontab it didnt work.

liam12360 01-31-2009 01:38

Re: Dailyconfig plugin
 
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.

Sexual Harassment Panda 04-01-2009 01:52

Re: Dailyconfig plugin
 
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.

Faust_mateo 04-04-2009 08:53

Re: Dailyconfig plugin
 
Anyone running this on a updated DOD:S with SM 1.2 ? This would be great!

Milo| 04-04-2009 21:16

Re: Dailyconfig plugin
 
I haven't tested it, but it should work fine if you compile it yourself using the webcompiler or your own compiler.

Drummerx 04-05-2009 01:48

Re: Dailyconfig plugin
 
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.


All times are GMT -4. The time now is 07:25.

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