[INACTIVE] [ADMN] KiwiAdmin 2.2 - ban/tempban/kick/ipban, (MySQL or txt) [670-1158]

Discussion in 'Inactive/Unsupported Plugins' started by yottabyte, Jan 23, 2011.

  1. Offline

    yottabyte

    This plugin is no longer being updated for the public. The source is still being updated though, grab that and use it if you want to. Note that you might need to change some hard coded database names and such. (Advanced users only, basically)
    https://github.com/yottabyte/KiwiAdmin

    If you wish to continue the plugin in some form, please contact me first.

    things (open)

    KiwiAdmin 2.2
    Built against Craftbukkit #1000


    Hello people, I'm releasing my first public plugin!
    This is a very simple plugin, it adds the banning and kicking stuff for more people than just ops!

    KiwiAdmin requires either the Permissions or the GroupManager plugin!

    Features
    • Banning
    • Kicking
    • Unbanning
    • IP bans
    • Reloading banlist from either flatfile or database
    • MySQL support!
    • All actions are broadcasted to the people!
    • Case insensitivity!
    • Partial names support
    • 100% custom messages with colors
    • Temporary bans
    • Stores kicker, time, reason etc.
    • PHP script for a public banlist table. Example
    Partial names for /kick, /tempban, /ipban and /ban is optional although it is highly recommended as it seems like Bukkit has a built in feature where it can recognize a player just from the first part of their name. Eg. you ban player with "/ban playe", the ban will then be stored as playe and player will still be able to log in.


    In permissions, add these:

    Code:
    kiwiadmin.ban - Ban players
    kiwiadmin.kick - Kick players
    kiwiadmin.kick.all - Kick all players
    kiwiadmin.unban - Unban a player
    kiwiadmin.reload - Reload from the database
    kiwiadmin.tempban - Temporarily ban a player
    kiwiadmin.ipban - IP ban a player
    kiwiadmin.export - Export banlist
    
    Commands are simple:
    Code:
    /ban [player] (reason) - Ban a player, the reason will be in the kick message.
    /kick [player] (reason) - Kick a player, the reason will be in the kick message.
    /kick * (reason) - Kick all players on the server
    /tempban [player] [time] [sec/min/hour/day/week/month] (reason)
    /unban [player] - Unban a player
    /ipban [player] (reason)
    /reloadka - Reload KiwiAdmin from banlist.txt
    /checkban [player] - check if a player is banned
    /exportbans - export all bans to banned-players.txt
    
    If using flatfile, bans are stored in /plugins/KiwiAdmin/banlist.txt.
    IP bans are stored in plugins/KiwiAdmin/iplist.txt

    If you are using MySQL, run this query:
    Code:
    CREATE TABLE  `banlist` (
      `name` varchar(32) NOT NULL,
      `reason` text NOT NULL,
      `admin` varchar(32) NOT NULL,
      `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
      `temptime` TIMESTAMP NOT NULL ,
      PRIMARY KEY (`name`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    CREATE TABLE  `banlistip` (
      `name` varchar(32) NOT NULL,
      `ip` varchar(15) NOT NULL,
      PRIMARY KEY (`name`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    You will also need the Connector/J in your root bukkit folder just like all other MySQL plugins!

    Using the php viewer
    You can download the php file here.
    Open it in any notepad style program and change the database settings. Save and upload to website!

    Updating from 1.x
    If you have a database from KiwiAdmin 1.x you have to run
    Code:
    ALTER TABLE  `banlist` ADD  `temptime` TIMESTAMP NOT NULL ;
    Updating database from 2.0 to 2.1
    2.1 introduces IP bans, you have to create this table to use them
    Code:
    CREATE TABLE  `minecraft`.`banlistip` (
      `name` varchar(32) NOT NULL,
      `ip` varchar(15) NOT NULL,
      PRIMARY KEY (`name`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    [​IMG] Download
    Source (not updated too often)

    Update 2.2
    • Fixed /kick *
    • Added /exportbans
    Changelog (open)


    Update 2.1
    • Added IP bans
    Update 2.0

    • Almost completely rewrote the entire plugin
    • Added temporary bans, full flatfile support
    • New configuration file
    • Added customizable messages!
    • Now displays ban reason when player tries to log in
    Update 1.2

    • Added partial names support for kicking and banning.
    • Fixed the kicking message when banning showing "Reason:" although there were no reason. (Only for MySQL users)
    Update 1.1

    • Reverted back to normal commands, /ban, /kick and /unban
    • More case insensitivity improvements. The banlists are no longer lower case only.
    • Fixed the ugly blank lines in the txt file if using flatfile
    Update 1.0


    • MySQL support!
    • Cleaned up A LOT of code.
    Update 0.5


    • Removed TSLPC
    • Added console commands support. These will be displayed as "server" eg. "yottabyte has been kicked by server!"
    Update 0.4


    • Updated to work with version 183+
    • Reformatted the commands to avoid interfering with the vanilla commands.
    Version 0.3


    • Added /unban
    • Added /reloadka - reloads the banlist from banlist.txt
    Version 0.2


    • When a player is kicked or banned, a global message is sent. Includes reason if there is one.
    • Changed PLAYER_JOIN to PLAYER_LOGIN, banned players are now kicked before they enter the server.

     
    losdamianos, malex, zcleaver and 3 others like this.
  2. Offline

    yottabyte

    I do not plan on quitting the plugin since my server depends on it too. However, I don't prioritize adding new features to this right now.
     
  3. Offline

    RustyDagger

    Cool I think U just got another install For Now At least If commandbook Comes with kick/ban ofc I'm going to """jumpto"" (lol world edit reference) it what server owner don't want 1 less plugin to get updates for.

    An ipban would be handy for those annoying people that seem to have 5 or 6 accounts
     
  4. Offline

    yottabyte

    I've looked into doing IP bans but I can't find any methods for this in Bukkit, yet.
     
  5. Offline

    MacG32

    Confirmed working with build #556. [​IMG]
     
  6. Offline

    oliverw92

    Why is this in the unsupported/inactive section...? It works fine
     
  7. Offline

    Moo Master

    Hey, i got a question is it possible to do
    /ban moo
    to ban moomasterq?
     
  8. Offline

    yottabyte

    Yes.
     
  9. Offline

    Moo Master

    Ooh, so sweet!

    Ima add this in on my next restart!
     
  10. Offline

    lazy_architect

    Please update this....
     
  11. Offline

    Moo Master

    Ya, Kiwis sound fresher then mcbans. So could you update this?
     
  12. Offline

    yottabyte

    Hm, I ain't getting any errors on build #617. Any error details?
     
  13. Offline

    ZachBora

    Works for me on #617.
     
  14. Offline

    Moo Master

    Well sorry, jumped a bit to hastily since most plugins were broken with the update.

    But in other news, could you possibly make it so when people try to join the server and are banned to have it say a configurable message? Like "You're Banned! Appeal on The Site!"

    So banned players can know more about where to appeal the ban, instead of them just wondering why they're banned. If not thanks anyways its a great plugin!
     
  15. Offline

    ZachBora

    This is a good idea. When I'm banning I write a message but it doesn't seem to be saved anywhere.

    What could be nice is to save both the message and who banned and to customize the ban message.

    Example :
    You were banned by <player> because of <ban reason>. To appeal, please go to <url>.

    Also in the same way, have a command like /baninfo <player> that will tell who banned and why.
     
  16. Offline

    oliverw92

    I can't get MySQL to work with this. I've tried several Connector/J files in the bukkit root folder, but i always get 'No suitable driver found...'
     
  17. Offline

    Jekotia

    That information is saved if you use KiwiAdmin with a MySQL database.

    Can anyone comment on if KiwiAdmin works on build 670? I'd test it myself but I am currently unable to run a server ):
     
  18. Offline

    yottabyte

    It does work, I use it on #670 myself.

    Edit: build 270? I must've been tired lol
     
  19. Offline

    ZachBora

    oh... I'll look into that thanks. Also works for me on 670.
     
  20. Offline

    yottabyte

    Plugin updated to 2.0. Finally got some time to update this. Running without errors is not guaranteed :p
     
  21. Offline

    Ahfaichucky

    awesome plugin, any chance of adding ip ban features soon.?
     
  22. Offline

    yottabyte

    That's on the todo list but I'm pretty busy working on two large plugins which are higher priority atm.
     
  23. Offline

    grandwazir

    Getting the following error when temp banning someone:

    Code:
    2011-04-24 16:55:02 [SEVERE] [KiwiAdmin] Couldn't execute MySQL statement:
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'temptime' in 'field list'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
        at com.mysql.jdbc.Util.getInstance(Util.java:382)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
        at com.yottabyte.bukkit.Database.addPlayer(Database.java:255)
        at com.yottabyte.bukkit.KiwiAdmin.tempbanPlayer(KiwiAdmin.java:444)
        at com.yottabyte.bukkit.KiwiAdmin.onCommand(KiwiAdmin.java:229)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:650)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:613)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:607)
        at net.minecraft.server.Packet3Chat.a(SourceFile:36)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:73)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
    Seems like a field is missing from the table. Fixed by running the following:

    Code:
    ALTER TABLE banlist ADD temptime timestamp NOT NULL AFTER time;
    
     
  24. Offline

    yottabyte

    Oh, my fault! Forgot to add that to the MySQL statement in the OP, will fix that
     
  25. Offline

    MiHo

    Nice, but why not use McBans?
     
  26. Offline

    yottabyte

    http://kiwike.se/banlist.php
    I couldn't get McBans to work with all their complicated keys and whatnot so I made my own plugin. I started this way back in the day when there was only McBans and the vanilla bans.
     
  27. Offline

    oliverw92

    Getting this error using MySQL and v2:

    Code:
    05:50:51 [SEVERE] Could not pass event PLAYER_LOGIN to KiwiAdmin
    java.lang.NullPointerException
    
            at java.util.regex.Matcher.appendReplacement(Unknown Source)
    
            at java.util.regex.Matcher.replaceAll(Unknown Source)
    
            at java.lang.String.replaceAll(Unknown Source)
    
            at com.yottabyte.bukkit.KiwiAdminPlayerListener.onPlayerLogin(KiwiAdminPlayerListener.java:47)
    
            at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:260)
    
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
    
            at net.minecraft.server.ServerConfigurationManager.a(ServerConfigurationManager.java:152)
    
            at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:82)
    
            at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:33)
    
            at net.minecraft.server.NetworkListenThread.a(SourceFile:87)
    
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
    05:50:51 [INFO] franjob [/84.150.151.133:49953] logged in with entity id 483122
    Also we seem to be having a few issues with using it on MySQL and it not banning people correctly. I'm going to investigate some more


    EDIT: Would you mind sharing that ban list php script you have :3

    EDIT2: Fixed the issue above, when i imported my ban list I forgot to set the reason to something for all the old bans. Would still appreciate the web script you have for bans though :p
     
  28. Offline

    yottabyte

    Sure, here's a download. Don't forget to change your database settings.
    http://dl.dropbox.com/u/11931950/minecraft/plugins/banlist.php
     
  29. Offline

    oliverw92

    Awesome, thanks :D


    Feature request - i see you cache the bans and then then push them to mysql whenever something happens (ban, unban etc). Would it be possible for you to make it refresh the cache something like every few minutes (a configurable amount would be good). I'm planning on making a web interface for banning/unbanning so my moderators can do stuff remotely (i.e. via phone)
     
  30. Offline

    PatrickFreed

    Is this working for 733?
     
  31. Offline

    yottabyte

    yes
     

Share This Page