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 ... 5   Go Down
  Print  
Author Topic: Voting Plugin  (Read 16311 times) Bookmark and Share
Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« on: May 29, 2009, 08:01:26 PM »

NOTE: You might want to check out: http://www.bigbrotherbot.net/forums/releases/voting-plugin-2804/ an updated version of my plugin by danger89

The idea behind this plugin is to enable only regular users to call on votes. There are two votes implemented, votemap and votekick.

Limiting votekick is to avoid noobs trying to kick out good players.
Limiting votemap is to avoid constant map changes by noobs. Also, it limits the votable maps.

Votekick should work on all games as this uses the bot's method of kicking. Votemap will work on games which use "map mapname" command to change map.

Regular users can be set by use of !makereg command or the !putgroup (though that command is by default limited to level 90 and above).

This code hasn't been thoroughly tested. Please report any bugs you find!


********* New functionality provided *********

!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 a substring of the map's name. For example, if they wish to vote "ut4_austria", they can type "!vm aus" (assuming no other map has that string in their name).

!maplist or !mapl
Lists all the available maps on the server. (Reads maplist.txt)

!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
How many times the bot tells how the vote is going and asks for votes. When the times are up, the vote ends.

vote_interval
Approximate time between failed votes.

tempban_minvotes
tempban_interval
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.

mapfile
File to read the allowed maps for voting.

Download:
Voting1.5.zip



« Last Edit: February 13, 2011, 03:10:37 PM by Ismael » Logged

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 #1 on: May 30, 2009, 12:05:19 AM »

surely promote does the same thing as !makereg?
I do like the votekick idea though!
Logged

[ www.xlrstats.com ]
Project Lead
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD, CoD2, CoD5, UrT
Posts: 2022
Offline Offline
WWW
Support Specialty: B3-Core, CoD/UrT/WoP/ETPro parsers, Plugin development
« Reply #2 on: May 30, 2009, 03:02:19 AM »

What game is it designed for?
Logged

Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« Reply #3 on: May 30, 2009, 07:17:00 AM »

This was thought for Urban Terror, but there isn't any UrT specific code so it might work on many other games.

About !makereg, doc says:
!makereg <name>
Level 80
Scope Public

make a name a regular * Level 1 user

Level 1? Isn't that the same as the player doing !register? Though, I just tested the command, and yes, it does what it should (make it a level 2 user). I'll remove the !promote in the next version.
Logged
Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« Reply #4 on: May 30, 2009, 08:37:59 AM »

Ok. I removed the !promote command. Use !makereg to make registered users Smiley

I added a delay between failed votes, though it isn't working exactly as I expected. If I ask for it to clear a user in 3 minutes, it does so in a time like 10, 20, 30... and not in between. I'm using OneTimeCronTab(command, 0, "*/somenumber"). Is this the Right Way?
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3485
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #5 on: May 30, 2009, 08:58:05 AM »

for cron related commands, "*/x" means "every x minutes".
So that might not be what you want for a OneTimeCronTab.
Hope that helps
Logged

Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« Reply #6 on: May 30, 2009, 01:16:23 PM »

But if I use just a number, it doesn't do anything Sad
Logged
Echelon v2. Dev.
Former Dev. (senate)
*****
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 114
Offline Offline
WWW
Support Specialty: Echelon v.2
« Reply #7 on: May 31, 2009, 04:40:07 AM »

Now that you have a voting framework could you extend it so that it can choose a map vote? I know thats a little more orientated but if the map names were in the config then there should be no reason the python code bit needs to be different for each game if it just calling the name of the map from config file.

Is this a little hard or do able?

I do really love this plugin though, good stuff.
Eire.32
Logged

Eire.32
Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« Reply #8 on: May 31, 2009, 08:27:58 AM »

Yes, it can be done, and it's not very complicated. I just wanted to do this one first. In a not so far future I'll implement votemap too.

I'd like to remark that all this is possible thanks to the great framework that B3 is. It's amazing how much you can extend it Smiley
Logged
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 #9 on: June 07, 2009, 12:09:17 AM »

Ismael, I noticed that you can get one of your vars from the admin plugin.

you could use
Code: python
self._adminPlugin.config.get("settings","admins_level")

one less configurable to worry about Smiley
Logged

Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« Reply #10 on: June 13, 2009, 01:30:50 PM »

New release:
!vk requires a motive to kick
If more than a certain percent of voters vote yes, the victim is tempbanned
Added !vkveto
Modlevel is read from admin plugin settings (thanks Bakes)
Logged
Moderator
*
OS: Linux
Type: Home user
Gameservers: UrT
Posts: 70
Offline Offline
« Reply #11 on: July 25, 2009, 11:02:53 AM »

New release.

Now can vote map! Available maps are read from a file.
Easier to extend to other votes.
Logged
Full Member
***
Posts: 53
Offline Offline
« Reply #12 on: August 05, 2009, 04:32:39 AM »

Ismael congratulations for your efforts Smiley
I would like to ask you about Call of Duty 4.
Even if i didn't tested yet, i would like to see your plugin to work like this...

The server admin puts the available maps in a file.
For example, file's contents are...

Map1
Map2
Map3
Map4
Map5

Now, suppose people are voting to play Map3, and so be it, Map3 starts.
After Map3's end, i would like not to see the Map3 to be available for the next map votings.
So only...

Map1
Map2
Map4
Map5

...will be available for voting.

If Map1 is selected...after it's end, this map (Map1) should not be in the list for the next map.
For the next map, the list of available maps should be...

Map2
Map4
Map5

Then if Map4 selected, after it ends,  only...

Map2
Map5

...maps should be available...

And after Map2's end (or Map5 which could have been voted as well), there will be only AutoVoting for the last (and not played yet) map.

After all these maps, the script should be able to start again and so on...

It may be a scripting headpain, but it's something unique which possibly gives another twisting power on server's admin hands.
Logged
Newbie
*
Posts: 1
Offline Offline
« Reply #13 on: December 21, 2009, 10:19:07 AM »

Hi,

To start i would like to thank Ismael for the idea, because i have a Windows UrT server and without the EXE fix for the callvote hack this is the best way to mantain votes on my server without the danger of being hacked.

I noticed a problem in the plugin, dunno why it happens, but at some point users call for !vm and the plugin says that there is a vote already running and we have to wait until it ends, question is, no vote is running and we wait like 20 mins and it's always saying the same message, most of the times i have to restart bot so users can vote again.

Hope someone have an idea of what's wrong.

Thanks

Nox
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« Reply #14 on: December 26, 2009, 01:52:27 PM »

The plugin does work, but sometimes (alot actually) it keep saying:
Quote
A vote is already in progress, wait until it finishes

So we can't vote, and yes the latest vote was a long time ago  Huh

Is this a common bug? I'm get the latest (1.5) version of this Vote plugin using CoD4.

thx already

Kind regards,
Melroy
« Last Edit: December 26, 2009, 02:05:32 PM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers
Tags:
Pages: [1] 2 3 ... 5   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal