MySCAL (MySQL Server Configs & Admin Logging)
I am looking for any suggestions for this plug-in, I currently class this plug-in as BETA because I am looking for feedback from the community, although I am using for my game servers. See my thoughts/suggestions below.
If you have any suggestions, please reply below, I saw two very good ideas and merged them together into a single 'viable' solution for larger communities with lots of game servers.
What Does it Do?
The over writing of the map specific configs coudl be a pain in the rear for some users. I could add the ability to run map specific configs (even down to generic CS_* or DE_* map config files if needed).Wondering whether it would be an idea, to try and run the map specific config file after the plug-in has finished loading?? Done simply in V1.1
- I was looking through the functions and noticed that it could be possible to also write the mapcycle.txt file also, is this a feature you would want and actually use?
- Need to add in game command to run the configs again if needed
- Will look at menu integration (never done this before, so might be a while)
- Would error logging based upon server ID be useful to anyone else than me?
- Would logging of every command (that appears in the SM log files) be useful to anyone else than me?
This plug-in allows server operators to store their server.cfg file entries in a MySQL database, rather than have server config files scattered across each server and to control them from a single location.
After approximately 3 seconds of the map loading, this plug grabs the configs from a database where the server number matches and then executes them.
If any map specific config files exist eg mapname.cfg it will now run these in your cfg folder automatically.
Also its capable of logging admin commands to a MySQL Database as well. As I use HSFighter
's web interface (link below), it made absolute sense to add this as well, as in theory its only a simple search based upon Steam ID, to keep a record of the commands an admin has made.
Also as a fail-safe, if the connection fails, server plug-in will run "server_back.cfg".
Web Interface Coming Soon!
The web interface is being worked up by HSFighter
and will be released later this week in this thread:
I am hoping that it may end up looking similar to this for CSS:
- Default: 1 - Enables and disables this plugin
- Server Number (see notes below)
- Default: 1 - Enables/Disables Admin Command Logging
A working MySQL Connection, http://wiki.alliedmods.net/SQL_Admin...#Configuration
noting that this plug-in will use what ever the default one is.
Run the SQL below or attached in the .sql file on your database to create the tables
Put this plugin in your <mod dir>/addons/sourcemod/plugins/ folder
The cvar is held in ' Command_Name' and the value is held in 'Command_Value', this also means you could also do "exec somefile.cfg" if needed
After entering your server configs to the database in columns, you may want to think about server numbers. you will need to add the following to your server.cfg file:
sm_myscal_server_no X // Where X is the server number
If the database connection fails, the plugin will attempt to run "server_backup.cfg", this of course could have been your original server.cfg which you have renamed.
Below and attached, is the SQL to create the two tables, you will see that its prepared for HSFighter
's web console (after one squillion PM's, loooool)
CREATE TABLE IF NOT EXISTS sm_servercfg(
ID int(11) PRIMARY KEY auto_increment,
Command_Name varchar(255) NOT NULL default '',
Command_Value varchar(255) NOT NULL default '',
Value_Key varchar(255) NOT NULL default '',
Default_Key varchar(255) NOT NULL default '',
Type varchar(16) NULL,
time_modified timestamp(14) NOT NULL default
CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
CREATE TABLE `smwa`.`sm_logging` (
`ID` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`Server_ID` INT( 11 ) NOT NULL ,
`steamid` VARCHAR( 100 ) NOT NULL ,
`logtag` VARCHAR( 100 ) NOT NULL ,
`message` VARCHAR( 255 ) NOT NULL ,
`time_modified` TIMESTAMP( 14 ) ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY ( `ID` )
) ENGINE = MYISAM
CVars that do not work & special considerations!
So far I have only found one CVar that does not work using this method and that is sv_downloadurl
, this must be set in the server.cfg file.
We have hundreds of admins, within a a few days we had already topped the 1000 command mark that the admin logging function had stored, over a long period of time, this map be a problem for someone with a small database allowance.
- First release
- Added the function to run map specific cfg files automatically