Skip to content

Commit

Permalink
Update steamkit
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Oct 21, 2024
1 parent 247f832 commit 9ed8a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DepotDownloader/DepotDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
</PackageReference>
<PackageReference Include="protobuf-net" Version="3.2.30" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="SteamKit2" Version="3.0.0-Beta.4" />
<PackageReference Include="SteamKit2" Version="3.0.0-Beta.5" />
</ItemGroup>
</Project>
13 changes: 6 additions & 7 deletions DepotDownloader/Steam3Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ReadOnlyCollection<SteamApps.LicenseListCallback.License> Licenses
public SteamContent steamContent;
readonly SteamApps steamApps;
readonly SteamCloud steamCloud;
readonly SteamUnifiedMessages.UnifiedService<IPublishedFile> steamPublishedFile;
readonly PublishedFile steamPublishedFile;

readonly CallbackManager callbacks;

Expand Down Expand Up @@ -72,7 +72,7 @@ public Steam3Session(SteamUser.LogOnDetails details)
this.steamApps = this.steamClient.GetHandler<SteamApps>();
this.steamCloud = this.steamClient.GetHandler<SteamCloud>();
var steamUnifiedMessages = this.steamClient.GetHandler<SteamUnifiedMessages>();
this.steamPublishedFile = steamUnifiedMessages.CreateService<IPublishedFile>();
this.steamPublishedFile = steamUnifiedMessages.CreateService<PublishedFile>();
this.steamContent = this.steamClient.GetHandler<SteamContent>();

this.callbacks = new CallbackManager(this.steamClient);
Expand Down Expand Up @@ -285,15 +285,14 @@ public async Task<PublishedFileDetails> GetPublishedFileDetails(uint appId, Publ
var pubFileRequest = new CPublishedFile_GetDetails_Request { appid = appId };
pubFileRequest.publishedfileids.Add(pubFile);

var callback = await steamPublishedFile.SendMessage(api => api.GetDetails(pubFileRequest));
var details = await steamPublishedFile.GetDetails(pubFileRequest);

if (callback.Result == EResult.OK)
if (details.Result == EResult.OK)
{
var response = callback.GetDeserializedResponse<CPublishedFile_GetDetails_Response>();
return response.publishedfiledetails.FirstOrDefault();
return details.Body.publishedfiledetails.FirstOrDefault();
}

throw new Exception($"EResult {(int)callback.Result} ({callback.Result}) while retrieving file details for pubfile {pubFile}.");
throw new Exception($"EResult {(int)details.Result} ({details.Result}) while retrieving file details for pubfile {pubFile}.");
}


Expand Down

0 comments on commit 9ed8a70

Please sign in to comment.