private void OnLoggedOff(SteamUser.LoggedOffCallback obj)
 {
     logger.Warn("Steam user logged off with result {result}", obj.Result);
     logger.Warn("Client is connected: {isConnected}", client.IsConnected);
     if (client.IsConnected)
     {
         user.LogOnAnonymous();
     }
 }
Пример #2
0
        private void OnConnected(SteamClient.ConnectedCallback callback)
        {
            Console.WriteLine($"Connected to Steam! Logging in...");

            if (config.SteamUsername == "")
            {
                steamUser.LogOnAnonymous();
            }
            else
            {
                byte[] sentryHash = null;
                if (File.Exists("sentry.bin"))
                {
                    // if we have a saved sentry file, read and sha-1 hash it
                    byte[] sentryFile = File.ReadAllBytes("sentry.bin");
                    sentryHash = CryptoHelper.SHAHash(sentryFile);
                }

                steamUser.LogOn(new SteamUser.LogOnDetails
                {
                    Username       = config.SteamUsername,
                    Password       = config.SteamPassword,
                    AuthCode       = authCode,
                    TwoFactorCode  = twoFactorAuth,
                    SentryFileHash = sentryHash
                });
            }
        }
Пример #3
0
        private void AttemptLogin()
        {
            if (!Credentials.IsAnonymous)
            {
                byte[] hash = null;

                using (var sha = SHA1.Create())
                {
                    var data = _authenticationProvider.GetSentryFileContent(Credentials);

                    if (data != null)
                    {
                        hash = sha.ComputeHash(data);
                    }
                }

                _steamUser.LogOn(new SteamKit.SteamUser.LogOnDetails
                {
                    Username               = Credentials.Username,
                    Password               = Credentials.Password,
                    TwoFactorCode          = TwoFactorCode,
                    AuthCode               = EmailAuthCode,
                    SentryFileHash         = hash,
                    LoginKey               = _authenticationProvider.GetLoginKey(Credentials),
                    ShouldRememberPassword = true,
                    LoginID = (uint)new Random().Next(100000000, 999999999)
                });
            }
            else
            {
                _steamUser.LogOnAnonymous();
            }
        }
        void OnConnected(SteamClient.ConnectedCallback callback)
        {
            if (callback.Result != EResult.OK)
            {
                MessageBox.Show("Failed to connect to steam");
                Application.Exit();
            }

            steamUser.LogOnAnonymous();
        }
Пример #5
0
        private void OnConnected(SteamClient.ConnectedCallback callback)
        {
            if (callback.Result != EResult.OK)
            {
                Bootstrap.Log("Could not connect to Steam: {0}", callback.Result);

                IsRunning = false;

                return;
            }

            Bootstrap.Log("Connected to Steam, logging in...");

            User.LogOnAnonymous();
        }
Пример #6
0
 private void ConnectedCallback(SteamClient.ConnectedCallback connected)
 {
     Console.WriteLine(" Done!");
     bConnected = true;
     if (!authenticatedUser)
     {
         Console.Write("Logging anonymously into Steam3...");
         steamUser.LogOnAnonymous();
     }
     else
     {
         Console.Write("Logging '{0}' into Steam3...", logonDetails.Username);
         steamUser.LogOn(logonDetails);
     }
 }
Пример #7
0
 private void OnConnected(SteamClient.ConnectedCallback callback)
 {
     Log.Info("Connected to Steam! Logging in '{0}'...", Username);
     if (Username == "anonymous")
     {
         steamUser.LogOnAnonymous();
     }
     else
     {
         steamUser.LogOn(new SteamUser.LogOnDetails
         {
             Username = Username,
             Password = password
         });
     }
 }
Пример #8
0
 private void ConnectedCallback(SteamClient.ConnectedCallback connected)
 {
     Log.Info(" Done!");
     bConnecting = false;
     bConnected  = true;
     if (!authenticatedUser)
     {
         Log.Info("Logging anonymously into Steam3...");
         steamUser.LogOnAnonymous();
     }
     else
     {
         Log.Info("Logging '{0}' into Steam3...", logonDetails.Username);
         steamUser.LogOn(logonDetails);
         LoginSuccessHandlers?.Invoke();
     }
 }
Пример #9
0
        private Task <bool> LoginAnon()
        {
            var tcs = new TaskCompletionSource <bool>();

            LoggedOnHandler    loggedOnCallback     = null;
            LogonFailedHandler logonFailedCallback  = null;
            ConnectedHandler   disconnectedCallback = null;

            loggedOnCallback     = () => { tcs.SetResult(true); onLoggedOn -= loggedOnCallback; onLogonFailed -= logonFailedCallback; onDisconnected -= disconnectedCallback; };
            logonFailedCallback  = (result) => { tcs.SetResult(false); onLogonFailed -= logonFailedCallback; onLoggedOn -= loggedOnCallback; onDisconnected -= disconnectedCallback; };
            disconnectedCallback = () => { tcs.SetResult(false); onDisconnected -= disconnectedCallback; onLoggedOn -= loggedOnCallback; onLogonFailed -= logonFailedCallback; };
            onLoggedOn          += loggedOnCallback;
            onLogonFailed       += logonFailedCallback;
            onDisconnected      += disconnectedCallback;

            DebugLog.WriteLine("Steam3Session", "Logging anonymously into Steam3...");
            steamUser.LogOnAnonymous();
            return(tcs.Task);
        }
Пример #10
0
        void OnConnected(SteamClient.ConnectedCallback callback)
        {
            setStatus("Connected to Steam!");
            Log.w("Connected!");

            /*
             * if (callback.Result != EResult.OK)
             * {
             *  MessageBox.Show("Failed to connect to steam");
             *  Environment.Exit(0);
             * } */

            if (string.IsNullOrEmpty(username))
            {
                steamUser.LogOnAnonymous();
            }
            else
            {
                byte[] sentryHash = null;

                if (File.Exists("steamguard.bin"))
                {
                    Log.w("Steam Guard exists, using existing config");
                    // if we have a saved sentry file, read and sha-1 hash it
                    byte[] sentryFile = File.ReadAllBytes("steamguard.bin");
                    sentryHash = CryptoHelper.SHAHash(sentryFile);
                }

                steamUser.LogOn(new SteamUser.LogOnDetails
                {
                    Username               = username,
                    Password               = password,
                    LoginKey               = loginkey,
                    AuthCode               = steamguard,
                    TwoFactorCode          = twofactor,
                    ShouldRememberPassword = rememberLogin,
                    LoginID = 1
                });
            }
        }
Пример #11
0
        public async Task <EResult> Login()
        {
            var result = EResult.OK;

            steamUser.LogOnAnonymous();

            await Task.Run(() =>
            {
                onLoggedOnEvent.WaitOne(10000);
                if (onLoggedOnResult != EResult.OK)
                {
                    isLoggedIn = false;
                    result     = onLoggedOnResult;
                }
                else
                {
                    isLoggedIn = true;
                }
            });

            return(result);
        }
Пример #12
0
        private void OnConnected(SteamClient.ConnectedCallback callback)
        {
            Bootstrap.Log("Connected to Steam, logging in...");

            User.LogOnAnonymous();
        }
Пример #13
0
        private void OnConnected(SteamClient.ConnectedCallback callback)
        {
            _logger.LogInformation("Connected to Steam! Logging in...");

            steamUser.LogOnAnonymous();
        }
Пример #14
0
 private void ConnectedCallback(SteamClient.ConnectedCallback connected)
 {
     //_Parent.Log.ConsolePrint(LogLevel.Debug, "Connected to Steam3, Authenticating as anonymous user");
     _User.LogOnAnonymous();
 }
Пример #15
0
 static void OnConnected( SteamClient.ConnectedCallback callback )
 {
     m_steamUser.LogOnAnonymous();
 }