[INACTIVE][ADMN/GEN] Vote v2.0 - The extensive voting plugin [232]

Discussion in 'Inactive/Unsupported Plugins' started by 8e8, Jan 28, 2011.

  1. Offline

    8e8

    Vote - The extensive voting plugin
    v2.0 [232]
    Updated: 2/6/2011 4:04pm EST

    Download - Donate
    Previous: v1.0.5 [186], v1.0.4 [168], v1.0.3 [162], v1.0.2 [162], v1.0.1 [162], v1.0 [162]

    Vote is exactly what you'd expect: a voting plugin. It's general usage makes it excellent for any server admin. It can be used to run a command if the majority of players agree to the vote, or just gather input. In order to run a command after the vote you must have the plugin supporting the command, the player starting the vote must have access to it, and the player must be ingame. Vote is still in production, but has the majority of planned features already implemented.

    NOTE: Vanilla server commands and commands from plugins which do not use the onCommand standard will not work. If your command does not run at the end of a successful vote, this is why.

    Planned Features/Changes (suggestions are welcome):
    • Allow for multiple vote responses
    • Support multiple votes at once
    • Add support for Bukkit's Groups/Permissions when it's ready
    • Remove support for Nijikokun's Permissions and default authentification
    • Switch to yaml configuration
    Command Usage (open)

    Supported tags
    Code:
    vote|vo, start|s, cancel|c, reconfig|r, yes|y, no|n, x
    Reload configuration and white/blacklists
    Code:
    /vote reconfig
    List votes in progress
    Code:
    /vote
    List options for particular vote
    Code:
    /vote #
    When starting a new vote you can override the default yes/no options by applying your own separated by ':'. The same goes for running a command when the option wins the vote. If you don't want a command to run for a particular option just leave it blank and add another ':'. See below for examples.
    Code:
    /vote start (time) question(&&option 1:option 2:option 3&&commandOn1::commandOn3)
    
    There's no limit to how many options you can have per vote, but do be gentle.
    Vote Examples (open)

    Create a simple yes/no vote
    Code:
    /vote start To be or not to be?
    
    Create a simple yes/no vote with command on success
    Code:
    /vote start To be or not to be?&&god
    
    Create a vote with a custom run time
    Code:
    /vote start 15 To be or not to be?&&god
    
    Create a vote with custom options
    Code:
    /vote start To be or not to be?&&To be:Or not:That is the question
    
    Create a vote with custom options and commands
    Code:
    /vote start To be or not to be?&&To be:Or not:NOT&&god::kick player
    

    Voting (open)

    If there is one vote in progress
    Code:
    # Will only work if using a default vote
    /vote yes
    /vote no
    # Remove your vote
    /vote x
    If there is multiple
    Code:
    # Will only work if using a default vote
    /vote # yes
    /vote # no
    Ex. /vote 1 yes
    # Remove your vote
    /vote # x
    Ex. /vote 1 x

    Cancel Vote (open)

    If there is one vote in progress
    Code:
    /vote cancel
    
    If multiple
    Code:
    /vote # cancel
    Ex. /vote 1 cancel
    


    Configuration (open)

    Code:
    # Use Nijikokun's Permissions?
     usePermissions: false
     # Log commands?
     useLogger: false
     # The default length of a vote if none is specified
     defaultLength: 30
     # Do we show each player's vote when they cast it?
     showVotes: true
     # Do we show the vote's tally after each vote?
     showTally: false
     # Can players change their vote?
     allowReVote: false
     # Can players remove their vote?
     allowRemoveVote: false
     # End the vote when everyone has voted?
     allVoted: true
     
    To add permissions (Default):
    Code:
    #Vote/authorized.users
    Insert,Player,Names,Like,So,caseinsensitive
    To add permissions (Nijikokun's Permissions):
    Code:
    #Permissions/config.yml
    permissions:
        - 'vote.start'
        - 'vote.cancel'
        - 'vote.reconfig'
        - 'vote.vote'
    

    Changelog (open)

    v2.0
    v1.0.5

    v1.0.4
    v1.0.3
    v1.0.2
    v1.0.1
    v1.0
     
  2. Offline

    Riot

    I approve of this thread. This can be very useful implemented with Towny to start a war or not. I can find a few useful applications for this. Why Don't you post a list of applications (like applicable not applications you download from say the App Store) to show why everyone should obtain this plugin.
     
  3. Offline

    8e8

    Thanks for the support! I added a couple more basic examples to the post. Also, just updated it to fix 2 small issues. One being a check missing to load Permissions, and the other to enable the reconfig command. I forgot to upload that build when I originally posted.

    Everything should work like a charm now.
     
  4. Offline

    Seta

    Like it thx! Really wanted something like this!
     
  5. Offline

    flaaghara

    When people vote, the Yes's and No's stay the same (0)
     
  6. Offline

    Bauer

    Goddammit, beat me to it.

    I've been working on a plugin like this for a few days.
     
  7. Offline

    8e8

    Doh. I changed the way the votes were sent and forgot to correct it in the tally function. It was an easy fix, and a stupid mistake. Sorry about that. The plugin should be in full working order now.

    @Bauer, sorry mate. You could always give suggestions to improve mine ;]
     
  8. Offline

    majorcyto

    Hey 8e8 thanks again for making this plugin for me, i was wondering if you could change something though. I use Voxel Sniper the editing tool and one of its main commands is /v and now i cant use it because you can also do /v yes with vote so there conflicting.

    Is there anything you can do for me?
     
  9. Offline

    8e8

    I requested that the developer of VoxelSniper use /vs as a prefix for his commands. If he doesn't change it, IDK. I'm not going to take out the /v shortform.
     
  10. Offline

    flaaghara

    Hey, the last fix worked as the Yes's and No's now display, but when two people press Yes, it goes to three, and then when three people press Yes, the total goes to 6? Also the command at the end doesn't work. I followed the exact example
    Code:
    /vote start 30 Switch to daylight? /time day
     
  11. Offline

    8e8

    This is why I'm glad people are testing it. I know exactly what you're talking about without even looking at my code. Another stupid mistake. I forgot to reset the tally everytime it checks the total. Not too sure about the command not working though. I'll have to take a look at that one since it worked when I tested it. I'll respond back shortly once I've looked into that and tested the update. Thanks again for reporting that.
    --- merged: Jan 29, 2011 6:49 AM ---
    Fixed, and updated. There doesn't seem to be anything wrong with running the command on vote success. Check to make sure that your server even supports that command, that the player can use that command, and that they haven't left before the vote ends. The performCommand function works as if the player typed it in themselves.
     
  12. Offline

    GmK

    I can confirm that it doesnt do the command. I as admin can do /time day just fine, but if I put it in a vote it doesnt happen :/

    No debug info as well, sorry.
     
  13. Offline

    flaaghara

    The newest Download still has Vote 1.0.2 even though the file name is Vote 1.0.3.
    Code:
    [INFO] [Vote] version [1.0.2] is loaded!
     
  14. Offline

    Lolmewn Retired Staff

    It seems timeing the voting doesn't work, I typed /vote start 30 Daytime? /time day
    And it is still voting... Can you maybe fix?
    And BTW, I love your plugin =D

    Edit: This is my console, didn't even see this error:
    Code:
    2011-01-29 22:09:29 [INFO] [Vote] (Question: Night? )(Result: /time night ) was started by Lolmewn
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.bukkit.entity.Player.performCommand(Ljava/lang/String;)Z
            at com.eighty8.bukkit.vote.VoteEvent$1.actionPerformed(VoteEvent.java:30)
            at javax.swing.Timer.fireActionPerformed(Unknown Source)
            at javax.swing.Timer$DoPostEvent.run(Unknown Source)
            at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
     
  15. Offline

    majorcyto

    Doesnt look like voxel is going to budge, dont remove it completely but instead have a config option to disable the quick commands? That way people who have conflicting plugins can still use this, and people who dont can still use the shortcut!

    Please :]
     
  16. Offline

    8e8

    Craftbukkit just got updated and it broke the performCommand method. I haven't yet updated it to address this, but I will soon.

    @GmK I don't quite understand why you can't do the commands. I haven't had any trouble with it.
    @flaaghara It's v1.0.3, but I forgot to update that in the plugin.yml
    @majorcyto I guess I can include the option since the Voxel crew won't smarten up.
    --- merged: Jan 30, 2011 12:38 AM ---
    Oh shoot I totally forgot! The reason the commands weren't working is because the developers of those plugins are using the deprecated method for registering the commands. They MUST start using onCommand (rather than onPlayerCommand) to work properly. It's the standard of bukkit, so make sure you let them know to change that.

    Any plugin using onCommand to register it's commands will work fine with this plugin. I'm writing this prematurely, as the recent update that broke performCommand might allow for onPlayerCommand to work.
     
  17. Offline

    majorcyto

    Yay i would appreciate it considering im the one that requested this plugin >.>
     
  18. Offline

    8e8

    You weren't the only one, and on top of that I didn't make it for you lol.
    --- merged: Jan 30, 2011 7:21 AM ---
    Updated to work with #168
     
  19. Offline

    Lolmewn Retired Staff

    Gonna test now =D
     
  20. Offline

    8e8

    Updated to work with craftbukkit #186
     
  21. Offline

    niftyapple

    I think you should finish yours then we will have a VOTE-off [​IMG]
     
  22. Offline

    majorcyto

    Hello 8e8, on craftbukkit version 210 after you run 1 vote it messes up afterwards. It will not allow you to run another vote, and says "you do not have permission to use this command" even though i obviously do because i ran a vote earlier...
     
  23. Offline

    8e8

    I've noticed this too, however it only says it when you've tried to run a vote WHILE one is already in progress. To be honest.. I have NO clue why it keeps saying unauthorized. It completely skips the authorization process and returns false when you do this. I really am stumped about what happened, but once I finish updating Reserved I'll be looking into the problem more thoroughly.
     
  24. Offline

    majorcyto

    Well the votes end after the timer is up then it still says that. Its like they never end, but it said it ended :confused:..
    --- merged: Feb 4, 2011 6:22 AM ---
    Also it appears the timer gets off then it decides to never end, and i can cancel the vote then add a new one but then that one never ends >_>

    Also due to recent changes it will now longer show a vote like for instance.. "/vo start 30 this is a test vote" will show up as "this" unless you do "this_is_a_test_vote" its not registering spaced <_<
     
  25. Offline

    8e8

    It's due to changes in craftbukkit. You need to make sure you're using the right version for the plugin. I'm working on updating it for the newer/est version of craftbukkit so it should be fine... Once I figure out what the heck is causing the unauthorized message to show up when it shouldn't (something I've noticed is also due to a craftbukkit update).
    --- merged: Feb 6, 2011 1:26 AM ---
    I've just about redone the whole dang plugin. Everything on the features list (besides Bukkit Permissions) is now added. I'm just about finished updating it, and then I'll have to test it out. I set it up to work like so:

    Starting a vote:
    Code:
    /vote start Question?||option 1:option 2:etc||/cmd2run4 option 1:/cmd2run4 option 2:/etc
    
    If you want a simple y/n vote then leave the options blank
    Code:
    /vote start Question?||||/cmd on success:/cmd on fail
    
    You can also leave the command for an option blank if you don't want one for that option
    Code:
    /vote start Question?||option 1:option 2:option 3||/cmd2run4 option 1::/cmd2run4 option 3
    
    There's no limit to how many options each vote can have, but try to be merciful.

    Voting:
    If there's only one vote in progress you can use y/n

    Code:
    /vote yes
    
    
    ... Alternatively
    Code:
    /vote 1 yes
    
    
    If there's more than one vote and choices you would do this:

    Code:
    /vote 1 2
    
    
    1 = voteId, 2 = choices

    When a vote is created it's ID is displayed, along with the choices and their IDs
    If you want to get a list of the votes in progress type /vote
    If you want to see what the choices are for the vote type /vote id (ie. /vote 1)

    I'll document this a lot more, with examples, to make sure it's clear how the system works. Looking forward to hearing some feedback!
     
  26. Offline

    majorcyto

    Is this new version available for download already? or it will be soon?
     
  27. Offline

    8e8

    I'm still doing some testing and working out bugs. It will be available soon. I also changed the separator symbol from || to && since it wouldn't split properly for some reason. It seems more fitting anyway. I'm currently doing some testing, and will start the documentation as soon as I finish. Then you should see a release. It could be maybe an hour or 2 before then?
    --- merged: Feb 6, 2011 9:11 PM ---
    Updated! Multi-votes/options/commands added! I did a somewhat half-assed job of documenting it, but if there's any questions feel free to ask.
     
  28. Offline

    CaptainDDL

    Would it be possible to have a list of plugins that can only be run via voting? I don't want to give all users access to /time, but I would be OK with the online users being able to vote on it.
     
  29. Offline

    Zinth

    Thanks for keeping this Plugin going I was tired of my members always asking me "Day P" and so I switched to this so they can make it day if everyone wants it to be day, which about half do and half don't so it works for us.
     
  30. Offline

    PacketCollision

    When trying to load this plugin for the first time (using the latest recommended craftbukkit version, 493), I got this error:
    Code:
    10:49:38 [SEVERE] Could not load plugins/Vote.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:80)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:59)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NoSuchMethodException: com.eighty8.bukkit.vote.Vote.<init>()
            at java.lang.Class.getConstructor0(Class.java:2723)
            at java.lang.Class.getConstructor(Class.java:1674)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
            ... 8 more
    
     

Share This Page