Ejemplo n.º 1
0
        private void HandleCreateAccount2(BncsReader dr)
        {
            int status = dr.ReadInt32();
            CreationFailureReason reason = CreationFailureReason.Unknown;

            switch (status)
            {
            case 2:
                reason = CreationFailureReason.InvalidCharacters; break;

            case 3:
                reason = CreationFailureReason.InvalidWord; break;

            case 6:
                reason = CreationFailureReason.NotEnoughAlphanumerics; break;

            case 4:
            default:
                reason = CreationFailureReason.AccountAlreadyExists; break;
            }

            if (status == 0)
            {
                AccountCreationEventArgs created = new AccountCreationEventArgs(_settings.Username);
                OnAccountCreated(created);

                LoginAccountOld();
            }
            else
            {
                AccountCreationFailedEventArgs failed = new AccountCreationFailedEventArgs(_settings.Username, reason);
                OnAccountCreationFailed(failed);
            }
        }
Ejemplo n.º 2
0
 void Client_AccountCreated(object sender, AccountCreationEventArgs e)
 {
     if (__accountCreated != null)
     {
         __accountCreated.Call(_host.ClientHost, ConvObj(e));
     }
 }
Ejemplo n.º 3
0
        private void HandleAuthAccountCreate(ParseData data)
        {
            DataReader            dr     = new DataReader(data.Data);
            int                   status = dr.ReadInt32();
            CreationFailureReason reason = CreationFailureReason.Unknown;

            switch (status)
            {
            case 0:
                AccountCreationEventArgs created = new AccountCreationEventArgs(m_settings.Username)
                {
                    EventData = data
                };
                OnAccountCreated(created);

                LoginAccountNLS();
                break;

            case 7:
                reason = CreationFailureReason.NameTooShort;
                break;

            case 8:
                reason = CreationFailureReason.InvalidCharacters;
                break;

            case 9:
                reason = CreationFailureReason.InvalidWord;
                break;

            case 10:
                reason = CreationFailureReason.NotEnoughAlphanumerics;
                break;

            case 11:
                reason = CreationFailureReason.AdjacentPunctuation;
                break;

            case 12:
                reason = CreationFailureReason.TooMuchPunctuation;
                break;

            case 4:
            default:
                reason = CreationFailureReason.AccountAlreadyExists;
                break;
            }

            if (status != 0)
            {
                AccountCreationFailedEventArgs failed = new AccountCreationFailedEventArgs(m_settings.Username, reason)
                {
                    EventData = data
                };
                OnAccountCreationFailed(failed);
            }
        }
Ejemplo n.º 4
0
        void IChatConnectionEventSource.OnAccountCreated(AccountCreationEventArgs args)
        {
            var tmp = this.AccountCreated;

            if (tmp != null)
            {
                tmp(this, args);
            }
        }
        /// <summary>
        /// When an account's credentials have been updated.
        /// </summary>
        /// <returns></returns>
        private void OnUpdated(Object sender, AccountCreationEventArgs args)
        {
            m_creationArgs = args;

            // Updates the picture and label for key level
            switch (args.KeyLevel)
            {
            default:
                keyPicture.Image        = CommonProperties.Resources.APIKeyWrong;
                keyLabel.Text           = m_creationArgs.Result.ErrorMessage;
                errorGuideLabel.Visible = true;
                errorGuideLabel.BringToFront();
                break;

            case CredentialsLevel.Limited:
                keyPicture.Image        = CommonProperties.Resources.APIKeyLimited;
                keyLabel.Text           = "This is a limited API key.";
                errorGuideLabel.Visible = false;
                break;

            case CredentialsLevel.Full:
                keyPicture.Image        = CommonProperties.Resources.APIKeyFull;
                keyLabel.Text           = "This is a full API key.";
                errorGuideLabel.Visible = false;
                break;
            }

            // Updates the characters list
            charactersListView.Items.Clear();
            foreach (var id in args.Identities)
            {
                var item = new ListViewItem(id.Name);
                item.Checked = (m_account == null || !m_account.IgnoreList.Contains(id));
                item.Tag     = id;

                charactersListView.Items.Add(item);
            }

            // Selects the last page
            throbber.State          = ThrobberState.Stopped;
            multiPanel.SelectedPage = resultPage;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// On the first page, when a textbox is changed, we ensure the previously generated <see cref="AccountCreationEventArgs"/> is destroyed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void apiKeyTextBox_TextChanged(object sender, EventArgs e)
 {
     m_creationArgs = null;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Cancel.
 /// Closes the window.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cancelButton_Click(object sender, EventArgs e)
 {
     m_creationArgs = null;
     this.Close();
 }
Ejemplo n.º 8
0
 public void OnAccountCreated(AccountCreationEventArgs e)
 {
     m_host.OnAccountCreated(e);
 }
Ejemplo n.º 9
0
 private void OnAccountCreated(AccountCreationEventArgs args)
 {
     ((IChatConnectionEventSource)this).OnAccountCreated(args);
 }
Ejemplo n.º 10
0
 static void client_AccountCreated(object sender, AccountCreationEventArgs e)
 {
     PrintTidTs(DateTime.Now);
     console.OutputForegroundColor = ConsoleColor.Cyan;
     console.WriteLine("Account successfully created.");
 }
Ejemplo n.º 11
0
 public void OnAccountCreated(AccountCreationEventArgs e)
 {
     m_host.OnAccountCreated(e);
 }
Ejemplo n.º 12
0
        private void HandleCreateAccount2(ParseData data)
        {
            DataReader dr = new DataReader(data.Data);
            int status = dr.ReadInt32();
            CreationFailureReason reason = CreationFailureReason.Unknown;
            switch (status)
            {
                case 2:
                    reason = CreationFailureReason.InvalidCharacters; break;
                case 3:
                    reason = CreationFailureReason.InvalidWord; break;
                case 6:
                    reason = CreationFailureReason.NotEnoughAlphanumerics; break;
                case 4:
                default:
                    reason = CreationFailureReason.AccountAlreadyExists; break;
            }

            if (status == 0)
            {
                AccountCreationEventArgs created = new AccountCreationEventArgs(m_settings.Username) { EventData = data };
                OnAccountCreated(created);

                LoginAccountOld();
            }
            else
            {
                AccountCreationFailedEventArgs failed = new AccountCreationFailedEventArgs(m_settings.Username, reason) { EventData = data };
                OnAccountCreationFailed(failed);
            }
        }
Ejemplo n.º 13
0
        private void HandleAuthAccountCreate(ParseData data)
        {
            DataReader dr = new DataReader(data.Data);
            int status = dr.ReadInt32();
            CreationFailureReason reason = CreationFailureReason.Unknown;
            switch (status)
            {
                case 0:
                    AccountCreationEventArgs created = new AccountCreationEventArgs(m_settings.Username) { EventData = data };
                    OnAccountCreated(created);

                    LoginAccountNLS();
                    break;
                case 7:
                    reason = CreationFailureReason.NameTooShort;
                    break;
                case 8:
                    reason = CreationFailureReason.InvalidCharacters;
                    break;
                case 9:
                    reason = CreationFailureReason.InvalidWord;
                    break;
                case 10:
                    reason = CreationFailureReason.NotEnoughAlphanumerics;
                    break;
                case 11:
                    reason = CreationFailureReason.AdjacentPunctuation;
                    break;
                case 12:
                    reason = CreationFailureReason.TooMuchPunctuation;
                    break;
                case 4:
                default:
                    reason = CreationFailureReason.AccountAlreadyExists;
                    break;
            }

            if (status != 0)
            {
                AccountCreationFailedEventArgs failed = new AccountCreationFailedEventArgs(m_settings.Username, reason) { EventData = data };
                OnAccountCreationFailed(failed);
            }
        }