Raised This Month: $87 Target: $400
 21% 

[ANY] Threaded Mysql Bans


Post New Thread Reply   
 
Thread Tools Display Modes
Author
senseit
Member
Join Date: Aug 2009
Plugin ID:
3119
Plugin Version:
1.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows multiple servers to share a common ban list via existing default mysql servers
    Old 07-28-2012 , 12:38   [ANY] Threaded Mysql Bans
    Reply With Quote #1

    Credits:
    Originally coded by MoggieX - Stripped and rebuilt to be threaded

    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?
    Writes bans to the MySQL database and kicks any users with matching bans as they attempt to join. For timed bans, the ban will automatically delete itself from the database on the next connection attempt after the ban expires. Each player is checked on connect, if they are a BOT they are ignored. Now times this over 4 or more servers and happy days!

    Compatibility:
    This will work on any sourcemod game.

    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)

    Commands:
    You can use any normal ban command (E.x. sm_ban, sm_unban, ban, unban). This plugin will catch these commands and overwrite them. So you don't need to tell your admins to use a new command, or unload/modify any base plugins. Plug, and Play.

    How to Install:
    1. Put the mysql_bans.smx file in your plugins directory
    2. On first load the plugin will automatically create a table to store bans in your 'default' connection in databases.cfg. The table columns can be found below.

    Current Version & Changelog
    1 Feb 13 - V1.3
    -Added SQL input validation on fields
    -Now storing player_name in database

    10 Sept 12 - V1.2
    -Fixed bug that caused perm ban users to get unbanned after 2 reconnection attempts

    07 Aug 12 - V1.1
    -Created OnBanClient OnRemoveBan forward calls to redirect normal ban functionality
    -Added console logging

    06 Aug 12 - V1.03
    -Minor change to SQL

    30 July 12 - V1.02
    -Fixed a bug in the code

    28 July 12 - V1.01
    -Fixed a bug in the code


    Code:
    CREATE TABLE IF NOT EXISTS `my_bans` (
        `id` int(11) NOT NULL auto_increment,
        `steam_id` varchar(32) NOT NULL,
        `player_name` varchar(65) NOT NULL,
        `ban_length` int(1) NOT NULL default '0',
        `ban_reason` varchar(100) NOT NULL,
        `banned_by` varchar(100) NOT NULL,
        `timestamp` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
        PRIMARY KEY  (`id`),
        UNIQUE KEY `steam_id` (`steam_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
    Attached Files
    File Type: sp Get Plugin or Get Source (mysqlt_bans.sp - 1544 views - 6.1 KB)

    Last edited by senseit; 02-01-2013 at 15:04.
    senseit is offline
    Jim E. Rustler
    BANNED
    Join Date: Jul 2012
    Old 07-28-2012 , 15:43   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #2

    Very good. Now if only there was a webpage of sorts to view and play with the data.
    Jim E. Rustler is offline
    senseit
    Member
    Join Date: Aug 2009
    Old 07-28-2012 , 17:53   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #3

    There was a bug in the code. Will error out if the banner's name is shorter than the banee's name. Was a typo with the string lengths. Updated to 1.01

    Last edited by senseit; 07-28-2012 at 17:54.
    senseit is offline
    Jim E. Rustler
    BANNED
    Join Date: Jul 2012
    Old 07-28-2012 , 20:03   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #4

    Is it possible to use this along side of sourcebans? I'd like to test it out a little more before committing to any of the two.
    Jim E. Rustler is offline
    nelioneil
    AlliedModders Donor
    Join Date: Sep 2005
    Old 07-28-2012 , 20:39   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #5

    Quote:
    Originally Posted by Jim E. Rustler View Post
    Is it possible to use this along side of sourcebans? I'd like to test it out a little more before committing to any of the two.
    But why? These are two similar banning systems using MySQL.
    nelioneil is offline
    Jim E. Rustler
    BANNED
    Join Date: Jul 2012
    Old 07-28-2012 , 21:56   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #6

    Quote:
    Originally Posted by nelioneil View Post
    But why? These are two similar banning systems using MySQL.
    Quote:
    Originally Posted by Jim E. Rustler
    I'd like to test it out a little more before committing to any of the two.
    Isn't it obvious?

    Last edited by Jim E. Rustler; 07-28-2012 at 21:56.
    Jim E. Rustler is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Location: Source SDK
    Old 07-29-2012 , 00:02   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #7

    Quote:
    Originally Posted by Jim E. Rustler View Post
    Isn't it obvious?
    No it's not obvious. Why would you need to have two banning systems running at the same time?

    Last edited by Sreaper; 07-29-2012 at 00:11.
    Sreaper is offline
    senseit
    Member
    Join Date: Aug 2009
    Old 07-29-2012 , 00:46   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #8

    Quote:
    Originally Posted by Jim E. Rustler View Post
    Is it possible to use this along side of sourcebans? I'd like to test it out a little more before committing to any of the two.
    Yes. This plugin just creates 2 new commands. It will not interfere with any existing commands or plugins.
    senseit is offline
    Jim E. Rustler
    BANNED
    Join Date: Jul 2012
    Old 07-29-2012 , 07:29   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #9

    Quote:
    Originally Posted by senseit View Post
    Yes. This plugin just creates 2 new commands. It will not interfere with any existing commands or plugins.
    Thanks for answering the question. I'll give this a honest try and see which is better for me. Do you plan on doing up a small webpage to shot bans and ban reasons by chance?
    Jim E. Rustler is offline
    senseit
    Member
    Join Date: Aug 2009
    Old 07-29-2012 , 07:34   Re: [ANY] Threaded Mysql Bans
    Reply With Quote #10

    Quote:
    Originally Posted by Jim E. Rustler View Post
    Thanks for answering the question. I'll give this a honest try and see which is better for me. Do you plan on doing up a small webpage to shot bans and ban reasons by chance?
    No, then it would just be the same thing as source bans. I just needed a way to keep local mysql bans on my own server network without wanting to import other people's bans, have a web interface, or any of that stuff. The idea here is just to keep it simple.
    senseit 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 17:07.


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