|
|
|
@ -165,7 +165,8 @@ namespace DepotDownloader
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
WaitUntilCallback(() => {
|
|
|
|
WaitUntilCallback( () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
callbacks.Subscribe( steamApps.PICSGetAccessTokens( new List<uint>() { appId }, new List<uint>() { } ), cbMethodTokens );
|
|
|
|
callbacks.Subscribe( steamApps.PICSGetAccessTokens( new List<uint>() { appId }, new List<uint>() { } ), cbMethodTokens );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
|
|
|
|
|
|
|
|
@ -195,7 +196,8 @@ namespace DepotDownloader
|
|
|
|
request.Public = false;
|
|
|
|
request.Public = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WaitUntilCallback(() => {
|
|
|
|
WaitUntilCallback( () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
callbacks.Subscribe( steamApps.PICSGetProductInfo( new List<SteamApps.PICSRequest>() { request }, new List<SteamApps.PICSRequest>() { } ), cbMethod );
|
|
|
|
callbacks.Subscribe( steamApps.PICSGetProductInfo( new List<SteamApps.PICSRequest>() { request }, new List<SteamApps.PICSRequest>() { } ), cbMethod );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -225,7 +227,8 @@ namespace DepotDownloader
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
WaitUntilCallback(() => {
|
|
|
|
WaitUntilCallback( () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
callbacks.Subscribe( steamApps.PICSGetProductInfo( new List<uint>(), packages ), cbMethod );
|
|
|
|
callbacks.Subscribe( steamApps.PICSGetProductInfo( new List<uint>(), packages ), cbMethod );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -240,7 +243,8 @@ namespace DepotDownloader
|
|
|
|
success = resultInfo.GrantedApps.Contains( appId );
|
|
|
|
success = resultInfo.GrantedApps.Contains( appId );
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
WaitUntilCallback(() => {
|
|
|
|
WaitUntilCallback( () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
callbacks.Subscribe( steamApps.RequestFreeLicense( appId ), cbMethod );
|
|
|
|
callbacks.Subscribe( steamApps.RequestFreeLicense( appId ), cbMethod );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
|
|
|
|
|
|
|
|
@ -276,7 +280,8 @@ namespace DepotDownloader
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
WaitUntilCallback(() => {
|
|
|
|
WaitUntilCallback( () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
callbacks.Subscribe( steamApps.GetAppOwnershipTicket( appId ), cbMethod );
|
|
|
|
callbacks.Subscribe( steamApps.GetAppOwnershipTicket( appId ), cbMethod );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}, () => { return completed; } );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -392,6 +397,22 @@ namespace DepotDownloader
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void TryWaitForLoginKey()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( logonDetails.Username == null || !ContentDownloader.Config.RememberPassword ) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime waitUntil = new DateTime().AddSeconds( 10 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ( true )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DateTime now = new DateTime();
|
|
|
|
|
|
|
|
if ( now >= waitUntil ) break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( ConfigStore.TheConfig.LoginKeys.ContainsKey( logonDetails.Username ) ) break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callbacks.RunWaitAllCallbacks( TimeSpan.FromMilliseconds( 100 ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void WaitForCallbacks()
|
|
|
|
private void WaitForCallbacks()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -443,7 +464,8 @@ namespace DepotDownloader
|
|
|
|
if ( bConnecting )
|
|
|
|
if ( bConnecting )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine( "Connection to Steam failed. Trying again" );
|
|
|
|
Console.WriteLine( "Connection to Steam failed. Trying again" );
|
|
|
|
} else
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine( "Lost connection to Steam. Reconnecting" );
|
|
|
|
Console.WriteLine( "Lost connection to Steam. Reconnecting" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -457,19 +479,41 @@ namespace DepotDownloader
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool isSteamGuard = loggedOn.Result == EResult.AccountLogonDenied;
|
|
|
|
bool isSteamGuard = loggedOn.Result == EResult.AccountLogonDenied;
|
|
|
|
bool is2FA = loggedOn.Result == EResult.AccountLoginDeniedNeedTwoFactor;
|
|
|
|
bool is2FA = loggedOn.Result == EResult.AccountLoginDeniedNeedTwoFactor;
|
|
|
|
|
|
|
|
bool isLoginKey = ContentDownloader.Config.RememberPassword && logonDetails.LoginKey != null && loggedOn.Result == EResult.InvalidPassword;
|
|
|
|
|
|
|
|
|
|
|
|
if (isSteamGuard || is2FA)
|
|
|
|
if ( isSteamGuard || is2FA || isLoginKey )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bExpectingDisconnectRemote = true;
|
|
|
|
bExpectingDisconnectRemote = true;
|
|
|
|
Abort( false );
|
|
|
|
Abort( false );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !isLoginKey )
|
|
|
|
|
|
|
|
{
|
|
|
|
Console.WriteLine( "This account is protected by Steam Guard." );
|
|
|
|
Console.WriteLine( "This account is protected by Steam Guard." );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( is2FA )
|
|
|
|
if ( is2FA )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.Write( "Please enter your 2 factor auth code from your authenticator app: " );
|
|
|
|
Console.Write( "Please enter your 2 factor auth code from your authenticator app: " );
|
|
|
|
logonDetails.TwoFactorCode = Console.ReadLine();
|
|
|
|
logonDetails.TwoFactorCode = Console.ReadLine();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if ( isLoginKey )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ConfigStore.TheConfig.LoginKeys.Remove( logonDetails.Username );
|
|
|
|
|
|
|
|
ConfigStore.Save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logonDetails.LoginKey = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( ContentDownloader.Config.SuppliedPassword != null )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine( "Login key was expired. Connecting with supplied password." );
|
|
|
|
|
|
|
|
logonDetails.Password = ContentDownloader.Config.SuppliedPassword;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine( "Login key was expired. Please enter your password: " );
|
|
|
|
|
|
|
|
logonDetails.Password = Util.ReadPassword();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.Write( "Please enter the authentication code sent to your email address: " );
|
|
|
|
Console.Write( "Please enter the authentication code sent to your email address: " );
|
|
|
|
@ -566,6 +610,8 @@ namespace DepotDownloader
|
|
|
|
|
|
|
|
|
|
|
|
private void LoginKeyCallback( SteamUser.LoginKeyCallback loginKey )
|
|
|
|
private void LoginKeyCallback( SteamUser.LoginKeyCallback loginKey )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine( "Accepted new login key for account {0}", logonDetails.Username );
|
|
|
|
|
|
|
|
|
|
|
|
ConfigStore.TheConfig.LoginKeys[ logonDetails.Username ] = loginKey.LoginKey;
|
|
|
|
ConfigStore.TheConfig.LoginKeys[ logonDetails.Username ] = loginKey.LoginKey;
|
|
|
|
ConfigStore.Save();
|
|
|
|
ConfigStore.Save();
|
|
|
|
|
|
|
|
|
|
|
|
|