Skip to content

Commit 232304d

Browse files
committed
Attempt to Fix Sourcecomms
Revert 'decl' keyword to 'new' for reason variables. Possible fix for reason issue, shouldn't hurt anything to merge.
1 parent 3b8140e commit 232304d

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

game_upload/addons/sourcemod/scripting/sourcecomms.sp

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,8 @@ public Query_AddBlockInsert(Handle:owner, Handle:hndl, const String:error[], any
12381238
ResetPack(data);
12391239
new length = ReadPackCell(data);
12401240
new type = ReadPackCell(data);
1241-
decl String:reason[256], String:name[MAX_NAME_LENGTH], String:auth[64], String:adminAuth[32], String:adminIp[20];
1241+
new String:reason[256];
1242+
decl String:name[MAX_NAME_LENGTH], String:auth[64], String:adminAuth[32], String:adminIp[20];
12421243
ReadPackString(data, name, sizeof(name));
12431244
ReadPackString(data, auth, sizeof(auth));
12441245
ReadPackString(data, reason, sizeof(reason));
@@ -1252,7 +1253,8 @@ public Query_AddBlockInsert(Handle:owner, Handle:hndl, const String:error[], any
12521253

12531254
public Query_UnBlockSelect(Handle:owner, Handle:hndl, const String:error[], any:data)
12541255
{
1255-
decl String:adminAuth[30], String:targetAuth[30], String:reason[256];
1256+
decl String:adminAuth[30], String:targetAuth[30];
1257+
new String:reason[256];
12561258

12571259
ResetPack(data);
12581260
new adminUserID = ReadPackCell(data);
@@ -1374,7 +1376,7 @@ public Query_UnBlockSelect(Handle:owner, Handle:hndl, const String:error[], any:
13741376
WritePackString(dataPack, g_sName[target]);
13751377
WritePackString(dataPack, targetAuth);
13761378

1377-
decl String:unbanReason[sizeof(reason) * 2 + 1];
1379+
new String:unbanReason[sizeof(reason) * 2 + 1];
13781380
SQL_EscapeString(g_hDatabase, reason, unbanReason, sizeof(unbanReason));
13791381

13801382
decl String:query[2048];
@@ -1517,7 +1519,7 @@ public Query_ProcessQueue(Handle:owner, Handle:hndl, const String:error[], any:d
15171519

15181520
decl String:auth[64];
15191521
decl String:name[MAX_NAME_LENGTH];
1520-
decl String:reason[256];
1522+
new String:reason[256];
15211523
decl String:adminAuth[64], String:adminIp[20];
15221524
decl String:query[4096];
15231525

@@ -1529,7 +1531,7 @@ public Query_ProcessQueue(Handle:owner, Handle:hndl, const String:error[], any:d
15291531

15301532
decl String:sAuthEscaped[sizeof(auth) * 2 + 1];
15311533
decl String:banName[MAX_NAME_LENGTH * 2 + 1];
1532-
decl String:banReason[sizeof(reason) * 2 + 1];
1534+
new String:banReason[sizeof(reason) * 2 + 1];
15331535
decl String:sAdmAuthEscaped[sizeof(adminAuth) * 2 + 1];
15341536
decl String:sAdmAuthYZEscaped[sizeof(adminAuth) * 2 + 1];
15351537

@@ -1626,7 +1628,8 @@ public Query_VerifyBlock(Handle:owner, Handle:hndl, const String:error[], any:us
16261628
if (NotApplyToThisServer(SQL_FetchInt(hndl, 8)))
16271629
continue;
16281630

1629-
decl String:sReason[256], String:sAdmName[MAX_NAME_LENGTH], String:sAdmAuth[64];
1631+
new String:sReason[256];
1632+
decl String:sAdmName[MAX_NAME_LENGTH], String:sAdmAuth[64];
16301633
new remaining_time = SQL_FetchInt(hndl, 0);
16311634
new length = SQL_FetchInt(hndl, 1);
16321635
new type = SQL_FetchInt(hndl, 2);
@@ -1999,7 +2002,8 @@ stock CreateBlock(client, targetId = 0, length = -1, type, const String:sReason[
19992002
PrintToServer("CreateBlock(admin: %d, target: %d, length: %d, type: %d, reason: %s, args: %s)", client, targetId, length, type, sReason, sArgs);
20002003
#endif
20012004

2002-
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml, String:target_name[MAX_NAME_LENGTH], String:reason[256];
2005+
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml, String:target_name[MAX_NAME_LENGTH];
2006+
new String:reason[256];
20032007
new bool:skipped = false;
20042008

20052009
// checking args
@@ -2194,7 +2198,8 @@ stock ProcessUnBlock(client, targetId = 0, type, String:sReason[] = "", const St
21942198
PrintToServer("ProcessUnBlock(admin: %d, target: %d, type: %d, reason: %s, args: %s)", client, targetId, type, sReason, sArgs);
21952199
#endif
21962200

2197-
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml, String:target_name[MAX_NAME_LENGTH], String:reason[256];
2201+
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml, String:target_name[MAX_NAME_LENGTH];
2202+
new String:reason[256];
21982203

21992204
if (targetId)
22002205
{
@@ -2405,7 +2410,8 @@ stock ProcessUnBlock(client, targetId = 0, type, String:sReason[] = "", const St
24052410

24062411
stock bool:TempUnBlock(Handle:data)
24072412
{
2408-
decl String:adminAuth[30], String:targetAuth[30], String:reason[256];
2413+
decl String:adminAuth[30], String:targetAuth[30];
2414+
new String:reason[256];
24092415
ResetPack(data);
24102416
new adminUserID = ReadPackCell(data);
24112417
new targetUserID = ReadPackCell(data);
@@ -2507,7 +2513,7 @@ stock InsertTempBlock(length, type, const String:name[], const String:auth[], co
25072513
LogMessage("Saving punishment for %s into queue", auth);
25082514

25092515
decl String:banName[MAX_NAME_LENGTH * 2 + 1];
2510-
decl String:banReason[256 * 2 + 1];
2516+
new String:banReason[256 * 2 + 1];
25112517
decl String:sAuthEscaped[64 * 2 + 1];
25122518
decl String:sAdminAuthEscaped[64 * 2 + 1];
25132519
decl String:sQuery[4096], String:sQueryVal[2048];
@@ -2875,7 +2881,7 @@ stock SavePunishment(admin = 0, target, type, length = -1, const String:reason[]
28752881
{
28762882
// Accepts length in minutes, writes to db in seconds! In all over places in plugin - length is in minutes.
28772883
decl String:banName[MAX_NAME_LENGTH * 2 + 1];
2878-
decl String:banReason[256 * 2 + 1];
2884+
new String:banReason[256 * 2 + 1];
28792885
decl String:sAuthidEscaped[64 * 2 + 1];
28802886
decl String:sAdminAuthIdEscaped[64 * 2 + 1];
28812887
decl String:sAdminAuthIdYZEscaped[64 * 2 + 1];
@@ -3054,7 +3060,7 @@ public Native_SetClientMute(Handle:hPlugin, numParams)
30543060
return ThrowNativeError(SP_ERROR_NATIVE, "Removing punishments from DB is not allowed!");
30553061
}
30563062

3057-
decl String:sReason[256];
3063+
new String:sReason[256];
30583064
GetNativeString(5, sReason, sizeof(sReason));
30593065

30603066
if (muteState)
@@ -3108,7 +3114,7 @@ public Native_SetClientGag(Handle:hPlugin, numParams)
31083114
return ThrowNativeError(SP_ERROR_NATIVE, "Removing punishments from DB is not allowed!");
31093115
}
31103116

3111-
decl String:sReason[256];
3117+
new String:sReason[256];
31123118
GetNativeString(5, sReason, sizeof(sReason));
31133119

31143120
if (gagState)

0 commit comments

Comments
 (0)