From 184ea54020b7b6dc2466dc3384b120eafe76fdc1 Mon Sep 17 00:00:00 2001 From: Ryan Kistner Date: Fri, 1 Dec 2017 00:09:19 -0700 Subject: [PATCH] Don't retrieve AppTickets as they aren't needed anymore --- DepotDownloader/CDNClientPool.cs | 4 ++-- DepotDownloader/ContentDownloader.cs | 4 ++-- DepotDownloader/Steam3Session.cs | 12 ++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DepotDownloader/CDNClientPool.cs b/DepotDownloader/CDNClientPool.cs index 2b4336cc..7c065fb3 100644 --- a/DepotDownloader/CDNClientPool.cs +++ b/DepotDownloader/CDNClientPool.cs @@ -129,7 +129,7 @@ namespace DepotDownloader { steamSession.RequestCDNAuthToken(appId, depotId, server.Host); - var cdnKey = string.Format("{0:D}:{1}", depotId, server.Host); + var cdnKey = string.Format("{0:D}:{1}", depotId, steamSession.ResolveCDNTopLevelHost(server.Host)); SteamApps.CDNAuthTokenCallback authTokenCallback; if (steamSession.CDNAuthTokens.TryGetValue(cdnKey, out authTokenCallback)) @@ -175,7 +175,7 @@ namespace DepotDownloader { steamSession.RequestCDNAuthToken(appId, depotId, server.Host); - var cdnKey = string.Format("{0:D}:{1}", depotId, server.Host); + var cdnKey = string.Format("{0:D}:{1}", depotId, steamSession.ResolveCDNTopLevelHost(server.Host)); SteamApps.CDNAuthTokenCallback authTokenCallback; if (steamSession.CDNAuthTokens.TryGetValue(cdnKey, out authTokenCallback)) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 978ce197..e685ec34 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -481,8 +481,8 @@ namespace DepotDownloader return null; } - if ( steam3 != null ) - steam3.RequestAppTicket( ( uint )depotId ); + // Skip requesting an app ticket + steam3.AppTickets[ depotId ] = null; ulong manifestID = GetSteam3DepotManifest( depotId, appId, branch ); if ( manifestID == INVALID_MANIFEST_ID && branch != "public" ) diff --git a/DepotDownloader/Steam3Session.cs b/DepotDownloader/Steam3Session.cs index 7ed43228..9c1cca11 100644 --- a/DepotDownloader/Steam3Session.cs +++ b/DepotDownloader/Steam3Session.cs @@ -313,8 +313,20 @@ namespace DepotDownloader }, () => { return completed; } ); } + public string ResolveCDNTopLevelHost(string host) + { + // SteamPipe CDN shares tokens with all hosts + if (host.EndsWith( ".steampipe.steamcontent.com" ) ) + { + return "steampipe.steamcontent.com"; + } + + return host; + } + public void RequestCDNAuthToken( uint appid, uint depotid, string host ) { + host = ResolveCDNTopLevelHost( host ); var cdnKey = string.Format( "{0:D}:{1}", depotid, host ); if ( CDNAuthTokens.ContainsKey( cdnKey ) || bAborted )