This is a continuation of the Whitelist plugin originally written by Silencium20. This plugin will automatically reload your whitelist when players are added to the whitelist file. This plugin will connect to Mojang servers for UUID lookups.
- AutoWhitelist is automatically reloaded when changed outside of Minecraft (e.g. with a text editor)
- AutoWhitelist supports console commands
- SQL support
- Support for every SQL database that has a JDBC implementation available
- User-defined table and database layouts supported
- Ampersand color codes in the kick message. (&4 = red etc...)
- UUID support.
How to install
- In your server.properties file set whitelist to false.
- Drop the jar file in your plugins directory and restart your server.
Commands: These commands can be used by Ops ingame or in the server console. When used with the server console don't type '/' before the command.
- /whitelist help - Shows the help ;-)
- /whitelist reload - Reloads the whitelist and it's settings
- /whitelist add [playername(s)] - Adds a player to the whitelist)
- /whitelist info [playername] - Display information about a player
- /whitelist remove [playername(s)] - Removes a player from the whitelist)
- /whitelist on|off - Activates/deactivates the whitelist
- /whitelist list - Lists all whitelisted players (from txt file)
- /whitelist dblist - Lists all whitelisted players (from DB)
- /whitelist dbdump - Dumps users from database to whitelist.txt file
- whitelist.admin - Gives players access to any of the /whitelist commands.
- whitelist.[command] - Gives players access to specific commands.
To support as many different database configurations as possible, Whitelist sets flexibility over simplicity. This way virtually every existing database can be used as a base for authentification.
The plugin will not automatically create tables for you. Below are a couple examples to get you started.
If you want to use UUIDs you can do something like this.
CREATE TABLE IF NOT EXISTS `tbl_users` ( `name` varchar(256) NOT NULL, `uuid` varchar(256) NOT NULL, `oper` varchar(256) NOT NULL, `time` varchar(256) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Or more basic without UUIDs.
CREATE TABLE IF NOT EXISTS `tbl_users` ( `name` varchar(256) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
If you want to use MySQL, you might need the MySQL Connector/J. It can be found here.
- Add DB reconnect logic.
- Update for MC 1.10.2.
- Info command should always respond.
- v3.5-26 - May 7, 2015
- Update for MC 1.8.3.
- v3.5-24 - February 20, 2015
- Don't allow null uuid when adding players.
- Automatically remove players with null uuid from json.
- NPE fixes.
- v3.5-22 - February 14, 2015
- Add support for offline mode.
- v3.5-20 - January 26, 2014
- Add support for UUID in SQL mode.
- v3.5-17 - September 1, 2014
- Fix player add message.
- Fix remove command.
- Make commands more verbose.
- v3.5-15 - August 27, 2014
- Add UUID support (whitelist.json)
- v3.4 - May 15, 2014
- Add %NAME% token for kick message.
- v3.3 - March 27, 2013
- Add dbdump command.
- v3.2 - October 11, 2012
- Changed from whitelist.properties to config.yml
- Fixed the list command
- Added dblist command
- v2.7b - June 15, 2012
- Added color code support. Use ampersand color codes in the kick message.
- v2.7a - June 12, 2012
- Initial version.
- Added support for CB 1.2.3-R0.1 and higher.
Awesome Plugin! Any chance you could add a way to add the username to the kick message along side the Ampersand color codes? That would be awesome!
You can do this quite easily. Just point both servers to the same database. You can configure the queries in any way you like. To make one of them read only just replace the add query with something that only does a read.
Is there any way to use this to modify the whitelist of another server? I have a server (server 1) which can only be accessed by logging a certain amount of in game playtime on one of my other servers (server 2,) but I have yet to figure out a way to automatically add people to server 1's whitelist.
If i used this plugin on both servers, and used mysql, would there be a way I could use it on server 2 to only modify the server 1's whitelist, however not have server 2 be affected by the whitelist?
And if not, would this be something you could consider adding? Like a "write only" and "read only" option?
At a minimum you only need one column. The column can be named anything. In the sample config I just use "name" for the column where users are are stored.
I can't create an empty table it has to include columns, just I don't know what kind of columns need.
This plugin does not create the tables. You will need to create your own tables.
Hello this plugin give me error message.
19:35:05 [WARNING] [AutoWhitelist] Whitelist: SQLException: Table 'whitelist.tbl_names' doesn't exist 19:35:05 [WARNING] [AutoWhitelist] Whitelist: SQLState: 42S02 19:35:05 [WARNING] [AutoWhitelist] Whitelist: VendorError: 1146
The table isn't exist. Could you link me the query string, what create the tables?
I figured out the problem. It was such a noob error... I somehow posted the information for the pass as the user, and the user as the pass. When I saw that in the log, all was clear. Thanks for your time.
Enable debug mode so that it dumps extra info to the server.log. That will give us an idea what the problem is.
Yes, unfortunately it doesn't grab the data from my database. After setting up the plugin, no one has been able to connect to the server unless I manually edit the whitelist.txt file.
Your setup looks correct. Is there a problem?
How exactly do you set the configuration for MySQL? I have the connector installed and I replaced all 'name' and 'tbl_users' with the values present from my WordPress site users values.
SqlQuery: SELECT user_login FROM vc_users WHERE user_login='<%USERNAME%>' SqlQueryList: SELECT user_login FROM vc_users SqlQueryAdd: INSERT INTO vc_users (user_login) VALUES ('<%USERNAME%>') SqlQueryRemove: DELETE FROM vc_users WHERE user_login='<%USERNAME%>'
The minecraft server and mysql server do not need to be on the same machine. If you separate them you will just need to update the SqlDriverConnection section of the config.yml and change localhost to the new hostname.
That wouldn't work because user_status is always zero, regardless of whether the person is activated or not. Not sure why, I just noticed that it is.
It seems before there was a code in user_activation_code when a person was not activated but that too seems to be null now for everyone.
I may not worry too much about it because I decided to go to an invitation-only type server with a whitelist. The way it works, nobody can register in the website by clicking the "Register" link. It will inform them they need an invitation. Those already members may send an invitation to someone's email and they can click a link and register. The software keeps track of who invites who. A new member must wait three days before they are allowed to invite people. I think this will be a great way to limit griefing. People inviting anyone who griefs will be subject to punishment as well as the griefer, but people with many invites will be rewarded some nice game items.
I do have a concern of another matter:
I host my website and Minecraft server from my own systems. If the server begins being more active, I may lease a pro-hosted server for it. Is it imperative that the Minecraft server and MySQL database be on the same machine or will it work as long as I can get the query lines correct? What lines would need to be altered?
Have you tried this?
Hello, again! I helped (and you helped me) get this working some time ago with a WordPress website. Well, I'm back again and trying to get it working and see some things have changed.
I have it working 95% of how I need it: A user must be registered in WordPress to be in the white list, however, I want to enforce that they have actually activated their account instead of just registering. Right now, it allows them without activation. I had this working before, but can't quite get it now.
To do it before, I was doing an SqlQuery like:
SqlQuery: SELECT user_nicename FROM mc_users WHERE user_nicename='<%USERNAME%>' and user_activation_key=' '
But before, there was an activation key in that value until their account was activated, then it disappeared. I think that's the key to my problem.
Will it work in 1.6.2 even though it is the 1.5.2 build that you download?
This works well, apart from when my server restarts, the whitelist automatically is set to "on", even if it is switched off before the restart. I take it this should not be happening? How can I correct this? Thanks.