Skip to content

[TF2] Fix voice muting causing the user to be kicked for sending too many commands - #2022

Open
rockbruno wants to merge 1 commit into
ValveSoftware:masterfrom
rockbruno:rochab/tf2-batch-mute
Open

[TF2] Fix voice muting causing the user to be kicked for sending too many commands#2022
rockbruno wants to merge 1 commit into
ValveSoftware:masterfrom
rockbruno:rochab/tf2-batch-mute

Conversation

@rockbruno

@rockbruno rockbruno commented Aug 25, 2026

Copy link
Copy Markdown

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 SetPlayerBlockedState that receives a list of users, sending the update only on the last entry rather than for every user. The reason this works is because UpdateServerState always sends the info for every user, so there's no need to call it in-between.

How to reproduce the issue:

  • Join a large server (or, if testing locally, change mute_player_dialog.cpp to not filter bots)
  • Open the Mute Players UI
  • Select every user and press "Mute"
  • Result: You will get kicked instantly. This PR fixes this.

I was able to validate this fix by temporarily changing the code to allow bots to be muted.

Screenshot_20260825_122803 20260825114822_1

Fixes ValveSoftware/Source-1-Games#8237

// Purpose: blocks/unblocks the target client(s) from being heard
// Input : vector of playerID, block state
//-----------------------------------------------------------------------------
void CVoiceStatus::SetPlayersBlockedState( const CUtlVector<VoiceBlockState_t> &playerStates )

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
rockbruno force-pushed the rochab/tf2-batch-mute branch from 263eeb0 to 0f3497f Compare August 26, 2026 17:36

if (voice_clientdebug.GetInt())
{
Msg( "CVoiceStatus::SetPlayerBlockedState part 2\n" );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to include this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TF2] Muting a large number of players causes the user to be kicked from the server

2 participants