Skip to content

Commit e661c71

Browse files
committed
Add failsafe against potential Steam issues in GetAppList()
Since this method has potential to loop infinitely, better safe than sorry.
1 parent 878b24d commit e661c71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,8 @@ internal async Task<bool> ChangePrivacySettings(UserPrivacy userPrivacy) {
16551655
{ "max_results", 50000 }
16561656
};
16571657

1658+
uint previousLastAppID = 0;
1659+
16581660
HashSet<uint>? result = null;
16591661

16601662
using WebAPI.AsyncInterface steamAppsService = Bot.SteamConfiguration.GetAsyncWebAPIInterface(SteamStoreService);
@@ -1715,11 +1717,11 @@ internal async Task<bool> ChangePrivacySettings(UserPrivacy userPrivacy) {
17151717

17161718
uint lastAppID = response["last_appid"].AsUnsignedInteger();
17171719

1718-
if (lastAppID == 0) {
1720+
if ((lastAppID == 0) || (lastAppID <= previousLastAppID)) {
17191721
break;
17201722
}
17211723

1722-
arguments["last_appid"] = lastAppID;
1724+
arguments["last_appid"] = previousLastAppID = lastAppID;
17231725
}
17241726

17251727
return result;

0 commit comments

Comments
 (0)