Skip to content

Commit 0ae741f

Browse files
committed
1.5.4.5
1 parent bd26c36 commit 0ae741f

File tree

239 files changed

+6198
-5113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+6198
-5113
lines changed
Binary file not shown.
-100 Bytes
Binary file not shown.
Binary file not shown.
-183 Bytes
Binary file not shown.
-849 Bytes
Binary file not shown.

game_upload/addons/sourcemod/scripting/SourceSleuth.sp

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with SourceBans++. If not, see <http://www.gnu.org/licenses/>.
1717
//
18-
// This file incorporates work covered by the following copyright(s):
18+
// This file is based off work covered by the following copyright(s):
1919
//
2020
// SourceSleuth 1.3 fix
2121
// Copyright (C) 2013-2015 ecca
@@ -24,12 +24,14 @@
2424
//
2525
// *************************************************************************
2626

27+
/* !SOMEONE PLEASE FIX THIS BROKEN ASS PLUGIN! */
28+
2729
#pragma semicolon 1
2830
#include <sourcemod>
2931
#undef REQUIRE_PLUGIN
3032
#include <sourcebans>
3133

32-
#define PLUGIN_VERSION "(SB++) 1.5.4.4"
34+
#define PLUGIN_VERSION "(SB++) 1.5.4.5"
3335

3436
#define LENGTH_ORIGINAL 1
3537
#define LENGTH_CUSTOM 2
@@ -53,18 +55,18 @@ new bool:CanUseSourcebans = false;
5355

5456
public Plugin:myinfo =
5557
{
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"
58+
name = "SourceSleuth",
59+
author = "ecca, Sarabveer(VEER™)",
60+
description = "Useful for TF2 servers. Plugin will check for banned ips and ban the player.",
61+
version = PLUGIN_VERSION,
62+
url = "https://sarabveer.github.io/SourceBans-Fork/"
6163
};
6264

6365
public OnPluginStart()
6466
{
6567
LoadTranslations("sourcesleuth.phrases");
6668

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

6971
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);
7072
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 +78,7 @@ public OnPluginStart()
7678
g_hAllowedArray = CreateArray(256);
7779

7880
AutoExecConfig(true, "Sm_SourceSleuth");
79-
81+
8082
SQL_TConnect(SQL_OnConnect, "sourcebans");
8183

8284
RegAdminCmd("sm_sleuth_reloadlist", ReloadListCallBack, ADMFLAG_ROOT);
@@ -110,10 +112,10 @@ public SQL_OnConnect(Handle:owner, Handle:hndl, const String:error[], any:data)
110112
if (hndl == INVALID_HANDLE)
111113
{
112114
LogError("SourceSleuth: Database connection error: %s", error);
113-
}
114-
else
115+
}
116+
else
115117
{
116-
hDatabase = hndl;
118+
hDatabase = hndl;
117119
}
118120
}
119121

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

126128
LogMessage("%L reloaded the whitelist", client);
127129

128-
if(client != 0)
130+
if (client != 0)
129131
{
130132
PrintToChat(client, "[SourceSleuth] WhiteList has been reloaded!");
131133
}
@@ -135,17 +137,17 @@ public Action:ReloadListCallBack(client, args)
135137

136138
public OnClientPostAdminCheck(client)
137139
{
138-
if(CanUseSourcebans && !IsFakeClient(client))
140+
if (CanUseSourcebans && !IsFakeClient(client))
139141
{
140142
new String:steamid[32];
141143
GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
142144

143-
if (g_cVar_bypass.BoolValue && CheckCommandAccess(client, "sleuth_admin", ADMFLAG_BAN, false))
145+
if (g_cVar_bypass.BoolValue && CheckCommandAccess(client, "sleuth_admin", ADMFLAG_BAN, false))
144146
{
145147
return;
146148
}
147149

148-
if(FindStringInArray(g_hAllowedArray, steamid) == -1)
150+
if (FindStringInArray(g_hAllowedArray, steamid) == -1)
149151
{
150152
new String:IP[32], String:Prefix[64];
151153
GetClientIP(client, IP, sizeof(IP));
@@ -154,10 +156,10 @@ public OnClientPostAdminCheck(client)
154156

155157
new String:query[1024];
156158

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-
159+
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);
160+
159161
new Handle:datapack = CreateDataPack();
160-
162+
161163
WritePackCell(datapack, GetClientUserId(client));
162164
WritePackString(datapack, steamid);
163165
WritePackString(datapack, IP);
@@ -173,12 +175,12 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
173175
new client;
174176
decl String:steamid[32], String:IP[32];
175177

176-
if(datapack != INVALID_HANDLE)
178+
if (datapack != INVALID_HANDLE)
177179
{
178180
client = GetClientOfUserId(ReadPackCell(datapack));
179181
ReadPackString(datapack, steamid, sizeof(steamid));
180182
ReadPackString(datapack, IP, sizeof(IP));
181-
CloseHandle(datapack);
183+
CloseHandle(datapack);
182184
}
183185

184186
if (hndl == INVALID_HANDLE)
@@ -191,14 +193,14 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
191193
{
192194
new TotalBans = SQL_GetRowCount(hndl);
193195

194-
if(TotalBans > g_cVar_bansAllowed.IntValue)
196+
if (TotalBans > g_cVar_bansAllowed.IntValue)
195197
{
196198
switch (g_cVar_actions.IntValue)
197199
{
198200
case LENGTH_ORIGINAL:
199201
{
200202
new length = SQL_FetchInt(hndl, 6);
201-
new time = length*60;
203+
new time = length * 60;
202204

203205
BanPlayer(client, time);
204206
}
@@ -210,14 +212,14 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
210212
case LENGTH_DOUBLE:
211213
{
212214
new length = SQL_FetchInt(hndl, 6);
213-
new time = length/60*2;
214-
215+
new time = length / 60 * 2;
216+
215217
BanPlayer(client, time);
216218
}
217219
case LENGTH_NOTIFY:
218220
{
219221
/* Notify Admins when a client with an ip on the bans list connects */
220-
PrintToAdmins("[SourceSleuth] %t", "sourcesleuth_admintext",client, steamid, IP);
222+
PrintToAdmins("[SourceSleuth] %t", "sourcesleuth_admintext", client, steamid, IP);
221223
}
222224
}
223225
}
@@ -235,7 +237,7 @@ PrintToAdmins(const String:format[], any:...)
235237
{
236238
new String:g_Buffer[256];
237239

238-
for (new i=1;i<=MaxClients;i++)
240+
for (new i = 1; i <= MaxClients; i++)
239241
{
240242
if (CheckCommandAccess(i, "sm_sourcesleuth_printtoadmins", ADMFLAG_BAN) && IsClientInGame(i))
241243
{
@@ -249,17 +251,17 @@ PrintToAdmins(const String:format[], any:...)
249251
public LoadWhiteList()
250252
{
251253
decl String:path[PLATFORM_MAX_PATH], String:line[256];
252-
254+
253255
BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "configs/sourcesleuth_whitelist.cfg");
254-
256+
255257
new Handle:fileHandle = OpenFile(path, "r");
256-
257-
while(!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, line, sizeof(line)))
258+
259+
while (!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, line, sizeof(line)))
258260
{
259-
ReplaceString(line, sizeof(line), "\n", "", false);
260-
261+
ReplaceString(line, sizeof(line), "\n", "", false);
262+
261263
PushArrayString(g_hAllowedArray, line);
262264
}
263-
265+
264266
CloseHandle(fileHandle);
265267
}
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
// *************************************************************************
22
// This file is part of SourceBans++.
33
//
4-
// Copyright (C) 2014-2015 Sarabveer Singh <sarabveer@sarabveer.me>
5-
//
4+
// Copyright (C) 2014-2016 Sarabveer Singh <me@sarabveer.me>
5+
//
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
88
// the Free Software Foundation, per version 3 of the License.
9-
//
9+
//
1010
// SourceBans++ is distributed in the hope that it will be useful,
1111
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1212
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
// GNU General Public License for more details.
14-
//
14+
//
1515
// You should have received a copy of the GNU General Public License
1616
// along with SourceBans++. If not, see <http://www.gnu.org/licenses/>.
1717
//
18-
// This file incorporates work covered by the following copyright(s):
18+
// This file incorporates work covered by the following copyright(s):
1919
//
2020
// SourceBans 1.4.11
2121
// Copyright (C) 2007-2015 SourceBans Team - Part of GameConnect
2222
// Licensed under GNU GPL version 3, or later.
23-
// Page: <http://www.sourcebans.net/> - <https://github.com/GameConnect/sourcebansv1>
23+
// Page: <http://www.sourcebans.net/> - <https://github.com/GameConnect/sourcebansv1>
2424
//
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
@@ -55,8 +55,8 @@ public __pl_sourcebans_SetNTVOptional()
5555
* @param target The client index of the player to ban
5656
* @param time The time to ban the player for (in minutes, 0 = permanent)
5757
* @param reason The reason to ban the player from the server
58-
* @noreturn
58+
* @noreturn
5959
*********************************************************/
6060
native SBBanPlayer(client, target, time, String:reason[]);
6161

62-
//Yarr!
62+
//Yarr!

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// *************************************************************************
22
// This file is part of SourceBans++.
33
//
4-
// Copyright (C) 2014-2015 Sarabveer Singh <sarabveer@sarabveer.me>
5-
//
4+
// Copyright (C) 2014-2016 Sarabveer Singh <me@sarabveer.me>
5+
//
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
88
// the Free Software Foundation, per version 3 of the License.
9-
//
9+
//
1010
// SourceBans++ is distributed in the hope that it will be useful,
1111
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1212
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
// GNU General Public License for more details.
14-
//
14+
//
1515
// You should have received a copy of the GNU General Public License
1616
// along with SourceBans++. If not, see <http://www.gnu.org/licenses/>.
1717
//
18-
// This file incorporates work covered by the following copyright(s):
18+
// This file incorporates work covered by the following copyright(s):
1919
//
2020
// SourceComms 0.9.266
2121
// Copyright (C) 2013-2014 Alexandr Duplishchev
@@ -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-
103-
}
102+
103+
}

0 commit comments

Comments
 (0)