if its the webclient just filter out all chat messages with ; or " in them
This commit is contained in:
parent
4a9a8e06cf
commit
5a1ca4959d
@ -2,6 +2,7 @@
|
||||
#include <PlayerManager>
|
||||
#include <sdktools>
|
||||
#include <basecomm>
|
||||
#include <ccc>
|
||||
#include <clientprefs>
|
||||
#include <selfmute>
|
||||
#include <voice>
|
||||
@ -13,6 +14,7 @@ Handle g_hCheckMutes = null;
|
||||
Handle g_hCookieTorchMuted = null;
|
||||
|
||||
bool g_bWasChecked[MAXPLAYERS + 1];
|
||||
bool g_bWebclient[MAXPLAYERS + 1];
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
@ -64,6 +66,7 @@ public Action check_mutes(Handle timer, any data)
|
||||
char dummy[64];
|
||||
OnClientAuthorized(i, dummy);
|
||||
set_webclient_listen_override(i);
|
||||
g_bWebclient[i] = true;
|
||||
}
|
||||
for (int j = 1; j <= MaxClients; j++)
|
||||
{
|
||||
@ -107,11 +110,13 @@ public Action check_mutes(Handle timer, any data)
|
||||
public void OnClientDisconnect(int client)
|
||||
{
|
||||
g_bWasChecked[client] = false;
|
||||
g_bWebclient[client] = false;
|
||||
}
|
||||
|
||||
public void OnClientAuthorized(int client, const char[] auth)
|
||||
{
|
||||
g_bWasChecked[client] = true;
|
||||
g_bWebclient[client] = false;
|
||||
if (IsFakeClient(client))
|
||||
{
|
||||
return;
|
||||
@ -131,6 +136,21 @@ public void OnClientAuthorized(int client, const char[] auth)
|
||||
}
|
||||
}
|
||||
|
||||
public Action CCC_OnChatMessage(int client, int author, const char[] message)
|
||||
{
|
||||
if (!g_bWebclient[client])
|
||||
{
|
||||
return Plugin_Continue;
|
||||
}
|
||||
int index = FindCharInString(message, '"', false);
|
||||
int index1 = FindCharInString(message, ';', false);
|
||||
if (index != -1 || index1 != -1)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public Action Timer_SendVoiceInit(Handle timer, int Serial)
|
||||
{
|
||||
int client;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user