[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


    No there wasn't, but I see where you're going. Making a note of your location when you type "/pe warp <#>" and then add a command like "/pe warp back" shouldn't be too hard I guess.

    Let me think about this for a bit, because it opens up a few interesting possibilities. One of those is to implement such a feature in my (currently unreleased) WarpPlugin and have it keep track of all your teleports and not just the ones made via PetitionPlugin.
  3. Offline


    interesting... though honestly something that would make petition more useful is if it would teleport you back based on the command you use....

    so, petition, warp, tp, spawn - etc - configurable of course.
  4. Offline


    I'm amateur but if you use MySQL, can you create a page reading from it? Like a page that just opens or neatens the information, or maybe a completely different plugin that is compatible.

    Sorry for being such a pain about this, but I'm really looking for a web based ticket system.
  5. Offline


    My moderators suddenly gets access denied for the warp-command.

    My config still says "warp-requires-permission=false", and i even tried added the warp-permission just for fun.. No change.
  6. Offline


    I've had a request from players that the open petition reminder is too frequent. It would be nice if this reminder time period could be specific in the config. Thanks! Perhaps 2 variables... reminder time to players and reminder to mods.
  7. Offline


    In settings.txt:

    My mods don't have this problem, do they have access to all the other moderator options and just not warp? Also, what version of Permissions.jar are you using?

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


    We are running 1.32 since we're still on MC 1.3.

    Yeah, they also had petition.moderate. Had to add "petition.*" to make it work.
  9. Offline


    Thanks! Strangely this was not in my settings.txt file... so I just added it in there.
  10. Offline


    Not so strange really, it was added later when the feature was introduced and the plugin only writes the settings.txt if it doesn't exist... better safe than sorry and all that :)

    Odd. I'll double-check the code when I get home. Maybe I have a funny spelling error or something...

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


    Really needed something like this on my server! Thanks for your work and it works great!
  12. Offline


    One suggestion for this great plugin :)

    Can you add a setting to "broadcast" when a petition is closed ? like that my player will know what's the number of the currently closed petition before going on their one :)
  13. Offline


    Why would they need to know this? When opening a new petition, a new ID is automatically issued by the server. Also, there's no guarantee that petitions will be handled or closed in any particular order so only the server knows the correct next ID, which is issued using a thread-safe locking mechanism to ensure uniqueness even if two players open a new petition at exactly the same time.

    Currently, all logged-in moderators are notified when a petition is closed. The owner of the petition is notified immediately if s/he's logged in, or automatically next time s/he logs on.
  14. Offline


    That's cause we work a lot with your petition plugin on our serveur, so when player see the id of the current closed pétition they know how many time wait before we work on their pétition.

    I just want an option to allow or disallow the broadcast message actually used to all op users ^^

    Like you want ^^
  15. Offline


    I don't think I'll be using this feature myself since we don't necessarily deal with the petitions in strict order but here you go; version 1.34 has just been uploaded with a new option:
    The default setting is "false", if set to "true" then all players will be notified when a petition is closed, not just the other moderators.

    Enjoy :)
    WolwX likes this.
  16. Offline


    I love this! makes handling requests much easier. I just wish the users werent this stupid though :(
  17. Offline


    @FloydATC Thankkkkkkssssssssssssssssss :D

    That's will be fine for my staff now :)
  18. Offline


    Nice plugin. But is it possible to have many different “Petitions”-rooms? So every room has a set of players who manage this room. For example I want to use this plugin, so other players could write me petitions/notifications/tips and on the other hand there are “to be discussed” petitions, which another player collects and handle.

  19. Offline


    Would be nice if I could set up a petition wall for my usage. I.e. it shows a summary on the signs, I left click to read it and its comments, right-click to assign, right-click again to warp there.

    Would be nice.
  20. Offline


    I would probably call them "categories" and not "rooms" but I see where you're going. It ties in with the concept of priorities and needs to be done right if it's done at all or it could ruin everything. I have to think about it some more.

    This will definitely not be implemented as part of the plugin but it sounds like a cool idea for a stand-alone plugin communicating with PetitionPlugin in the same way a web interface would. There will be an API for this sooner or later. (Looks at calendar.... Yep, later.)
  21. Offline


    Love this plugin, about to whip up a web front end to it and it got me thinking, is there any plans to move to MySQL or SQLlite (my preference is MySQL)?
  22. Offline


    Yes, I may add optional support for MySQL as an alternative to the flat files, but don't hold your breath.
  23. Offline


    Well then in the mean time, I am putting together a web interface to make responding / assigning pe's a little more easy (we all know how cumbersome the MC chat system is). Because of this I intend to modify the text files outside of your plugin, can you perhaps get your plugin to poll for changes at a configurable interval (say 5-10min) so it could pickup / announce the changes?

    If not, do you have any suggestions on how I could interact with your plugin ?
  24. Offline


    The notifier thread always scans the open petitions to count open petitions per player, but picking up changes like assignment and comments would require a lot more complex coding so I'm reluctant to do it.

    A proper extension interface in PetitionPlugin could let the web interface trigger the actions as if a command was entered in-game and then act on the petitions regardless of the back-end (flat files or database records) I consider using a socket listener thread for this because I've done similar things in the past with other programming languages. The only thing keeping me from starting to code this is that I don't have any good ideas when it comes to authentication.
  25. Offline


    Although I certainly defer to Kainzo's experience with the system, I would guess that many 'larger' servers are already running MySQL and therefore the overhead of this system would be minimal. Actually the overall footprint might be smaller ...

    One thing that I like about stuffing things into a database like MySQL is that now I can access it externally through my own UI, and not have to try to funnel everything through the Minecraft UI bottleneck.
  26. Offline


    Sometimes people make petitions which are cut off. Is that the client cutting off or is it something that can be changed in bukkit? I'm guessing it's a client limitation...
  27. Offline


    Or categories. I didn't know which word was the best, but I'm looking forward that this will be implemented :) .


    Does this plugin work with (Essentials)GroupManager? Because my users have the “petition” permission, but can't view any petition. Or could they view their own petitions?


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


    Still rocking hard on this plugin - keep up the good work mang.
  29. Offline


    Our moderators can not warp to petitions except ones they created. I have given them all the permissions you listed. I would like for moderators to be able to warp to any open petition.

    Also the 'unassign' command doesn't remove the assignment, it re-assigns it to the person issuing the unassign command.

    Aside from those issues, this is a great plugin, and has saved me loads of time keeping up with problems around the server.
  30. Offline


    Hello, I'm getting following error:
    21:53:12 [SCHWERWIEGEND] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'pe' in plugin PetitionPlugin v1.34
            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:254)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.NumberFormatException: For input string: "#6"
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
            at java.lang.Integer.parseInt(Integer.java:470)
            at java.lang.Integer.valueOf(Integer.java:570)
            at com.floyd.bukkit.petition.PetitionPlugin.performView(PetitionPlugin.java:460)
            at com.floyd.bukkit.petition.PetitionPlugin.onCommand(PetitionPlugin.java:113)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
  31. Offline


    @xZise: you don't need the '#' on the petition ID when putting in /pe commands :)

    Still it should probably be caught and handled.

Share This Page