From aafab99498bf7cf7822527937f62b316cbc77057 Mon Sep 17 00:00:00 2001 From: akorb Date: Thu, 11 Jun 2020 18:31:07 +0200 Subject: [PATCH] More reverse engineering of stateFlags --- SteamShutdown/App.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/SteamShutdown/App.cs b/SteamShutdown/App.cs index 3df3015..33fa4f9 100644 --- a/SteamShutdown/App.cs +++ b/SteamShutdown/App.cs @@ -16,9 +16,24 @@ public class App /// public static bool CheckDownloading(int appState) { - // The second bit defines if anything for the app needs to be downloaded - // Doesn't matter if queued, download running and so on - return IsBitSet(appState, 1); + return (IsBitSet(appState, 1) || IsBitSet(appState, 10)) && !IsBitSet(appState, 9); + + /* Counting from zero and starting from the right + * Bit 1 indicates if a download is running + * Bit 2 indicates if a game is installed + * Bit 9 indicates if the download has been stopped by the user. The download will not happen, so don't wait for it. + * Bit 10 (or maybe Bit 5) indicates if a DLC is downloaded for a game + * + * All known stateFlags while a download is running so far: + * 00000000110 + * 10000000010 + * 10000010010 + * 10000100110 + * 10000000110 + * 10000010100 Bit 1 not set, but Bit 5 and Bit 10. Happens if downloading a DLC for an already downloaded game. + * Because for a very short time after starting the download for this DLC the stateFlags becomes 20 = 00000010100 + * I think Bit 5 indicates if "something" is happening with a DLC and Bit 10 indicates if it is downloading. + */ } public override string ToString()