Raised This Month: $32 Target: $400
 8% 

MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Plugin ID:
435
Plugin Version:
1.1
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    7 
    Plugin Description:
    Run your server config files remote and also log admin commands via MySQL
    Old 06-23-2008 , 04:59   MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #1

    MySCAL (MySQL Server Configs & Admin Logging)

    Foreword
    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.

    My Thoughts/Suggestions:
    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.
    1. 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
    2. 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?
    3. Need to add in game command to run the configs again if needed
    4. Will look at menu integration (never done this before, so might be a while)
    5. Would error logging based upon server ID be useful to anyone else than me?
    6. Would logging of every command (that appears in the SM log files) be useful to anyone else than me?
    What Does it Do?
    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:
    http://forums.alliedmods.net/showthread.php?t=60174

    I am hoping that it may end up looking similar to this for CSS:
    http://www.cstrike-planet.com/cfgmaker?cfg=srcds

    CVars
    sm_myscal_version - Duh
    sm_myscal_enable - Default: 1 - Enables and disables this plugin
    sm_myscal_server_no - Server Number (see notes below)
    sm_myscal_log_enable - Default: 1 - Enables/Disables Admin Command Logging

    Installation
    1. A working MySQL Connection, http://wiki.alliedmods.net/SQL_Admin...#Configuration noting that this plug-in will use what ever the default one is.
    2. Run the SQL below or attached in the .sql file on your database to create the tables
    3. Put this plugin in your <mod dir>/addons/sourcemod/plugins/ folder
    4. Change maps.

    FYI: 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

    Optional:
    Server Number:
    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:

    PHP Code:
    sm_myscal_server_no X // Where X is the server number 
    FailSafe:
    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.

    SQL:
    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)

    Server Config:
    PHP Code:
    CREATE TABLE IF NOT EXISTS sm_servercfg(
    ID              int(11PRIMARY KEY auto_increment,
    Server_ID       int(11),
    Command_Name    varchar(255NOT NULL default '',
    Command_Value   varchar(255NOT NULL default '',
    Value_Key       varchar(255NOT NULL default '',
    Default_Key     varchar(255NOT NULL default '',
    Type            varchar(16NULL,
    time_modified   timestamp(14NOT NULL default
    CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
    )TYPE=MyISAM
    Admin Logging:
    PHP Code:
     CREATE TABLE `smwa`.`sm_logging` (
    `
    IDINT11 NOT NULL AUTO_INCREMENT ,
    `
    Server_IDINT11 NOT NULL ,
    `
    steamidVARCHAR100 NOT NULL ,
    `
    logtagVARCHAR100 NOT NULL ,
    `
    messageVARCHAR255 NOT NULL ,
    `
    time_modifiedTIMESTAMP14 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.

    Version History
    V1.0 - First release
    V1.1 - Added the function to run map specific cfg files automatically

    Thanks to..Matt
    Attached Files
    File Type: zip myscal_sql.zip (511 Bytes, 1983 views)
    File Type: sp Get Plugin or Get Source (myscal.sp - 3683 views - 10.4 KB)
    __________________

    Last edited by MoggieX; 06-23-2008 at 15:42.
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    recon0
    Veteran Member
    Join Date: Sep 2007
    Location: US
    Old 06-23-2008 , 07:32   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #2

    This looks pretty good ;)

    Since there's a known problem with sv_downloadurl, could you search the editor and throw an error if that string is found?

    What about releasing the admin logging in a separate system?
    __________________

    Last edited by recon0; 06-23-2008 at 07:35.
    recon0 is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 06-23-2008 , 08:30   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #3

    Quote:
    Originally Posted by r3recon View Post
    This looks pretty good ;)

    Since there's a known problem with sv_downloadurl, could you search the editor and throw an error if that string is found?

    What about releasing the admin logging in a separate system?
    Yup could do, or tbh to keep it as lite as possible, read the instructions :-P

    As for just the admin loggging only, set sm_myscal_enable to 0

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    voogru
    Inspector Javert
    Join Date: Oct 2004
    Old 06-23-2008 , 09:23   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #4

    Code:
     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
    Engine definitions for steamids are 64 characters, and you can store a steamid as a 4 byte unsigned int if you convert the steamid to a friendID.

    Last edited by voogru; 06-23-2008 at 09:28.
    voogru is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 06-23-2008 , 10:48   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #5

    Quote:
    Originally Posted by voogru View Post
    Engine definitions for steamids are 64 characters, and you can store a steamid as a 4 byte unsigned int if you convert the steamid to a friendID.
    Cheers, I set it to 100, not knowing what their restriction would be

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    ottobohn
    Senior Member
    Join Date: Sep 2007
    Old 06-23-2008 , 11:14   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #6

    We'll test this on one of our servers, probably soccer server, and give feedback. I'm all about logging being done remotely just in case servers go down.

    otto
    ottobohn is offline
    recon0
    Veteran Member
    Join Date: Sep 2007
    Location: US
    Old 06-24-2008 , 03:14   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #7

    Quote:
    Originally Posted by MoggieX View Post
    Yup could do, or tbh to keep it as lite as possible, read the instructions :-P

    As for just the admin loggging only, set sm_myscal_enable to 0

    Matt
    I think you should put them in separate plugins... I'm thinking about forking it and building a really fancy viewer with a search system for the logs (.NET WinForm app)... Maybe in the future the plugin can queue all log entries to SQLite and send them to the remote DB on map changes.
    __________________

    Last edited by recon0; 06-24-2008 at 03:39.
    recon0 is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 06-24-2008 , 04:16   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #8

    Quote:
    Originally Posted by r3recon View Post
    I think you should put them in separate plugins... I'm thinking about forking it and building a really fancy viewer with a search system for the logs (.NET WinForm app)... Maybe in the future the plugin can queue all log entries to SQLite and send them to the remote DB on map changes.
    There is a web console already under way, which ties this in and several other sections into a single solution.

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    HSFighter
    Veteran Member
    Join Date: Aug 2007
    Location: Flensburg - Germany
    Old 06-24-2008 , 06:09   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #9

    Quote:
    Originally Posted by MoggieX View Post
    There is a web console already under way, which ties this in and several other sections into a single solution.

    Matt
    This will not be a problem.
    It will be esay to switch the settings in the webpanel to a separate plugin for adminlogging.
    The new Multiserver-Support for the Webadmin will allow this ^^
    I think it's a fine solution to put the admin logging to a separate plugin
    __________________



    Sorry for my very bad english
    Greetings HSFighter

    Last edited by HSFighter; 06-24-2008 at 06:13.
    HSFighter is offline
    Send a message via ICQ to HSFighter
    sirmoe
    Senior Member
    Join Date: Mar 2008
    Old 07-04-2008 , 00:41   Re: MySCAL (MySQL Server Configs & Admin Logging) - Need Feedback!
    Reply With Quote #10

    I'm getting the following errors, any ideas?

    L 07/04/2008 - 149:17: [myscal.smx] [MySCAL] Database Error
    L 07/04/2008 - 149:17: [myscal.smx] [MySCAL] Attempting to run server_backup.cfg
    L 07/04/2008 - 149:17: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    sirmoe 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 16:12.


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