From ce5443ca9a50401b3f5c4336b91b4c90b0ab7f11 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 15 Jun 2020 15:55:59 +0200 Subject: [PATCH] Closes #1848 --- ArchiSteamFarm/Bot.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 95f179dd3..902578057 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -671,11 +671,27 @@ namespace ArchiSteamFarm { } } + SteamApps.PICSTokensCallback tokenCallback = null; + + for (byte i = 0; (i < WebBrowser.MaxTries) && (tokenCallback == null) && IsConnectedAndLoggedOn; i++) { + try { + tokenCallback = await SteamApps.PICSGetAccessTokens(appID, null); + } catch (Exception e) { + ArchiLogger.LogGenericWarningException(e); + } + } + + if (tokenCallback == null) { + return (optimisticDiscovery ? appID : 0, DateTime.MinValue, true); + } + + SteamApps.PICSRequest request = new SteamApps.PICSRequest(appID, tokenCallback.AppTokens.TryGetValue(appID, out ulong accessToken) ? accessToken : 0, false); + AsyncJobMultiple.ResultSet productInfoResultSet = null; for (byte i = 0; (i < WebBrowser.MaxTries) && (productInfoResultSet == null) && IsConnectedAndLoggedOn; i++) { try { - productInfoResultSet = await SteamApps.PICSGetProductInfo(appID, null, false); + productInfoResultSet = await SteamApps.PICSGetProductInfo(request.ToEnumerable(), Enumerable.Empty()); } catch (Exception e) { ArchiLogger.LogGenericWarningException(e); }