Skip to content

Commit

Permalink
More reverse engineering of stateFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
akorb committed Jun 11, 2020
1 parent 1179fbf commit aafab99
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions SteamShutdown/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,24 @@ public class App
/// </summary>
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()
Expand Down

0 comments on commit aafab99

Please sign in to comment.