private void OnConfirmClicked(string characterName)
        {
            characterRequestParameters.Name = characterName;

            var noticeWindow = Utils.ShowNotice("Creating a new character... Please wait.", ShowCharacterNamwWindow, true);

            noticeWindow.OkButton.interactable = false;

            coroutinesExecutor.StartTask(CreateCharacter, exception => ServiceConnectionProviderUtils.OnOperationFailed());
        }
Esempio n. 2
0
        private void Teleport()
        {
            isTeleporting = true;

            CoroutinesExecutor.StartTask(ChangeScene, onException: exception => ServiceConnectionProviderUtils.OnOperationFailed());
        }
        private void Register(string email, string password, string firstName, string lastName)
        {
            var noticeWindow = Utils.ShowNotice("Registration is in a process.. Please wait.", okButtonClicked: () =>
            {
                registrationWindow.Show();
            });

            noticeWindow.OkButton.interactable = false;

            Action registerAction = () =>
            {
                var parameters = new RegisterRequestParameters(email, password.CreateSha512(), firstName, lastName);
                coroutinesExecutor.StartTask((yield) => Register(yield, parameters), exception => ServiceConnectionProviderUtils.OnOperationFailed());
            };

            if (RegistrationConnectionProvider.Instance.IsConnected())
            {
                registerAction.Invoke();
            }
            else
            {
                RegistrationConnectionProvider.Instance.Connect(onConnected: registerAction);
            }
        }
Esempio n. 4
0
 private void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
 {
     coroutinesExecutor.StartTask(EnterScene, exception => ServiceConnectionProviderUtils.OnOperationFailed());
 }
Esempio n. 5
0
        private void Login(string email, string password)
        {
            var noticeWindow = Utils.ShowNotice("Logging in... Please wait.", okButtonClicked: () =>
            {
                loginWindow.Show();
            });

            noticeWindow.OkButton.interactable = false;

            Action authenticateAction = () =>
            {
                var parameters = new AuthenticateRequestParameters(email, password.CreateSha512());
                coroutinesExecutor.StartTask((yield) => Authenticate(yield, parameters), exception => ServiceConnectionProviderUtils.OnOperationFailed());
            };

            if (LoginConnectionProvider.Instance.IsConnected())
            {
                authenticateAction.Invoke();
            }
            else
            {
                LoginConnectionProvider.Instance.Connect(onConnected: authenticateAction);
            }
        }
Esempio n. 6
0
        private void RefreshGameServerList()
        {
            if (GameServerSelectorConnectionProvider.Instance.IsConnected())
            {
                if (gameServerInformations.Count != 0)
                {
                    gameServerInformations.Clear();
                }

                gameServerSelectorWindow.OnRefreshBegan();
                gameServerSelectorWindow.GameServerSelectorRefreshImage.Message = "Getting server list...";

                Action provideGameServerList = () => coroutinesExecutor.StartTask(ProvideGameServerList, exception => ServiceConnectionProviderUtils.OnOperationFailed());
                if (!gameServerSelectorWindow.GameServerSelectorRefreshImage.IsShowed)
                {
                    gameServerSelectorWindow.GameServerSelectorRefreshImage.Show(provideGameServerList);
                }
                else
                {
                    provideGameServerList.Invoke();
                }
            }
            else
            {
                LogUtils.Log(MessageBuilder.Trace("There is no connection to game server provider."));
            }
        }
Esempio n. 7
0
        private void OnDeleteCharacterButtonClicked(int characterIndex)
        {
            var noticeWindow = Utils.ShowNotice("Deleting a character... Please wait.", null, true);

            noticeWindow.OkButton.interactable = false;

            var parameters = new RemoveCharacterRequestParameters(characterIndex);

            coroutinesExecutor.StartTask((y) => DeleteCharacter(y, parameters), exception => ServiceConnectionProviderUtils.OnOperationFailed());
        }
Esempio n. 8
0
        private void Start()
        {
            CreateChooseFighterTextUI();

            coroutinesExecutor.StartTask(GetCharacters, exception => ServiceConnectionProviderUtils.OnOperationFailed());
        }
Esempio n. 9
0
        private void OnStartButtonClicked(int characterIndex)
        {
            var clickedCharacter = characters[characterIndex];

            clickedCharacter.PlayWalkAnimationAction();

            var noticeWindow = Utils.ShowNotice("Entering to the world... Please wait.", null, true);

            noticeWindow.OkButton.interactable = false;

            var parameters = new ValidateCharacterRequestParameters(characterIndex);

            coroutinesExecutor.StartTask((y) => ValidateCharacter(y, parameters), exception => ServiceConnectionProviderUtils.OnOperationFailed());
        }