Skip to content

Commit f9f19c1

Browse files
committed
1.5.4.3
Added ULX Gmod Module Downgrade SM Plugin to 1.5.3
1 parent 0f39533 commit f9f19c1

File tree

17 files changed

+3802
-3280
lines changed

17 files changed

+3802
-3280
lines changed
Binary file not shown.
Binary file not shown.
-138 Bytes
Binary file not shown.
-88 Bytes
Binary file not shown.
Binary file not shown.

game_upload/addons/sourcemod/scripting/SourceSleuth.sp

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#undef REQUIRE_PLUGIN
3030
#include <sourcebans>
3131

32-
#define PLUGIN_VERSION "(SB++) 1.5.4.2"
32+
#define PLUGIN_VERSION "(SB++) 1.5.4.3"
3333

3434
#define LENGTH_ORIGINAL 1
3535
#define LENGTH_CUSTOM 2
@@ -53,18 +53,18 @@ new bool:CanUseSourcebans = false;
5353

5454
public Plugin:myinfo =
5555
{
56-
name = "SourceSleuth",
57-
author = "ecca, Sarabveer(VEER™)",
58-
description = "Useful for TF2 servers. Plugin will check for banned ips and ban the player.",
59-
version = PLUGIN_VERSION,
60-
url = "http://sourcemod.net"
56+
name = "SourceSleuth",
57+
author = "ecca, Sarabveer(VEER™)",
58+
description= "Useful for TF2 servers. Plugin will check for banned ips and ban the player.",
59+
version = PLUGIN_VERSION,
60+
url = "http://sourcemod.net"
6161
};
6262

6363
public OnPluginStart()
6464
{
6565
LoadTranslations("sourcesleuth.phrases");
6666

67-
CreateConVar("sm_sourcesleuth_version", PLUGIN_VERSION, "SourceSleuth plugin version", FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD);
67+
CreateConVar("sm_sourcesleuth_version", PLUGIN_VERSION, "SourceSleuth plugin version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
6868

6969
g_cVar_actions = CreateConVar("sm_sleuth_actions", "3", "Sleuth Ban Type: 1 - Original Length, 2 - Custom Length, 3 - Double Length, 4 - Notify Admins Only", FCVAR_PLUGIN, true, 1.0, true, 4.0);
7070
g_cVar_banduration = CreateConVar("sm_sleuth_duration", "0", "Required: sm_sleuth_actions 1: Bantime to ban player if we got a match (0 = permanent (defined in minutes) )", FCVAR_PLUGIN);
@@ -76,7 +76,7 @@ public OnPluginStart()
7676
g_hAllowedArray = CreateArray(256);
7777

7878
AutoExecConfig(true, "Sm_SourceSleuth");
79-
79+
8080
SQL_TConnect(SQL_OnConnect, "sourcebans");
8181

8282
RegAdminCmd("sm_sleuth_reloadlist", ReloadListCallBack, ADMFLAG_ROOT);
@@ -110,10 +110,10 @@ public SQL_OnConnect(Handle:owner, Handle:hndl, const String:error[], any:data)
110110
if (hndl == INVALID_HANDLE)
111111
{
112112
LogError("SourceSleuth: Database connection error: %s", error);
113-
}
114-
else
113+
}
114+
else
115115
{
116-
hDatabase = hndl;
116+
hDatabase = hndl;
117117
}
118118
}
119119

@@ -125,7 +125,7 @@ public Action:ReloadListCallBack(client, args)
125125

126126
LogMessage("%L reloaded the whitelist", client);
127127

128-
if (client != 0)
128+
if(client != 0)
129129
{
130130
PrintToChat(client, "[SourceSleuth] WhiteList has been reloaded!");
131131
}
@@ -135,29 +135,29 @@ public Action:ReloadListCallBack(client, args)
135135

136136
public OnClientPostAdminCheck(client)
137137
{
138-
if (CanUseSourcebans && !IsFakeClient(client))
138+
if(CanUseSourcebans && !IsFakeClient(client))
139139
{
140-
decl String:steamid[32];
140+
new String:steamid[32];
141141
GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
142142

143-
if (g_cVar_bypass.BoolValue && CheckCommandAccess(client, "sleuth_admin", ADMFLAG_BAN, false))
143+
if (g_cVar_bypass.BoolValue && CheckCommandAccess(client, "sleuth_admin", ADMFLAG_BAN, false))
144144
{
145145
return;
146146
}
147147

148-
if (FindStringInArray(g_hAllowedArray, steamid) == -1)
148+
if(FindStringInArray(g_hAllowedArray, steamid) == -1)
149149
{
150-
decl String:IP[32], String:Prefix[64];
150+
new String:IP[32], String:Prefix[64];
151151
GetClientIP(client, IP, sizeof(IP));
152152

153153
g_cVar_sbprefix.GetString(Prefix, sizeof(Prefix));
154154

155-
decl String:query[1024];
156-
157-
FormatEx(query, sizeof(query), "SELECT * FROM %s_bans WHERE ip='%s' AND RemoveType IS NULL AND ends > %d", Prefix, IP, g_cVar_bantype.IntValue == 0 ? GetTime() : 0);
155+
new String:query[1024];
158156

157+
FormatEx(query, sizeof(query), "SELECT * FROM %s_bans WHERE ip='%s' AND RemoveType IS NULL AND ends > %d", Prefix, IP, g_cVar_bantype.IntValue == 0 ? GetTime() : 0);
158+
159159
new Handle:datapack = CreateDataPack();
160-
160+
161161
WritePackCell(datapack, GetClientUserId(client));
162162
WritePackString(datapack, steamid);
163163
WritePackString(datapack, IP);
@@ -173,12 +173,12 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
173173
new client;
174174
decl String:steamid[32], String:IP[32];
175175

176-
if (datapack != INVALID_HANDLE)
176+
if(datapack != INVALID_HANDLE)
177177
{
178178
client = GetClientOfUserId(ReadPackCell(datapack));
179179
ReadPackString(datapack, steamid, sizeof(steamid));
180180
ReadPackString(datapack, IP, sizeof(IP));
181-
CloseHandle(datapack);
181+
CloseHandle(datapack);
182182
}
183183

184184
if (hndl == INVALID_HANDLE)
@@ -190,14 +190,14 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
190190
{
191191
new TotalBans = SQL_GetRowCount(hndl);
192192

193-
if (TotalBans > g_cVar_bansAllowed.IntValue)
193+
if(TotalBans > g_cVar_bansAllowed.IntValue)
194194
{
195195
switch (g_cVar_actions.IntValue)
196196
{
197197
case LENGTH_ORIGINAL:
198198
{
199199
new length = SQL_FetchInt(hndl, 6);
200-
new time = length * 60;
200+
new time = length*60;
201201

202202
BanPlayer(client, time);
203203
}
@@ -209,14 +209,14 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
209209
case LENGTH_DOUBLE:
210210
{
211211
new length = SQL_FetchInt(hndl, 6);
212-
new time = length / 60 * 2;
213-
212+
new time = length/60*2;
213+
214214
BanPlayer(client, time);
215215
}
216216
case LENGTH_NOTIFY:
217217
{
218218
/* Notify Admins when a client with an ip on the bans list connects */
219-
PrintToAdmins("[SourceSleuth] %t", "sourcesleuth_admintext", client, steamid, IP);
219+
PrintToAdmins("[SourceSleuth] %t", "sourcesleuth_admintext",client, steamid, IP);
220220
}
221221
}
222222
}
@@ -232,9 +232,9 @@ stock BanPlayer(client, time)
232232

233233
PrintToAdmins(const String:format[], any:...)
234234
{
235-
decl String:g_Buffer[256];
235+
new String:g_Buffer[256];
236236

237-
for (new i = 1; i <= MaxClients; i++)
237+
for (new i=1;i<=MaxClients;i++)
238238
{
239239
if (CheckCommandAccess(i, "sm_sourcesleuth_printtoadmins", ADMFLAG_BAN) && IsClientInGame(i))
240240
{
@@ -248,25 +248,17 @@ PrintToAdmins(const String:format[], any:...)
248248
public LoadWhiteList()
249249
{
250250
decl String:path[PLATFORM_MAX_PATH], String:line[256];
251-
251+
252252
BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "configs/sourcesleuth_whitelist.cfg");
253-
253+
254254
new Handle:fileHandle = OpenFile(path, "r");
255-
256-
if (fileHandle != INVALID_HANDLE)
257-
{
258-
while (!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, line, sizeof(line)))
259-
{
260-
ReplaceString(line, sizeof(line), "\n", "", false);
261-
262-
PushArrayString(g_hAllowedArray, line);
263-
}
264-
265-
CloseHandle(fileHandle);
266-
}
267-
else
255+
256+
while(!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, line, sizeof(line)))
268257
{
269-
LogError("[SM] Warning File: \"configs/sourcesleuth_whitelist.cfg\" missing or inaccessible.");
270-
LogError("[SM] Continuing without loading ip address whitelists.");
258+
ReplaceString(line, sizeof(line), "\n", "", false);
259+
260+
PushArrayString(g_hAllowedArray, line);
271261
}
262+
263+
CloseHandle(fileHandle);
272264
}

game_upload/addons/sourcemod/scripting/include/sourcebans.inc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// *************************************************************************
22
// This file is part of SourceBans++.
33
//
4-
// Copyright (C) 2014-2016 Sarabveer Singh <me@sarabveer.me>
4+
// Copyright (C) 2014-2015 Sarabveer Singh <sarabveer@sarabveer.me>
55
//
66
// SourceBans++ is free software: you can redistribute it and/or modify
77
// it under the terms of the GNU General Public License as published by
@@ -25,19 +25,19 @@
2525
// *************************************************************************
2626

2727
#if defined _sourcebans_included
28-
#endinput
28+
#endinput
2929
#endif
3030
#define _sourcebans_included
3131

3232
public SharedPlugin:__pl_sourcebans =
3333
{
34-
name = "SourceBans",
35-
file = "sourcebans.smx",
36-
#if defined REQUIRE_PLUGIN
37-
required = 1
38-
#else
39-
required = 0
40-
#endif
34+
name = "SourceBans",
35+
file = "sourcebans.smx",
36+
#if defined REQUIRE_PLUGIN
37+
required = 1
38+
#else
39+
required = 0
40+
#endif
4141
};
4242

4343
#if !defined REQUIRE_PLUGIN

game_upload/addons/sourcemod/scripting/include/sourcecomms.inc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// *************************************************************************
22
// This file is part of SourceBans++.
33
//
4-
// Copyright (C) 2014-2016 Sarabveer Singh <me@sarabveer.me>
4+
// Copyright (C) 2014-2015 Sarabveer Singh <sarabveer@sarabveer.me>
55
//
66
// SourceBans++ is free software: you can redistribute it and/or modify
77
// it under the terms of the GNU General Public License as published by
@@ -25,16 +25,16 @@
2525
// *************************************************************************
2626

2727
#if defined _sourcecomms_included
28-
#endinput
28+
#endinput
2929
#endif
3030
#define _sourcecomms_included
3131

3232
/* Punishments types */
33-
enum bType {
34-
bNot = 0, // Player chat or voice is not blocked
35-
bSess, // ... blocked for player session (until reconnect)
36-
bTime, // ... blocked for some time
37-
bPerm // ... permanently blocked
33+
enum bType{
34+
bNot = 0, // Player chat or voice is not blocked
35+
bSess, // ... blocked for player session (until reconnect)
36+
bTime, // ... blocked for some time
37+
bPerm // ... permanently blocked
3838
}
3939

4040
/**
@@ -82,14 +82,14 @@ native bType:SourceComms_GetClientMuteType(client);
8282
*/
8383
native bType:SourceComms_GetClientGagType(client);
8484

85-
public SharedPlugin:__pl_sourcecomms =
85+
public SharedPlugin:__pl_sourcecomms =
8686
{
87-
name = "sourcecomms",
88-
file = "sourcecomms.smx",
87+
name = "sourcecomms",
88+
file = "sourcecomms.smx",
8989
#if defined REQUIRE_PLUGIN
90-
required = 1
90+
required = 1
9191
#else
92-
required = 0
92+
required = 0
9393
#endif
9494
};
9595

@@ -99,5 +99,5 @@ public __pl_sourcecomms_SetNTVOptional()
9999
MarkNativeAsOptional("SourceComms_SetClientGag");
100100
MarkNativeAsOptional("SourceComms_GetClientMuteType");
101101
MarkNativeAsOptional("SourceComms_GetClientGagType");
102-
102+
103103
}

game_upload/addons/sourcemod/scripting/sb_admcfg.sp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030

3131
public Plugin:myinfo =
3232
{
33-
name = "SourceBans++: Admin Config Loader",
34-
author = "AlliedModders LLC, Sarabveer(VEER™)",
35-
description = "Reads admin files",
36-
version = "1.5.4.2",
33+
name = "SourceBans: Admin Config Loader",
34+
author = "AlliedModders LLC, Sarabveer(VEER™)",
35+
description = "Reads admin files",
36+
version = "(SB++) 1.5.4.3",
3737
url = "https://github.com/Sarabveer/SourceBans-Fork"
3838
};
3939

4040
/** Various parsing globals */
41-
new bool:g_LoggedFileName = false; /* Whether or not the file name has been logged */
42-
new g_ErrorCount = 0; /* Current error count */
43-
new g_IgnoreLevel = 0; /* Nested ignored section count, so users can screw up files safely */
44-
new g_CurrentLine = 0; /* Current line we're on */
45-
new String:g_Filename[PLATFORM_MAX_PATH]; /* Used for error messages */
41+
new bool:g_LoggedFileName = false; /* Whether or not the file name has been logged */
42+
new g_ErrorCount = 0; /* Current error count */
43+
new g_IgnoreLevel = 0; /* Nested ignored section count, so users can screw up files safely */
44+
new g_CurrentLine = 0; /* Current line we're on */
45+
new String:g_Filename[PLATFORM_MAX_PATH]; /* Used for error messages */
4646

4747
#include "sb_admcfg/sb_admin_groups.sp"
4848
#include "sb_admcfg/sb_admin_users.sp"

game_upload/addons/sourcemod/scripting/sb_admcfg/sb_admin_groups.sp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// *************************************************************************
22
// This file is part of SourceBans++.
33
//
4-
// Copyright (C) 2014-2016 Sarabveer Singh <me@sarabveer.me>
4+
// Copyright (C) 2014-2015 Sarabveer Singh <sarabveer@sarabveer.me>
55
//
66
// SourceBans++ is free software: you can redistribute it and/or modify
77
// it under the terms of the GNU General Public License as published by
@@ -74,10 +74,10 @@ public SMCResult ReadGroups_NewSection(SMCParser smc, const char[] name, bool op
7474
}
7575

7676
public SMCResult ReadGroups_KeyValue(SMCParser smc,
77-
const char[] key,
78-
const char[] value,
79-
bool key_quotes,
80-
bool value_quotes)
77+
const char[] key,
78+
const char[] value,
79+
bool key_quotes,
80+
bool value_quotes)
8181
{
8282
if (g_CurGrp == INVALID_GROUP_ID || g_IgnoreLevel)
8383
{
@@ -93,7 +93,7 @@ public SMCResult ReadGroups_KeyValue(SMCParser smc,
9393
if (StrEqual(key, "flags", false))
9494
{
9595
new len = strlen(value);
96-
for (new i = 0; i < len; i++)
96+
for (new i=0; i<len; i++)
9797
{
9898
if (!FindFlagByChar(value[i], flag))
9999
{
@@ -120,7 +120,7 @@ public SMCResult ReadGroups_KeyValue(SMCParser smc,
120120
}
121121
}
122122
} else if (g_GroupPass == GROUP_PASS_SECOND
123-
&& g_GroupState == GROUP_STATE_INGROUP) {
123+
&& g_GroupState == GROUP_STATE_INGROUP) {
124124
/* Check for immunity again, core should handle double inserts */
125125
if (StrEqual(key, "immunity", false))
126126
{
@@ -206,7 +206,7 @@ static InternalReadGroups(const String:path[], pass)
206206
g_CurGrp = INVALID_GROUP_ID;
207207
g_GroupPass = pass;
208208
g_NeedReparse = false;
209-
209+
210210
SMCError err = g_hGroupParser.ParseFile(path);
211211
if (err != SMCError_Okay)
212212
{

0 commit comments

Comments
 (0)