Banmanager gives NullPointerException and no command works.
tryy3 opened this issue ยท 5 comments
Hi, I recently switched from a different ban plugin to banmanager.
It worked nicely for a few days, but then I went ahead and made a script that took all the bans from the old ban plugin and added them to banmanager, I thought I inserted the bans correctly, but sadly that wasn't true.
I can't see anything wrong in the mysql db, they all seem to be working fine but when I start my server, I get a NullPointerException, the plugin doesn't go red on /plugins but no commands work, when I do any banmanager commands it just gives me the usage info and no error on the console.
http://pastebin.com/mPkj69LZ this is the NullPointerException error.
http://pastebin.com/RJ1tJP7W this is a full startup log.
This happens on all servers, so I am not sure if its the mysql that is wrong or something or if I am using a bugged version or similiar, I tried using the latest on dev.bukkit.org (v5.1.1) and build 84 from jenkins, same issue on both.
The most likely cause is missing player data within your player table.
BanManager stores player name, ip etc within the player table, the bans table then references that via the uuid. All bans require data within the player table.
Which plugin did you attempt to import from and may I see the script? There's most likely an issue with it.
http://pastebin.com/wC3dT4Xa thats my console.yml
Oh... So I would need to grab the UUID and playernames from the bans and add them to the player table too, I only converted the bans, I never thought of converting the player tables too?
I switched from BungeeAdminTools.
http://pastebin.com/yzHT4fy6 this is the script that actually inserted into the db, I made most of the conversion in different steps, because some of the people had already changed their name and stuff so I had to remove some names.
I also noticed that the UUID didn't insert correctly, due to the UNHEX function in mysql, but I made a seperate script for that.
BM uses a JOIN on the players table to reduce duplicate data, i.e. names.
So yes, you first need to add their data to the players table if it doesn't already exist, then add it to the bans table.
The BanConverter for v4 should help give you an idea of how to achieve this
If you need any further help, just post here, and I'll do my best to assist you.