Example #1
0
        public IEnumerator <TaskContract> Execute()
        {
            DBC.Check.Require(_displayName != null, "You forgot to inject the name");

            var displayNameData = new DisplayNameData
            {
                DisplayName = _displayName,
            };

            yield return(_webRequest.Execute(displayNameData).Continue());

            response = ((JsonResponseHandler <VerifyDisplayNameResponse>)_webRequest.responseHandler).response;
        }
Example #2
0
        string OnSuccess(VerifyDisplayNameResponse response)
        {
            if (response.valid == true)
            {
                entitiesDB.QueryUniqueEntity <ButtonEntityViewComponent>(ExclusiveGroups.DisplayName).buttonState
                .interactive = true;

                _validatedString = _currentString;

                return(LocalizationService.Localize(GameStringsID.strValidDisplayName));
            }

            entitiesDB.QueryUniqueEntity <ButtonEntityViewComponent>(ExclusiveGroups.DisplayName).buttonState
            .interactive = false;

            return(LocalizationService.Localize(GameStringsID.strInvalidDisplayName));
        }
        string OnSuccess(VerifyDisplayNameResponse response)
        {
            if (response.Available == true)
            {
                //if I make this kind of assumptions (just one button present on the gui), I need to assert
                //somewhere else (maybe initialization) if there is more than one button on the gui to communicate
                //my intention. Otherwise let's always use the group bind.
                entitiesDB.QueryUniqueEntity <ButtonEntityViewStruct>(ExclusiveGroups.DisplayName).buttonState
                .interactive = true;

                return(LocalizationService.Localize(GameStringsID.strValidDisplayName));
            }

            //According Mike's logic, the service return success because the name has been validated, even if
            //it's actually in use.
            return(LocalizationService.Localize(GameStringsID.strAlreadyDisplayName));
        }