tricking nosteamers into auto muting steam clients because of broadcast voice data using steam codec and not celt. however steam clients still hear sendvoicedata that transcodes opus to celt

This commit is contained in:
jenz 2026-07-01 22:19:55 +02:00
parent 4469d07602
commit bf6ed6e4e1
3 changed files with 1744 additions and 4 deletions

View File

@ -3,6 +3,7 @@
#include <sdktools>
#include <basecomm>
#include <clientprefs>
#include <selfmute>
#include <voice>
#pragma semicolon 1
@ -34,6 +35,21 @@ public void OnPluginEnd()
}
}
public void set_webclient_listen_override(int client)
{
for (int j = 1; j <= MaxClients; j++)
{
if (!IsValidClient(j) || client == j || IsFakeClient(j))
continue;
if (!PM_IsPlayerSteam(client) && PM_IsPlayerSteam(j))
{
//the nosteam client is not allowed to hear the steam client because broadcastvoicedata would ear rape them.
//LogMessage("%N has muted %N", client, j);
SetListenOverride(client, j, Listen_No);
}
}
}
public Action check_mutes(Handle timer, any data)
{
for (int i = 1; i <= MaxClients; i++)
@ -44,9 +60,10 @@ public Action check_mutes(Handle timer, any data)
}
if (!g_bWasChecked[i])
{
//this exists for the webclient. the webclient is skipping all connection related forwards. hence a manual check like this is needed for the webclient.
char dummy[64];
OnClientAuthorized(i, dummy);
g_bWasChecked[i] = true;
set_webclient_listen_override(i);
}
for (int j = 1; j <= MaxClients; j++)
{
@ -54,11 +71,10 @@ public Action check_mutes(Handle timer, any data)
{
continue;
}
//i = muter, j = mutee
bool isMuted = GetListenOverride(i, j) == Listen_No;
bool isMuted = BaseComm_IsClientMuted(j);
if (!isMuted)
{
isMuted = BaseComm_IsClientMuted(j);
isMuted = SelfMute_IsIgnoring(i, j);
}
//PrintToChatAll("i: %N. j: %N. isMuted: %i", i, j, isMuted);
ClientMutedOtherClient(i, j, isMuted);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
#if defined _selfmute_included_
#endinput
#endif
#define _selfmute_included_
native bool SelfMute_IsIgnoring(int client, int target);