Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index files from Steam #2385

Merged
merged 23 commits into from
Dec 17, 2024
Merged

Index files from Steam #2385

merged 23 commits into from
Dec 17, 2024

Conversation

halgari
Copy link
Collaborator

@halgari halgari commented Dec 12, 2024

Adds a CLI verb for indexing game files for use in the game-hashes repo. This PR also does the following

  • Adds support for logging into steam, and accessing product info
  • Adds support for getting manfiest info from the steam content network
  • Adds support for reading files from Steam's CDN
  • Updates the Chunked stream reader so that it can handle blocks of any size (previously all blocks but the last had to be the same size)
  • Adds a MultiHasher for hashing a stream effiently into all the various hash formats we would need
  • Adds value types for SHA1, MD5, and CRC32.
  • Adds hashing logic for the minimal hash
  • The CLI verb creates all these variants for every file it hashes, along with xxHash3, and xxHash64
  • Adds value types for all the Steam values

How to Test:

  • There's a test called CanDownloadProuctInfo by default this test is set to skip.
  • Enable the test (remove the skip reason)
  • Run the test
  • The logs for the test will present a QR code, use the steam app on your phone to scan this QR code
  • The test will download and the data for SDV

Alternatively:

  • Run the index-steam-app verb
  • It will ask you to log in via a Steam QR code
  • It will download all the current versions of SDV and index them (not saving any of the game files, it indexes purely in a streaming method)

@halgari halgari marked this pull request as ready for review December 12, 2024 17:06
@halgari halgari requested a review from a team December 12, 2024 17:06
@erri120 erri120 self-requested a review December 13, 2024 16:08
Comment on lines +10 to +13
/// <summary>
/// The OSes that the depot is available on.
/// </summary>
public required string[] OsList { get; init; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have the OS list, we could also get the languages of a depot.

Comment on lines 17 to 25
/// <summary>
/// The size of the downloaded files
/// </summary>
public required Size Size { get; init; }

/// <summary>
/// The size of the files on the CDN
/// </summary>
public required Size DownloadSize { get; init; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these two sizes different?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably one is compressed, other is decompressed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DownloadSize is compressed, Size is size-on-disk (uncompressed).

Copy link
Member

@erri120 erri120 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent, we should name these properties CompressedSize and DecompressedSize.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to veto this one, we're going to process this data and import it into a MnemonicDB database before pulling it into the app, so the names here aren't the ones we'll be using anywhere in the app, instead they're used when we're talking directly to SteamAPIs, and it's important that we don't manipulate this data too much or try to adapt it to some other format.

Comment on lines +49 to +52
/// <summary>
/// The size of the file, compressed
/// </summary>
public Size Size { get; init; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other types have both compressed and decompressed sizes, for consistency this should be named CompressedSize and we should add DecompressedSize if we have it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm matching what SteamKit provides here, I don't mind changing it, but then we'd be out-of-sync with the "official" source

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy if we have something that is consistent internally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment on the other section

Abstractions/NexusMods.Abstractions.Steam/DTOs/Manifest.cs Outdated Show resolved Hide resolved
src/Networking/NexusMods.Networking.Steam/Session.cs Outdated Show resolved Hide resolved
Comment on lines 1 to 2
<Project Sdk="Microsoft.NET.Sdk">

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be missing an import of directory.props.

halgari and others added 15 commits December 16, 2024 06:26
@halgari halgari merged commit f79dd35 into main Dec 17, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants