Esempio n. 1
0
 protected virtual void OnClientLoggingOut(OverrideEventArgs e)
 {
     if (ClientLoggingOut != null)
     {
         ClientLoggingOut(this, e);
     }
 }
Esempio n. 2
0
        public void Logout()
        {
            if (!IsLoggedIn)
            {
                OnClientLoggedOut(EventArgs.Empty);
                return;
            }

            OverrideEventArgs ea = new OverrideEventArgs();

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

            client.Network.Logout();
        }
Esempio n. 3
0
        private void netcom_ClientLoggingOut(object sender, OverrideEventArgs e)
        {
            btnLogin.Enabled = false;

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

            proLogin.Visible = true;
        }
Esempio n. 4
0
 protected virtual void OnClientLoggingOut(OverrideEventArgs e)
 {
     if (ClientLoggingOut != null) ClientLoggingOut(this, e);
 }
Esempio n. 5
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;

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

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

            case StartLocationType.Custom:
                startLocation = loginOptions.StartLocationCustom.Trim();

                StartLocationParser parser = new StartLocationParser(startLocation);
                startLocation = NetworkManager.StartLocation(parser.Sim, parser.X, parser.Y, parser.Z);

                break;
            }

            string password;

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

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

            Grid = loginOptions.Grid;
            loginParams.Start         = startLocation;
            loginParams.AgreeToTos    = AgreeToTos;
            loginParams.URI           = Grid.LoginURI;
            loginParams.LastExecEvent = loginOptions.LastExecEvent;
            client.Network.BeginLogin(loginParams);
        }
Esempio n. 6
0
        public void Logout()
        {
            if (!loggedIn)
            {
                OnClientLoggedOut(EventArgs.Empty);
                return;
            }

            OverrideEventArgs ea = new OverrideEventArgs();
            OnClientLoggingOut(ea);
            if (ea.Cancel) return;

            client.Network.Logout();
        }
Esempio n. 7
0
        public void Login()
        {
            loggingIn = true;

            OverrideEventArgs ea = new OverrideEventArgs();
            OnClientLoggingIn(ea);

            if (ea.Cancel)
            {
                loggingIn = 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;

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

                case StartLocationType.Custom:
                    startLocation = loginOptions.StartLocationCustom.Trim();

                    StartLocationParser parser = new StartLocationParser(startLocation);
                    startLocation = NetworkManager.StartLocation(parser.Sim, parser.X, parser.Y, parser.Z);

                    break;
            }

            string password;

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

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

            grid = loginOptions.Grid;
            loginParams.Start = startLocation;
            loginParams.AgreeToTos = AgreeToTos;
            loginParams.URI = grid.LoginURI;
            client.Network.BeginLogin(loginParams);
        }
Esempio n. 8
0
        public void Login()
        {
            loggingIn = 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)
            {
                loggingIn = 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;

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

                case StartLocationType.Custom:
                    startLocation = loginOptions.StartLocationCustom.Trim();

                    StartLocationParser parser = new StartLocationParser(startLocation);
                    startLocation = NetworkManager.StartLocation(parser.Sim, parser.X, parser.Y, parser.Z);

                    break;
            }

            string password;

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

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

            grid = loginOptions.Grid;
            loginParams.Start = startLocation;
            loginParams.AgreeToTos = AgreeToTos;
            loginParams.URI = grid.LoginURI;
            loginParams.LastExecEvent = loginOptions.LastExecEvent;
            client.Network.BeginLogin(loginParams);
        }
 protected virtual void OnClientLoggingOut(OverrideEventArgs e)
 {
     ClientLoggingOut?.Invoke(this, e);
 }
Esempio n. 10
0
 private void netcom_ClientLoggingOut(object sender, OverrideEventArgs e)
 {
     if (!AllowRadegastUIControl) e.Cancel = true;
 }
Esempio n. 11
0
 private void netcom_ClientLoggingIn(object sender, OverrideEventArgs e)
 {
     if (!AllowRadegastUIControl) e.Cancel = true;
     if (ClientManagerConfig.StartLispThreadAtPluginInit)
     {
         RunClientManagerStartupLisp();
     }
 }