Skip to content

Commit bf8b7f3

Browse files
authored
(#850) Fix: Improve check for get valid steamid
Check the first 3 characters after STEAM_ to see if it contains ID_ for see if it's not a valid STEAMID format. Both of these 2 value return GetClientAuthId as true. - STEAM_ID_STOP_IGNORING_RETVALS - STEAM_ID_PENDING
1 parent 523604a commit bf8b7f3

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

game/addons/sourcemod/scripting/sbpp_comms.sp

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,11 @@ stock void CreateBlock(int client, int targetId = 0, int length = -1, int type,
22422242

22432243
if (target && IsClientInGame(target))
22442244
{
2245-
if (!GetClientAuthId(target, AuthId_Steam2, auth, sizeof(auth)))
2245+
if (!GetClientAuthId(target, AuthId_Steam2, auth, sizeof(auth), false))
2246+
{
2247+
g_bPlayerStatus[target] = false;
2248+
}
2249+
if (strncmp(auth[6], "ID_", 3) != 0 )
22462250
{
22472251
g_bPlayerStatus[target] = false;
22482252
}
@@ -2432,10 +2436,28 @@ stock void ProcessUnBlock(int client, int targetId = 0, int type, char[] sReason
24322436
{
24332437
int target = target_list[i];
24342438

2435-
if (IsClientConnected(target))
2436-
GetClientAuthId(target, AuthId_Steam2, targetAuth, sizeof(targetAuth));
2437-
else
2438-
continue;
2439+
if (target && IsClientConnected(target))
2440+
{
2441+
if (!GetClientAuthId(target, AuthId_Steam2, targetAuth, sizeof(targetAuth), false))
2442+
{
2443+
g_bPlayerStatus[target] = false;
2444+
continue;
2445+
}
2446+
if (strncmp(targetAuth[6], "ID_", 3) != 0 )
2447+
{
2448+
g_bPlayerStatus[target] = false;
2449+
continue;
2450+
}
2451+
}
2452+
2453+
if (!g_bPlayerStatus[target])
2454+
{
2455+
// The target has not been blocks verify. It must be completed before you can unblock anyone.
2456+
char name[32];
2457+
GetClientName(target, name, sizeof(name));
2458+
ReplyToCommand(client, "%s%t", PREFIX, "Player Comms Not Verified", name);
2459+
continue; // skip
2460+
}
24392461

24402462
switch (type)
24412463
{
@@ -2472,7 +2494,10 @@ stock void ProcessUnBlock(int client, int targetId = 0, int type, char[] sReason
24722494

24732495
if (IsClientInGame(target))
24742496
{
2475-
GetClientAuthId(target, AuthId_Steam2, targetAuth, sizeof(targetAuth));
2497+
if (!GetClientAuthId(target, AuthId_Steam2, targetAuth, sizeof(targetAuth), false))
2498+
g_bPlayerStatus[target] = false;
2499+
if (strncmp(targetAuth[6], "ID_", 3) != 0 )
2500+
g_bPlayerStatus[target] = false;
24762501
}
24772502
else
24782503
{
@@ -3396,4 +3421,4 @@ public int Native_GetClientGagType(Handle hPlugin, int numParams)
33963421

33973422
return g_GagType[target];
33983423
}
3399-
//Yarr!
3424+
//Yarr!

0 commit comments

Comments
 (0)