[INACTIVE][ADMN] PetitionPlugin v1.34 - Help ticket system [600-818]

Discussion in 'Inactive/Unsupported Plugins' started by FloydATC, Jan 20, 2011.

  1. Offline


    This plugin is used for players to log problems, requests and complaints. This plugin relies on Permissions.jar for access control. This will ofcourse be changed once permissions are properly implemented in Bukkit.

    The source code is included in the .jar file, feel free to do whatever you want with it. If you use it to save the universe, credits would be nice.

    • Players may open one or more petitions and get assigned a unique ticket # for each. This number can be used to track the petition until it has been closed.
    • Each petition may be assigned to a specific op/admin or left as unassigned
    • Players as well as ops/admins may add comments to an open petition
    • Ops/admins (and currently players) may warp to the location where the petition was opened
    • Ops/admins (and currently players) may review the history of each open petition
    • Closed petitions are archived and can be reviewed or reopened by moderators
    • Use the command "/petition" or the shorthand command "/pe". These can be reconfigured if you want. Option to change these was removed in v1.20, sorry.
    • All commands are case-insensitive
    • New and updated petitions are announced to everyone with 'petition.moderate' permission
    • Want to call them something else than petitions? This can be configured.
    • Supports multiple worlds
    • Offline players receive notifications on petition updates when logging in
    • Server admins can handle petitions on the server console
    • Players and moderators are reminded of their open petitions at configurable intervals
    Command syntax
    /pe open|create|new <Message>
    /pe comment|log <#> <Message>
    /pe close <#> [<Message>]
    /pe list [<count>]
    /pe view <#>
    /pe assign <#> [<Operator>]
    /pe unassign <#>
    /pe warp|goto <#>
    Note that the command/alias "/pe" can no longer be changed by the server administrator.

    How to install
    1. Download http://minecraft.atc.no/plugins/PetitionPlugin.jar
    2. Copy it to your "plugins" directory
    3. Optionally create a new directory called "plugins/PetitionPlugin"
    4. Optionally create a new directory called "plugins/PetitionPlugin/archive"
    5. Optionally create a new file "plugins/PetitionPlugin/settings.txt"
    6. Load the plugin (Restart the server, or use any plugin you have for this purpose)
    The configuration file is optional, the following settings are available:
    Command examples
    A player in distress:
    /pe open Someone has burned down my home!
    # the player receives a ticket number, say 45 for this example
    /pe comment 45 And killed my chicken!
    The brave (but slightly insensitive) administrator arrives:
    /pe list
    # the plugin shows me a list of currently open petitions
    /pe assign 45 FloydATC
    # the petition status is changed to show that I am now handling this incident
    /pe warp 45
    # I am teleported to the scene
    /pe comment 45 Nice crater
    /pe close 45 Feather refunded, have a nice day
    # +1 served
    Again, note that the command/alias "/pe" can be changed by the server administrator.

    v1.00 - Original release
    v1.01 - Rebuild (fixed onPlayerCommand issue)
    v1.02 - Implemented locking and permissions
    v1.03 - Added notifications and colors, and fixed a stupid permission bug
    v1.04 - Fixed a few problems with notifications, added more colors.
    v1.05 - Command/alias can now be configured. More colors.
    v1.06 - Fixed crash bug when closing without a comment. Added optional notifications on assign/unassign.
    v1.07 - Improved error-checking. Players may now list/close/comment/view/warp to their own petitions.
    v1.08 - Automatically create necessary directories and files if they don't exist
    v1.10 - A few cosmetic fixes + petition length in header
    v1.11 - Added experimental support for multiple worlds
    v1.12 - Changed to use world name instead of ID
    v1.20 - Rewrote to use onCommand(), fixed /pe warp security issue + much more.
    v1.21 - Removed the "stupidly long constructor" as per Bukkit team recommendation
    v1.22 - Implemented a notification system for offline players, admins and operators
    v1.23 - Fixed duplicate messages. Commands now work from the server console.
    v1.24 - Added optional setting to limit use of warp. Petitions are now almost listed in correct order.
    v1.25 - Fixed null pointer error on player join.
    v1.26 - Petitions are now listed in correct order. Finally.
    v1.27 - Optional online/offline filter to /pe list implemented.
    v1.28 - Non-moderators could assign/unassign their petitions. Fixed.
    v1.30 - Closed petitions may be viewed and reopened. Added list filters "closed", "unassigned", "newest" plus Regular Expression matching.
    v1.31 - The list would always get reversed. Fixed.
    v1.32 - Notification thread implemented, remind users and mods at regular intervals.
    v1.33 - Changed onPlayerJoin() as required by build #600. Fixed deprecated call to void teleportTo().
    v1.34 - Added option to notify all players when a petition is closed, not just the moderators.

    • Requires the Permissions plugin (2.6 or equivalent required) Use other versions or compatible plugins at own risk.
    • 'petition' required to open, comment and view a petition
    • 'petition.warp-to-own' required IF 'warp-requires-permission' is enabled
    • 'petition.warp-to-own-if-assigned' required IF 'warp-requires-permission' is enabled
    • 'petition.moderate' required for everything else
    Known problems
    Certain situations can lead to double notifications, such as an operator commenting on his own petition. Colorization is work-in-progress.

    I'm a Java newbie, please be gentle.
    Thank you :)
    DJdur, Phaedrus, kahlilnc and 3 others like this.
  2. Offline


    Version 1.27 posted, this one accepts optional "online" or "offline" keywords for "/pe list" in addition to the optional count. E.g.
    "/pe list online" will list maximum 10 petitions where the owner is online,
    "/pe list online 20" will list maximum 20 petitions where the owner is online,
    "/pe list offline 5" will list maximum 5 petitions where the owner is offline.

    I just don't feel like implementing "assigned to me", "older than a fortnight" or "just the cool ones" tonight, sorry. All work and no play makes Jack a dull boy.
  3. Offline


    Just the cool ones? Lol. I want that option. lol.

    But seriously, thank you for this plugin. This will make the Admins/Mods job way easier, and I won't have to hear as many complaints.
  4. Offline


    This seems tremendously helpful! Thank you! [​IMG]
  5. Offline


    Non-moderators could assign and unassign petitions. Oops. Fixed in version 1.28
  6. Offline


    Hello author.

    This plugin is THE best. No more 'admins admin admins' chat spam for me, no more stress. This is AWESOME.

    Now, may I add a request, history lookup.

    The ability to lookup old petitions would be great, more so for just recently closed petitions, but the ability to /pe history list and /pehistory [#] would be fantastic.

    Anyhow, thank you for allowing me to continue my server, the stress of players was almost too much before this plugin.

    Peace out.
  7. Offline


    Glad to hear it :-D

    Yep, this is actually why I did the archive thing instead of just deleting old petitions. Unfortunately, a simple "list history" by itself would be pretty useless so I need to implement more filters like I did with online/offline before this is feasible. Things like keyword or name search comes to mind but my Java-Fu isn't quite there yet.

    Let's see what I can work out and hey... the source is there, contributions are most welcome if anyone feels like chipping in.
    dak393 likes this.
  8. Offline

    Nathan C

    Darn, not working on the latest craftbukkit.

    Commandalias is no longer used.

    So the plugin does not work, even on 530-531

    EDIT: New config file fixes it.
  9. Offline


    The settings "commandalias" and "command" introduced in version 1.05 were retired in version 1.20 because the onPlayerCommand() was replaced with onCommand() and all commands must be declared in plugin.yml.

    I'm running 531 and have no problems using the standard /pe or /petition commands. What kind of problems are you experiencing?
  10. Offline

    Nathan C


    Ok, I feel like an idiot. The problem was that my old config file for this plugin had "commandalias" in it, so I deleted the config file and reloaded the server.

    It works now on the latest build of CraftBukkit.

    I am sorry for this.
  11. Offline


    Not a problem at all :)

    The plugin will warn you about those settings no longer having any effect if they are present, other than that it should just keep on ticking.
  12. Offline


    I have just posted a major update, version 1.30 adds the following features:
    • Added optional "closed" parameter to "/pe list"; use to list closed petitions instead of open ones
    • Added optional "newest" parameter to "/pe list"; use to list petitions in reverse order (newest first)
    • Added optional "unassigned" parameter to "/pe list"; use to ignore petitions that have already been assigned
    • Any unknown non-integer parameter to "/pe list" is treated as a regular expression. If present, this expression is matched against the petition header and used as a filter. Simple example: "/pe list lava". Complex example: "/pe list \w\@(\w\.)+\w"
    • Added new command "/pe reopen" so moderators can re-open previously closed petitions
    • Players may now view a petition even if it has been closed, making notifications more useful
    • Moderators may now view and warp to a petition even after it has been closed
    Oh and v1.31 fixes a stupid bug that caused the list to always get reversed.
  13. Offline


    There's one thing I'm not getting so far... let's say I'm playing on my server and somebody submits a petition. I don't see any sort of notification at all. How can I get notified of a pending ticket without having to do "/pe list" every few minutes?
  14. Offline


    If you have the "petition.moderate" permission, you should receive a notification whenever a petition is opened or modified. Otherwise, you should receive a notification only when one of your own petitions are updated.

    The one thing missing is a reminder every N minutes that you have X open petitions. This one bothers me, because I'm not sure how to do it in a clean and efficient way. Polling is crude, threading is painful.

    Update: Fixed spelling error

    @Skadar: ...painful, yet doable.

    Version 1.32 introduces a notifier thread which reminds ordinary players about their open petitions, and reminds everyone with "petition.moderate" about all open petitions.

    The notification interval defaults to 5 minutes (300 seconds) and can be adjusted in "settings.txt" with the new configuration setting "notify-interval-seconds". If this setting is invalid, zero or less than zero, the thread will not be started at all.

    The source is still included in the JAR. If anyone would review the code and give me some feedback it would be greatly appreciated. I'm still learning Java and there are bound to be a lot of mistakes.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 6, 2016
  15. Offline


    This plugin looks like it'll play very well into my style of dealing with griefing. I can't wait to start using it!
  16. Offline


    Love this plugin :) keep it up Floyd!
  17. Offline


    Got this
    2011-03-22 17:09:49 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'pe' in plugin PetitionPlugin v1.32
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:229)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NumberFormatException: For input string: "kan"
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
            at java.lang.Integer.parseInt(Integer.java:449)
            at java.lang.Integer.valueOf(Integer.java:554)
            at com.floyd.bukkit.petition.PetitionPlugin.performComment(PetitionPlugin.java:232)
            at com.floyd.bukkit.petition.PetitionPlugin.onCommand(PetitionPlugin.java:138)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    The player was not quite sure exactly what he wrote in the petition in question.
    FYI, concerning the For input string: "kan", "kan" means "may" as in "may i" in norwegian, perhaps it was part of the original title.

    Heres the petition made by him before this message:
    log=Closed by Acez84
  18. Offline


    Looks to me as if he forgot to type the petition ID (19 in this case) before the message, e.g.
    /pe log Kan bla bla bla
    as opposed to
    /pe log 19 Kan bla bla bla
    I'll improve the input checking a bit so users get a clear error message instead of the plugin just dumping out like that. Note that it's impossible for me to see from this trace if he used the keyword "log" or "comment", the result would be the same. By the way, norwegian is my native language too :)
  19. Offline


    floyd such a nice plugin im going to use it :D
  20. Offline


    Can u make one option to hide the nick who comment or close the petition? I dont want people knowing my mods nicks.
  21. Offline


    Okey, thanks for the help.

    Kjempefin plugin forresten, den har gjort alt så mye enklere for oss på serveren:)
  22. Offline


    If it was possible to make a web interface for this, it would make it a lot easier for management to sort tickets. Is this possible?
  23. Offline


    I suppose I could make a setting for this, yes.

    Let me think about this for a bit, it may be better to do this as a separate plugin that interfaces with this one. Web interfaces open up a whole range of other problems; stand-alone and/or a back-end to Apache/Lighttpd, user authentication/permissions, design/customization. Just to mention a few things that come to mind. And when you finally get it all right, some pedantic hermit comes along with his pet browser that refuses to cooperate.

    When I read the "dynmap" thread and see the kind of questions ppl ask... :-/
  24. Offline


    Maybe work with the creator of milkAdmin(or another addon) to add optional support? That cuts alot of the work out due to a already published interface. But yea, a seperate plugin would be better than throwing it all into this one.

    Edit: Upon another look, dynmap does not seem as complex as you made it sound. You could ask one of those dev to help you set it up. If you make it easy enough, there shouldn't be many help requests.
  25. Offline


    Does 1.32 use the bukkit scheduler? if so it may have adverse effects on larger servers - the bukkit scheduler uses ticks .. and the server ticks are massively hindered on larger servers with 50+players.

    The normal tick rate is 20/20 - under AVERAGE load we see 6/20 ticks... meaning anything that uses the scheduler will be based off the 6tick system instead of 20ticks.

    I'll also add that - I would personally stay away from any very bloated activities with this plugin. It's quite easy to use these in-game and any other sorting / addition to web support will definitely bloat it down. Not to mention that while Dynmap is wonderful, it is a potential lag fest for the bigger servers who most benefit from help tickets, etc.
  26. Offline


    No, I spawn a small thread that simply sleeps until it's time to do another round of notifications. When gathering the stats, it sleeps 100 ms per file it processes, to reduce server load even more.

    I agree 100%.
  27. Offline


    on an unrelated note - we have reached 1600 tickets. My lordy. I'm going to start backing them up soon and at the 10,000 mark. Start over at 0 probably.
  28. Offline


    I'd love to hear more about experiences from servers like this with really high load and a lot of tickets.

    I'm sort of playing with the idea of optionally supporting MySQL as a back-end. Got years of experience with Perl and MySQL, absolutely zero experience with Java and MySQL. I have a feeling that searching 10000 closed tickets stored in txt files won't be very pretty :-/
  29. Offline


    Honestly, the flatfile system is perfect - the only issue is these tickets are hard to back up and save :p when we make local tests :)
  30. Offline


    New version v1.33 posted. Build #600 of Bukkit broke onPlayerJoin() and I also fixed a deprecated call to void teleportTo(). This means v1.33 will most likely break on earlier versions so I'm keeping a copy of 1.32 online just in case. Please test carefully before upgrading a live server. As always.
  31. Offline


    Was there ever an ability implemented to allow players to /return to the last point (x/y/z) before teleporting? if there isnt... my god can we have one please?

Share This Page