Hi
I want to take advantage of the new MineBans 'execute on ban' thing. What I want to do is have a plugin that would alter an external DataBase to set a MySQL column to '1', without lagging the server. I know how to set up the structure of a plugin, and a tiny bit about entering information into MySQL. What I would like to know is how to set up the command, and how to set up config files... Oh and how to use permissions
The kind of command that I'm looking to do is: /mysql UPDATE `test` SET `banned`=1 WHERE `username`=%player_name%
The %player_name% would be filled out by MineBans
Oh, and don't worry about how the usernames would get into the DB in the first place, I already have that sorted out.
So... Could anyone help me out ? Sadly I have hardly touched base with Java, but I'm willing to learn
And if its just too long to help me in these amazing forums, I will make a tutorials suggestion, and see if anyone else upvotes it
[JAVA][BUKKIT] Execute MySQL queries on a command
Re: [JAVA][BUKKIT] Execute MySQL queries on a command
Well you can use the ban event that MineBans provides instead of the command thing
public void onPlayerBan(PlayerBanEvent event){ String sql = "UPDATE `test` SET `banned` = 1 WHERE `username` = '" + event.getPlayerName() + "'; }That should be all you need but there is also event.getType() which is either BanType.TEMP, BanType.LOCAL or BanType.GLOBAL, you may want to exclude temp bans for example.