예제 #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);
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: Mofsy/jinxbot
 static void client_AccountCreationFailed(object sender, AccountCreationFailedEventArgs e)
 {
     PrintTidTs(DateTime.Now);
     console.OutputForegroundColor = ConsoleColor.Red;
     console.WriteLine("Failed to create account ({0}).", e.Reason);
     LoginWithNewCredentials(sender);
 }