Raised This Month: $51 Target: $400
 12% 

[L4D,L4D2,TF2] BuiltinVotes 0.5.8 (2013-01-29)


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-13-2012 , 15:02   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #141

Just an FYI, I added a few new convenience stocks to builtinvotes.inc. They don't affect the extension at all.

The new stocks are:

PHP Code:
/**
 * Sends a vote menu to a single team.  See DisplayBuiltinVote() for more information.
 *
 * @param vote                Vote Handle.
 * @param team                Team to send vote to. 1 = spectators, 2 = RED/Survivors, 3 = BLU/Infected
 * @param time                Maximum time to leave menu on the screen.
 * @return                    True on success, false if this menu already has a vote session
 *                            in progress.
 * @error                    Invalid Handle.
 */
stock DisplayBuiltinVoteToTeam(Handle:voteteamtime)

/**
 * Sends a vote menu to all clients except one.  See DisplayBuiltinVote() for more information.
 * Useful for kick/ban votes
 *
 * @param vote                Vote Handle.
 * @param client            Client index not to send vote to
 * @param time                Maximum time to leave menu on the screen.
 * @return                    True on success, false if this menu already has a vote session
 *                            in progress.
 * @error                    Invalid Handle.
 */
stock DisplayBuiltinVoteToAllButOne(Handle:voteclienttime)

/**
 * Sends a vote menu to a single team except one player.  See DisplayBuiltinVote() for more information.
 *
 * @param vote                Vote Handle.
 * @param client            Client index not to send vote to.  Team is derived from this client.
 * @param time                Maximum time to leave menu on the screen.
 * @return                    True on success, false if this menu already has a vote session
 *                            in progress.
 * @error                    Invalid Handle.
 */
stock DisplayBuiltinVoteToTeamButOne(Handle:voteclienttime
These were originally wrote for another plugin I was working on, but I figured I might as well add them to the main .inc file, as others may find them useful.

Note that the Team ones automatically call SetBuiltinVoteTeam.
Attached Files
File Type: inc builtinvotes.inc (24.4 KB, 116 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-13-2012 at 15:03.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-16-2012 , 16:56   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #142

The games currently assume the first vote cast in a Yes/No vote will be Yes. However, BuiltinVotes does not assume that.

Do you guys think the extension should record the initiator's vote as a Yes vote by default? This may fix some issues with the vote panels showing the wrong number of votes when they first display.

Alternatively, this could be an option (SetBuiltinVotesInitiatorYesVote or something like that) and have the vote system adjust the totals if a vote starts while this option is set.

Edit: For kick votes, the target auto-votes No using the default TF2 system.

I also plan on doing some testing with my votesniffer plugin and the stock TF2 vote system this weekend. Hopefully I can test some things with just 2 clients (I have two TF2 accounts) to find out what's going on with the vote counts on the display. I also plan on taking a closer look at what TF2 does if a second callvote command is issued when a vote is ongoing so I can update the TF2 Voting documentation.
Attached Files
File Type: sp Get Plugin or Get Source (tfvotesniffer.sp - 243 views - 8.9 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-18-2012 at 20:51. Reason: Whoops, somehow it was hooking a bad usermessage. Fixed now.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-20-2012 , 11:39   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #143

I need to do some testing on the BuiltinVotes side, but it should be properly incrementing the vote counters in TF2 even in the current version. vote_cast is the only event or UserMessage being sent to update the vote counts when I let CVoteController (Valve's system) control the votes on a system without BuiltinVotes.

Now, one feature I plan on adding very soon is the ability to set a target UserID (not Client ID). This is required in TF2 (and possibly L4D2) because votes that act on users take their username as the Argument (via SetBuiltinVoteArgument). Unfortunately, passing the username around is a bad idea... bad, bad, bad. Expect this change sooner rather than later, because I need this in a plugin I'm writing.

BuiltinVotes won't actually *do* anything else with this user ID, it will just be for use in the various vote Handlers.

One interesting thing I noted this weekend: In TF2, if a client's name matches the name used in a Kick vote, said client will automatically vote No without the user actually doing anything.

(Also, TF2 Kick votes (possibly L4D/L4D2 as well) are only for the team that player is on; I couldn't test what happens when that player changes teams)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-20-2012 at 12:57.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-20-2012 , 15:01   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #144

Apparently builtinvotes.inc cares what order the functions are in. Here's a new version which should fix errors in team-related votes.
Attached Files
File Type: inc builtinvotes.inc (25.2 KB, 113 views)
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-25-2012 , 16:56   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.1 (2012-01-19)
Reply With Quote #145

Quote:
Originally Posted by lucasdidur View Post
In this update, I can watch the live vote ?
I've been doing some poking around, and I'm still not sure what exactly how TF2 is sending the updated vote counts to the players.

I'm currently sniffing all the vote events and usermessages, but the only vote messages I'm seeing go across are vote_cast events, which apparently aren't correctly updating the counts on the vote display.

It's irritating, because I can see the vote counts reset whenever I start a new vote using the Valve system.

I don't suppose anyone knows what it could be?

I've checked all the vote events, vote usermessages, HudNotify, HudNotifyCustom, HudMsg, ResetHUD usermessages, game_message, gameui_activated, gameui_hidden, update_status_item, and server_message events.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-25-2012 at 17:46.
Powerlord is offline
lucasdidur
Senior Member
Join Date: Jan 2011
Location: Brazil
Old 03-27-2012 , 11:25   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #146

Maybe it can be a SourceMod error, which is not getting the information to be able to update or something like that
__________________



lucasdidur is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-27-2012 , 12:00   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #147

Quote:
Originally Posted by lucasdidur View Post
Maybe it can be a SourceMod error, which is not getting the information to be able to update or something like that
It's possible that SourceMod isn't seeing the server call the vote_changed event, although I'm not sure why.

I could try having BuiltinVotes send vote_changed events despite this and see if the counts update correctly. It shouldn't be too hard, as BuiltinVotes already has a hook in place for updating the vote counts as L4D and L4D2 require it.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
snelvuur
Veteran Member
Join Date: Jun 2008
Location: Netherlands
Old 04-05-2012 , 11:06   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #148

At some point people did a rtv, i was fooling around and did a "changelevel map" so it broke the rtv vote (so we didn't go to the rtv map) after some time i told the guys, ok now you can rtv. So they did, then only a few of us could do the votes with F1 to F5. I did see in the logs that it was constantly spamming the log sending out the box towards clients. Almost 80% of the people could not vote. The extra debugging didn't give any more clues, i assume the box doesn't get send correctly to the client and then it does not change the F1 to F5 keys to work. Which basicly also makes sense since we dont see any choices coming in.
__________________
Arguing with a fool only proves there are two
snelvuur is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-05-2012 , 11:33   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #149

Quote:
Originally Posted by snelvuur View Post
At some point people did a rtv, i was fooling around and did a "changelevel map" so it broke the rtv vote (so we didn't go to the rtv map) after some time i told the guys, ok now you can rtv. So they did, then only a few of us could do the votes with F1 to F5. I did see in the logs that it was constantly spamming the log sending out the box towards clients. Almost 80% of the people could not vote. The extra debugging didn't give any more clues, i assume the box doesn't get send correctly to the client and then it does not change the F1 to F5 keys to work. Which basicly also makes sense since we dont see any choices coming in.
I assume /revote didn't fix the issue?

Of course, even if /revote does fix the issue, I was under the impression that changing levels would reset the client's vote choice on their side. I may have to do some more experiments to find out.

In other news, I noticed that there may be an off-by-one error in the number of expected votes. I'll have to look at this code more closely. I also still have some testing to do in the test version with the vote_changed event present.

Edit: I'm beginning to think there are a number of events being sent by the vote system that my votesniffer isn't seeing. I may have to add these to my extension despite not seeing any actual evidence that they are used.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-05-2012 at 11:42.
Powerlord is offline
snelvuur
Veteran Member
Join Date: Jun 2008
Location: Netherlands
Old 04-05-2012 , 11:39   Re: [L4D,L4D2,TF2] BuiltinVotes 0.5.7 (2012-03-06)
Reply With Quote #150

Revote didn't work. Strangly only a few people could vote, from a full server there where only 4 votes (including myself, perhaps because i was admin it did work? no clue if that matters)

But like i said, the logs kept spamming that it wanted to show the dialog to the client. But as far as i can tell everybody did get the dialog but they cannot press the F1 to F5 buttons.
__________________
Arguing with a fool only proves there are two
snelvuur is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode