Skip to content

Commit 37c4aaf

Browse files
committed
1.5.4.6 - Fix SourceComms and Perm Bans
1 parent 780db16 commit 37c4aaf

File tree

12 files changed

+53
-56
lines changed

12 files changed

+53
-56
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Legend:
1010
? = Other stuff
1111
```
1212

13+
(23/04/16): Version 1.5.4.6
14+
-----------------------
15+
01. ! Fix Perm Ban bug in SourceSleuth
16+
02. ! Fix Updater
17+
1318
(18/04/16): Version 1.5.4.5
1419
-----------------------
1520
01. ! Fix Variuous Bugs in the Plugins EXCEPT SourceSleuth
Binary file not shown.
Binary file not shown.
Binary file not shown.
455 Bytes
Binary file not shown.
Binary file not shown.

game_upload/addons/sourcemod/scripting/SourceSleuth.sp

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#undef REQUIRE_PLUGIN
3232
#include <sourcebans>
3333

34-
#define PLUGIN_VERSION "(SB++) 1.5.4.5"
34+
#define PLUGIN_VERSION "(SB++) 1.5.4.6"
3535

3636
#define LENGTH_ORIGINAL 1
3737
#define LENGTH_CUSTOM 2
@@ -53,36 +53,36 @@ ConVar g_cVar_bypass;
5353
//- Bools -//
5454
new bool:CanUseSourcebans = false;
5555

56-
public Plugin:myinfo =
56+
public Plugin:myinfo =
5757
{
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,
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,
6262
url = "https://sarabveer.github.io/SourceBans-Fork/"
6363
};
6464

6565
public OnPluginStart()
6666
{
6767
LoadTranslations("sourcesleuth.phrases");
68-
68+
6969
CreateConVar("sm_sourcesleuth_version", PLUGIN_VERSION, "SourceSleuth plugin version", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD);
70-
70+
7171
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);
7272
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);
7373
g_cVar_sbprefix = CreateConVar("sm_sleuth_prefix", "sb", "Prexfix for sourcebans tables: Default sb", FCVAR_PLUGIN);
7474
g_cVar_bansAllowed = CreateConVar("sm_sleuth_bansallowed", "0", "How many active bans are allowed before we act", FCVAR_PLUGIN);
7575
g_cVar_bantype = CreateConVar("sm_sleuth_bantype", "0", "0 - ban all type of lengths, 1 - ban only permanent bans", FCVAR_PLUGIN, true, 0.0, true, 1.0);
7676
g_cVar_bypass = CreateConVar("sm_sleuth_adminbypass", "0", "0 - Inactivated, 1 - Allow all admins with ban flag to pass the check", FCVAR_PLUGIN, true, 0.0, true, 1.0);
77-
77+
7878
g_hAllowedArray = CreateArray(256);
79-
79+
8080
AutoExecConfig(true, "Sm_SourceSleuth");
81-
81+
8282
SQL_TConnect(SQL_OnConnect, "sourcebans");
83-
83+
8484
RegAdminCmd("sm_sleuth_reloadlist", ReloadListCallBack, ADMFLAG_ROOT);
85-
85+
8686
LoadWhiteList();
8787
}
8888

@@ -122,16 +122,16 @@ public SQL_OnConnect(Handle:owner, Handle:hndl, const String:error[], any:data)
122122
public Action:ReloadListCallBack(client, args)
123123
{
124124
ClearArray(g_hAllowedArray);
125-
125+
126126
LoadWhiteList();
127-
127+
128128
LogMessage("%L reloaded the whitelist", client);
129-
129+
130130
if (client != 0)
131131
{
132132
PrintToChat(client, "[SourceSleuth] WhiteList has been reloaded!");
133133
}
134-
134+
135135
return Plugin_Continue;
136136
}
137137

@@ -141,30 +141,30 @@ public OnClientPostAdminCheck(client)
141141
{
142142
new String:steamid[32];
143143
GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
144-
144+
145145
if (g_cVar_bypass.BoolValue && CheckCommandAccess(client, "sleuth_admin", ADMFLAG_BAN, false))
146146
{
147147
return;
148148
}
149-
149+
150150
if (FindStringInArray(g_hAllowedArray, steamid) == -1)
151151
{
152152
new String:IP[32], String:Prefix[64];
153153
GetClientIP(client, IP, sizeof(IP));
154-
154+
155155
g_cVar_sbprefix.GetString(Prefix, sizeof(Prefix));
156-
156+
157157
new String:query[1024];
158-
158+
159159
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-
160+
161161
new Handle:datapack = CreateDataPack();
162-
162+
163163
WritePackCell(datapack, GetClientUserId(client));
164164
WritePackString(datapack, steamid);
165165
WritePackString(datapack, IP);
166166
ResetPack(datapack);
167-
167+
168168
SQL_TQuery(hDatabase, SQL_CheckHim, query, datapack);
169169
}
170170
}
@@ -174,25 +174,25 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
174174
{
175175
new client;
176176
decl String:steamid[32], String:IP[32];
177-
177+
178178
if (datapack != INVALID_HANDLE)
179179
{
180180
client = GetClientOfUserId(ReadPackCell(datapack));
181181
ReadPackString(datapack, steamid, sizeof(steamid));
182182
ReadPackString(datapack, IP, sizeof(IP));
183183
CloseHandle(datapack);
184184
}
185-
185+
186186
if (hndl == INVALID_HANDLE)
187187
{
188188
LogError("SourceSleuth: Database query error: %s", error);
189189
return;
190190
}
191-
191+
192192
if (SQL_FetchRow(hndl))
193193
{
194194
new TotalBans = SQL_GetRowCount(hndl);
195-
195+
196196
if (TotalBans > g_cVar_bansAllowed.IntValue)
197197
{
198198
switch (g_cVar_actions.IntValue)
@@ -201,7 +201,7 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
201201
{
202202
new length = SQL_FetchInt(hndl, 6);
203203
new time = length * 60;
204-
204+
205205
BanPlayer(client, time);
206206
}
207207
case LENGTH_CUSTOM:
@@ -212,14 +212,14 @@ public SQL_CheckHim(Handle:owner, Handle:hndl, const String:error[], any:datapac
212212
case LENGTH_DOUBLE:
213213
{
214214
new length = SQL_FetchInt(hndl, 6);
215-
215+
216216
new time = 0;
217-
218-
if(length != 0)
217+
218+
if (length != 0)
219219
{
220220
time = length / 60 * 2;
221221
}
222-
222+
223223
BanPlayer(client, time);
224224
}
225225
case LENGTH_NOTIFY:
@@ -242,13 +242,13 @@ stock BanPlayer(client, time)
242242
PrintToAdmins(const String:format[], any:...)
243243
{
244244
new String:g_Buffer[256];
245-
245+
246246
for (new i = 1; i <= MaxClients; i++)
247247
{
248248
if (CheckCommandAccess(i, "sm_sourcesleuth_printtoadmins", ADMFLAG_BAN) && IsClientInGame(i))
249249
{
250250
VFormat(g_Buffer, sizeof(g_Buffer), format, 2);
251-
251+
252252
PrintToChat(i, "%s", g_Buffer);
253253
}
254254
}
@@ -257,17 +257,17 @@ PrintToAdmins(const String:format[], any:...)
257257
public LoadWhiteList()
258258
{
259259
decl String:path[PLATFORM_MAX_PATH], String:line[256];
260-
260+
261261
BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "configs/sourcesleuth_whitelist.cfg");
262-
262+
263263
new Handle:fileHandle = OpenFile(path, "r");
264-
264+
265265
while (!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, line, sizeof(line)))
266266
{
267267
ReplaceString(line, sizeof(line), "\n", "", false);
268-
268+
269269
PushArrayString(g_hAllowedArray, line);
270270
}
271-
271+
272272
CloseHandle(fileHandle);
273273
}

game_upload/addons/sourcemod/scripting/sb_admcfg.sp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public Plugin myinfo =
3737
name = "SourceBans: Admin Config Loader",
3838
author = "AlliedModders LLC, Sarabveer(VEER™)",
3939
description = "Reads Admin Files",
40-
version = "(SB++) 1.5.4.5",
40+
version = "(SB++) 1.5.4.6",
4141
url = "https://github.com/Sarabveer/SourceBans-Fork"
4242
};
4343

game_upload/addons/sourcemod/scripting/sbchecker.sp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <sourcemod>
2828

29-
#define VERSION "(SB++) 1.5.4.5"
29+
#define VERSION "(SB++) 1.5.4.6"
3030
#define LISTBANS_USAGE "sm_listsbbans <#userid|name> - Lists a user's prior bans from Sourcebans"
3131
#define INVALID_TARGET -1
3232

game_upload/addons/sourcemod/scripting/sourcebans.sp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include <adminmenu>
3333
#tryinclude <updater>
3434

35-
#define SB_VERSION "1.5.4.5F"
36-
#define SBR_VERSION "1.5.4.5"
35+
#define SB_VERSION "1.5.4.6F"
36+
#define SBR_VERSION "1.5.4.6"
3737

3838
#if defined _updater_included
3939
#define UPDATE_URL "https://sarabveer.github.io/SourceBans-Fork/updater/updatefile.txt"
@@ -65,7 +65,6 @@ new g_BanTime[MAXPLAYERS + 1] = { -1, ... };
6565

6666
new State:ConfigState;
6767
new Handle:ConfigParser;
68-
new Handle:updaterCvar = INVALID_HANDLE;
6968
new Handle:hTopMenu = INVALID_HANDLE;
7069

7170
new const String:Prefix[] = "[SourceBans] ";
@@ -236,13 +235,6 @@ public OnPluginStart()
236235
}
237236

238237
#if defined _updater_included
239-
public Action:Updater_OnPluginDownloading() {
240-
if (!GetConVarBool(updaterCvar)) {
241-
return Plugin_Handled;
242-
}
243-
return Plugin_Continue;
244-
}
245-
246238
public OnLibraryAdded(const String:name[]) {
247239
if (StrEqual(name, "updater")) {
248240
Updater_AddPlugin(UPDATE_URL);

game_upload/addons/sourcemod/scripting/sourcecomms.sp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
// Do not edit below this line //
4343
//-----------------------------//
4444

45-
#define PLUGIN_VERSION "(SB++) 1.5.4.5"
45+
#define PLUGIN_VERSION "(SB++) 1.5.4.6"
4646
#define PREFIX "\x04[SourceComms]\x01 "
4747

4848
#define MAX_TIME_MULTI 30 // maximum mass-target punishment length

web_upload/init.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
// ---------------------------------------------------
9696
#define('SB_GIT', true);
9797
if(!defined('SB_VERSION')){
98-
define('SB_VERSION', '1.5.4.5');
99-
define('SB_GITRev', '$Git: 346 $');
98+
define('SB_VERSION', '1.5.4.6');
99+
define('SB_GITRev', '$Git: 350 $');
100100
}
101101
define('LOGIN_COOKIE_LIFETIME', (60*60*24*7)*2);
102102
define('COOKIE_PATH', '/');

0 commit comments

Comments
 (0)