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/
@netherfoam
Yea MySQL is enabled. Here is the server.log on startup: http://pastebin.com/gRQEaCAw
@GrillGuth
Do you have mysql enabled? MaxBans could just be running off of flatfile for you, as it should by default.
@netherfoam
Well thats weird... as I said I banned me and warned somebody. Its working but, when I am overwatching my MySQL-DB via phpmyadmin no new entries were added. No errors thrown so far. Now as I read your reply (a few hours later), I checked again ... the ban is working but no entries added. I restarted my server. While stoping this error is thrown: http://pastebin.com/1H0iDRkA But the MySQL-DB is updated now... ban and warning. On the server it is working as well. Now I unbanned me via console and it worked fine for the server but again no MySQL-Updatet... phpmyadmin is still showing me in the list.
@GrillGuth
No errors in the server.log? Queries should execute in 30 seconds or less (Okay, possibly more if your server is lagging with a low tick rate). If connection fails, a stacktrace will be thrown. If the query fails, a stacktrace will be thrown. If there were no errors, the query must have succeeded.
Try rebooting, then doing /checkban on the player and see if theyre still banned or warned. If they are, then the ban saved properly and there is no issue.
@netherfoam
Thanks for the reply. I have a good and a bad news :)
The error disappeard, but it seems like the database isnt used/updated anymore.
I banned somebody (myselfe) as well as warned somebody. Everything is working fine ingame... i can't connect, but the MySQL-DB isn't updated. I waited 2-3 hours and still no new insert ;(
@ThisUsernameIsMine
That's a shame, it would be nice to know why this happens for you and nobody else.
@netherfoam
netherfoam: thanks for the answers, but at the same time i'm afraid i'll have to drop the use of MaxBans.
It's taking way too much time to shut itself down between server-restarts (even when everybody's left the server) :-(
@J2DOLAR
I saw your PM, tweaked some code, thought I wrote a response but apparently I was distracted (...I remember typing it...)
I don't believe that not closing the connections would cause an increase in RAM usage, however I've added closing the statements for generic insert queries in the database.
Instead, you may have a large database of bans and IPs? I think my server uses about 10MB to hold all of this data (Boot from empty database vs boot from 1MB database), this is because I cache my information rather than read from the hard drive. I've taken this approach because it MUCH faster, even if it costs RAM, which is cheap and generally not an issue on servers as much as harddrive performance and processing.
How big do you think the increase is, though? Certainly the plugin does not use anything noticable, unless you are looking for it.
@ThisUsernameIsMine
Not sure about this. Possibly a notification when a muted player tries to speak, but this is similar to a 'list all bans' command - Which is crazy, due to the number of bans you should be handing out... And mutes will be similar to this. If you want a history of mutes or something, try the /history command, like /history 50 will display the last 50 punishments dealt.
Reasons for mutes is something I haven't bothered with, they're not as requested as bans but I will add them when I actually have time.
I'm not sure what your last question is stating? If you're asking me to merge /tempmute and /mute, so that /mute NewGuy101 1 hour works, I won't be doing that at all. It makes things too complicated to code and that means more bugs!
@slayr288
Planned.
@slayr288
@GrillGuth
You both seem to be having the same issue. Can you try this version? I modified my reconnect code.
https://dl.dropbox.com/u/72835893/Plugins/MaxBans.jar
@netherfoam
I get this error when the plugin is disabling on a shutdown. Yes, my MySQL Server is running fine, and it's on localhost. All of my other plugins using MySQL are working fine, meaning the error is related to MaxBans. I'm using MaxBans v1.5 with Spigot #670
http://pastebin.com/Pdn6RkAf
@netherfoam
Sorry, for the delayed answer. I did a few checks and it seems like my MySQL-server isn't down. The error is also shown, when mysql closed a connection because of the "wait_timeout"-parameter. The problem is, that I can not change (higher) this parameter as the mysql-database isn't hosted by myself. MaxBan is the only plugin for me with that problem, others connecting to the same database are working fine. Is there any possibility to avoid this problem plugin-side? I know its very user-specified problem, but it would be nice if you can help me.
And sorry for my bad english....
Hello again, i have three suggestions for your you:
- add a command/permission to view a list of currently muted players and the timespan
- add an optional mute-reason for (temp)mutes
- change the way how /mute works, so that you can use it for temp-mutes as well (so that we don't need /tempmute anymore)
Thanks! ;-)
Hi netherfoam,
I decided to load up your plugin on my server today and test it. I've found that it increases the amount of memory used drastically. So I went to your github, checked out your code, etc. It was all really good. However, I noticed that your MySQL usage was not very resource friendly. For example, whenever you create PreparedStatements, you don't close them after you use them. After multiple calls of a method that does this, the server starts to lag. I apologize if I misread or if this isn't a/the cause of the lag; I only skimmed through your code.
I'd just thought that I should report this to you. Also, I PM'd you about this four days ago, but it doesn't seem you check your inbox, so I rewrote it here.
Cheers -J2
Hello,
Could you add a config option to set the duration of the warnings ban? Instead of the 1 hour default.
@Battojutsu
I really don't know what (or why) plugin would do that :|
Try process of elimination? Disable half, check if it happens. If it happens still, disable half of what remains, check, repeat.... until you find which one does it...
hey i have a slight issue that im sure its one of my other plugins... im wondering maybe you can find my solution :P you see i liked when it was full of color when i kick or ban.. now its plain white and boring D: the message states (green) [player2322] was kicked by [battosai] for [Misconduct] the words in [] are green and the rest are white :(
im wondering what could have caused this and how i can fix it :) heres a list of plugins
authme autocleaner chatmanager chestshop contrip coreprotect crazycore crazyspawner deathtpplus essentials factions factionsplus keepitems lockette maxbans (obviously) mobarena modifyworld nametags permissionsex simplebackup restart spout supplysign worldborder worldedit worldguard
any help you can provide would be excellent thanks guys!
@netherfoam @netherfoam
Because of the limited upload bandwidth (4 Mbit) i've set the server-slots to 20 (sometimes 25/30).
Its not a (rented) dedicated and the system is used for other tasks as well, so there will likely be other processes/activities running ;-)
But... without MaxBans enabled the remaining 48 to 50 mods hold up fine (with the TPS being 20.0 most of the time).
I happen to have MySQL. I use it for LogBlock and my webserver.
@ThisUsernameIsMine
As well as that, how many players are on your server when it happens? Ten, twenty, fifty?
@ThisUsernameIsMine
Oops, syncing is meant to be disabled by default! I'll fix that...
I'm not sure why it would take that long, the buffer shouldn't get very full like that. Do you possibly have other processes writing to the disk frequently? That might slow it down.
Basically, it's trying to save all the changes from memory in the (Supposedly) last 30 seconds or less. But that should be a few queries at most, and should not take long.
I will add a bit of debug for if the queue gets unexpectedly large (15+ queries to write in 30 seconds)
Is MySQL a possibility for you?
@netherfoam
I'm indeed using 1.5 and only use a plugin's reload capability if it has such (i never do server /reload).
The only options i changed in the config were appeal-message: "" and disabled Sync-usage.
Before the server responded it took Maxbans 1 minute to complete its tasks (see server-log below):
- http://privatepaste.com/496d5d9f59
Also, when shutting down the server, it takes a while for Maxbans to clear/flush its buffers etc.