예제 #1
0
        //public event EventHandler<FriendsManager.FriendshipOfferedEvent> FriendshipOfferRcvd;
        ////client.Friends.OnFriendOnline += new FriendsManager.FriendOnlineEvent(Friends_OnFriendOnline);

        //protected virtual void OnFriendshipOfferRcvd(FriendsManager.FriendshipOfferedEvent e)
        //{
        //    if (FriendshipOfferRcvd != null) FriendshipOfferRcvd(this, e);
        //}

        protected virtual void OnClientLoggingIn(OverrideEventArgs e)
        {
            if (ClientLoggingIn != null)
            {
                ClientLoggingIn(this, e);
            }
        }
예제 #2
0
        public void Logout()
        {
            if (!loggedIn)
            {
                OnClientLoggedOut(EventArgs.Empty);
                return;
            }

            OverrideEventArgs ea = new OverrideEventArgs();

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

            client.Network.Logout();
        }
예제 #3
0
파일: Form1.cs 프로젝트: hamalawy/slmiv
 private void netcom_ClientLoggingIn(object sender, OverrideEventArgs e)
 {
     //Show the progressbar
     this.Focus();
     this.Update();
     pBarConnection.Focus();
     pBarConnection.Visible = true;
     pBarConnection.Update();
 }
예제 #4
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;
        }
예제 #5
0
        public void Login()
        {
            try
            {
                loggingIn = true;

                LastExecStatus crashrep = instance.HadCrashed();

                loginOptions.CrashStatus = crashrep;

                instance.StartCrashRep();

                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
                //    password = OpenMetaverse.Utils.MD5(loginOptions.Password);

                password = OpenMetaverse.Utils.MD5(loginOptions.Password);

                string[] agt = loginOptions.UserAgent.Split(' ');

                LoginParams loginParams = client.Network.DefaultLoginParams(
                    loginOptions.FirstName, loginOptions.LastName, password,
                    agt[0], loginOptions.UserAgent.Substring(9));

                loginParams.Start = startLocation;

                loginParams.AgreeToTos = true;
                loginParams.Channel    = "METAbolt";
                loginParams.Author     = loginOptions.Author;

                loginParams.MAC = GetMACAddress();
                //loginParams.MethodName = string.Empty;
                loginParams.Platform = System.Environment.OSVersion.VersionString;   // "Windows";
                //loginParams.ReadCritical = false;
                loginParams.Version = instance.METAbolt_Version;

                // V 0.9.1.6 change
                switch (loginOptions.Grid)
                {
                case LoginGrid.MainGrid: client.Settings.LOGIN_SERVER = MainGridLogin; loginParams.URI = MainGridLogin; break;

                case LoginGrid.BetaGrid: client.Settings.LOGIN_SERVER = BetaGridLogin; loginParams.URI = BetaGridLogin; break;

                case LoginGrid.Custom: client.Settings.LOGIN_SERVER = loginOptions.GridCustomLoginUri; loginParams.URI = loginOptions.GridCustomLoginUri; break;
                }

                client.Network.BeginLogin(loginParams);
            }
            catch (Exception ex)
            {
                Logger.Log("Connection to SL failed", Helpers.LogLevel.Warning, ex);
            }
        }
예제 #6
0
파일: Disconnected.cs 프로젝트: SObS/SLeek
 private void netcom_ClientLoggingIn(object sender, OverrideEventArgs e)
 {
     proReconnect.Visible = true;
     btnExit.Enabled = false;
     btnReconnect.Enabled = false;
 }
예제 #7
0
파일: SLNetCom.cs 프로젝트: SObS/SLeek
        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 ClientLoginEventArgs(LoginStatus.Failed, "One or more fields are blank."));
            }

            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
                password = Helpers.MD5(loginOptions.Password);

            LoginParams loginParams = client.Network.DefaultLoginParams(
                loginOptions.FirstName, loginOptions.LastName, password,
                loginOptions.UserAgent, loginOptions.Author);

            loginParams.Start = startLocation;

            switch (loginOptions.Grid)
            {
                case LoginGrid.MainGrid: client.Settings.LOGIN_SERVER = MainGridLogin; break;
                case LoginGrid.BetaGrid: client.Settings.LOGIN_SERVER = BetaGridLogin; break;
                case LoginGrid.Custom: client.Settings.LOGIN_SERVER = loginOptions.GridCustomLoginUri; break;
            }

            client.Network.BeginLogin(loginParams);
        }
예제 #8
0
파일: SLNetCom.cs 프로젝트: SObS/SLeek
        public void Logout()
        {
            if (!loggedIn)
            {
                OnClientLoggedOut(EventArgs.Empty);
                return;
            }

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

            client.Network.Logout();
        }
예제 #9
0
파일: MainConsole.cs 프로젝트: SObS/SLeek
        private void netcom_ClientLoggingIn(object sender, OverrideEventArgs e)
        {
            lblLoginStatus.Text = "Logging in...";
            lblLoginStatus.ForeColor = Color.FromKnownColor(KnownColor.ControlText);

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

            btnLogin.Enabled = false;
        }
예제 #10
0
        public void Login()
        {
            try
            {
                loggingIn = true;

                LastExecStatus crashrep = instance.HadCrashed();

                loginOptions.CrashStatus = crashrep;

                instance.StartCrashRep();

                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
                //    password = OpenMetaverse.Utils.MD5(loginOptions.Password);

                password = OpenMetaverse.Utils.MD5(loginOptions.Password);

                string[] agt = loginOptions.UserAgent.Split(' ');

                LoginParams loginParams = client.Network.DefaultLoginParams(
                    loginOptions.FirstName, loginOptions.LastName, password,
                    agt[0], loginOptions.UserAgent.Substring(9));

                loginParams.Start = startLocation;

                loginParams.AgreeToTos = true;
                loginParams.Channel = "METAbolt";
                loginParams.Author = loginOptions.Author;

                loginParams.MAC = GetMACAddress();
                //loginParams.MethodName = string.Empty;
                loginParams.Platform = System.Environment.OSVersion.VersionString;   // "Windows";
                //loginParams.ReadCritical = false;
                loginParams.Version = instance.METAbolt_Version;

                // V 0.9.1.6 change
                switch (loginOptions.Grid)
                {
                    case LoginGrid.MainGrid: client.Settings.LOGIN_SERVER = MainGridLogin; loginParams.URI = MainGridLogin; break;
                    case LoginGrid.BetaGrid: client.Settings.LOGIN_SERVER = BetaGridLogin; loginParams.URI = BetaGridLogin; break;
                    case LoginGrid.Custom: client.Settings.LOGIN_SERVER = loginOptions.GridCustomLoginUri; loginParams.URI = loginOptions.GridCustomLoginUri; break;
                }

                client.Network.BeginLogin(loginParams);
            }
            catch (Exception ex)
            {
                Logger.Log("Connection to SL failed", Helpers.LogLevel.Warning, ex);
            }
        }
예제 #11
0
 protected virtual void OnClientLoggingOut(OverrideEventArgs e)
 {
     if (ClientLoggingOut != null) ClientLoggingOut(this, e);
 }