Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Voting Plugin (by danger89)  (Read 39876 times)

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Voting Plugin (by danger89)
« Reply #75 on: August 14, 2012, 08:19:02 PM »
Again, it say a vote is already in progress, but there's no vote! I need to restart B3 every time.
The plugin dev (danger89) will:

Edit:
You can always share the b3.log file with us, please set in the b3.xml the log level on 9 just for debugging.

Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline ruggio95

  • Jr. Member
  • **
  • Posts: 14
Re: Voting Plugin (by danger89)
« Reply #76 on: August 14, 2012, 11:42:33 PM »
The b3.log is too large (5,07 MB), so i attached it in this reply.

[attachment deleted by admin]

Offline Canta

  • Jr. Member
  • **
  • Posts: 15
Re: Voting Plugin (by danger89)
« Reply #77 on: January 23, 2013, 11:15:02 AM »
Does not work with B3 v1.9.0
Can you update the plugin?
thanks

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Voting Plugin (by danger89)
« Reply #78 on: January 23, 2013, 03:01:17 PM »
Does not work with B3 v1.9.0
Can you update the plugin?
thanks

you might want to post a b3.log showing what doesn't work with 1.9
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Canta

  • Jr. Member
  • **
  • Posts: 15
Re: Voting Plugin (by danger89)
« Reply #79 on: January 23, 2013, 06:12:45 PM »
This is what the log says:

  • 130123 10:47:57   BOT       'Starting Plugin voting'
    130123 10:47:57   DEBUG   'AdminPlugin: Command "voteyes (vy)" registered with cmd_voteyes for level (1, 100)'
    130123 10:47:57   DEBUG   'AdminPlugin: Command "voteno (vn)" registered with cmd_voteno for level (1, 100)'
    130123 10:47:57   ERROR   'Could not start plugin voting'
    Traceback (most recent call last):
      File "b3\parser.pyo", line 787, in startPlugins
      File "b3\parser.pyo", line 770, in start_plugin
      File "b3\plugin.pyo", line 149, in onStartup
      File "C:\Users\fut\Desktop\b3_nuevo1\b3_reig\extplugins\voting.py", line 109, in startup
    UnboundLocalError: local variable 'modLevel' referenced before assignment

Just load voteyes (v) and voteno (vn) the other commands not loaded.
On other servers I have it with B3 1.8.2. works perfect.

Offline Weedy

  • Newbie
  • *
  • Posts: 4
Re: Voting Plugin (by danger89)
« Reply #80 on: February 03, 2013, 01:12:50 PM »
This is what the log says:

  • 130123 10:47:57   BOT       'Starting Plugin voting'
    130123 10:47:57   DEBUG   'AdminPlugin: Command "voteyes (vy)" registered with cmd_voteyes for level (1, 100)'
    130123 10:47:57   DEBUG   'AdminPlugin: Command "voteno (vn)" registered with cmd_voteno for level (1, 100)'
    130123 10:47:57   ERROR   'Could not start plugin voting'
    Traceback (most recent call last):
      File "b3\parser.pyo", line 787, in startPlugins
      File "b3\parser.pyo", line 770, in start_plugin
      File "b3\plugin.pyo", line 149, in onStartup
      File "C:\Users\fut\Desktop\b3_nuevo1\b3_reig\extplugins\voting.py", line 109, in startup
    UnboundLocalError: local variable 'modLevel' referenced before assignment

Just load voteyes (v) and voteno (vn) the other commands not loaded.
On other servers I have it with B3 1.8.2. works perfect.


Hello thar,

I had this very same problem. It's a bug made visible by the incompatibility to the change of group level declaration. While it was only possible to use numbers before, you can use keywords like mod or admin now. This might fix the bug:

In the voting.py, change the lines 97 -  104 to:

Code: [Select]
        try:
            minLevel_vote = self._adminPlugin.getGroupLevel(self.config.get('settings', 'min_level_vote'))
        except:
            minLevel_vote = 40
        try:
            modLevel = self._adminPlugin.getGroupLevel(self._adminPlugin.config.get("settings","admins_level"))
        except:
            modLevel = 20

And change line 349 to:

Code: [Select]
self._modLevel = self._adminPlugin.getGroupLevel(self._adminPlugin.config.get("settings","admins_level"))

It could be that my lines don't perfectly fit. But you see the thing kinda.

It fixes the Bug (modLevel instead of minLevel) and fixes the incompatibility to newer B3's... but it might break compatibility to older B3's. Also I'm not sure if that's the right way to go. There might be other, more backwards compatible ways to do this.

Now that I think about it, I'll just attach the file!

Let me know if it worked. :)

[attachment deleted by admin]

Offline Canta

  • Jr. Member
  • **
  • Posts: 15
Re: Voting Plugin (by danger89)
« Reply #81 on: February 08, 2013, 11:12:00 AM »
It works!
I knew the problem was the group level, but did not know how to fix it.
thanks ;D

Offline MoDiX

  • Newbie
  • *
  • Posts: 9
Re: Voting Plugin (by danger89)
« Reply #82 on: March 19, 2013, 06:51:47 PM »
http://pastebin.com/5PnfewXj 

not sure if passwords removed , will switch later

The problem i am expiriencing is with the vote command (General)
Each time i start a vote , the vote ends 10 seconds later , and requests only 2 for each answer

how do i set the vote to last longer? (B3 1.9.0)
How do i set the vote to know how much votes are needed according to the amount of players?
How do i set for map vote so if a player types for example : !votemap Terminal or terminal or TERMINAL , so they wont have to type full map name (for skidrow it isnt mp_skidrow , how do i set it so its general name?)

Thanks :D
-MoDiX

Offline falkor

  • Jr. Member
  • **
  • Posts: 20
Re: Voting Plugin (by danger89)
« Reply #83 on: April 17, 2014, 09:58:34 PM »

Hello thar,

I had this very same problem. It's a bug made visible by the incompatibility to the change of group level declaration. While it was only possible to use numbers before, you can use keywords like mod or admin now. This might fix the bug:

In the voting.py, change the lines 97 -  104 to:

Code: [Select]
        try:
            minLevel_vote = self._adminPlugin.getGroupLevel(self.config.get('settings', 'min_level_vote'))
        except:
            minLevel_vote = 40
        try:
            modLevel = self._adminPlugin.getGroupLevel(self._adminPlugin.config.get("settings","admins_level"))
        except:
            modLevel = 20

And change line 349 to:

Code: [Select]
self._modLevel = self._adminPlugin.getGroupLevel(self._adminPlugin.config.get("settings","admins_level"))

It could be that my lines don't perfectly fit. But you see the thing kinda.

It fixes the Bug (modLevel instead of minLevel) and fixes the incompatibility to newer B3's... but it might break compatibility to older B3's. Also I'm not sure if that's the right way to go. There might be other, more backwards compatible ways to do this.

Now that I think about it, I'll just attach the file!

Let me know if it worked. :)

It does not work for me:

140417 21:54:32   ERROR   'Could not start plugin voting'
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/parser.py", line 789, in startPlugins
    start_plugin(plugin_name)
  File "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/parser.py", line 772, in start_plugin
    p.onStartup()
  File "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/plugin.py", line 149, in onStartup
    self.startup()
  File "/var/lib/b3/urt41/extplugins/voting.py", line 127, in startup
    self._votes["map"].startup(self._adminPlugin,  self.console,  self.config)
  File "/var/lib/b3/urt41/extplugins/voting.py", line 411, in startup
    f = open(self.config.getpath('votemap',  'mapfile'))
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/conf/maplist.txt'

Offline Weedy

  • Newbie
  • *
  • Posts: 4
Re: Voting Plugin (by danger89)
« Reply #84 on: May 18, 2014, 04:51:56 PM »
It does not work for me:

140417 21:54:32   ERROR   'Could not start plugin voting'
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/parser.py", line 789, in startPlugins
    start_plugin(plugin_name)
  File "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/parser.py", line 772, in start_plugin
    p.onStartup()
  File "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/plugin.py", line 149, in onStartup
    self.startup()
  File "/var/lib/b3/urt41/extplugins/voting.py", line 127, in startup
    self._votes["map"].startup(self._adminPlugin,  self.console,  self.config)
  File "/var/lib/b3/urt41/extplugins/voting.py", line 411, in startup
    f = open(self.config.getpath('votemap',  'mapfile'))
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/conf/maplist.txt'


Hey there,

your problem lies within the error: The file "/usr/local/lib/python2.6/dist-packages/b3-1.9.2-py2.6.egg/b3/conf/maplist.txt" cannot be opened.

You most probably didn't mean to specify this as your configuration for the vote plugin. Try using the full path - starting with a slash - to your voting.xml in your b3.xml!

Offline norma

  • Jr. Member
  • **
  • Posts: 14
Re: Voting Plugin (by danger89)
« Reply #85 on: September 11, 2014, 07:21:25 AM »
Hi all =).

Just one question please.

I'm using version 1.9.2 of b3. I have this plugin working great on bf3 servers, but on COD4 when a vote passes even though this is in my config file:

   <settings name="votekick">
      <set name="min_level_kick">0</set>      
      <set name="tempban_percent">75</set> <!-- minimum necessary percentage that voted in order to pass the vote -->
      <set name="tempban_duration">60</set> <!-- tempban duration in minutes -->
   </settings>   

I get this:

http://pastebin.com/raw.php?i=zpLnwMzt

no matter the number however crazy big I put for tempban_duration, only 0 minute kicks.

Please help me :D

Just one thing... because I had the problem that someone had earlier with the plugin not loading due to UnboundLocalError: local variable 'modLevel' referenced before assignment, I did in fact change the group 'name' to number instead, in the admin config. I'm guessing this has caused the problem? Please some help how to fix. I have this plugin running just fine on BF3 :|




Offline Mr.Chillax

  • Newbie
  • *
  • Posts: 1
  • Hardware and Network manager.
    • Morning Star Gaming Network
Re: Voting Plugin (by danger89)
« Reply #86 on: September 13, 2014, 07:38:44 PM »
Hi,

If you know what is causing the error Norma posted above please tell us. But I fixed the plugin today and it's working now. So there is no urgency, I just still would like to know what caused the real error.

Offline mix

  • Jr. Member
  • **
  • Posts: 21
Re: Voting Plugin (by danger89)
« Reply #87 on: December 20, 2014, 09:58:44 PM »
Maybe it was because you was alone in your server?

Code: xml [Select]
<configuration plugin="votekick">
  <settings name="settings">
  <set name="min_level_vote">0</set>

I created my own VIP group (level 2), but you can also set it to level 1 which is registered users.
can you upload it again please
the link not working now

Offline danger89

  • Full Member
  • ***
  • Posts: 129
    • JoinMyServer - Game Servers
Re: Voting Plugin (by danger89)
« Reply #88 on: February 05, 2015, 04:48:10 PM »
Hi B3 fans,

I see the plugin is still very popular. I don't have any Call of Duty server running anymore. However, as plugin developer I should maybe take some time to help you all to get this plugin compatible again.

Now, I known there is still much demand, I can see if I got time to take a look at it (I can't really promise).

Kind regards,
Melroy van den Berg
danger89 - Dangerous I
JoinMyServer.com
Call of Duty 4 Game Servers

Offline MAGIC

  • Newbie
  • *
  • Posts: 5
Re: Voting Plugin (by danger89)
« Reply #89 on: February 21, 2015, 10:28:38 PM »
The download mirror is down: http://www.2shared.com/file/ZE5V3pQ9/vote_plugin_22_by_danger89.html

Also anyone tried that plugin with BFBC2?

 


Rate this page +1 at Google Search