summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nameblocker.sp11
1 files 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 @@
34 34
35 // If database locking takes too long I might need to use threaded calls, which sounds like a fucking nightmare 35 // If database locking takes too long I might need to use threaded calls, which sounds like a fucking nightmare
36 36
37// TODO: Overhaul logging and print everything to console. I can't debug this as of now
38
37#pragma newdecls required 39#pragma newdecls required
38#pragma semicolon 1 40#pragma semicolon 1
39 41
40#include <sourcemod> 42#include <sourcemod>
41#include <regex> 43#include <regex>
42 44
45#define DEBUG_304142124110815 1
46
43public Plugin myinfo = { 47public Plugin myinfo = {
44 name = "SM Name Blocker", 48 name = "SM Name Blocker",
45 description = "A simple plugin to stop people with blacklisted names from joining a server", 49 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) {
113 Format(tmp, maxbuflen, "%s %s", tmp, arg); 117 Format(tmp, maxbuflen, "%s %s", tmp, arg);
114 } 118 }
115 119
120 #if defined DEBUG_304142124110815
121 PrintToServer("<SM Name Blocker::concatArgs> Preformed concat: %s", tmp);
122 #endif
116 return strcopy(buf, maxbuflen, tmp); 123 return strcopy(buf, maxbuflen, tmp);
117} 124}
118 125
@@ -199,7 +206,7 @@ void loadFromDatabase() {
199 SQL_LockDatabase(db); 206 SQL_LockDatabase(db);
200 207
201 // select patterns from nameblock table/database 208 // select patterns from nameblock table/database
202 if(SQL_Execute(dbPopulate) && !err) { 209 if(!SQL_Execute(dbPopulate) && !err) {
203 SQL_GetError(dbPopulate, sqlerr, sizeof(sqlerr)); 210 SQL_GetError(dbPopulate, sqlerr, sizeof(sqlerr));
204 err = 2; 211 err = 2;
205 } 212 }
@@ -272,7 +279,7 @@ public void OnClientSettingsChanged(int client) {
272 279
273 280
274public Action cmdRegisterPattern(int client, int args) { 281public Action cmdRegisterPattern(int client, int args) {
275 if(args < 2) { 282 if(args < 1) {
276 ReplyToCommand(client, "Error: missing regex pattern"); 283 ReplyToCommand(client, "Error: missing regex pattern");
277 return Plugin_Handled; 284 return Plugin_Handled;
278 } 285 }