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!

You are here: Big Brother Bot ForumAdd-OnsPlugins DiscussionPlugin Releases! (Moderator: MordyT)Voting Plugin (by danger89)
Pages: [1] 2 3 ... 5   Go Down
  Print  
Author Topic: Voting Plugin (by danger89)  (Read 6018 times) Bookmark and Share
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« on: January 14, 2011, 03:10:57 PM »

I try to get the "Voting plugin" working of Ismael, however he didn't updated since 2009.
There where several bugs in the code and some missing vote options, so... I fixed some bugs and created some new features  Grin

The code is tested mainly with Call of Duty 4, however this plugin should also works with other games.
Please report any bug  Cheesy

Version: 2.2

Fixed / new features:
  • Fixed to accept the vote the total count of yes must be higher or equal to the minimum vote setting.
  • Bug fixed votemap.
  • Fixed minium vote for each vote type.
  • Added !votemapgametype and !votemaprotate
  • Fixed default values for more security. And level 1 instead of level 2 group in config file.
  • Both kick & tempban commands have as reason description "Voted out" and saves the caller in admin field of the database, this allows you to search to all the kick/tempban votes and to find the caller again.
  • Extended / fixed configuration file
  • New configuration options
  • Added !votegametype
  • Fixed some small bugs
  • The exact full map and gametype name is only allowed. The server (CoD4) hangs for example at !vm killhouse instead of !vm mp_killhouse
  • Fixed bug: "A vote is already in progress"

Check attachment for the download. Mirror.

********* Installation of Votekick for B3 by danger89 *********

* Place plugins/voting.py in plugins/ and conf/voting.xml, conf/maplist.txt and conf/gametypelist.txt in conf/ map
* In your b3.xml config, add in the plugin section (choose the correct priority):

<plugin name="voting" priority="14" config="@b3/conf/voting.xml"/>

* Adjust the minimal level for each command and set the values in voting.xml

* Set all the maps you wish to allow to be voted in the server in maplist.txt

* Set all the gametypes you wish to allow to be voted in the server in gamelist.txt

* Ready to go!

********* New functionality provided & bugs fixed *********

Fixed minium vote for all vote types.

Fixed default values and added try/except for security if the config file didn't load properly.

!votemapgametype
With this command you can vote for a gametype and also directly vote for a map.

!votemaprotate
This will skip the current map and rotate to the next map in of the map rotation.

Configuration file vote_interval is changed to vote_interval_failed
It's the time in minutes after a failed vote and re-vote

Configuration file vote_interval_announcements added
It's the time in minutes between each announcement

Configuration file tempban_interval changed to tempban_duration
To make it clear.

Added comment in the configuration file.

!votekick and !votetempban commands have same reason "Voted out"
This allows you to search to all the kick/tempban votes.

!votekick and !votetempban commands saves the caller in the admin field
This allows you to find the caller again.

!votegametype or !vg
Initate a votemap for a gametype.
If the gametype is in gametypelist.txt, a vote will be carried out. Players need to write the full gametype abbreviation. See the list in gametypelist.txt

!gametypelist or !gamel
Lists all the available gametypes on the server. (It reads the maplist.txt file)

!votekick or !vk
Initiate a votekick against a player.
The votes can only be initated by players above configured level. Admins can't be voted out.
If more than tempban_minvotes players vote, and more than tempban_percent of them are "yes", the player will be tempbanned for tempban_interval.

!votemap or !vm
Initate a votemap for a map.
If the map is in maplist.txt, a vote will be carried out. Players only need to write the full map's name. For example, if they wish to vote "Shipment", they can type "!vm mp_shipment" (assuming no other map has that string in their name).

!maplist or !mapl
Lists all the available maps on the server. (It reads the maplist.txt file)

!voteyes or !vy
!voteno or !vn
Vote yes or no in the current vote.

!voteveto or !vveto
Veto the current vote

*** Configurable variables ***
min_level_*
Set the minimal level for the command.

vote_times
Number of times the bot tells how the vote is going and asks for votes. When the times are up, the vote ends.

vote_interval_announcements
Time in minutes between each announcement.

vote_interval_failed
Time in minutes between failed votes.

tempban_minvotes
Minimum necessary votes in order to pass the vote.

tempban_percent
If more than tempban_minvotes players vote, and more than tempban_percent of them are "yes", the player will be tempbanned for tempban_interval.

tempban_duration
Tempban duration in minutes.

mapfile
File to read the allowed maps for voting.

gametypefile
File to read the allowed gametypes for voting.


-Melroy van den Berg


[attachment deleted by maintenance]
« Last Edit: June 16, 2011, 12:36:54 PM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers

Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 47
Offline Offline
« Reply #1 on: January 16, 2011, 04:33:20 PM »

first of all thanks for the plugin  great tool.  i have only one little question, i want to configure it corretly but i need to know:

<set name="vote_times">2</set> this is how many times the bot will inform the situation  of the voting and ask for votes correct? but  how many time will pass between the 2 announcements? because yesterday i tried a gametype voting (i was alone in the server) and the two announcements were made followed and voting was passed instantly

<set name="vote_interval">2</set> this is Approximate time between failed votes. ok but seconds? minutes?  Huh

<set name="tempban_interval">2</set> same here, seconds? minutes?

thanks in advance  Grin
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #2 on: January 17, 2011, 01:24:09 AM »

first of all thanks for the plugin  great tool.  i have only one little question, i want to configure it corretly but i need to know:

<set name="vote_times">2</set> this is how many times the bot will inform the situation  of the voting and ask for votes correct? but  how many time will pass between the 2 announcements? because yesterday i tried a gametype voting (i was alone in the server) and the two announcements were made followed and voting was passed instantly

<set name="vote_interval">2</set> this is Approximate time between failed votes. ok but seconds? minutes?  Huh

<set name="tempban_interval">2</set> same here, seconds? minutes?

Good questions.

You must know the voting plugin works with CronTabs which means a function will be called very x minutes. So with that knowledge, vote_times means you got 2 times to vote (at least that is what you see). The interval between each time is 1 minute, this one minute is a defined static variable. So you have a total of 2*1=2 minutes to vote Smiley I hope I clarified it for you.

After you see 2 vote announcements you will see the final result of the vote -> the vote passed (because you started a voted and by default the vote-caller votes YES).

Code example:
Code: python
if self._times > 0:
OneTimeCronTab(self.function,  "*/1")
Here you change the _times variable.

The vote_interval works the same way, but here you change the CronTab interval time. This time is in minutes. This is not approximate.

Code example:
Code: python
OneTimeCronTab(let_caller_vote,  0, "*/%s" %self._vote_interval)
Here you change the _vote_interval variable.

The tempban_interval is also in minutes.

Code example:
Code: python
    def tempban(...., duration=2, .....):
       duration = functions.time2minutes(duration)
Here you change the duration variable.

Note:
In my new version of the Voting Plugin I will add "B3" to the admin of the tempban, so you can see that a player was temp banned by the voting system (of B3). Besides that I also change tempban_interval to tempban_duration to make it clear.
Maybe I will make a variable of "*/1" so you can change the vote_interval(_failed) of a vote that failed (so the vote-caller can't vote again in x minutes) and vote_interval(_announcements) of the announcements.
« Last Edit: January 17, 2011, 01:45:37 AM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 47
Offline Offline
« Reply #3 on: January 17, 2011, 03:35:05 AM »

After you see 2 vote announcements you will see the final result of the vote -> the vote passed (because you started a voted and by default the vote-caller votes YES).

the 2 announcements were made followed, no 2 minutes of voting but 2 seconds. that´s because i was confusing about minutes or seconds (i dont care too much because i have votegametype and votemap set to level 20 or high but i am worried about votekick to do the same)

my config

- <configuration plugin="votekick">
- <settings name="settings">
  <set name="min_level_vote">0</set>
  <set name="vote_times">2</set>
  <set name="vote_interval">2</set>
  </settings>
- <settings name="votekick">
  <set name="min_level_kick">1</set>
  <set name="tempban_minvotes">4</set>
  <set name="tempban_interval">2</set>
  <set name="tempban_percent">75</set>
  </settings>
- <settings name="votemap">
  <set name="min_level_map">20</set>
  <set name="mapfile">@b3/conf/maplist.txt</set>
  </settings>
- <settings name="votegametype">
  <set name="min_level_gametype">20</set>
  <set name="gametypefile">@b3/conf/gametypelist.txt</set>
  </settings>
  </configuration>

thanks for reply  Grin
« Last Edit: January 17, 2011, 03:46:03 AM by LiKaNtRoP » Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #4 on: January 17, 2011, 03:54:26 AM »

the 2 announcements were made followed, no 2 minutes of voting but 2 seconds. that´s because i was confusing about minutes or seconds (i dont care too much because i have votegametype and votemap set to level 20 or high but i am worried about votekick to do the same)

Maybe it was because you was alone in your server?

Code: xml

 
 0
I created my own VIP group (level 2), but you can also set it to level 1 which is registered users.
Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 47
Offline Offline
« Reply #5 on: January 17, 2011, 04:15:57 AM »

Maybe it was because you was alone in your server?

maybe, I have not tried with more people on the server

I created my own VIP group (level 2), but you can also set it to level 1 which is registered users.

I had it at level 1 but change it to level 0 for non registered can vote as well (most of them don´t know or don´t want to register). is wrong?
« Last Edit: January 17, 2011, 04:32:26 AM by LiKaNtRoP » Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #6 on: January 17, 2011, 05:33:08 AM »

is wrong?
No it's good, it should work well.
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 #7 on: January 17, 2011, 11:35:00 AM »

New version released: 1.7
Edit:
txt files added, I forgot Roll Eyes
« Last Edit: January 17, 2011, 12:34:22 PM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 47
Offline Offline
« Reply #8 on: January 17, 2011, 12:27:12 PM »

thx i will try it later  Grin
Logged
Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: MW2 (aIW)
Posts: 187
Offline Offline
WWW
« Reply #9 on: January 31, 2011, 08:07:05 PM »

I´ll try it for MW2. Let´s see Huh Huh Huh
Thank you for the plugin
Logged
Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: MW2 (aIW)
Posts: 187
Offline Offline
WWW
« Reply #10 on: January 31, 2011, 09:28:47 PM »

Hi
I run B3 1.4.1 for a  MW2 dedicated server

I put the voting.py file in extplugins/ and the voting.xml, gametypelist.txt and maplist.txt in extplugins/conf/
Then in the b3.xml  I defined the plugin and set the path


When I run B3, I have this message:


warning Adminplugin:could not get command_prefix_big, using default

I don´t know what am I doing wrong. Please help. Embarrassed
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #11 on: February 04, 2011, 10:08:09 AM »

Hi
I run B3 1.4.1 for a  MW2 dedicated server

I put the voting.py file in extplugins/ and the voting.xml, gametypelist.txt and maplist.txt in extplugins/conf/
Then in the b3.xml  I defined the plugin and set the path


When I run B3, I have this message:


warning Adminplugin:could not get command_prefix_big, using default

I don´t know what am I doing wrong. Please help. Embarrassed


It still seems to be an admin plugin problem and not the voting plugin problem. You can try to set the mode on debug level. And upload/place the log file in this topic.
Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 47
Offline Offline
« Reply #12 on: February 04, 2011, 04:00:22 PM »

there are something wrong with your plugin mate.  a minutes ago i was in the server and i see 2 votings.  in the two the players was kicked with only 1 vote and there was no interval of time between the announcements (and the server was full 16/16)

my settings

- <configuration plugin="votekick">
- <settings name="settings">
  <set name="min_level_vote">0</set>
  <set name="vote_times">3</set>
- <!--  number of times it shows an announcement
  -->
  <set name="vote_interval_announcements">1</set>
- <!--  time in minutes between each announcement
  -->
  <set name="vote_interval_failed">5</set>
- <!--  time in minutes after a failed vote and re-vote
  -->
  </settings>
- <settings name="votekick">
  <set name="min_level_kick">1</set>
  <set name="tempban_minvotes">4</set>
- <!--  minimum necessary votes in order to pass the vote
  -->
  <set name="tempban_percent">75</set>
- <!--  minimum necessary percentage that voted in order to pass the vote
  -->
  <set name="tempban_duration">2</set>
- <!--  tempban duration in minutes
  -->
  </settings>
- <settings name="votemap">
  <set name="min_level_map">80</set>
  <set name="mapfile">@conf/maplist.txt</set>
  </settings>
- <settings name="votegametype">
  <set name="min_level_gametype">80</set>
  <set name="gametypefile">@conf/gametypelist.txt</set>
  </settings>
  </configuration>

with this config i thought should be 3 minutes for vote not 5 seconds.  and why the player is kicked if only one person voted yes and i have 4 minimum votes and 75 %  in config?  Huh

sorry but i have to remove this plugin because is very dangerous. people can kick a player with only 1 positive vote and almost instantly  Undecided
« Last Edit: February 04, 2011, 04:04:12 PM by LiKaNtRoP » Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #13 on: February 04, 2011, 05:25:07 PM »

there are something wrong with your plugin mate.  a minutes ago i was in the server and i see 2 votings.  in the two the players was kicked with only 1 vote and there was no interval of time between the announcements (and the server was full 16/16)

my settings
with this config i thought should be 3 minutes for vote not 5 seconds.  and why the player is kicked if only one person voted yes and i have 4 minimum votes and 75 %  in config?  Huh
sorry but i have to remove this plugin because is very dangerous. people can kick a player with only 1 positive vote and almost instantly  Undecided

I understand your worries. I need to test the plugin with your configuration as soon as possible. Thanks for noticing.
Can you place also your b3.xml config file, where you use the voting plugin?

I created a new version! which fixed the default values to safe values, so if the config file didn't load properly the plugin should still work safe.
I also added 2 new commands:
  • !votemapgametype With this command you can vote for a gametype and also directly vote for a map.
  • !votemaprotate This will skip the current map and rotate to the next map in of the map rotation.

Version: 2.0

You can try version 2.0 and maybe the security problem is fixed of you or wait until i tested your config file.

I also changed level group 2 to level group 1, because I created a group that is level 2. However by default there is only a level 1 group and no level 2 at all Smiley You can try version 2.0.

« Last Edit: February 05, 2011, 05:17:47 AM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD6
Posts: 47
Offline Offline
« Reply #14 on: February 05, 2011, 06:34:14 AM »

my b3.xml

 <?xml version="1.0" ?>
- <configuration>
- <settings name="b3">
  <set name="parser">cod6</set>
  <set name="database">removed</set>
  <set name="bot_name">M&M</set>
  <set name="bot_prefix">^0(^2b3^0)^7:</set>
  <set name="time_format">%I:%M%p %Z %m/%d/%y</set>
  <set name="time_zone">CET</set>
  <set name="log_level">9</set>
  <set name="logfile">logs\b3.log</set>
  </settings>
- <settings name="server">
  <set name="rcon_password">removed</set>
  <set name="port">removed</set>
  <set name="game_log">removed</set>
  <set name="public_ip">removed</set>
  <set name="rcon_ip">removed</set>
  <set name="punkbuster">off</set>
  </settings>
- <settings name="autodoc">
  <set name="type">html</set>
  <set name="maxlevel">100</set>
  <set name="destination">/path/to/b3_doc.html</set>
  </settings>
- <settings name="messages">
  <set name="kicked_by">%s^7 was kicked by %s^7 %s</set>
  <set name="kicked">%s^7 was kicked %s</set>
  <set name="banned_by">%s^7 was banned by %s^7 %s</set>
  <set name="banned">%s^7 was banned %s</set>
  <set name="temp_banned_by">%s^7 was temp banned by %s^7 for %s^7 %s</set>
  <set name="temp_banned">%s^7 was temp banned for %s^7 %s</set>
  <set name="unbanned_by">%s^7 was un-banned by %s^7 %s</set>
  <set name="unbanned">%s^7 was un-banned %s</set>
  </settings>
- <settings name="plugins">
  <set name="external_dir">@b3/extplugins</set>
  </settings>
- <plugins>
  <plugin name="admin" config="@conf/plugin_admin.xml" />
  <plugin name="adv" config="@conf/plugin_adv.xml" />
  <plugin name="stats" config="@conf/plugin_stats.xml" />
  <plugin name="voting" config="@conf/voting.xml" />
  <plugin name="welcome" config="@conf/plugin_welcome.xml" />
  <plugin name="pingkicker" config="@conf/plugin_pingkicker.xml" />
  </plugins>
  </configuration>

I've also seen that the b3 database does not record the kicks made by this plugin in penalty column  Undecided
« Last Edit: February 05, 2011, 06:39:20 AM by LiKaNtRoP » Logged
Tags: danger89  vote  voting  plugin 
Pages: [1] 2 3 ... 5   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal