MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
4 Attachment(s)
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 |
Re: MySQL Banning - Single DB - Cover Multiple Servers
It's good to have choices between your plugin and sourcebans.net
Otto |
Re: MySQL Banning - Single DB - Cover Multiple Servers
Quote:
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 |
Re: MySQL Banning - Single DB - Cover Multiple Servers
Well done Mogg :up:
|
Re: MySQL Banning - Single DB - Cover Multiple Servers
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? |
Re: MySQL Banning - Single DB - Cover Multiple Servers
Quote:
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 |
Re: MySQL Banning - Single DB - Cover Multiple Servers
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. |
Re: MySQL Banning - Single DB - Cover Multiple Servers
Quote:
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 |
Re: MySQL Banning - Single DB - Cover Multiple Servers
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? |
Re: MySQL Banning - Single DB - Cover Multiple Servers
Quote:
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 |
All times are GMT -4. The time now is 22:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.