diff --git a/scripting/no_dupe_account.smx b/scripting/no_dupe_account.smx new file mode 100644 index 0000000..bb683d4 Binary files /dev/null and b/scripting/no_dupe_account.smx differ diff --git a/scripting/no_dupe_account.sp b/scripting/no_dupe_account.sp index 3451502..e13fd8a 100644 --- a/scripting/no_dupe_account.sp +++ b/scripting/no_dupe_account.sp @@ -8,7 +8,7 @@ #include #include -#define PLUGIN_VERSION "1.5.0 Beta 2" +#define PLUGIN_VERSION "1.5.0 Beta 3" #define AMOUNT_METHODS 14 // total amount of methods in the config file @@ -1636,8 +1636,29 @@ void OnCheckSteamBansResponse(Handle hRequest, bool bFailure, bool bRequestSucce char sArray[6][64]; // cut the last one ExplodeString(sBody, ",", sArray, sizeof(sArray), sizeof(sArray[])); + + /* + Example of the API output: + {"players":[{"SteamId":"76561198074861737","CommunityBanned":false,"VACBanned":false,"NumberOfVACBans":0,"DaysSinceLastBan":0,"NumberOfGameBans":0,"EconomyBan":"none"}]} + */ + + // CommunityBanned field check if (StrContains(sArray[1], "false") == -1) // doesn't contain 'false' { + /* + If it doesn't contain 'true' too, it means the Steam API is bugged because the CommunityBanned field is missing. + Steam could be in maintenance. + This experimental fix aims at detecting whenever Steam is in maintenance in order not to kick people that fail this verification. + It also stops all future verifications about bans, this way, no weird values! + - + Issue link: https://github.com/azalty/sm-no-dupe-account/issues/28 + */ + if (StrContains(sArray[1], "true") == -1) + { + LogError("Steam Bans request failed: CommunityBanned field is missing (potential Steam maintenance)!"); + return; + } + g_bCommunityBanned[client] = true; } g_iVACBans[client] = StringToInt(sArray[3][18]) // get everything after ':', aka the integer