The creator of these plugins has not shown activity in a while. Posting in this board may not result in a fast reply or a reply at all. [ Read the full Support Disclaimer here ]

Pages: 1 2 3 [4] 5   Go Down
  Print  
Author Topic: Voting Plugin  (Read 14962 times) Bookmark and Share
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #45 on: January 24, 2010, 05:19:34 AM »

@Ismael
Yep I got still the same problem.
Logged

JoinMyServer.com
Call of Duty 4 Game Servers

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #46 on: February 10, 2010, 11:04:35 AM »

The problem is still NOT solved with this vote plugin!  :'(

I'm waiting about almost 3 months!  Shocked

Quote
From: Bakes
December 27, 2009, 05:57:24 AM
I'm writing my own mapvote plugin at the moment, which works differently. Should be done tonight, I'm writing it around that bug.
Undecided
« Last Edit: February 10, 2010, 11:09:00 AM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1225
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #47 on: February 10, 2010, 01:29:26 PM »

Fine, have this. It should still be regarded as a beta, I haven't looked at it for a while and certainly haven't bugtested it much. Config options should be pretty obvious.

Usage: player types 'rtv' (note, not a bot command), once enough players have said 'rtv' a vote is started with four random maps contained in maps.txt, the map gets rotated onto the map with the plurality. Hopefully it will work for you, I haven't edited the plugin since the 20th December. You might need to do a few modifications.

It is licensed under the GPLv2.

rtv.py
Code: python

__version__ = '1.0'
__author__  = 'Bakes'

import b3, re
import b3.events
import threading
import random
import time
#--------------------------------------------------------------------------------------------------
class RtvPlugin(b3.plugin.Plugin):
   _adminPlugin = None
   _voteActive = False
   _voteLastActive = None
   activeclients = {}
   voteallowed = True
   maps = []
   randomizedmaps = {}
   votedclients = {}

   def onStartup(self):
     self.registerEvent(b3.events.EVT_CLIENT_SAY)
     self.registerEvent(b3.events.EVT_GAME_ROUND_START)
     """\
     Initialize plugin settings
     """
     file = open(self.config.get('settings', 'maplist'), 'r')
     for line in file:
       self.maps.append(line)

  # get the admin plugin so we can register commands
     self._adminPlugin = self.console.getPlugin('admin')
     if not self._adminPlugin:
     # something is wrong, can't start without admin plugin
       self.error('Could not find admin plugin')
       return False
   
     self.debug('Started')


   def onEvent(self, event):
       if event.type == b3.events.EVT_CLIENT_SAY:
          self.debug(self._adminPlugin.parseUserCmd(event.data)[0])
          if self._adminPlugin.parseUserCmd(event.data)[0].startswith('rtv'):
            if event.client.maxLevel > self.config.getint('settings', 'minlevel'):
             
             if self.voteallowed:
              try:
               failed = True
               self.debug('failed set to false')
               if not self.activeclients[event.client.id]:
                 self.debug('This was not meant to happen')
              except KeyError:
                 self.debug('failed set to true')
                 failed = False
              if failed == False:
                self.debug('Rocking the Vote?')
                self.rockthevote(event.client, event.data)
              else:
                 event.client.message('You have already voted')
                 return False
          else:
              event.client.message('You do not have permission to use rockthevote')
       elif event.type == b3.events.EVT_GAME_ROUND_START:
          self.debug('Round Started')
   def allowvote(self):
       self.voteallowed = True

   def rockthevote(self, client, data):
       if not self._voteActive:
         self.activeclients[client.id] = True
         if (float(len(self.activeclients))/float(len(self.console.clients.getList()))) > float(self.config.getint('settings', 'rtv_threshold_percent')/100):
            self.console.say('The vote is being rocked!')
            self.activeclients = {}
            self.randomizedmaps = {}
            random.shuffle(self.maps)
            i = 0
            for map in self.maps:
              map = map.strip()
              if i > 4:
                break
              else:
                self.randomizedmaps[map] = 0
              i = i + 1
            self.console.say('Vote for a new map! The choices are:')
            for map in self.randomizedmaps:
               self.console.say('^1'+map)
            self._voteActive = True
            timer = threading.Timer(self.config.getint('settings', 'time_to_vote'), self.activatemap)
            timer.start()
            self.console.say('Please type ^1rtv ^2mapname ^7to vote for a new map! You have %s seconds' % self.config.get('settings', 'time_to_vote'))
       else:
         self.activeclients[client.id] = True
         mapname = self._adminPlugin.parseUserCmd(data)[1]
         if not mapname:
            client.message('You must specify a mapname when voting!')
         else:
            try:
             self.debug(mapname)
             if self.randomizedmaps[mapname]:
                self.debug('Client entered an acceptable map')
            except KeyError:
             #else:  
              string = ''
              client.message('You must select a valid map, the options are:')
              for map in self.randomizedmaps:
                 string = string+map+', '
              client.message(string)
              return False
            self.randomizedmaps[mapname] = self.randomizedmaps[mapname] + 1
            client.message('Your vote was ^2successful')
   def activatemap(self):
       self.debug('map activating')
       best = 0
       bestmap = None
       for map in self.randomizedmaps:
          if self.randomizedmaps[map] > best:
              best = self.randomizedmaps[map]
              bestmap = map
       self._voteActive = False
       self.activeclients = {}
       if best > 0:
         self.console.say('New map has been selected! Rotating to %s' % bestmap)
         time.sleep(3)
         self.console.write('map %s' % bestmap)
         self.debug('Map Change, so setting vote allowed false until map has been played for a bit')
         self.voteallowed = False
         t = threading.Timer(self.config.getint('settings','time_before_rtv'), self.allowvote)
         t.start()
       else:
         self.console.say('Noone voted!')
         self._voteActive = False

plugin_rtv.xml
Code: xml

 
   b3/extplugins/conf/maplist.txt
   15
   15
   1
   50
 



maplist.txt
Code:
mp_crash
mp_strike
mp_backlot
mp_bog
mp_crossfire
mp_crash_snow
mp_showdown

A small tip for you, demanding will get you nowhere in life. Developers may work hard to improve your experience, but it should not be demanded of us. We don't get anything out of b3 except for satisfaction, we have no salary, we get no money, and for myself at least, b3 is a big timesink (strange as it may seem, I don't run any gameservers, so get absolutely nothing out of b3), we have other things to do. I have been working flat out since the beginning of January, I assume Ismael has also had too much time to do any b3 work.
Sorry that it's a bit late (it's actually only two months, not three), but you shouldn't expect anything of me, even if I do give a deadline, because I only do b3 when I want to work on improving my python.
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #48 on: February 19, 2010, 07:55:17 AM »

Thank you very much!  Grin I will test it...

Sorry to be so blunt, that was not my intention. I know you work hard for it and B3 is just a hobby for you all Wink Forgive me  :'(


EDIT:
Indeed its a Beta version, this equal to !map, so without any voting possibility. I think I need to wait a little bit longer untill you finished it...
« Last Edit: February 19, 2010, 08:52:49 AM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
Posts: 40
Offline Offline
« Reply #49 on: March 08, 2010, 09:17:14 AM »

Hey,

there is a some trouble if u have some similar map names.

i.e. u have in the maplist
Code:
mp_tojane
mp_tojane_night

so u cant call a vote for mp_tojane. U will get the message: "More than one map matches the name, be more specific"

I found the source, but I dont know how to fix it. Line 315-321
Code:
for map in self._mapList:
if s in map:
self._map  = map
if matched:
client.message('^7More than one map matches the name, be more specific')
return False
matched = True
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #50 on: March 31, 2010, 11:50:40 AM »

Is there some news about a good/working vote plugin? Or need I to go to manuadmin?
Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
OS: Windows
Type: Renting Server with B3
Gameservers: BFBC2
Posts: 21
Offline Offline
« Reply #51 on: June 13, 2010, 01:30:52 PM »

Is this working for bfbc2? I think I saw it in game...anyone suggestions?
Logged
Jr. Member
**
OS: Windows
Type: Renting Server with B3
Gameservers: BFBC2
Posts: 21
Offline Offline
« Reply #52 on: June 15, 2010, 10:51:32 AM »

This plugin works in bfbc2, i am just not sure how to populate the "maplist.txt" with bfbc2 maps...therefore the vote map feature is not working.
Logged
Jr. Member
**
OS: Windows
Type: Renting Server with B3
Gameservers: BC2
Posts: 44
Offline Offline
« Reply #53 on: July 07, 2010, 11:29:15 AM »

Something seems to be acting oddly. 2 people voted to kick someone and he was kicked for the server, but I thought I had set it much higher (to require at least 12 votes.) What did I do wrong?


These are my settings:
<configuration plugin="votekick">
   <settings name="settings">
      <set name="min_level_vote">0</set>
      
      <set name="vote_times">5</set>
      <set name="vote_interval">3</set>
   </settings>
   
   <settings name="votekick">
      <set name="min_level_kick">0</set>
      
      <set name="tempban_minvotes">12</set>
      <set name="tempban_interval">5</set>
      <set name="tempban_percent">60</set>
   </settings>   
   
   <settings name="votemap">
      <set name="min_level_map">2</set>      
      <set name="mapfile">@b3/extplugins/conf/maplist.txt</set>
   </settings>
</configuration>

Logged
Sr. Member
****
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 179
Offline Offline
WWW
« Reply #54 on: July 07, 2010, 12:00:44 PM »

if 2 poeple vote yes kick and 1 person votes no stay the person will get kicked.
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 21
Offline Offline
WWW
« Reply #55 on: November 19, 2010, 03:44:46 PM »

I just get the error "A vote is already in progress"...


Found an error:
Code:
101119 23:30:39 ERROR Error executing crontab <bound method VotingPlugin.end_vote of <voting.VotingPlugin instance at 0x8a077ec>>: float division
[('/home/b3isnipe/b3/b3/b3/cron.py', 270, 'run', 'c.run()'), ('/home/b3isnipe/b3/b3/b3/cron.py', 64, 'run', 'self.command()'), ('/home/b3isnipe/b3/b3/b3/extplugins/voting.py', 171, 'end_vote', 'self._currentVote.end_vote_yes(self._yes,  self._no)'), ('/home/b3isnipe/b3/b3/b3/extplugins/voting.py', 271, 'end_vote_yes', 'if self._tempban_interval and (yes*100.0 / no) > self._tempban_percent and yes > self._tempban_minvotes:')]
« Last Edit: November 19, 2010, 03:49:39 PM by Blueeyes » Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #56 on: December 15, 2010, 10:23:31 AM »

I just get the error "A vote is already in progress"...


Found an error:
Code:
101119 23:30:39 ERROR Error executing crontab <bound method VotingPlugin.end_vote of <voting.VotingPlugin instance at 0x8a077ec>>: float division
[('/home/b3isnipe/b3/b3/b3/cron.py', 270, 'run', 'c.run()'), ('/home/b3isnipe/b3/b3/b3/cron.py', 64, 'run', 'self.command()'), ('/home/b3isnipe/b3/b3/b3/extplugins/voting.py', 171, 'end_vote', 'self._currentVote.end_vote_yes(self._yes,  self._no)'), ('/home/b3isnipe/b3/b3/b3/extplugins/voting.py', 271, 'end_vote_yes', 'if self._tempban_interval and (yes*100.0 / no) > self._tempban_percent and yes > self._tempban_minvotes:')]

Me too, still the same problems...
Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #57 on: January 11, 2011, 09:55:37 AM »

Found a bug:

voting.py
Find:
Code: python
if s is map:
replace to
Code: python
if s == map:
.
Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #58 on: January 14, 2011, 03:13:49 PM »

Since this plugin has not shown any activity in a while and it still got some bugs and features missing. I refer you to my own remake of this plugin, you can find it here!!

All the bugs mentioned above are fixed in my version 1.7.
« Last Edit: January 17, 2011, 12:42:46 PM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: MW2 (aIW)
Posts: 187
Offline Offline
WWW
« Reply #59 on: February 03, 2011, 08:11:32 PM »

I can´t get to work the plugin. The package I downloaded ( danger89) has a "plugins" folder and a "conf" folder,  plugins/voting.py conf/voting.xml, conf/gametypelist.txt, and conf/maplist.txt

There goes the initial dobut...I have B3 1.4.1 and no "plugins" folder but a "extplugins" folder, so I put the voting.py there. Inside the extplugins folder I have a conf folder, then I put ther the voting.xml,the gametypelist.txt and maplist.txt (maps for CoD6). In the b3.xml I set a line <plugin name="voting" priority="14" config="@b3/extplugins /conf/voting.xml"/>.
The result is that I have gotten to get the plugin loads, but when I try to start a vote ( !votemap or !vm) and other commands, iB3 says "invalid parameters".


May someone that got this plugin working for CoD help me please? I don´t know what to do!

Thanks in advance

Logged
Tags:
Pages: 1 2 3 [4] 5   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal