Пример #1
0
        internal async Task <bool> RegisterPlayer()
        {
            try
            {
                RegistrationState = "Registering...";
                Registering       = true;
                if (PlayerName.All(char.IsLetterOrDigit))
                {
                    PlayerDescriptor player = await GameLoader.Instance.RegisterPlayer(ServerIP, PlayerName);

                    GameLoader.Instance.Player = player;
                    RegistrationState          = "Logged in!";
                    IsSuccessfullyRegistered   = true;
                }
            }
            catch
            {
                RegistrationState = "Register";
            }
            finally
            {
                Registering = false;
            }
            return(IsSuccessfullyRegistered);
        }