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

MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Plugin ID:
258
Plugin Version:
3.0
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    Got multiple game servers and pulling hair out with multiple ban files? SOLVED use a MySQL DB to store them!
    Old 01-17-2008 , 13:56   MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
    Reply With Quote #1

    MySQL Banning - Single DB - Cover Multiple Servers V3.0
    Yes even the most 'illiterate' n00b can write a sourcemod plugin!

    10 June 08 - This update is purely down to naris who has made a number of changes to the code to fix a number of outstanding issues.

    History
    I got fed up with moving bans from one server to another, imagine you have 4 game servers and then 2 more game servers coming soon to content with, keeping each one of those up to date with the latest list of scum errr bans is an absolute administration nightmare.

    I have gone this route as I don't want everything involved with SourceBans (I didn't like the interface to sourcebans it over complicated the issue at hand, plus this specific piece of functionality wasn't was working and it has a nasty habit of over-writing the admins flat files too, wiping previous set details) as I have a custom made front end that I use for admins via a MySQL connection. The other plugin posted and approved, that was supposed to do this, didn't! I gave up trying to fix [it was fubar'd imo] and wrote this one.

    Target Audience
    This plugin is aimed at server operators that require to have a single point of reference for all thier game server bans.

    What does it do?
    Instead of only banning to the game servers banned_user.cfg file, this plugin will post that ban to a MySQL database AND to the banned_user.cfg file, thus if the 'bannee' goes to another one of your servers he's banned from there as well!

    Each player is checked on connect, if they are a BOT they are ignored, if they are an Admin they can be configured to be ignored (thus making it faster), if they are found they are kicked and told they are banned. Now times this over 4 or more servers and happy days!

    ConVar's
    These are the ConVar's used by this plugin

    mysql_bans_version

    Just a version stamp for tracking

    mysql_bans_error_check

    Options: 1 = On, 0 = Off, Default =1
    Default to 1, this makes the plugin 'noisy' which is good for checking its work right!

    mysql_bans_admin_check
    Options: 1 = On, 0 = Off, Default =1
    If enabled (by default) then if the connecting player is an admin, no further checks are made. Helps speed things up

    Commands
    These commands can be used via the clients console while in game:

    mysql_ban <#userid|name> <minutes|0> [reason]
    mysql_addban <time> <steamid> [reason]
    mysql_unban <steamid>
    mysql_banip <time> <ip|#userid|name> [reason]

    Compatibility List
    Currently it has been tested and proven to work with the following mods:
    - Counter Strike Source
    - Zombie Panic! Source
    - Pirates, Knights & Vikings II
    - Sourceforts
    - Team Fortress 2
    - Insurgency
    - Day of Defeat Source


    Requirements
    These are out of scope for the install of this plugin, but must be performed for it to work...

    1. A working MySQL Database
    2. A correctly set up 'default' connection to the db in '<mod-dir>/addons/sourcemod/configs/databases.cfg' (see here for more info http://wiki.alliedmods.net/SQL_Admin...#Configuration)

    How to Install
    1. The plugin will create the table automatically, if it does not, download the SQL file attached and run on your database (this creates the database table & fields for you to use)
    2.
    Put the mysql_bans.smx file in your plugins directory
    3. Put the mysqlbans.phrases.txt file in your translations directory
    4. Change the map!

    Its worth noting that this plugin is extremely noisy by default, once you are happy that its working, put mysql_bans_error_check 0 in your soucremod.cfg file.

    Things to do:

    - Sort out the translation file as its incorrect
    - Investigate threaded queries (this post http://forums.alliedmods.net/showpos...8&postcount=27 )
    - Sort out the integration for HSFighter Excellent Source Admin Tool

    Current Version & Changelog
    10 June 08 - V3.0
    - This update is purely down to naris as he has updated and fixed a number of issues:
    - Timed bans now work (updated SQL statement & timed ban checking code)
    - IP Bannning
    - Pickup bans from other commands, including the admin menu
    - Add table creation on the plugin start
    - It checks bans on a LAN
    - Centralised into specific functions
    - Sorted the mess that I had made :-)

    23 Jan 08 - V2.0
    - Major re-write!
    - Added mysql_banip and associated coding needed to check a clients IP after connecting
    - mysql_bans_admin_check now works
    - mysql_ban takes a user id now
    - Added a phrases file to boot
    - Upgraded error checking, now extremely 'noisy' by default
    - Closed a load of handles to stop memory leaks

    17 Jan 08 - V 1.1

    - It actually bans people now

    17 Jan 08 - V 1.0
    - First public release

    Thanks to...
    naris for the major rewrite in V3.0
    Scuzzy For that huge chunk of code!
    BAILOPAN Nuff said =)
    Team MX | Bats for being my ban buddy
    Attached Files
    File Type: txt mysql_bans_sql.txt (618 Bytes, 2993 views)
    File Type: txt mysqlbans.phrases.txt (463 Bytes, 2978 views)
    File Type: smx mysql_bans.smx (10.0 KB, 1781 views)
    File Type: sp Get Plugin or Get Source (mysql_bans.sp - 5080 views - 25.3 KB)
    __________________

    Last edited by MoggieX; 06-10-2008 at 04:48.
    MoggieX is offline
    Send a message via Skype™ to MoggieX
     


    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 15:21.


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