KarmicJail
KarmicJail
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
About
This plugin is a fork of imjake9's SimpleJail plugin. It was made because our server needed a new Jail system to replace the defective one that was implemented in the past. While other jail systems were simple and lightweight, they were not nearly as featured as we were used to or wouldn't support our scope. For instance, at the time we had about 190 old entries of jailed players in a MySQL database and we wanted to transfer those over to whatever new system we woud use. Thus, KarmicJail was made, for Mine-RP.
Features
- Simple, single jail system.
- Uses MySQL / SQLite database for storage.
- Look up and page through current jail records.
- Complete history of every jailed player.
- Records each instance a player gets jailed, with all attached info, such as who jailed them, the reason, date, etc.
- Can add custom comments to any player's record.
- Optional permission group modification
- Optional jailed player event / interaction denial
- Persistent jail time. Players need to be online to actually serve their time in jail.
- Quick alias to commands
- Name auto-complete for online players.
- Auto-correct name capitalization for online and offline players, so long as they have visited the server at least once.
- Ex/ Try to jail player "HaXXoR", the following command would work: /j haxxor
- Offline player support.
- Optional inventory management of jailed players.
- Clear the jailed player's inventory so that they don't have access to it in jail.
- View and modify the inventory of a jailed player.
- Return inventory (with modifications if any) to jailed player on release (or not :P).
- Jail multiple people in one command.
- Teleport to the last known location of any player to ever visit the server.
- Warp players to the jail location without "jailing" them.
- Custom jail event for other plugins.
This plugin depends on Vault.
Also requires SQLibrary for SQLite and MySQL.
Commands and Permissions
Configuration
Custom events for plugin developers
TODO:
- ??? - Vote/comment and shape what the future update for the plugin should be.
Maven
This plugin supports Maven. Just add our repository:
<repository> <id>dakani</id> <name>Dakani Nexus Repo</name> <url>http://repo.dakanilabs.com/content/repositories/public</url> </repository>
And add KarmicJail as a dependency:
<dependency> <groupId>com.mitsugaru</groupId> <artifactId>KarmicJail</artifactId> <version>0.443</version> </dependency>
Trello Dev board
Visit the Trello board to see the current todo list for all projects.
You can comment and vote on any of the topics there.
All changes on the Trello board are in real-time.
If this plugin has helped you, please consider donating.
yeah, multiworld implementation is what I had in mind with the suggestion. How about disabling the removal of armor until we have a way to restore it? or was the removal a side affect of dumping all the inventory?
@Gikon
Yeah, that was a known issue back when I first added inventory management. I just haven't gotten around to implementing the armor portion of the inventory.
@Gikon
Eventually, the groups for jail/unjail will need to be a list with world designations (thus, multi-group and multi-world), but I'm currently working on another plugin at the moment.
Oh, this is fantastic. I can see a great way to use both of these features seperately on different servers. You are a champ!
Seems everything is working well, with both setups. Short of the missing armor. One addition I might suggest for the GROUP: category is an option to designate which world the rank modifications will affect, Or have it target the world in which the jail resides?
It is completely configurable as it is now to work, however if any admins have multiple rank/groups setup for each world as I did, and didn't use the sub world dependacies in the configuration... they'll end up with issues again.. honestly it's not your problem.. and not sure it'd even be worth the bloat to stop the issue.
Also found another issue/bug. It removes users armor when put in jail, but doesn't return it upon unjailing. :/
@Gikon
Alright, after a bit of testing, I sort of understand what is going on. Basically, when it tries to return the groups, it'll return the group to the player per world... However, in the case of Group Manager, it seems to add the same group for each world... :\ Regardless if they already have the group.
Not completely sure why yours would re-add the Jailed group, but the above explains why it is added 4 times (one per world).
In any case, I've added your request to define what group to add when unjailed. You might want to set group.returnOnUnjail to false then so that they only receive the group you've defined.
Also, in case it helps, I've added in player event / interaction denial into the config as well. So, permission groups are now completely optional.
I'll submit it to BukkitDev for approval. If its not readily available on the project page, you can also grab it from the GitHub downloads page here: https://github.com/Mitsugaru/KarmicJail/downloads
I'll look into the armor issue at some point.
Fantastic plugin, had some issues with it seeing multiple permission plugins, was able to sort that myself and properly setup world inheritance for permissions.
THe issue I ran into was that it would see the user rank for world definitely in group manager, and would reissue the rank changes all to the main world. IE: read world / world_nether / world_the_end
each world had different user ranks as "default", but shared the same permissions.
So when a user was jailed. it would read world / citizen, and world_nether / ghost. then it would only change the user rank in the main world upon unjailing, it would issue rank changes for "each" world, but only to the main world. so in world, the user would get set as Citizen (world), then set as ghost (nether), and then as default (the_end).
the ranks in the sub worlds of nether and end, never changed on any level. however it was jumping my users through unused ranks on the main map.
Perhaps a setting to only pull the rank from the world the jail is in? Or a setting that tells it which world to only pull details from?
anywho.. Sailing clean with it now! Thanks for the plugin.
Found another issue/bug. Removes users armor when put in jail, but doesn't return it upon unjailing. :/
@Mitsugaru
Will do. I'll sneak it in on the next scheduled reset.
@dabomb665m
Can you test this version here and see if it cut down on the delay for the respawn event: https://github.com/Mitsugaru/KarmicJail/downloads
Let me know what you find out.
@dabomb665m
Well, I check the player's status to see if they need to be sent back to the jail point (if enabled in the config, and by default true).
However, might have another way of doing it that may get rid of the issue.
Thanks for bringing it up and I'll let you know when I change it and if it made a difference.
@Mitsugaru
Hi Mitsugaru.
Thanks for a great and simple to use plugin. I have a quick question about performance. Lately I've been trimming/weeding out unnecessary or expensive plugins in order to keep my growing server running tip top.
I use Nolagg+'s examine tool to check the MS spent by plugins and I notice that every once in a while, KarmicJail will spike and eat up 3-6ms during a tick. The spike comes from "PlayerRespawnEvent[Highest] in class class com.mitsugaru.karmicjail.events.KarmicJailListener. It doesn't seem to be a consistent MS hog, so I'm wondering if its just something off in the class that is causing it?
Do you have any idea what may be causing something like this? Conflict with another plugin perhaps? I see this behavior with a handful of plugins usually with EntityDeathEvent as well. Normally a plugin will consistently chug away and eat some MS... but there are a few on my list that just randomly spike to 3-7 ms but normally eat near nothing.
@BONNe1704
Right, the config option for returning inventory thing is my fault. I forgot to put the check when releasing a player from jail.
Uploaded new jar with the change that should fix that: https://github.com/Mitsugaru/KarmicJail/downloads
Test that option and let me know how that goes.
Not sure why it would double their inventory... Haven't seen that happen and not sure how that would happen. o.O
Also, not sure why it would report a false time for the given player. I suppose as a quick fix you could just set his time back to 0 or negative to stop his timed release thread from counting down.
Ok, no problem with 0.422. All works correctly, but only items come back.
In settings i have put returnOnUnjail: false! but they get them back and double sometime :(
6 Tests i made with 3 differnet user groups and 2 time was double item, In jail all was without items, but when unjailed all gets them back (ignoring config settings)
CONSULE
2012-04-25 21:47:39 [INFO] _Kast_ [/212.93.105.45:52786] logged in with entity id 62404 at ([world] 686.8834221472412, 64.0, 155.3792165290287) 2012-04-25 21:47:40 [INFO] [KarmicJail] Jailed '_Kast_' on login with time: about 3h59m 2012-04-25 21:47:41 [INFO] [31m[KarmicJail][36m _Kast_[31m jailed for [37mxray[0m 2012-04-25 21:47:44 [INFO] [37mDeathCube [33mnew[37m will start in 1 minute![0m 2012-04-25 21:47:50 [INFO] Read timed out
He loged in as Jailed on 3h59 min
But when i check it, it shows 0 - > Forever and also in mysql it put 0
@BONNe1704
Those three messages are more than likely my mistake. The reason those messages were coming up was because I forgot some break statements in my switches.
Try this version on GitHub:
https://github.com/Mitsugaru/KarmicJail/downloads
with debug for events and logToConsole set to true in your config.yml. Unhandled isn't usually important.
With these debug messages, you should see in your console that the thread was found and stopped for a timed jailed player when they quit. So test this version and let me know the output and results.
18:23:23 [WARNING] [KarmicJail] Unhandled getStringField for field STATUS
18:27:00 [WARNING] [KarmicJail] Unhandled getDoubleField for field TIME
18:27:00 [WARNING] [KarmicJail] Unhandled getStringField for field REASON
Debug. I jail myself to 1 minute. Logout and login. After 1 minute end, it shows in jailtime- > jailed forever, but when join, it shows less then minute.
First message is spawming all time when debug is ON
@BONNe1704
I'm having some trouble reproducing your bug... Is there any specific details to those cases where it occurs?
Hmm, i have bug... Sometime players is not unjailed, when time ends... and when write /jailtime it shows, jailed Forever... Not with everyone, but with some (do not metter Default group or not) Also no errors in consule. Just end time and change it to Forever.
P.s. I use mysql... and 0.421
@Mitsugaru
Thank you! It didn't become a issue till this weekend when we decided to make our jail a whole world :)
I will check it out shortly and set the config options.
@khanjal
Submitted version 0.421 for approval. Adds two config options about teleporting a jailed player.
One for regular teleport on jail command / on login. Another for respawn. If you want, I suppose I could split up the command and login one to be separate... IDK why I didn't do that now that I think about it... Anyways, there you go.
You can also find it on GitHub: https://github.com/Mitsugaru/KarmicJail/downloads
Also, I plan to make the whole permissions group thing optional as well at some point in the near future. A server I know has been telling me they don't like their permissions all mucked up with so many players with the jailed group (Even though they wanted the jail to be permissions based anyways... IDEK anymore :\ ).
@BONNe1704
For your case, you want that to be true. The default is false because I'm sure that most users don't want everyone to be warped to the jail by default.
@khanjal
Absolutely, give me a second to put that in. I'll reply again once I have a build for you to try.
warpAllOnJoin: false ?