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

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

  1. Offline

    FloydATC

    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.

    Features:
    • 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
    Code:
    /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)
    Settings
    The configuration file is optional, the following settings are available:
    Code:
    single=Petition
    plural=Petitions
    notify-all-on-close=false
    notify-owner-on-assign=true
    notify-owner-on-unassign=true
    notify-interval-seconds=300
    warp-requires-permission=false
    Command examples
    A player in distress:
    Code:
    /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:
    Code:
    /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.

    Changelog:
    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.

    Dependencies:
    • Requires the Permissions plugin (2.6 or equivalent required) Use other versions or compatible plugins at own risk.
    Permissions
    • '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

    TOAST7312

    A note should be made to state that one needs to create a 'settings.txt' file under the "plugins/PetitionPlugin" folder.

    I received an error upon startup of my server stating there was was no settings.txt file. I went to see if it perhaps had created the file, but it hadn't so I created a file to that effect. Upon next startup there was no error. The plugin still seems to be working, however, so it's not a huge issue. If I find any other problems regarding this issue I will post here.
     
  3. Offline

    FloydATC

    Note added. As you point out, the error is completely harmless, the plugin just uses default values if the file isn't present.
     
  4. Offline

    Arisilde

    Can you make the plugin crate the folder/file itself like some other plugins do?

    Also, for some reason petitions don't stop showing up with /pe list even after I /pe close them.
     
  5. Offline

    FloydATC

    I assume you mean they DO show up even after you close them. Did you create the "archive" subfolder?

    The plugin really should take care of creating those subfolders and stuff if they don't exist, I know. A future version will, I promise... At some point I'll be spending more time helping ppl with this, than it would take to just fix it :eek:
     
  6. Offline

    Arisilde

    No, i didn't make an archive folder, lol. Where did it say to do that? Do i put that in the Petition folder, and is the A capitol or lowercase?
     
  7. Offline

    Runelynx

    Hmmm everything works except closing a ticket. It gives me the confirm, and the requestor... but the tickets still show up in /pe list.
    --- merged: Jan 30, 2011 1:20 PM ---
    Nevermind, created archive folder inside PetitionPlugin and now they close properly.
    You should put install instructions in OP :)
     
  8. Offline

    Xemnas33

    How to install

    1. Download http://minecraft.atc.no/plugins/PetitionPlugin.jar
    2. Copy it to your "plugins" directory
    3. Create a new directory called "plugins/PetitionPlugin"
    4. Create a new directory called "plugins/PetitionPlugin/archive"
    5. Optionally create a new file "plugins/PetitionPlugin/settings.txt"
    6. Load the plugin by restarting your server.
    I think there already is install instructions.
     
  9. Offline

    FloydATC

    Version 1.08 released, this one will automaticaly create the necessary directories and files if they do not exist already.

    I've also reorganized the OP slightly in the hope that it will be easier to read.
     
  10. Offline

    Kainzo

    Is this working with the new commands and permissions? Just making sure because im about to go through an update en-mass all my plugins.
     
  11. Offline

    FloydATC

    No, not yet. Sorry.

    I hope to get a chance to look at both tonight, my concern is that the new command interface may cause a problem. My understanding is that it requires that all commands be declared in the "plugin.yml" manifest included in the .jar file. This is kind of hard to combine with the current "command=" and "commandalias=" settings so unless I can come up with a clever idea those custom commands may be difficult to support. The default commands (/petition and /pe) shouldn't be a problem ofcourse.
     
  12. Offline

    Kainzo

    honestly - i like the configurable /petition - but at the same time - /petition is just fine for me heh :p
     
  13. Offline

    FloydATC

    After reading up on the onCommand subject it seems the proper way is to just use hard-coded commands and then rely on Bukkit's (yet to be implemented) alias system if you want to tweak things. But then it dawned on me that onCommand lives in the plugin class, not the PlayerListener class. This means it'll take a little more thinking since it basically obsoletes the entire listener for this particular plugin. That, along with the new permission model which seems more than just a little awkward means I need more time. This is starting to get over my head :-/
    --- merged: Feb 5, 2011 4:46 PM ---
    Minor update: v1.10 fixes a couple of minor cosmetic issues and adds a small suffix to each petition header showing the number of events logged. Built-in permissions and onCommand are not yet in place.
     
  14. Offline

    Kainzo

    The command /pe warp # is broken with 264+ (the netherworld change) you'll need to specify where the petition is saving the locations and what world it is saving. Everything else works fine. Just wanted to pass this along.
     
  15. Offline

    FloydATC

    Just as I expected. I just need to get around to figuring out the proper way to do it and I'll post an update. Question: Does it work for warps from and to the "old" world or is it *completely* broken at the moment?
     
  16. Offline

    Kainzo

    It feels completely broken atm. I do know that myWarps is the only 'warps' that works - SimpleWarp also broke. I believe you have to indicate which world you're warping to - or just 'place' the player somewhere - im not entirely sure, it may have something to do if you choose to preload chunks or not before sending the player there? uncertain.
     
  17. Offline

    FloydATC

    I have posted an update, v1.11 v1.12, which adds experimental support for multiple worlds. It should will fall back to using the first world if the ID name is unknown or missing, this means existing petitions should work as expected. I have not had a chance to test this on a server with multiple worlds so I would love some feedback from someone who has one.

    :)
     
  18. Offline

    Kainzo

    Heres a cool thing - have a /pe list online - option that ONLY lists the petitions for you from people who are ONLINE.

    Also - I will test 1.12 later.
     
  19. Offline

    Naphtaline

    Hello !

    Your permissions looks strange

    I think it should be better like that :
    "petition.use" -> use petition
    "petition.moderate" -> moderate petition

    Then "petition.*" would let user to use and moderate petition.
     
  20. Offline

    Kainzo

    I can see this as being a problem - but it works - so why change it? ;p
     
  21. Offline

    Xemnas33

    I prefer the pe list to show offline and online ones as it displays the status of the person so unless it can be done without them you can just move on to the next and come back later.
     
  22. Offline

    FloydATC

    The idea is for "/pe list" to accept optional switches. I consider adding such switches to show "online", "offline", "assigned to me" and "unassigned" tickets. The default will still be to show all of them. I also consider adding support for different sort orders but my Java-Fu isn't quite strong enough and I have limited time. Stay tuned for updates though :)
     
  23. Offline

    Kainzo

    This still seems broken on 322 (and 300+) - I try to warp and all it says is "Teleporting you to where the petition was opened"
     
  24. Offline

    Daveyo

    is that he only function broken?
     
  25. Offline

    Xemnas33

    I believe so
     
  26. Offline

    FloydATC

    This is so strange... it works for me and I'm running 0.0.0-404-g51fc7b4-b322

    Update: Are you sure you're running v1.12? v1.10 is not properly world-aware so it will crash on recent Craftbukkit builds. The experimental v1.11 used ID instead of the world name, which turned out to be a bad idea. Old petitions (with no 'world' property) will default to the world named "world"; if this is not found then I think those old petitions will break.

    If we still can't figure this out, I'll have a look at adding some debug code you can enable in the config file.
     
  27. Offline

    Kainzo

    I'm updating this to 1.12 now and testing with 328 - I will let you know of any issues in just a moment
     
  28. Offline

    Xemnas33

    Works fine for me now I just missed out on the update =/
    Really need bukkit to get auto updates sooner!
     
  29. Offline

    Kainzo

    It works fine on 2.12
     
  30. Offline

    INemesisI

    its not working with permission for me, added petition to default group, but nothing happens when they type /pe
    admins which have '*' can use it ...
    have newes bukkit and permissions version ...
     
  31. Offline

    FloydATC

    Heads up, I just posted a major update to v1.20, here are the most important changes:
    1. Rewrote to use onCommand() instead of the deprecated onPlayerCommand() callback to integrate properly with Fill when it comes along. Unfortunately, this deprecates the "command" and "commandalias" settings, you will have to rely upon Craftbukkit command aliases when they become available. In the mean time, you will have to stick with the "/petition" command or use the standard alias "/pe". Sorry. When loading an old settings file, the plugin will warn about this in the server log.
    2. Rewrote the command parser for more efficient permission checking and easier debugging. In the process, I fixed a long standing bug where anyone could warp to other people's open tickets.
    3. Changed the plugin namespace as demanded by the Bukkit team. This should be a completely transparent change but it is required for newer builds of Craftbukkit. Previous versions of the plugin will no longer work.
    4. The plugin will now accept "/pe create" or "/pe new" as aliases for "/pe open"
    5. The plugin will now accept "/pe goto" as an alias for "/pe warp"
    6. Some minor improvements to logging; many messages were missing the [Pe] prefix and denied access to subcommands/tickets is now logged.
    --- merged: Feb 19, 2011 3:58 PM ---
    Please try updating to v1.20, this may be the namespace/security issue hurting you if you recently updated your Craftbukkit. Let me know if this solves the problem please.
     

Share This Page