From 4265c752d5240fb290b091b381fdd18c722347b5 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Thu, 23 Jan 2025 17:37:44 +0100 Subject: [PATCH 1/5] feat(API): Plugins status forwards & sbppchecker lib --- .../scripting/include/sourcebanschecker.inc | 21 ++++++++ .../scripting/include/sourcebanspp.inc | 21 ++++++++ .../scripting/include/sourcecomms.inc | 22 +++++++- .../sourcemod/scripting/sbpp_checker.sp | 44 ++++++++++++++-- game/addons/sourcemod/scripting/sbpp_comms.sp | 51 ++++++++++++++++--- game/addons/sourcemod/scripting/sbpp_main.sp | 44 +++++++++++++--- 6 files changed, 183 insertions(+), 20 deletions(-) diff --git a/game/addons/sourcemod/scripting/include/sourcebanschecker.inc b/game/addons/sourcemod/scripting/include/sourcebanschecker.inc index f0be9fd44..af639a3e9 100644 --- a/game/addons/sourcemod/scripting/include/sourcebanschecker.inc +++ b/game/addons/sourcemod/scripting/include/sourcebanschecker.inc @@ -29,6 +29,12 @@ #endif #define _sourcebanschecker_included +#define SBPPChecker_V_MAJOR 1 +#define SBPPChecker_V_MINOR 8 +#define SBPPChecker_V_PATCH 4 + +#define SBPPChecker_VERSION "1.8.4" + public SharedPlugin __pl_sourcebanschecker = { name = "sourcebans++", @@ -83,3 +89,18 @@ native int SBPP_CheckerGetClientsMutes(int iClient); * @return The number of gags of the client. *********************************************************/ native int SBPP_CheckerGetClientsGags(int iClient); + +/********************************************************* + * Called when the plugin becomes available. + * + * @noreturn + *********************************************************/ +forward void SBPPChecker_OnPluginOK(); + +/********************************************************* + * Called when the plugin becomes unavailable. + * This can happen when the plugin is paused or unloaded. + * + * @noreturn + *********************************************************/ +forward void SBPPChecker_OnPluginNotOK(); diff --git a/game/addons/sourcemod/scripting/include/sourcebanspp.inc b/game/addons/sourcemod/scripting/include/sourcebanspp.inc index f85758127..3130bdf62 100644 --- a/game/addons/sourcemod/scripting/include/sourcebanspp.inc +++ b/game/addons/sourcemod/scripting/include/sourcebanspp.inc @@ -29,6 +29,12 @@ #endif #define _sourcebanspp_included +#define SB_VERSION_MAJOR 1 +#define SB_VERSION_MINOR 8 +#define SB_VERSION_PATCH 3 + +#define SB_VERSION "1.8.3" + public SharedPlugin __pl_sourcebanspp = { name = "sourcebans++", @@ -83,6 +89,21 @@ native void SBPP_BanPlayer(int iAdmin, int iTarget, int iTime, const char[] sRea *********************************************************/ native void SBPP_ReportPlayer(int iReporter, int iTarget, const char[] sReason); +/********************************************************* + * Called when the plugin becomes available. + * + * @noreturn +*********************************************************/ +forward void SBPP_OnPluginOK(); + +/********************************************************* + * Called when the plugin becomes unavailable. + * This can happen when the plugin is paused or unloaded. + * + * @noreturn +*********************************************************/ +forward void SBPP_OnPluginNotOK(); + /********************************************************* * Called when the admin banning the player. * diff --git a/game/addons/sourcemod/scripting/include/sourcecomms.inc b/game/addons/sourcemod/scripting/include/sourcecomms.inc index 905cbdd99..97b1c7d0c 100644 --- a/game/addons/sourcemod/scripting/include/sourcecomms.inc +++ b/game/addons/sourcemod/scripting/include/sourcecomms.inc @@ -29,6 +29,12 @@ #endif #define _sourcecomms_included +#define SBPPComms_VERSION_MAJOR 1 +#define SBPPComms_VERSION_MINOR 8 +#define SBPPComms_VERSION_PATCH 2 + +#define SBPPComms_VERSION "1.8.2" + /** * @section Int definitions for punishments types. */ @@ -96,6 +102,21 @@ native bType SourceComms_GetClientMuteType(int client); */ native bType SourceComms_GetClientGagType(int client); +/** + * Called when the plugin becomes available. + * + * @noreturn + */ +forward void SourceComms_OnPluginOK(); + +/** + * Called when the plugin becomes unavailable. + * This can happen when the plugin is paused or unloaded. + * + * @noreturn + */ +forward void SourceComms_OnPluginNotOK(); + /** * Called when added communication block for player. * @@ -134,5 +155,4 @@ public void __pl_sourcecomms_SetNTVOptional() MarkNativeAsOptional("SourceComms_SetClientGag"); MarkNativeAsOptional("SourceComms_GetClientMuteType"); MarkNativeAsOptional("SourceComms_GetClientGagType"); - } diff --git a/game/addons/sourcemod/scripting/sbpp_checker.sp b/game/addons/sourcemod/scripting/sbpp_checker.sp index d2f54cf12..ae2e2b130 100644 --- a/game/addons/sourcemod/scripting/sbpp_checker.sp +++ b/game/addons/sourcemod/scripting/sbpp_checker.sp @@ -28,8 +28,8 @@ #pragma newdecls required #include +#include -#define VERSION "1.8.3" #define LISTBANS_USAGE "sm_listbans <#userid|name> - Lists a user's prior bans from Sourcebans" #define LISTCOMMS_USAGE "sm_listcomms <#userid|name> - Lists a user's prior comms from Sourcebans" #define INVALID_TARGET -1 @@ -47,12 +47,15 @@ int g_iBanCounts[MAXPLAYERS + 1]; int g_iMuteCounts[MAXPLAYERS + 1]; int g_iGagCounts[MAXPLAYERS + 1]; +GlobalForward g_hFwd_StatusOK; +GlobalForward g_hFwd_StatusNotOK; + public Plugin myinfo = { name = "SourceBans++: Bans Checker", author = "psychonic, Ca$h Munny, SourceBans++ Dev Team", description = "Notifies admins of prior bans from Sourcebans upon player connect.", - version = VERSION, + version = SBPPChecker_VERSION, url = "https://sbpp.github.io" }; @@ -61,7 +64,7 @@ public void OnPluginStart() LoadTranslations("common.phrases"); LoadTranslations("sbpp_checker.phrases"); - CreateConVar("sbchecker_version", VERSION, "", FCVAR_NOTIFY); + CreateConVar("sbchecker_version", SBPPChecker_VERSION, "", FCVAR_NOTIFY); RegAdminCmd("sm_listbans", OnListSourceBansCmd, ADMFLAG_GENERIC, LISTBANS_USAGE); RegAdminCmd("sm_listcomms", OnListSourceCommsCmd, ADMFLAG_GENERIC, LISTCOMMS_USAGE); RegAdminCmd("sb_reload", OnReloadCmd, ADMFLAG_RCON, "Reload sourcebans config and ban reason menu options"); @@ -74,6 +77,24 @@ public void OnPluginStart() } } +public void OnAllPluginsLoaded() +{ + SendForward_Available(); +} + +public void OnPluginPauseChange(bool pause) +{ + if (pause) + SendForward_NotAvailable(); + else + SendForward_Available(); +} + +public void OnPluginEnd() +{ + SendForward_NotAvailable(); +} + public void OnMapStart() { ReadConfig(); @@ -95,13 +116,16 @@ public void OnDatabaseConnected(Database db, const char[] error, any data) public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { - RegPluginLibrary("sourcebans++"); + RegPluginLibrary("sourcechecker++"); CreateNative("SBPP_CheckerGetClientsBans", Native_SBCheckerGetClientsBans); CreateNative("SBPP_CheckerGetClientsComms", Native_SBCheckerGetClientsComms); CreateNative("SBPP_CheckerGetClientsMutes", Native_SBCheckerGetClientsMutes); CreateNative("SBPP_CheckerGetClientsGags", Native_SBCheckerGetClientsGags); + g_hFwd_StatusOK = CreateGlobalForward("SBPPChecker_OnPluginOK", ET_Ignore); + g_hFwd_StatusNotOK = CreateGlobalForward("SBPPChecker_OnPluginNotOK", ET_Ignore); + g_bLate = late; return APLRes_Success; @@ -655,4 +679,16 @@ stock void LateLoading() GetClientAuthId(i, AuthId_Steam2, sSteam32ID, sizeof(sSteam32ID)); OnClientAuthorized(i, sSteam32ID); } +} + +stock void SendForward_Available() +{ + Call_StartForward(g_hFwd_StatusOK); + Call_Finish(); +} + +stock void SendForward_NotAvailable() +{ + Call_StartForward(g_hFwd_StatusNotOK); + Call_Finish(); } \ No newline at end of file diff --git a/game/addons/sourcemod/scripting/sbpp_comms.sp b/game/addons/sourcemod/scripting/sbpp_comms.sp index 29dfef095..c61631844 100644 --- a/game/addons/sourcemod/scripting/sbpp_comms.sp +++ b/game/addons/sourcemod/scripting/sbpp_comms.sp @@ -43,7 +43,6 @@ // Do not edit below this line // //-----------------------------// -#define PLUGIN_VERSION "1.8.1" #define PREFIX "\x04[SourceComms++]\x01 " //GLOBAL DEFINES @@ -134,10 +133,12 @@ int SMCParser ConfigParser; -Handle - g_hFwd_OnPlayerPunished - , g_hFwd_OnPlayerUnpunished - , g_hGagExpireTimer[MAXPLAYERS + 1] = { null, ... } +GlobalForward g_hFwd_StatusOK + , g_hFwd_StatusNotOK + , g_hFwd_OnPlayerPunished + , g_hFwd_OnPlayerUnpunished; + +Handle g_hGagExpireTimer[MAXPLAYERS + 1] = { null, ... } , g_hMuteExpireTimer[MAXPLAYERS + 1] = { null, ... }; bType g_MuteType[MAXPLAYERS + 1]; @@ -170,7 +171,7 @@ public Plugin myinfo = name = "SourceBans++: SourceComms", author = "Alex, SourceBans++ Dev Team", description = "Advanced punishments management for the Source engine in SourceBans style", - version = PLUGIN_VERSION, + version = SBPPComms_VERSION, url = "https://sbpp.github.io" }; @@ -183,6 +184,9 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max CreateNative("SourceComms_GetClientMuteType", Native_GetClientMuteType); CreateNative("SourceComms_GetClientGagType", Native_GetClientGagType); + g_hFwd_StatusOK = CreateGlobalForward("SourceComms_OnPluginOK", ET_Ignore); + g_hFwd_StatusNotOK = CreateGlobalForward("SourceComms_OnPluginNotOK", ET_Ignore); + g_hFwd_OnPlayerPunished = CreateGlobalForward("SourceComms_OnBlockAdded", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_Cell, Param_String); g_hFwd_OnPlayerUnpunished = CreateGlobalForward("SourceComms_OnBlockRemoved", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String); @@ -203,7 +207,7 @@ public void OnPluginStart() CvarPort = FindConVar("hostport"); g_hServersWhiteList = new ArrayList(); - CreateConVar("sourcecomms_version", PLUGIN_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY); + CreateConVar("sourcecomms_version", SBPPComms_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY); AddCommandListener(CommandCallback, "sm_gag"); AddCommandListener(CommandCallback, "sm_mute"); AddCommandListener(CommandCallback, "sm_silence"); @@ -222,7 +226,7 @@ public void OnPluginStart() #endif #if defined DEBUG - PrintToServer("Sourcecomms plugin loading. Version %s", PLUGIN_VERSION); + PrintToServer("Sourcecomms plugin loading. Version %s", SBPPComms_VERSION); #endif // Catch config error @@ -248,6 +252,24 @@ public void OnPluginStart() g_bLate = false; } +public void OnAllPluginsLoaded() +{ + SendForward_Available(); +} + +public void OnPluginPauseChange(bool pause) +{ + if (pause) + SendForward_NotAvailable(); + else + SendForward_Available(); +} + +public void OnPluginEnd() +{ + SendForward_NotAvailable(); +} + public void OnLibraryRemoved(const char[] name) { if (strcmp(name, "adminmenu", false) == 0) @@ -3503,4 +3525,17 @@ public int Native_GetClientGagType(Handle hPlugin, int numParams) return g_GagType[target]; } + +stock void SendForward_Available() +{ + Call_StartForward(g_hFwd_StatusOK); + Call_Finish(); +} + +stock void SendForward_NotAvailable() +{ + Call_StartForward(g_hFwd_StatusNotOK); + Call_Finish(); +} + //Yarr! diff --git a/game/addons/sourcemod/scripting/sbpp_main.sp b/game/addons/sourcemod/scripting/sbpp_main.sp index 5bc16abcd..b022209c7 100644 --- a/game/addons/sourcemod/scripting/sbpp_main.sp +++ b/game/addons/sourcemod/scripting/sbpp_main.sp @@ -35,8 +35,6 @@ #pragma newdecls required -#define SB_VERSION "1.8.2" - #if defined _updater_included #define UPDATE_URL "https://sbpp.github.io/updater/updatefile.txt" #endif @@ -120,11 +118,13 @@ int SMCParser ConfigParser; -Handle - g_hFwd_OnBanAdded - , g_hFwd_OnReportAdded - , g_hFwd_OnClientPreAdminCheck - , PlayerRecheck[MAXPLAYERS + 1] = { INVALID_HANDLE, ... }; /* Timer handle */ +GlobalForward g_hFwd_StatusOK + , g_hFwd_StatusNotOK + , g_hFwd_OnBanAdded + , g_hFwd_OnReportAdded + , g_hFwd_OnClientPreAdminCheck; + +Handle PlayerRecheck[MAXPLAYERS + 1] = { INVALID_HANDLE, ... }; /* Timer handle */ DataPack PlayerDataPack[MAXPLAYERS + 1] = { null, ... }; @@ -152,6 +152,9 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max CreateNative("SBPP_BanPlayer", Native_SBBanPlayer); CreateNative("SBPP_ReportPlayer", Native_SBReportPlayer); + g_hFwd_StatusOK = CreateGlobalForward("SBPP_OnPluginOK", ET_Ignore); + g_hFwd_StatusNotOK = CreateGlobalForward("SBPP_OnPluginNotOK", ET_Ignore); + g_hFwd_OnBanAdded = CreateGlobalForward("SBPP_OnBanPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String); g_hFwd_OnReportAdded = CreateGlobalForward("SBPP_OnReportPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_String); g_hFwd_OnClientPreAdminCheck = CreateGlobalForward("SBPP_OnClientPreAdminCheck", ET_Ignore, Param_Cell); @@ -260,6 +263,8 @@ public void OnLibraryAdded(const char[] name) public void OnAllPluginsLoaded() { + SendForward_Available(); + TopMenu topmenu; #if defined DEBUG LogToFile(logFile, "OnAllPluginsLoaded()"); @@ -271,6 +276,19 @@ public void OnAllPluginsLoaded() } } +public void OnPluginPauseChange(bool pause) +{ + if (pause) + SendForward_NotAvailable(); + else + SendForward_Available(); +} + +public void OnPluginEnd() +{ + SendForward_NotAvailable(); +} + public void OnConfigsExecuted() { char filename[200]; @@ -2829,4 +2847,16 @@ stock void AccountForLateLoading() } } +stock void SendForward_Available() +{ + Call_StartForward(g_hFwd_StatusOK); + Call_Finish(); +} + +stock void SendForward_NotAvailable() +{ + Call_StartForward(g_hFwd_StatusNotOK); + Call_Finish(); +} + //Yarr! From 649d1dad03634e16551c6fdb542f677d1f403a47 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Wed, 29 Jan 2025 19:31:36 +0100 Subject: [PATCH 2/5] Revert "feat(API): Plugins status forwards & sbppchecker lib" This reverts commit 4265c752d5240fb290b091b381fdd18c722347b5. --- .../scripting/include/sourcebanschecker.inc | 21 -------- .../scripting/include/sourcebanspp.inc | 21 -------- .../scripting/include/sourcecomms.inc | 22 +------- .../sourcemod/scripting/sbpp_checker.sp | 44 ++-------------- game/addons/sourcemod/scripting/sbpp_comms.sp | 51 +++---------------- game/addons/sourcemod/scripting/sbpp_main.sp | 44 +++------------- 6 files changed, 20 insertions(+), 183 deletions(-) diff --git a/game/addons/sourcemod/scripting/include/sourcebanschecker.inc b/game/addons/sourcemod/scripting/include/sourcebanschecker.inc index af639a3e9..f0be9fd44 100644 --- a/game/addons/sourcemod/scripting/include/sourcebanschecker.inc +++ b/game/addons/sourcemod/scripting/include/sourcebanschecker.inc @@ -29,12 +29,6 @@ #endif #define _sourcebanschecker_included -#define SBPPChecker_V_MAJOR 1 -#define SBPPChecker_V_MINOR 8 -#define SBPPChecker_V_PATCH 4 - -#define SBPPChecker_VERSION "1.8.4" - public SharedPlugin __pl_sourcebanschecker = { name = "sourcebans++", @@ -89,18 +83,3 @@ native int SBPP_CheckerGetClientsMutes(int iClient); * @return The number of gags of the client. *********************************************************/ native int SBPP_CheckerGetClientsGags(int iClient); - -/********************************************************* - * Called when the plugin becomes available. - * - * @noreturn - *********************************************************/ -forward void SBPPChecker_OnPluginOK(); - -/********************************************************* - * Called when the plugin becomes unavailable. - * This can happen when the plugin is paused or unloaded. - * - * @noreturn - *********************************************************/ -forward void SBPPChecker_OnPluginNotOK(); diff --git a/game/addons/sourcemod/scripting/include/sourcebanspp.inc b/game/addons/sourcemod/scripting/include/sourcebanspp.inc index 3130bdf62..f85758127 100644 --- a/game/addons/sourcemod/scripting/include/sourcebanspp.inc +++ b/game/addons/sourcemod/scripting/include/sourcebanspp.inc @@ -29,12 +29,6 @@ #endif #define _sourcebanspp_included -#define SB_VERSION_MAJOR 1 -#define SB_VERSION_MINOR 8 -#define SB_VERSION_PATCH 3 - -#define SB_VERSION "1.8.3" - public SharedPlugin __pl_sourcebanspp = { name = "sourcebans++", @@ -89,21 +83,6 @@ native void SBPP_BanPlayer(int iAdmin, int iTarget, int iTime, const char[] sRea *********************************************************/ native void SBPP_ReportPlayer(int iReporter, int iTarget, const char[] sReason); -/********************************************************* - * Called when the plugin becomes available. - * - * @noreturn -*********************************************************/ -forward void SBPP_OnPluginOK(); - -/********************************************************* - * Called when the plugin becomes unavailable. - * This can happen when the plugin is paused or unloaded. - * - * @noreturn -*********************************************************/ -forward void SBPP_OnPluginNotOK(); - /********************************************************* * Called when the admin banning the player. * diff --git a/game/addons/sourcemod/scripting/include/sourcecomms.inc b/game/addons/sourcemod/scripting/include/sourcecomms.inc index 97b1c7d0c..905cbdd99 100644 --- a/game/addons/sourcemod/scripting/include/sourcecomms.inc +++ b/game/addons/sourcemod/scripting/include/sourcecomms.inc @@ -29,12 +29,6 @@ #endif #define _sourcecomms_included -#define SBPPComms_VERSION_MAJOR 1 -#define SBPPComms_VERSION_MINOR 8 -#define SBPPComms_VERSION_PATCH 2 - -#define SBPPComms_VERSION "1.8.2" - /** * @section Int definitions for punishments types. */ @@ -102,21 +96,6 @@ native bType SourceComms_GetClientMuteType(int client); */ native bType SourceComms_GetClientGagType(int client); -/** - * Called when the plugin becomes available. - * - * @noreturn - */ -forward void SourceComms_OnPluginOK(); - -/** - * Called when the plugin becomes unavailable. - * This can happen when the plugin is paused or unloaded. - * - * @noreturn - */ -forward void SourceComms_OnPluginNotOK(); - /** * Called when added communication block for player. * @@ -155,4 +134,5 @@ public void __pl_sourcecomms_SetNTVOptional() MarkNativeAsOptional("SourceComms_SetClientGag"); MarkNativeAsOptional("SourceComms_GetClientMuteType"); MarkNativeAsOptional("SourceComms_GetClientGagType"); + } diff --git a/game/addons/sourcemod/scripting/sbpp_checker.sp b/game/addons/sourcemod/scripting/sbpp_checker.sp index ae2e2b130..d2f54cf12 100644 --- a/game/addons/sourcemod/scripting/sbpp_checker.sp +++ b/game/addons/sourcemod/scripting/sbpp_checker.sp @@ -28,8 +28,8 @@ #pragma newdecls required #include -#include +#define VERSION "1.8.3" #define LISTBANS_USAGE "sm_listbans <#userid|name> - Lists a user's prior bans from Sourcebans" #define LISTCOMMS_USAGE "sm_listcomms <#userid|name> - Lists a user's prior comms from Sourcebans" #define INVALID_TARGET -1 @@ -47,15 +47,12 @@ int g_iBanCounts[MAXPLAYERS + 1]; int g_iMuteCounts[MAXPLAYERS + 1]; int g_iGagCounts[MAXPLAYERS + 1]; -GlobalForward g_hFwd_StatusOK; -GlobalForward g_hFwd_StatusNotOK; - public Plugin myinfo = { name = "SourceBans++: Bans Checker", author = "psychonic, Ca$h Munny, SourceBans++ Dev Team", description = "Notifies admins of prior bans from Sourcebans upon player connect.", - version = SBPPChecker_VERSION, + version = VERSION, url = "https://sbpp.github.io" }; @@ -64,7 +61,7 @@ public void OnPluginStart() LoadTranslations("common.phrases"); LoadTranslations("sbpp_checker.phrases"); - CreateConVar("sbchecker_version", SBPPChecker_VERSION, "", FCVAR_NOTIFY); + CreateConVar("sbchecker_version", VERSION, "", FCVAR_NOTIFY); RegAdminCmd("sm_listbans", OnListSourceBansCmd, ADMFLAG_GENERIC, LISTBANS_USAGE); RegAdminCmd("sm_listcomms", OnListSourceCommsCmd, ADMFLAG_GENERIC, LISTCOMMS_USAGE); RegAdminCmd("sb_reload", OnReloadCmd, ADMFLAG_RCON, "Reload sourcebans config and ban reason menu options"); @@ -77,24 +74,6 @@ public void OnPluginStart() } } -public void OnAllPluginsLoaded() -{ - SendForward_Available(); -} - -public void OnPluginPauseChange(bool pause) -{ - if (pause) - SendForward_NotAvailable(); - else - SendForward_Available(); -} - -public void OnPluginEnd() -{ - SendForward_NotAvailable(); -} - public void OnMapStart() { ReadConfig(); @@ -116,16 +95,13 @@ public void OnDatabaseConnected(Database db, const char[] error, any data) public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { - RegPluginLibrary("sourcechecker++"); + RegPluginLibrary("sourcebans++"); CreateNative("SBPP_CheckerGetClientsBans", Native_SBCheckerGetClientsBans); CreateNative("SBPP_CheckerGetClientsComms", Native_SBCheckerGetClientsComms); CreateNative("SBPP_CheckerGetClientsMutes", Native_SBCheckerGetClientsMutes); CreateNative("SBPP_CheckerGetClientsGags", Native_SBCheckerGetClientsGags); - g_hFwd_StatusOK = CreateGlobalForward("SBPPChecker_OnPluginOK", ET_Ignore); - g_hFwd_StatusNotOK = CreateGlobalForward("SBPPChecker_OnPluginNotOK", ET_Ignore); - g_bLate = late; return APLRes_Success; @@ -679,16 +655,4 @@ stock void LateLoading() GetClientAuthId(i, AuthId_Steam2, sSteam32ID, sizeof(sSteam32ID)); OnClientAuthorized(i, sSteam32ID); } -} - -stock void SendForward_Available() -{ - Call_StartForward(g_hFwd_StatusOK); - Call_Finish(); -} - -stock void SendForward_NotAvailable() -{ - Call_StartForward(g_hFwd_StatusNotOK); - Call_Finish(); } \ No newline at end of file diff --git a/game/addons/sourcemod/scripting/sbpp_comms.sp b/game/addons/sourcemod/scripting/sbpp_comms.sp index c61631844..29dfef095 100644 --- a/game/addons/sourcemod/scripting/sbpp_comms.sp +++ b/game/addons/sourcemod/scripting/sbpp_comms.sp @@ -43,6 +43,7 @@ // Do not edit below this line // //-----------------------------// +#define PLUGIN_VERSION "1.8.1" #define PREFIX "\x04[SourceComms++]\x01 " //GLOBAL DEFINES @@ -133,12 +134,10 @@ int SMCParser ConfigParser; -GlobalForward g_hFwd_StatusOK - , g_hFwd_StatusNotOK - , g_hFwd_OnPlayerPunished - , g_hFwd_OnPlayerUnpunished; - -Handle g_hGagExpireTimer[MAXPLAYERS + 1] = { null, ... } +Handle + g_hFwd_OnPlayerPunished + , g_hFwd_OnPlayerUnpunished + , g_hGagExpireTimer[MAXPLAYERS + 1] = { null, ... } , g_hMuteExpireTimer[MAXPLAYERS + 1] = { null, ... }; bType g_MuteType[MAXPLAYERS + 1]; @@ -171,7 +170,7 @@ public Plugin myinfo = name = "SourceBans++: SourceComms", author = "Alex, SourceBans++ Dev Team", description = "Advanced punishments management for the Source engine in SourceBans style", - version = SBPPComms_VERSION, + version = PLUGIN_VERSION, url = "https://sbpp.github.io" }; @@ -184,9 +183,6 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max CreateNative("SourceComms_GetClientMuteType", Native_GetClientMuteType); CreateNative("SourceComms_GetClientGagType", Native_GetClientGagType); - g_hFwd_StatusOK = CreateGlobalForward("SourceComms_OnPluginOK", ET_Ignore); - g_hFwd_StatusNotOK = CreateGlobalForward("SourceComms_OnPluginNotOK", ET_Ignore); - g_hFwd_OnPlayerPunished = CreateGlobalForward("SourceComms_OnBlockAdded", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_Cell, Param_String); g_hFwd_OnPlayerUnpunished = CreateGlobalForward("SourceComms_OnBlockRemoved", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String); @@ -207,7 +203,7 @@ public void OnPluginStart() CvarPort = FindConVar("hostport"); g_hServersWhiteList = new ArrayList(); - CreateConVar("sourcecomms_version", SBPPComms_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY); + CreateConVar("sourcecomms_version", PLUGIN_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY); AddCommandListener(CommandCallback, "sm_gag"); AddCommandListener(CommandCallback, "sm_mute"); AddCommandListener(CommandCallback, "sm_silence"); @@ -226,7 +222,7 @@ public void OnPluginStart() #endif #if defined DEBUG - PrintToServer("Sourcecomms plugin loading. Version %s", SBPPComms_VERSION); + PrintToServer("Sourcecomms plugin loading. Version %s", PLUGIN_VERSION); #endif // Catch config error @@ -252,24 +248,6 @@ public void OnPluginStart() g_bLate = false; } -public void OnAllPluginsLoaded() -{ - SendForward_Available(); -} - -public void OnPluginPauseChange(bool pause) -{ - if (pause) - SendForward_NotAvailable(); - else - SendForward_Available(); -} - -public void OnPluginEnd() -{ - SendForward_NotAvailable(); -} - public void OnLibraryRemoved(const char[] name) { if (strcmp(name, "adminmenu", false) == 0) @@ -3525,17 +3503,4 @@ public int Native_GetClientGagType(Handle hPlugin, int numParams) return g_GagType[target]; } - -stock void SendForward_Available() -{ - Call_StartForward(g_hFwd_StatusOK); - Call_Finish(); -} - -stock void SendForward_NotAvailable() -{ - Call_StartForward(g_hFwd_StatusNotOK); - Call_Finish(); -} - //Yarr! diff --git a/game/addons/sourcemod/scripting/sbpp_main.sp b/game/addons/sourcemod/scripting/sbpp_main.sp index b022209c7..5bc16abcd 100644 --- a/game/addons/sourcemod/scripting/sbpp_main.sp +++ b/game/addons/sourcemod/scripting/sbpp_main.sp @@ -35,6 +35,8 @@ #pragma newdecls required +#define SB_VERSION "1.8.2" + #if defined _updater_included #define UPDATE_URL "https://sbpp.github.io/updater/updatefile.txt" #endif @@ -118,13 +120,11 @@ int SMCParser ConfigParser; -GlobalForward g_hFwd_StatusOK - , g_hFwd_StatusNotOK - , g_hFwd_OnBanAdded - , g_hFwd_OnReportAdded - , g_hFwd_OnClientPreAdminCheck; - -Handle PlayerRecheck[MAXPLAYERS + 1] = { INVALID_HANDLE, ... }; /* Timer handle */ +Handle + g_hFwd_OnBanAdded + , g_hFwd_OnReportAdded + , g_hFwd_OnClientPreAdminCheck + , PlayerRecheck[MAXPLAYERS + 1] = { INVALID_HANDLE, ... }; /* Timer handle */ DataPack PlayerDataPack[MAXPLAYERS + 1] = { null, ... }; @@ -152,9 +152,6 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max CreateNative("SBPP_BanPlayer", Native_SBBanPlayer); CreateNative("SBPP_ReportPlayer", Native_SBReportPlayer); - g_hFwd_StatusOK = CreateGlobalForward("SBPP_OnPluginOK", ET_Ignore); - g_hFwd_StatusNotOK = CreateGlobalForward("SBPP_OnPluginNotOK", ET_Ignore); - g_hFwd_OnBanAdded = CreateGlobalForward("SBPP_OnBanPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String); g_hFwd_OnReportAdded = CreateGlobalForward("SBPP_OnReportPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_String); g_hFwd_OnClientPreAdminCheck = CreateGlobalForward("SBPP_OnClientPreAdminCheck", ET_Ignore, Param_Cell); @@ -263,8 +260,6 @@ public void OnLibraryAdded(const char[] name) public void OnAllPluginsLoaded() { - SendForward_Available(); - TopMenu topmenu; #if defined DEBUG LogToFile(logFile, "OnAllPluginsLoaded()"); @@ -276,19 +271,6 @@ public void OnAllPluginsLoaded() } } -public void OnPluginPauseChange(bool pause) -{ - if (pause) - SendForward_NotAvailable(); - else - SendForward_Available(); -} - -public void OnPluginEnd() -{ - SendForward_NotAvailable(); -} - public void OnConfigsExecuted() { char filename[200]; @@ -2847,16 +2829,4 @@ stock void AccountForLateLoading() } } -stock void SendForward_Available() -{ - Call_StartForward(g_hFwd_StatusOK); - Call_Finish(); -} - -stock void SendForward_NotAvailable() -{ - Call_StartForward(g_hFwd_StatusNotOK); - Call_Finish(); -} - //Yarr! From d0af722e2653f664bb2d8b96ebe42617d7b7aaab Mon Sep 17 00:00:00 2001 From: Rushaway Date: Wed, 29 Jan 2025 19:33:33 +0100 Subject: [PATCH 3/5] update RegPluginLibrary for sbppchecker --- game/addons/sourcemod/scripting/sbpp_checker.sp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/addons/sourcemod/scripting/sbpp_checker.sp b/game/addons/sourcemod/scripting/sbpp_checker.sp index d2f54cf12..41c0bb62e 100644 --- a/game/addons/sourcemod/scripting/sbpp_checker.sp +++ b/game/addons/sourcemod/scripting/sbpp_checker.sp @@ -29,7 +29,7 @@ #include -#define VERSION "1.8.3" +#define VERSION "1.8.4" #define LISTBANS_USAGE "sm_listbans <#userid|name> - Lists a user's prior bans from Sourcebans" #define LISTCOMMS_USAGE "sm_listcomms <#userid|name> - Lists a user's prior comms from Sourcebans" #define INVALID_TARGET -1 @@ -95,7 +95,7 @@ public void OnDatabaseConnected(Database db, const char[] error, any data) public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { - RegPluginLibrary("sourcebans++"); + RegPluginLibrary("sourcechecker++"); CreateNative("SBPP_CheckerGetClientsBans", Native_SBCheckerGetClientsBans); CreateNative("SBPP_CheckerGetClientsComms", Native_SBCheckerGetClientsComms); From ce2f2344a33f16f15fd3fdb2a745eef6630d6976 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Fri, 14 Feb 2025 09:47:29 +0100 Subject: [PATCH 4/5] Adjust major version --- game/addons/sourcemod/scripting/sbpp_checker.sp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/addons/sourcemod/scripting/sbpp_checker.sp b/game/addons/sourcemod/scripting/sbpp_checker.sp index 41c0bb62e..a656649af 100644 --- a/game/addons/sourcemod/scripting/sbpp_checker.sp +++ b/game/addons/sourcemod/scripting/sbpp_checker.sp @@ -29,7 +29,7 @@ #include -#define VERSION "1.8.4" +#define VERSION "1.9.0" #define LISTBANS_USAGE "sm_listbans <#userid|name> - Lists a user's prior bans from Sourcebans" #define LISTCOMMS_USAGE "sm_listcomms <#userid|name> - Lists a user's prior comms from Sourcebans" #define INVALID_TARGET -1 @@ -655,4 +655,4 @@ stock void LateLoading() GetClientAuthId(i, AuthId_Steam2, sSteam32ID, sizeof(sSteam32ID)); OnClientAuthorized(i, sSteam32ID); } -} \ No newline at end of file +} From b04b0fba5b4f358e3ca00d85ae9f0e70ddc3b2e4 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Fri, 14 Feb 2025 18:15:38 +0100 Subject: [PATCH 5/5] Update sbpp_checker.sp --- game/addons/sourcemod/scripting/sbpp_checker.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/addons/sourcemod/scripting/sbpp_checker.sp b/game/addons/sourcemod/scripting/sbpp_checker.sp index a656649af..eeeb3d110 100644 --- a/game/addons/sourcemod/scripting/sbpp_checker.sp +++ b/game/addons/sourcemod/scripting/sbpp_checker.sp @@ -29,7 +29,7 @@ #include -#define VERSION "1.9.0" +#define VERSION "2.0.0" #define LISTBANS_USAGE "sm_listbans <#userid|name> - Lists a user's prior bans from Sourcebans" #define LISTCOMMS_USAGE "sm_listcomms <#userid|name> - Lists a user's prior comms from Sourcebans" #define INVALID_TARGET -1