Skip to content

Commit f1baddf

Browse files
authored
fix: remove debug log, fix typos, logic inversion, and wrong return values (#1510)
sbpp_main.sp: - Remove accidental debug LogMessage left in SelectBanIPCallback ("******************************Tagetauth: %s") - Fix 'permament' -> 'permanent' typo (two occurrences: CommandBan, CommandSBBan) - Fix inverted condition in AddedFromSQLiteCallback: 'results == null' should be 'results != null' — successful SQLite inserts were being treated as failures, causing the offline-ban queue recovery to re-extend temp bans instead of clearing processed entries sbpp_report.sp: - Start player-list loop at i=1 instead of i=0; client 0 is the server console and is never a valid report target sbpp_sleuth.sp: - Return Plugin_Handled from sm_slreload command handler; Plugin_Continue caused 'Unknown command' to appear in the caller's console
1 parent c33c4ef commit f1baddf

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

game/addons/sourcemod/scripting/sbpp_main.sp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,6 @@ public void SelectBanIpCallback(Database db, DBResultSet results, const char[] e
12571257
DB.Escape(reason, banReason, sizeof(banReason));
12581258
DB.Escape(targetName, sTEscapedName, sizeof(sTEscapedName));
12591259

1260-
LogMessage("******************************Tagetauth: %s", targetAuth);
1261-
12621260
if (results == null)
12631261
{
12641262
LogToFile(logFile, "Ban IP Select Query Failed: %s", error);
@@ -1327,7 +1325,7 @@ public void InsertBanIpCallback(Database db, DBResultSet results, const char[] e
13271325
{
13281326
char length[32];
13291327
if(minutes == 0)
1330-
FormatEx(length, sizeof(length), "permament");
1328+
FormatEx(length, sizeof(length), "permanent");
13311329
else
13321330
FormatEx(length, sizeof(length), "%d %s", minutes, minutes == 1 ? "minute" : "minutes");
13331331

@@ -1609,7 +1607,7 @@ public void AddedFromSQLiteCallback(Database db, DBResultSet results, const char
16091607
char auth[MAX_AUTHID_LENGTH];
16101608

16111609
dataPack.ReadString(auth, sizeof(auth));
1612-
if (results == null)
1610+
if (results != null)
16131611
{
16141612
// The insert was successful so delete the record from the queue
16151613
FormatEx(buffer, sizeof(buffer), "DELETE FROM queue WHERE steam_id = '%s'", auth);
@@ -2599,7 +2597,7 @@ stock void UTIL_InsertTempBan(int time, const char[] name, const char[] auth, co
25992597
{
26002598
char length[32];
26012599
if(time == 0)
2602-
FormatEx(length, sizeof(length), "permament");
2600+
FormatEx(length, sizeof(length), "permanent");
26032601
else
26042602
FormatEx(length, sizeof(length), "%d %s", time, time == 1 ? "minute" : "minutes");
26052603
KickClient(client, "%t\n\n%t", "Banned Check Site", WebsiteAddress, "Kick Reason", admin, reason, length);

game/addons/sourcemod/scripting/sbpp_report.sp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public Action CmdReport(int iClient, int iArgs)
6767

6868
char sName[MAX_NAME_LENGTH], sIndex[4];
6969

70-
for (int i = 0; i <= MaxClients; i++)
70+
for (int i = 1; i <= MaxClients; i++)
7171
{
7272
if (!IsValidClient(i))
7373
continue;

game/addons/sourcemod/scripting/sbpp_sleuth.sp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public Action ReloadListCallBack(int client, int args)
182182
PrintToChat(client, "%sWhiteList has been reloaded!", PREFIX);
183183
}
184184

185-
return Plugin_Continue;
185+
return Plugin_Handled;
186186
}
187187

188188
public void OnClientPostAdminCheck(int client)

0 commit comments

Comments
 (0)