From 5781f59beb4435285ba1c0c709548a354233d48f Mon Sep 17 00:00:00 2001 From: Altair Sossai Date: Mon, 14 Oct 2024 14:07:09 -0300 Subject: [PATCH] Update bequiet plugin --- addons/sourcemod/plugins/fixes/bequiet.smx | Bin 7905 -> 5361 bytes addons/sourcemod/scripting/bequiet.sp | 244 +++++++++++++-------- 2 files changed, 148 insertions(+), 96 deletions(-) diff --git a/addons/sourcemod/plugins/fixes/bequiet.smx b/addons/sourcemod/plugins/fixes/bequiet.smx index 984fea76ee51956faf842c38348d8f1934ed46f0..109b7291d7d9d57fdc28c2e3a735720325751071 100644 GIT binary patch delta 5188 zcmXYt2Q=0H|Hm&kWS0~XLgvjT`zo94jIyIkHVK&@m!vNlnb~_>Gy7)UYiE~{b#Wz| z>snpg|Molo&v`%2^YJ<7bDpo)`?I9DCjh9c8$2T=A=zUDfySU95aV?c5a>6Nf6u?1 zW&wf7iQaq<1X85|frtlm$qxc)67x0@bpa5_fSBw=QiyIzOgKk}&y@p#ZV;K#v6wZ`^OSD_tkQ-PyTAIw<_!ay3D!k7w&E3M->Z@4z%YNoMLxhig@goJnhH zSsor48V>BLxg%Cu7+Y91#ADR2R#V8u^2xYWsdT`JKYYPSG~cdud|Wx4+`Gh@%g}h> z#`4AmUBb>iEUQ;a1Kf?(%OO5bP6vLkJ@D1l8avhO}3{VDRMlU_p`^ zz7-xAEBkag_Ac@nIqnm@qXiRE;4N-g{vV&VBt5;r(zaM%7Nh{!uN(c1 z99IYr>_BIUd9Kl7)WCi-Xe%jC4`yT&4TcRo#UOUr0*_`zl7O4W(M2?vFu1%s7O)oe zT%*AZlH^FT_h_xE(Lz8a`>Ayc*+q=PJ^KXOS@x@{_0qf8WAQjNP>bl17DECFh>g17Urgrh-q+g3ayC&F64p zLM&!rt0y!0v(wJTmy1*}^4f$aBS8GydX3~=RkMrd4M@ed+WNXr1DfLI+#asi>3yF=iK%Z{d z^`<*CB)#YYSR%JSdB3VO^J-yz>`+T2)v4m14O9JO1i71U2~4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--git a/addons/sourcemod/scripting/bequiet.sp b/addons/sourcemod/scripting/bequiet.sp index befeb6dc5..e8dc9d4bb 100644 --- a/addons/sourcemod/scripting/bequiet.sp +++ b/addons/sourcemod/scripting/bequiet.sp @@ -1,124 +1,176 @@ #pragma semicolon 1 - -#include #pragma newdecls required + #include - -ConVar hCvarCvarChange, hCvarNameChange, hCvarSpecNameChange, hCvarSpecSeeChat; -bool bCvarChange, bNameChange, bSpecNameChange, bSpecSeeChat; +#define PLUGIN_VERSION "2.0.2" public Plugin myinfo = { - name = "BeQuiet", - author = "Sir", - description = "Please be Quiet!", - version = "1.33.7", - url = "https://github.com/SirPlease/SirCoding" + name = "[L4D & 2] BeQuiet", + author = "Sir, Forgetest", + description = "Please be Quiet! (Spec hearing chat, name/cvar change supress)", + version = PLUGIN_VERSION, + url = "https://github.com/Target5150/MoYu_Server_Stupid_Plugins" } +ConVar hCvarCvarChange, hCvarNameChange, hCvarSpecNameChange, hCvarSpecSeeChat; + public void OnPluginStart() { - AddCommandListener(Say_Callback, "say"); - AddCommandListener(TeamSay_Callback, "say_team"); - - //Server CVar - HookEvent("server_cvar", Event_ServerConVar, EventHookMode_Pre); - HookEvent("player_changename", Event_NameChange, EventHookMode_Pre); - - //Cvars - hCvarCvarChange = CreateConVar("bq_cvar_change_suppress", "1", "Silence Server Cvars being changed, this makes for a clean chat with no disturbances."); - hCvarNameChange = CreateConVar("bq_name_change_suppress", "1", "Silence Player name Changes."); - hCvarSpecNameChange = CreateConVar("bq_name_change_spec_suppress", "1", "Silence Spectating Player name Changes."); - hCvarSpecSeeChat = CreateConVar("bq_show_player_team_chat_spec", "1", "Show Spectators Survivors and Infected Team chat?"); - - bCvarChange = GetConVarBool(hCvarCvarChange); - bNameChange = GetConVarBool(hCvarNameChange); - bSpecNameChange = GetConVarBool(hCvarSpecNameChange); - bSpecSeeChat = GetConVarBool(hCvarSpecSeeChat); - - hCvarCvarChange.AddChangeHook(cvarChanged); - hCvarNameChange.AddChangeHook(cvarChanged); - hCvarSpecNameChange.AddChangeHook(cvarChanged); - hCvarSpecSeeChat.AddChangeHook(cvarChanged); - - AutoExecConfig(true); - LoadTranslations("bequiet.phrases"); + //Player name change + HookUserMessage(GetUserMessageId("SayText2"), UserMsg_OnSayText2, true); + + //Server CVar + HookEvent("server_cvar", Event_ServerConVar, EventHookMode_Pre); + + //Cvars + hCvarCvarChange = CreateConVar("bq_cvar_change_suppress", "1", "Silence Server Cvars being changed, this makes for a clean chat with no disturbances.", FCVAR_SPONLY, true, 0.0, true, 1.0); + hCvarNameChange = CreateConVar("bq_name_change_suppress", "0", "Silence Player name Changes.", FCVAR_SPONLY, true, 0.0, true, 1.0); + hCvarSpecNameChange = CreateConVar("bq_name_change_spec_suppress", "0", "Silence Spectating Player name Changes.", FCVAR_SPONLY, true, 0.0, true, 1.0); + hCvarSpecSeeChat = CreateConVar("bq_show_player_team_chat_spec", "1", "Show Spectators Survivors and Infected Team chat?", FCVAR_SPONLY, true, 0.0, true, 1.0); + + AutoExecConfig(true); } -Action Say_Callback(int client, char[] command, int args) +public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) { - char sayWord[MAX_NAME_LENGTH]; - GetCmdArg(1, sayWord, sizeof(sayWord)); - - if(sayWord[0] == '!' || sayWord[0] == '/') - { - return Plugin_Handled; - } - return Plugin_Continue; + static char s_sPubChatTrigger[8] = "!", s_sPrivChatTrigger[8] = "/"; + static int s_iPubTriggerLen = 1, s_iPrivTriggerLen = 1; + +// 1.12.0.6944 +// https://github.com/alliedmodders/sourcemod/commit/3b4a343274286b31a9b3cf33c64f7ef +#if SOURCEMOD_V_MAJOR > 1 + || (SOURCEMOD_V_MAJOR == 1 && SOURCEMOD_V_MINOR >= 12 && SOURCEMOD_V_REV >= 6944) + static bool bInit = false; + if (!bInit) + { + s_iPubTriggerLen = GetPublicChatTriggers(s_sPubChatTrigger, sizeof(s_sPubChatTrigger)); + s_iPrivTriggerLen = GetSilentChatTriggers(s_sPrivChatTrigger, sizeof(s_sPrivChatTrigger)); + + if (!s_iPubTriggerLen) + s_iPubTriggerLen = strcopy(s_sPubChatTrigger, sizeof(s_sPubChatTrigger), "!"); + if (!s_iPrivTriggerLen) + s_iPrivTriggerLen = strcopy(s_sPrivChatTrigger, sizeof(s_sPrivChatTrigger), "/"); + + bInit = true; + } +#endif + + if (strncmp(sArgs, s_sPubChatTrigger, s_iPubTriggerLen) == 0 + || strncmp(sArgs, s_sPrivChatTrigger, s_iPrivTriggerLen) == 0) + return Plugin_Handled; + + return Plugin_Continue; } -Action TeamSay_Callback(int client, char[] command, int args) +public void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs) { - char sayWord[MAX_NAME_LENGTH]; - GetCmdArg(1, sayWord, sizeof(sayWord)); - - if(sayWord[0] == '!' || sayWord[0] == '/') - { - return Plugin_Handled; - } - - if (bSpecSeeChat && GetClientTeam(client) != 1) - { - char sChat[256]; - GetCmdArgString(sChat, 256); - StripQuotes(sChat); - int i = 1; - while (i <= 65) - { - if (IsValidClient(i) && GetClientTeam(i) == 1) - { - if (GetClientTeam(client) == 2) - { - CPrintToChat(i, "%t", "SurvivorSay", client, sChat); - } - else CPrintToChat(i, "%t", "InfectedSay", client, sChat); - } - i++; - } - } - return Plugin_Continue; + if (!IsValidClient(client)) + return; + + if (!hCvarSpecSeeChat.BoolValue || strcmp(command, "say_team") != 0) + return; + + // TODO: Formats for dead players? Not really seen much. + static const char s_ChatFormats[][] = { + "L4D_Chat_Survivor", + "L4D_Chat_Infected", + /* "L4D_Chat_Survivor_Dead", + "L4D_Chat_Infected_Dead",*/ + }; + + int idxTeam = GetClientTeam(client) - 2; + if (idxTeam != 0 && idxTeam != 1) + return; + + /*if (!IsPlayerAlive(client)) + idxTeam += 2;*/ + + // collect all spectators + SourceTV + int[] clients = new int[MaxClients]; + int numClients = 0; + for (int i = 1; i <= MaxClients; ++i) + { + if (IsClientInGame(i) && GetClientTeam(i) == 1 && (!IsFakeClient(i) || IsClientSourceTV(i))) + clients[numClients++] = i; + } + + if (numClients <= 0) + return; + + char name[MAX_NAME_LENGTH]; + GetClientName(client, name, sizeof(name)); + UTIL_SayText2Filter(client, clients, numClients, true, s_ChatFormats[idxTeam], name, sArgs); } Action Event_ServerConVar(Event event, const char[] name, bool dontBroadcast) { - if (bCvarChange) return Plugin_Handled; - return Plugin_Continue; -} - -Action Event_NameChange(Event event, const char[] name, bool dontBroadcast) -{ - int clientid = event.GetInt("userid"); - int client = GetClientOfUserId(clientid); - - if (IsValidClient(client)) - { - if (GetClientTeam(client) == 1 && bSpecNameChange) return Plugin_Handled; - else if (bNameChange) return Plugin_Handled; - } - return Plugin_Continue; + return hCvarCvarChange.BoolValue ? Plugin_Handled : Plugin_Continue; } -void cvarChanged(Handle convar, const char[] oldValue, const char[] newValue) +// Thanks for help from HarryPotter (@fbef0102) IIRC +Action UserMsg_OnSayText2(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init) { - bCvarChange = hCvarCvarChange.BoolValue; - bNameChange = hCvarNameChange.BoolValue; - bSpecNameChange = hCvarSpecNameChange.BoolValue; - bSpecSeeChat = hCvarSpecSeeChat.BoolValue; + int client = msg.ReadByte(); + if (!IsValidClient(client)) + return Plugin_Continue; + + msg.ReadByte(); // Skip the second byte + + // Read the message + static char sMessage[128]; + msg.ReadString(sMessage, sizeof(sMessage), true); + + if (GetClientTeam(client) == 1) + { + if (!hCvarSpecNameChange.BoolValue) + return Plugin_Continue; + } + else if (!hCvarNameChange.BoolValue) + return Plugin_Continue; + + if (strcmp(sMessage, "#Cstrike_Name_Change") != 0) + return Plugin_Continue; + + return Plugin_Handled; } -bool IsValidClient(int client) +stock bool IsValidClient(int client) { - if (client <= 0 || client > MaxClients || !IsClientConnected(client) || !IsClientInGame(client)) return false; - return true; + return client > 0 && client <= MaxClients && IsClientInGame(client); } + +stock void UTIL_SayText2Filter( int entity, const int[] recipients, int numRecipient, bool bChat, const char[] msg_name, const char[] param1 = NULL_STRING, const char[] param2 = NULL_STRING, const char[] param3 = NULL_STRING, const char[] param4 = NULL_STRING ) +{ + BfWrite bf = UserMessageToBfWrite(StartMessage( "SayText2", recipients, numRecipient, USERMSG_RELIABLE )); + + if ( entity < 0 ) + entity = 0; // world, dedicated server says + + bf.WriteByte( entity ); + bf.WriteByte( bChat ); + bf.WriteString( msg_name ); + + if ( !IsNullString(param1) ) + bf.WriteString( param1 ); + else + bf.WriteString( "" ); + + if ( !IsNullString(param2) ) + bf.WriteString( param2 ); + else + bf.WriteString( "" ); + + if ( !IsNullString(param3) ) + bf.WriteString( param3 ); + else + bf.WriteString( "" ); + + if ( !IsNullString(param4) ) + bf.WriteString( param4 ); + else + bf.WriteString( "" ); + + EndMessage(); +} \ No newline at end of file