From 2462b2aa1013c42f215f311798a7a77e54c3eefd Mon Sep 17 00:00:00 2001 From: nwrl Date: Thu, 14 Aug 2025 22:27:57 -0500 Subject: Add note to self --- nameblocker.sp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nameblocker.sp b/nameblocker.sp index c6686c2..f125638 100644 --- a/nameblocker.sp +++ b/nameblocker.sp @@ -34,12 +34,16 @@ // If database locking takes too long I might need to use threaded calls, which sounds like a fucking nightmare +// TODO: Overhaul logging and print everything to console. I can't debug this as of now + #pragma newdecls required #pragma semicolon 1 #include #include +#define DEBUG_304142124110815 1 + public Plugin myinfo = { name = "SM Name Blocker", description = "A simple plugin to stop people with blacklisted names from joining a server", @@ -113,6 +117,9 @@ int concatArgs(char[] buf, int maxbuflen, int maxarglen, int end, int start=1) { Format(tmp, maxbuflen, "%s %s", tmp, arg); } + #if defined DEBUG_304142124110815 + PrintToServer(" Preformed concat: %s", tmp); + #endif return strcopy(buf, maxbuflen, tmp); } @@ -199,7 +206,7 @@ void loadFromDatabase() { SQL_LockDatabase(db); // select patterns from nameblock table/database - if(SQL_Execute(dbPopulate) && !err) { + if(!SQL_Execute(dbPopulate) && !err) { SQL_GetError(dbPopulate, sqlerr, sizeof(sqlerr)); err = 2; } @@ -272,7 +279,7 @@ public void OnClientSettingsChanged(int client) { public Action cmdRegisterPattern(int client, int args) { - if(args < 2) { + if(args < 1) { ReplyToCommand(client, "Error: missing regex pattern"); return Plugin_Handled; } -- cgit v1.2.3