[TF2] Fix voice muting causing the user to be kicked for sending too many commands - #2022
Open
rockbruno wants to merge 1 commit into
Open
[TF2] Fix voice muting causing the user to be kicked for sending too many commands#2022rockbruno wants to merge 1 commit into
rockbruno wants to merge 1 commit into
Conversation
rockbruno
commented
Aug 25, 2026
| // Purpose: blocks/unblocks the target client(s) from being heard | ||
| // Input : vector of playerID, block state | ||
| //----------------------------------------------------------------------------- | ||
| void CVoiceStatus::SetPlayersBlockedState( const CUtlVector<VoiceBlockState_t> &playerStates ) |
Author
There was a problem hiding this comment.
Note: You may notice the logic ignores the blocked field. The original also did that. I considered removing the field from the API entirely, but that would imply changing all callers and I wasn't sure that was a good idea for this PR
Co-Authored-By: Luciano Ferruzzi <ferruzzi.luciano@gmail.com>
rockbruno
force-pushed
the
rochab/tf2-batch-mute
branch
from
August 26, 2026 17:36
263eeb0 to
0f3497f
Compare
kvog-git
reviewed
Aug 27, 2026
|
|
||
| if (voice_clientdebug.GetInt()) | ||
| { | ||
| Msg( "CVoiceStatus::SetPlayerBlockedState part 2\n" ); |
Contributor
There was a problem hiding this comment.
Did you intend to include this?
Author
There was a problem hiding this comment.
Yes, the original code also had them, it just looks weird on the diff view because of the added indentation. https://github.com/rockbruno/source-sdk-2013/blob/c22529f725414dbb857ace0f170013ab32d35fff/src/game/shared/voice_status.cpp#L552-L576
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently there's an issue with the "Mute Players" UI in TF2 where if you select multiple users, the muting will be done one-by-one by sending individual commands to the server. If you're playing in a large server with e.g. 64 players, this will consistently cause you to get kicked for sending too many commands to the server.
This PR fixes this logic by adding a variant to
SetPlayerBlockedStatethat receives a list of users, sending the update only on the last entry rather than for every user. The reason this works is becauseUpdateServerStatealways sends the info for every user, so there's no need to call it in-between.How to reproduce the issue:
I was able to validate this fix by temporarily changing the code to allow bots to be muted.
Fixes ValveSoftware/Source-1-Games#8237