AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Server Startup Configuration (https://forums.alliedmods.net/showthread.php?t=64625)

TFN|Nick 12-19-2007 16:02

Server Startup Configuration
 
2 Attachment(s)
Server Startup Configuration

by
-=( TFN | Pieface )=-


Description
This is a tool that allows users to run a config file only on server startup. This is useful if you want to setup all of your sourcemod files but may want to tweak settings later. Say for instance:

"I use deathbeam and have setup my colours for teams as x,y,z but got complaints about it so i have disabled it. However when the server changes map and server.cfg is executed again all my settings are back to normal and i have to manually disable it again. So now our head admin has to disable it in the script so we can activate it later. This is a pain!"

This plugin was designed to run only the one file on server startup so that i can change any settings and have them stay that way without having to execute a file manually after the server has restarted.

Eh, i developed it for my server but i'm just posting it here so anyone who wants to can use it :D .

IMPORTANT: This plugin has been tested on my CS:S server and works fine but there maybe kinks etc to be worked out. Therefore the plugin is still in BETA!

CVars
sm_startup_active <1|0> This enables/disables the plugin
sm_startup_file MyConfig.cfg This is the full file path of your config
sm_startup <1|0> This is a system CVar used to decide whether to execute the script or not. DO NOT CHANGE!!
sm_startup_version Kinda speaks for itself really :D

Installation
Place the .smx file into the "plugin" folder and the .sp into your "scripting" folder. Put the following line into your server.cfg:

sm_startup_file MyConfig.cfg*

*This needs to be the full file path to your config file.

Change Log
0.1.x - initial versions, overly complicated and buggy.
0.2.0 - recode of 0.1.x, easier to setup/change. (BETA)
0.2.1 - tested and various bugs fixed. (BETA)
0.2.2 - fixed a bug. File names where logging as numbers *n00b*

Future Plans
WarMode support
AutoExec creation
Admin Menu support

Support
I will support this plugin, but i will need the following details:
  • sourcemod version
  • metamod version
  • server type
  • plugin version
  • error logs/messages etc

FlyingMongoose 12-19-2007 16:48

Re: Server Startup Configuration
 
isn't this exactly what autoexec.cfg and placing exec [filepathfromcfgfolder] in it does?

TFN|Nick 12-19-2007 16:51

Re: Server Startup Configuration
 
I tried that but it executed before the plugins had loaded and so the values wheren't set. And i did look for alternatives first but there was nothing so i took the DIY approach :D

EDIT: and, like i said in the post, i made it for myself and i'm just sharing it ;)

komat 12-20-2007 00:05

Re: Server Startup Configuration
 
Quote:

Originally Posted by TFN|Nick (Post 565024)
I tried that but it executed before the plugins had loaded and so the values wheren't set. And i did look for alternatives first but there was nothing so i took the DIY approach :D

EDIT: and, like i said in the post, i made it for myself and i'm just sharing it ;)

i never had that problem
all my config comamnds for hte plugins are in my server.cfg not autoexec.cfg

bl4nk 12-20-2007 00:17

Re: Server Startup Configuration
 
Plugins are loaded before the configs are, unless the plugin uses OnConfigsExecuted().

TFN|Nick 12-20-2007 03:54

Re: Server Startup Configuration
 
@bl4nk: Well, i asked about this before. And it was suggested i use autoexec.cfg. So i did. I put all my settings in there and the server rebooted- no settings changed... and i left it that way for a month to see if it was just me, but it wasn't doing anything- so i made this to sort it out.

@komat: i did that before, but if i wanted to say disable a plugin from working that was off by default i had to change it in server.cfg because it just kept reloading the same settings over and over again. It wasn't so bad if it was a plugin that was on by default because i didn't have to set that CVar, but things like awp punish and deathbeam where a pain if i wanted to make a change :(

ferret 12-20-2007 07:27

Re: Server Startup Configuration
 
Nothing really wrong with this plugin. It has limited usage, but does server a purpose in allowing a specific configuration to be controlled via CVAR. I could also see this being useful for a warmode.

Ie, have all your normal plugins in this file, and the cvar on. Then to turn everything off and keep it off, set the cvar to 0 and change map.

What you may want to consider is having both a "enable cfg" and "disable cfg". Then hook the "active" cvar for changes. When it changes to 0, exec the disable cfg, and when it changes to 1, exec the enabled cfg.

Then you could use it with the default warmode_on and warmode_off CFGs included with SourceMod. You could also make a cvar for the filename of each Cvars.

Just some ideas to add more range of functionality.

ottobohn 12-20-2007 10:53

Re: Server Startup Configuration
 
Could you go a step farther? Could you have it load up configs depending on maps like event scripts, mani mod, and metamods?

I'd like to load one map, example: Dust2, and have a config loading specifically for it. If we go to Office, I want a config that pertains to that.

/cfg/sourcemod/mapcfg/de_dust2.cfg will load up for dust2

/cfg/sourcemod/mapcfg/cs_office.cfg will load up for what we need for office.

Thanks!

Otto

ferret 12-20-2007 10:59

Re: Server Startup Configuration
 
That's going to be in base SourceMod soonish, I've already begun work on it.

TFN|Nick 12-20-2007 12:38

Re: Server Startup Configuration
 
@ferret: Thanks for the approval. I designed the plugin originally to do this but it became overly complicated for my liking. However, I have some ideas on how to make this easier and will see what i can cook up tonight along the lines of your recommendations.

@otto: What ferret said :D


All times are GMT -4. The time now is 08:24.

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