Raised This Month: $202 Target: $400
 50% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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:
    12 
    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, 2407 views)
    File Type: txt mysqlbans.phrases.txt (463 Bytes, 2357 views)
    File Type: smx mysql_bans.smx (10.0 KB, 1390 views)
    File Type: sp Get Plugin or Get Source (mysql_bans.sp - 4132 views - 25.3 KB)
    __________________

    Last edited by MoggieX; 06-10-2008 at 04:48.
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    ottobohn
    Senior Member
    Join Date: Sep 2007
    Old 01-17-2008 , 14:24   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #2

    It's good to have choices between your plugin and sourcebans.net

    Otto
    ottobohn is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 01-17-2008 , 16:42   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #3

    Quote:
    Originally Posted by ottobohn View Post
    It's good to have choices between your plugin and sourcebans.net

    Otto
    Indeed it is!

    PS, If you've just downloaded it, you might wanna change to the next version I just uploaded, as this version actually bans people, LOL.

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    Team MX Major_SoulReaver
    New Member
    Join Date: Jan 2008
    Old 01-18-2008 , 02:23   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #4

    Well done Mogg
    Team MX Major_SoulReaver is offline
    LocutusH
    Senior Member
    Join Date: Dec 2007
    Location: Hungary
    Old 01-18-2008 , 04:50   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #5

    Could i use this plugin, to store the timed bans on my server?
    I have only one server, so for the multi server thingie i have no use.

    But the major problem of SM is, when i give a 1 Week ban to a user, and the server gets restarted every night, the ban goes avay, since only permanbs are stored in the banned_user.cfg.

    So would this mysql ban plugin solve my problem too?
    __________________
    LocutusH is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 01-18-2008 , 12:04   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #6

    Quote:
    Originally Posted by LocutusH View Post
    Could i use this plugin, to store the timed bans on my server?
    I have only one server, so for the multi server thingie i have no use.

    But the major problem of SM is, when i give a 1 Week ban to a user, and the server gets restarted every night, the ban goes avay, since only permanbs are stored in the banned_user.cfg.

    So would this mysql ban plugin solve my problem too?
    Yes, it would IF I added a check around the time and date stamp, which it currently doesn't do that, BUT I added bits needed for it, along with IP banning when I was editing the code.

    I saw some code for checking times the other day, just a case of putting a check for this in and then testing it.

    So.... not at the moment, but soon!

    PS. The reason why I didn't add it to begin with is that we/I only ever perm ban a player.

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    KMFrog
    Senior Member
    Join Date: Oct 2007
    Old 01-19-2008 , 14:06   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #7

    Does this handle player names correctly?

    I'm currently looking for an easy way to "fix" the player names in a DB so they appear as they would while in-game.
    __________________
    Was I helpful or not? Rate Me!
    KMFrog is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 01-20-2008 , 05:12   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #8

    Quote:
    Originally Posted by KMFrog View Post
    Does this handle player names correctly?

    I'm currently looking for an easy way to "fix" the player names in a DB so they appear as they would while in-game.
    Do you mean the unicode mish-mash you get for using those chars, like this:

    Team MҲ | MoggieҲ [UKMD]

    When it should have come out like:

    Team MҲ l MoggieҲ [UKMD]

    As it doesn't I'm afraid.

    Also quick update.
    - Timed bans is kinda working, need to test this bit even more before releasing
    - IP bans is almost done as well and will be released shortly
    - I looked at the SM menu integration, just need the time to add that in after core features are done and tidy.

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    Godless
    New Member
    Join Date: Jan 2008
    Old 01-21-2008 , 19:43   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #9

    Works fine with my TF server, however it crashes my Zombie Master server as soon as an non admin player joins, not giving out any error.

    May i rewrite it a bit, so it querys out of my amxbans database?
    Godless is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 01-22-2008 , 05:28   Re: MySQL Banning - Single DB - Cover Multiple Servers
    Reply With Quote #10

    Quote:
    Originally Posted by Godless View Post
    Works fine with my TF server, however it crashes my Zombie Master server as soon as an non admin player joins, not giving out any error.

    May i rewrite it a bit, so it querys out of my amxbans database?
    Heya Godless,

    I'm still working on tidying the code up first, if you let me finish I'll post the revised code up within a day or so.

    I'm currently testing my revised code on 3 CS:S servers and 2 TF2 servers at the same time.

    Now with the ZM server, are there any errors returned (in the error logs or console) as that plugin is extremely 'noisy' if error checking is on, as I needed that to work out what was happening myself?

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    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 15:44.


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