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:
parent
4469d07602
commit
bf6ed6e4e1
@ -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);
|
||||
|
||||
1718
SelfMute/scripting/SelfMute_codec_transcode.sp
Normal file
1718
SelfMute/scripting/SelfMute_codec_transcode.sp
Normal file
File diff suppressed because it is too large
Load Diff
6
SelfMute/scripting/include/selfmute.inc
Normal file
6
SelfMute/scripting/include/selfmute.inc
Normal file
@ -0,0 +1,6 @@
|
||||
#if defined _selfmute_included_
|
||||
#endinput
|
||||
#endif
|
||||
#define _selfmute_included_
|
||||
|
||||
native bool SelfMute_IsIgnoring(int client, int target);
|
||||
Loading…
Reference in New Issue
Block a user