Fix ugc web download and remove dead code (#174)

pull/175/head
Pavel Djundik 5 years ago committed by GitHub
parent d7870040fe
commit 9d4b87ba60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -405,7 +405,7 @@ namespace DepotDownloader
if ( steam3.steamUser.SteamID.AccountType != EAccountType.AnonUser )
{
steam3.GetUGCDetails( ugcId );
details = steam3.GetUGCDetails( ugcId );
}
else
{
@ -612,9 +612,6 @@ namespace DepotDownloader
return null;
}
// Skip requesting an app ticket
steam3.AppTickets[ depotId ] = null;
if (manifestId == INVALID_MANIFEST_ID)
{
manifestId = GetSteam3DepotManifest(depotId, appId, branch);

@ -15,8 +15,6 @@ namespace DepotDownloader
public List<string> FilesToDownload { get; set; }
public List<Regex> FilesToDownloadRegex { get; set; }
public bool UsingExclusionList { get; set; }
public string BetaPassword { get; set; }
public bool VerifyAll { get; set; }

@ -31,7 +31,6 @@ namespace DepotDownloader
private set;
}
public Dictionary<uint, byte[]> AppTickets { get; private set; }
public Dictionary<uint, ulong> AppTokens { get; private set; }
public Dictionary<uint, ulong> PackageTokens { get; private set; }
public Dictionary<uint, byte[]> DepotKeys { get; private set; }
@ -82,7 +81,6 @@ namespace DepotDownloader
this.bDidReceiveLoginKey = false;
this.seq = 0;
this.AppTickets = new Dictionary<uint, byte[]>();
this.AppTokens = new Dictionary<uint, ulong>();
this.PackageTokens = new Dictionary<uint, ulong>();
this.DepotKeys = new Dictionary<uint, byte[]>();
@ -287,41 +285,6 @@ namespace DepotDownloader
return success;
}
public void RequestAppTicket( uint appId )
{
if ( AppTickets.ContainsKey( appId ) || bAborted )
return;
if ( !authenticatedUser )
{
AppTickets[ appId ] = null;
return;
}
bool completed = false;
Action<SteamApps.AppOwnershipTicketCallback> cbMethod = ( appTicket ) =>
{
completed = true;
if ( appTicket.Result != EResult.OK )
{
Console.WriteLine( "Unable to get appticket for {0}: {1}", appTicket.AppID, appTicket.Result );
Abort();
}
else
{
Console.WriteLine( "Got appticket for {0}!", appTicket.AppID );
AppTickets[ appTicket.AppID ] = appTicket.Ticket;
}
};
WaitUntilCallback( () =>
{
callbacks.Subscribe( steamApps.GetAppOwnershipTicket( appId ), cbMethod );
}, () => { return completed; } );
}
public void RequestDepotKey( uint depotId, uint appid = 0 )
{
if ( DepotKeys.ContainsKey( depotId ) || bAborted )
@ -414,37 +377,7 @@ namespace DepotDownloader
callbacks.Subscribe( steamApps.CheckAppBetaPassword( appid, password ), cbMethod );
}, () => { return completed; } );
}
public CPublishedFile_GetItemInfo_Response.WorkshopItemInfo GetPubfileItemInfo( uint appId, PublishedFileID pubFile )
{
var pubFileRequest = new CPublishedFile_GetItemInfo_Request() { app_id = appId };
pubFileRequest.workshop_items.Add( new CPublishedFile_GetItemInfo_Request.WorkshopItem() { published_file_id = pubFile } );
bool completed = false;
CPublishedFile_GetItemInfo_Response.WorkshopItemInfo details = null;
Action<SteamUnifiedMessages.ServiceMethodResponse> cbMethod = callback =>
{
completed = true;
if ( callback.Result == EResult.OK )
{
var response = callback.GetDeserializedResponse<CPublishedFile_GetItemInfo_Response>();
details = response.workshop_items.FirstOrDefault();
}
else
{
throw new Exception( $"EResult {(int)callback.Result} ({callback.Result}) while retrieving UGC id for pubfile {pubFile}.");
}
};
WaitUntilCallback(() =>
{
callbacks.Subscribe( steamPublishedFile.SendMessage( api => api.GetItemInfo( pubFileRequest ) ), cbMethod );
}, () => { return completed; });
return details;
}
public PublishedFileDetails GetPublishedFileDetails(uint appId, PublishedFileID pubFile)
{
var pubFileRequest = new CPublishedFile_GetDetails_Request() { appid = appId };

Loading…
Cancel
Save