private void netcom_ClientLoggingOut(object sender, OverrideEventArgs e)
        {
            btnLogin.Enabled = false;

            lblLoginStatus.Text      = "Logging out...";
            lblLoginStatus.ForeColor = Color.FromKnownColor(KnownColor.ControlText);

            proLogin.Visible = true;
        }
Exemple #2
0
        private void netcom_ClientLoggingIn(object sender, OverrideEventArgs e)
        {
            Console.WriteLine("Logging In...");
            //lblLoginStatus.Text = "Logging in...";
            //lblLoginStatus.ForeColor = Color.FromKnownColor(KnownColor.ControlText);

            //proLogin.Visible = true;
            //pnlLoggingIn.Visible = true;
            //pnlLoginPrompt.Visible = false;

            //btnLogin.Enabled = false;
        }
Exemple #3
0
        public void Logout()
        {
            if (!IsLoggedIn)
            {
                OnClientLoggedOut(EventArgs.Empty);
                return;
            }

            OverrideEventArgs ea = new OverrideEventArgs();

            OnClientLoggingOut(ea);
            if (ea.Cancel)
            {
                return;
            }

            client.Network.Logout();
        }
Exemple #4
0
        public void Login()
        {
            IsLoggingIn = true;

            // Report crashes only once and not on relogs/reconnects
            LastExecStatus execStatus = instance.GetLastExecStatus();

            if (!instance.AnotherInstanceRunning() && execStatus != LastExecStatus.Normal && (!instance.ReportedCrash))
            {
                instance.ReportedCrash     = true;
                loginOptions.LastExecEvent = execStatus;
                Logger.Log("Reporting crash of the last application run to the grid login service", Helpers.LogLevel.Warning);
            }
            else
            {
                loginOptions.LastExecEvent = LastExecStatus.Normal;
                Logger.Log("Reporting normal shutdown of the last application run to the grid login service", Helpers.LogLevel.Info);
            }
            instance.MarkStartExecution();

            OverrideEventArgs ea = new OverrideEventArgs();

            OnClientLoggingIn(ea);

            if (ea.Cancel)
            {
                IsLoggingIn = false;
                return;
            }

            if (string.IsNullOrEmpty(loginOptions.FirstName) ||
                string.IsNullOrEmpty(loginOptions.LastName) ||
                string.IsNullOrEmpty(loginOptions.Password))
            {
                OnClientLoginStatus(
                    new LoginProgressEventArgs(LoginStatus.Failed, "One or more fields are blank.", string.Empty));
            }

            string startLocation = string.Empty;
            string loginLocation = string.Empty;

            switch (loginOptions.StartLocation)
            {
            case StartLocationType.Home: startLocation = "home"; break;

            case StartLocationType.Last: startLocation = "last"; break;

            case StartLocationType.Custom:
                var parser = new LocationParser(loginOptions.StartLocationCustom.Trim());
                startLocation = parser.GetStartLocationUri();
                break;
            }

            string password;

            if (LoginOptions.IsPasswordMD5(loginOptions.Password))
            {
                password = loginOptions.Password;
            }
            else
            {
                password = Utils.MD5(loginOptions.Password.Length > 16
                    ? loginOptions.Password.Substring(0, 16)
                    : loginOptions.Password);
            }

            LoginParams loginParams = client.Network.DefaultLoginParams(
                loginOptions.FirstName, loginOptions.LastName, password,
                loginOptions.Channel, loginOptions.Version);

            Grid = loginOptions.Grid;
            loginParams.Start         = startLocation;
            loginParams.LoginLocation = loginLocation;
            loginParams.AgreeToTos    = AgreeToTos;
            loginParams.URI           = Grid.LoginURI;
            loginParams.LastExecEvent = loginOptions.LastExecEvent;
            loginParams.MfaEnabled    = true;
            loginParams.MfaHash       = loginOptions.MfaHash;
            loginParams.Token         = loginOptions.MfaToken;

            client.Network.BeginLogin(loginParams);
        }
Exemple #5
0
 void Netcom_ClientLoggingIn(object sender, Radegast.OverrideEventArgs e)
 {
     Talker.SayMore("Logging in.  Please wait.");
 }
 protected virtual void OnClientLoggingOut(OverrideEventArgs e)
 {
     ClientLoggingOut?.Invoke(this, e);
 }