Exemple #1
0
        private void ClickSendAuthKey(object sender, DialogClickEventArgs e)
        {
            SteamAlerts.HideInputDialog();

            if (inputAuthKey.Text.Length > 0)
            {
                Connect(inputAuthKey.Text);
            }
            else
            {
                RequestAuthKey();
                SteamAlerts.ShowAlertDialog("Invalid key", "Please enter a valid auth key", this);
            }

            SteamAlerts.EnableAlerts();
        }
Exemple #2
0
        private void Connect(String authCode)
        {
            ISharedPreferences pref = PreferenceManager.GetDefaultSharedPreferences(this);

            String username = pref.GetString("prefUsername", "");
            String password = pref.GetString("prefPassword", "");

            if (username.Length > 0 && password.Length > 0)
            {
                SteamService.GetClient().Connect(username, password, authCode);
                SteamAlerts.ShowProgressDialog("Connecting", "Connecting to the Steam servers...", this);
            }
            else
            {
                SteamAlerts.ShowAlertDialog("Warning", "No valid username or password entered", this);
            }
        }
Exemple #3
0
        public void HandleCallback(CallbackMsg msg)
        {
            if (msg.IsType <SteamClient.ConnectCallback>())
            {
                int    retryCount = SteamService.GetClient().GetRetryCount();
                String retries    = (retryCount > 0) ? " (retry " + retryCount + ")" : "";
                SteamAlerts.ShowProgressDialog("Connecting", "Logging in..." + retries, this);
            }
            else if (msg.IsType <SteamUser.LogOnCallback>())
            {
                SteamUser.LogOnCallback callback = (SteamUser.LogOnCallback)msg;

                if (callback.Result == EResult.AccountLogonDenied)
                {
                    RequestAuthKey();
                }
                else if (callback.Result == EResult.InvalidLoginAuthCode)
                {
                    InvalidAuthKey();
                }
                else if (callback.Result == EResult.InvalidPassword)
                {
                    SteamAlerts.ShowAlertDialog("Invalid credentials", "Invalid username or password", this);
                }
                else if (callback.Result == EResult.AlreadyLoggedInElsewhere)
                {
                    SteamAlerts.ShowAlertDialog("Already logged in", "This Steam account is already logged in elsewhere", this);
                }
            }
            else if (msg.IsType <SteamUser.LoggedOffCallback>())
            {
                SteamUser.LoggedOffCallback callback = (SteamUser.LoggedOffCallback)msg;

                if (callback.Result == EResult.InvalidProtocolVer)
                {
                    SteamAlerts.ShowAlertDialog("Error", "Invalid protocol version", this);
                }
            }

            UpdateButtons();
        }