AutoWhitelist
About AutoWhitelist
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.
Features
- 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
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
Permissions
- whitelist.admin - Gives players access to any of the /whitelist commands.
- whitelist.[command] - Gives players access to specific commands.
Basic Configuration
See config.yml
SQL Configuration
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.
Table Creation
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;
Dependencies
If you want to use MySQL, you might need the MySQL Connector/J. It can be found here.
Source
https://github.com/cnaude/Whitelist
Change Log
- v3.5-32
- 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.
@KaomieSu
Yes I will add this feature.
@Spinsir007
Please try latest dev: build at http://h.cnaude.org:8081/job/Whitelist/2/ I added a permission node for each command. Example:
Hello! You have an amazing plug-in here. One problem. I have a staff position called a Supporter and their job is to whitelist people. I do not want them to have full access to the plug-in though. What are the perms to only add one command to a player?
Hello, Are you planning on adding UUIDs compatibility to be in line with authentication post-1.7.6? I guess using a format similar to the new default whitelist.json would work. I know there are other ways to work around names / UUIDs resolution, but I like how simple this plugin has always been just for auto-reloading the whitelist. Thanks
@geeksteralan
Version 3.4 has been uploaded and is pending approval. It includes an option to use %NAME% in the kick message. :)
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!
@atomfitz
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?
Thanks
@seditnaburus
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.
@seditnaburus
This plugin does not create the tables. You will need to create your own tables.
Hello this plugin give me error message.
whitelist dbdump
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.
@Xuroth
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.
@Xuroth
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%>'
@TE5LA
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.
@cnaude
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?
@TE5LA
Have you tried this?