MaxBans
Support Spigot from 1.7.x to 1.12.x
MaxBans is a project I've been writing for my server, MaxGamer. I struggled to find a banning plugin that wasn't a joke, and the good plugins were all designed for Premium servers anyway. Nothing gave us the tools that SHOULD have been out there - Like temp mutes, temp IP bans, duplicate IP lookups, and good autocompletion!
It is thoroughly tested on an Offline-Mode server, so you can bet it's rock solid and feather light!
Databases
- MySQL
- SQLite (Flatfile)
Best Features
Here are the top ten features of MaxBans over other banning plugins:
- Full UUID support
- Ability to view players' previous username(s) - date of change
- Full server lockdown - Prevent anyone from joining with a custom message (Such as bot attacks)
- Offline player name auto completion
- Warnings system
- Duplicate IP detection
- DNSBL lookups to stop proxys!
- Multiline kick messages! No more running off the screen!
- Notifications when a banned player tries to join!
- All times are relative! (Eg. "You're banned for 4 minutes 6 seconds", not "You're banned til 5:43pm CST")
- Customize every colour!
- Block commands like /me when muted!
Commands
- /unban <name, IP or UUID>
- /ban <name, IP or UUID> <reason>
- /ipban <name, IP or UUID> <reason>
- /tempban <name, IP or UUID> <number> <minutes|hours|days|weeks|etc> <reason>
- /tempipban <name, IP or UUID> <number> <minutes|hours|days|weeks|etc> <reason>
- /mute <name or UUID>
- /tempmute <name or UUID> <number> <minutes|hours|days|weeks|etc>
- /kick <name, * for everyone or UUID>
- /checkip <name or UUID>
- /uuid
- /togglechat
- /dupeip <name, IP or UUID>
- /checkban <name, IP or UUID>
- /warn <name or UUID> <reason>
- /clearwarnings <name or UUID> <reason>
- /unwarn <name or UUID> - Removes a players most recent warning
- /unmute <name or UUID>
- /history [name] [number of records] - Displays a history of bans, kicks, mutes & more dealt
- /mbreload - Reloads the plugin
- /mbdebug - Outputs debug information for me if you're having issues!
- /mbwhitelist <name or UUID> - Allows the given user to bypass IP bans (Not regular bans! Eg, use for players with siblings who need to be IP banned)
- /ipreport - Basically, a mass /dupeip, on everyone who is online
- /lockdown [reason]
- /forcespawn - Teleports someone to the spawn (Twice, so /back won't work)
- /mbreload - Reloads maxbans
- /mbimport - Imports vanilla minecraft (And others) bans.
- /mbexport - Export bans to vanilla, MySQL or SQLite databases. (Allows swapping SQLite <-> MySQL), and others ban plugins.
- /rangeban <ip1-ip2> [reason] - Bans the IP range from ip1 to ip2 for the supplied reason.
- /temprangeban <ip1-ip2> <time> <hours/min/sec> [reason] - Temporary variant of above
- /unrangeban <ip> - Removes any RangeBan which overlaps with the given IP. Eg, if 127.0.0.1-127.0.0.5 is banned, unbanning 127.0.0.3 will lift the whole ban on 127.0.0.1-127.0.0.5.
Almost any command may have -s added in it to prevent announcing it, for example:
/tempban NewGuy101 -s 1 hour MaxBans is Awesome!
- Nobody will see the announcement that NewGuy101 was temp banned, just the fact he "has left the game."
If you want an in-depth analysis of each command, try here:
http://dev.bukkit.org/server-mods/maxbans/pages/command-tutorial/
Configuration Guide
http://dev.bukkit.org/server-mods/maxbans/pages/config-tutorial/
This is an in-depth guide on how to configure MaxBans :) If I've missed anything, ask in the comments!
Common Issues
http://dev.bukkit.org/server-mods/maxbans/pages/common-issues/
This is a list of common issues people have with MaxBans, such as plugin conflicts.
Features that will never implement
- Fines (Use your economy to do this!)
- Jails
- Regional bans
- Ban weightings
Ban Listing Webpage
Check out this guy's work for an amazing webpage setup to view MaxBans while using MySQL.
Demo (dont download from here): http://yive.me/maxbans/.
Its updated and is working on latest version of MaxBans!
You can download the updated version from here: https://github.com/FabioZumbi12/maxbans-php
- Added pagination;
- Fixed other ban pages not loading;
Metrics
This plugin uses Hidendra's plugin metrics system (http://mcstats.org/plugin/maxbans) which tracks server information including:
- A unique ID
- Java version
- Online/Offline mode
- Plugin & Server version
- OS name, version, architecture
- Number of CPU cores
- Players online
- Metrics version
These stats can be disabled using the PluginMetrics config file (BukkitServer/plugins/PluginMetrics/config.yml).
GeoIP Lookup
MaxBans will download a GeoIP.csv file, which allows it to look up the country of origin for IP addresses. The file is downloaded directly from maxmind GeopIP site. The file is only downloaded once (Unless it is renamed/removed).
FabioZumbi12:
Hello all. I am other dev and now i assuming the Project for bugfixes and possible improvements.
Netherfoam still busy but still online on comunity. I have a lot of time to code (i have a home work) and i can maintain this plugin (and my others) Always updated ;)
See ya o/
Server locks up at disabling maxbans when i shut down.
@netherfoam
Yea I was not trying to go on a "witch hunt", just that MB was the only plugin to throw an error prior to the crash. I believe it was only around 20 accounts were spammed before it died, that was the crazy part.
http://pastebin.com/fQrMUyb5
Once again thanks for your quick reply's and help.
@Chalkie19
Try this one:
https://dl.dropbox.com/u/72835893/Plugins/MaxBans.jar
Hopefully it works, I've rewritten it to use synchronized blocks instead of a lock boolean.
@Chalkie19
So I'm not exactly sure what went wrong there... (Don't suppose you've seen this error before maybe?)
It seems there was a query that was null in the list of queries, which really doesn't narrow anything down.
EDIT: Though, I don't see how this would crash your server... The task is async, and the only other MaxBans related info says a thread was sleeping while preparing to write queries to the database (Eg waiting for the main thread to finish filling the requested queries list)
Plus, those two different stacktraces of MaxBans show it was at two different positions in time - e.g. I don't think MaxBans had frozen at all.....
Nevermind, I just realised what went wrong. Buffer got locked -> Queries started executing, one of them crashed during the execution, so the thread got dumped. Buffer never got unlocked, so nothing else could write data...
How many logins were you dealing with per minute? Tens, hundreds?
I'll work on a fix now.
Got briefly proxy login spammed today whilst I was trying to sleep for more then 2 minutes. Since I had not enabled Anti Join Bot proxy (which stops them usually) there was nothing to stop them and after a few minutes they seemed to have killed Maxbans which in turned crashed the server which in turn caused mass panic and a 3 hour rollback...and I am sure as owner your self you can image the happiness of my members. Anyway crash and trace below. (sorry for horrible spelling, seems to be a direct correlation between being tired and brain farts)
Trace is in the pastebin since it's too large. http://pastebin.com/xfVAccB6
@netherfoam
I am pretty sure that the MySQL-Server is up and there are no server side connection problems. But I will check this. :)
@GrillGuth
This means that your MySQL server is down, its nkt an issue with maxbans, but your mysql setup :)
Sometimes I get this error:
@amfm93
I thought I added an option... My mistake, it's warn-expirey (The time a warn takes to be deleted).. I was thinking it was the punishment expirey D:
I'll see what I can do about adding it in. The warnings system for us is more of an anti-rage system... Folks calm down after an hour, but we give it out like free coupons.
I don't think I'll add a cap where players should be perma banned. Possibly, I can set it to execute a given command on hitting the warnings, but otherwise I won't make this possible.
Great work! Best banning plugin I've used so far. I like how it doesn't use any sort of web services and it's stable + lightweight.
I wouldn't mind seeing a feature where I can customize the length of the ban after reaching max warnings (I would like it to be 3 days since 1 hour is a bit wimpy).
Also, maybe after max warnings have a ban-max-warnings where if for instance a player gets tempbanned and comes back and still gets more warnings then he or she will be permabanned.
Thats impressive... It depends on the size of the database though, the number of unique ip addresses that your server has seen will usually determine how long the conversion takes
@netherfoam
Took 30 seconds on my server... really made me feel the age of my desktop :)
@Chalkie19
Yeah... unfortunately SQLite is really slow, and I have to write code that works with SQLite and MySQL :/
Oh dear, glad I decided to test on a local server :)
Plugin has only been on for 3ish weeks.
@netherfoam
Opss... I didn't notice there is tempmute :D
@DeWilX
You want tempmute.
Eg
Command like this would be great. :)
and maybe even with <reason> and it shows to player like this
@Chalkie19
Glad it's not for nothing! I can't stand the big plugins who write the changelog there, but they write it per version, so if I upgrade by 5 versions, I have to look at 5 different pages to find the total of all changes XD
But yes, it will add the tables automatically and there's no need for a wipe of any kind :)
@netherfoam
Sounds great! Since there is a new ban, will this require a fresh DB since it's adding another table, or will it just add the table into the sqllite I already have? I assume it will just add the extra table, bust just wanna make sure.
"Does anyone even read this, to be honest?" Yup I do, I hate updates with no or bad change logs.
Much rather; Upgraded to gigawatts compacter codding engine, 28.94% faster lookup on bans. Now using magnets to pull info from the database. Added a unix ano herpaderpa shield to repeal multiple attacks on a server.
Rather then; Made it go faster. Or just nothing.
@Chalkie19
Okay, So I've added this feature in 1.4... The release is here: https://dl.dropbox.com/u/72835893/Plugins/MaxBans.jar
I haven't tested it as thoroughly as I'd like, but general syntax is:
/rangeban <IP1-IP2> [Reason] - Bans the IP Range IP1-IP2 with the given reason. If you want, you can use wildcards too... Such as /rangeban 127.0.0.* is the same as /rangeban 127.0.0.0-127.0.0.255 (IP addresses only go up to 255 btw.. not 999)
/temprangeban <IP1-IP2> <Time> <TimeForm (Hours/mins, days, etc)> [Reason] - Temporary variant of above.. similar syntax.
/unrangeban <IP> - A bit different to the above syntax. This command finds the range that the given IP address is in.. Example...
127.0.0.0-127.0.0.255 is the banned range...
So if we do /unrangeban 127.0.0.55, then the entire 127.0.0.0-127.0.0.255 range ban will be removed.
Lastly, there's /mbwhitelist <user>... This command makes the given user immune to IP "restrictions", but not regular bans. So...
Also works for rangebans and DNSBL proxies. The whitelist is not vanilla MC's whitelist! To unwhitelist a user, just do /mbwhitelist <user> again.