Пример #1
0
        private void OnRegisterButtonClicked(
            UIRegistrationDetails uiRegistrationDetails)
        {
            var email           = uiRegistrationDetails.Email;
            var password        = uiRegistrationDetails.Password;
            var confirmPassword = uiRegistrationDetails.ConfirmPassword;
            var firstName       = uiRegistrationDetails.FirstName;
            var lastName        = uiRegistrationDetails.LastName;

            if (authenticationValidator.IsEmptyEmailAddress(email, out var message) ||
                authenticationValidator.IsInvalidEmailAddress(email, out message) ||
                authenticationValidator.IsEmptyPassword(password, out message) ||
                authenticationValidator.IsEmptyConfirmPassword(confirmPassword, out message) ||
                authenticationValidator.IsPasswordTooShort(password, out message) ||
                authenticationValidator.IsConfirmPasswordTooShort(confirmPassword, out message) ||
                authenticationValidator.ArePasswordsDoNotMatch(password, confirmPassword, out message) ||
                authenticationValidator.IsFirstNameEmpty(firstName, out message) ||
                authenticationValidator.IsLastNameEmpty(lastName, out message) ||
                authenticationValidator.IsFirstNameTooShort(firstName, out message) ||
                authenticationValidator.IsLastNameTooShort(lastName, out message))
            {
                NoticeUtils.ShowNotice(message);
            }
            else
            {
                registrationView?.DisableInteraction();
                authenticatorInteractor.Register(uiRegistrationDetails);
            }
        }
Пример #2
0
        public void OnRegistrationSucceed()
        {
            registrationView?.EnableInteraction();

            HideRegistrationWindow();
            ShowLoginWindow();

            NoticeUtils.ShowNotice(message: NoticeMessages.AuthView.RegistrationSucceed);
        }
Пример #3
0
        public void OnCreateCharacterFailed(UICharacterCreationFailed reason)
        {
            switch (reason)
            {
            case UICharacterCreationFailed.Unknown:
            {
                NoticeUtils.ShowNotice(message: NoticeMessages.CharacterView.CreationFailed);
                break;
            }

            case UICharacterCreationFailed.NameAlreadyInUse:
            {
                NoticeUtils.ShowNotice(message: NoticeMessages.CharacterView.NameAlreadyInUse);
                break;
            }
            }
        }
Пример #4
0
        private void OnLoginButtonClicked(
            UIAuthenticationDetails uiAuthenticationDetails)
        {
            var email    = uiAuthenticationDetails.Email;
            var password = uiAuthenticationDetails.Password;

            if (authenticationValidator.IsEmptyEmailAddress(email, out var message) ||
                authenticationValidator.IsInvalidEmailAddress(email, out message) ||
                authenticationValidator.IsEmptyPassword(password, out message) ||
                authenticationValidator.IsPasswordTooShort(password, out message))
            {
                NoticeUtils.ShowNotice(message);
            }
            else
            {
                loginView?.DisableInteraction();
                authenticatorInteractor.Login(uiAuthenticationDetails);
            }
        }
Пример #5
0
        public void OnRegistrationFailed(string reason)
        {
            registrationView?.EnableInteraction();

            NoticeUtils.ShowNotice(message: reason);
        }
Пример #6
0
        public void OnLoginFailed(string reason)
        {
            loginView?.EnableInteraction();

            NoticeUtils.ShowNotice(message: reason);
        }
Пример #7
0
 public void OnCharacterDeletionFailed()
 {
     NoticeUtils.ShowNotice(message: NoticeMessages.CharacterView.DeletionFailed);
 }
Пример #8
0
 public void OnCharacterUnvalidated()
 {
     NoticeUtils.ShowNotice(message: NoticeMessages.CharacterView.ValidationFailed);
 }