public override IEnumerator Execute(ScriptableActionPlayer player) { if (!isWaiting) { setup(player); isBaseValidationDone = false; } loginService = Service.Get <MixLoginCreateService>(); while (loginService.ValidationInProgress) { yield return(null); } loginService.ValidationInProgress = true; loginService.OnValidationSuccess += onValidationSuccess; loginService.OnValidationFailed += onValidationFailed; loginService.ValidateUsernamePassword("K4fR0VfK4MToQslVupGkGvAKFqw3HBXOfkpXalYUX1Kv5kbKL08MNxk3W2gfjk0", inputString); isWaiting = true; sw = new Stopwatch(); sw.Start(); maxTime = 30000; while (!isBaseValidationDone && sw.ElapsedMilliseconds < maxTime) { yield return(null); } if (!isBaseValidationDone) { loginService.OnValidationSuccess -= onValidationSuccess; loginService.OnValidationFailed -= onValidationFailed; HasError = false; } isWaiting = false; loginService.ValidationInProgress = false; }
public override IEnumerator Execute(ScriptableActionPlayer player) { accountFlowData = Service.Get <MembershipService>().GetAccountFlowData(); if (!isWaiting) { setup(player); isBaseValidationDone = false; isNameSuggestionValidationDone = false; if (accountFlowData.PreValidatedUserNames == null || accountFlowData.PreValidatedUserNames.Count == 0) { numSuggestionRounds = 0; } } loginService = Service.Get <MixLoginCreateService>(); while (loginService.ValidationInProgress) { yield return(null); } loginService.ValidationInProgress = true; loginService.OnValidationSuccess += onValidationSuccess; loginService.OnValidationFailed += onValidationFailed; loginService.ValidateUsernamePassword(inputString, "testing123"); isWaiting = true; sw = new Stopwatch(); sw.Start(); maxTime = 30000; while ((!isBaseValidationDone || !isNameSuggestionValidationDone) && sw.ElapsedMilliseconds < maxTime) { yield return(null); } if (!isBaseValidationDone) { loginService.OnValidationSuccess -= onValidationSuccess; loginService.OnValidationFailed -= onValidationFailed; HasError = false; } if (!isNameSuggestionValidationDone) { loginService.OnValidationSuccess -= onSuggestionValidationSuccess; loginService.OnValidationFailed -= onSuggestionValidationFailed; } isWaiting = false; loginService.ValidationInProgress = false; }
private IEnumerator getNextDisplayNameSuggestion() { currentSuggestedUsername = ""; if (accountFlowData.PreValidatedUserNames.Count < 1 && suggestedNames.Count < MaxAttemptsIncrementing) { currentNumber++; currentSuggestedUsername = displayNameStub + currentNumber; } else if (accountFlowData.PreValidatedUserNames.Count < MaxSuggestedNames && suggestedNames.Count < MaxAttemptsIncrementing + MaxAttempts3Digits) { currentSuggestedUsername = displayNameStub + UnityEngine.Random.Range(1, 999); if (currentSuggestedUsername.Length > MaxSuggestedUsernameLength) { currentSuggestedUsername = currentSuggestedUsername.Substring(0, MaxSuggestedUsernameLength); } } else if (accountFlowData.PreValidatedUserNames.Count < MaxSuggestedNames && suggestedNames.Count < MaxAttemptsIncrementing + MaxAttempts3Digits + MaxAttempts4Digits) { currentSuggestedUsername = displayNameStub + UnityEngine.Random.Range(1, 9999); if (currentSuggestedUsername.Length > MaxSuggestedUsernameLength) { currentSuggestedUsername = currentSuggestedUsername.Substring(0, MaxSuggestedUsernameLength); } } if (!string.IsNullOrEmpty(currentSuggestedUsername)) { maxTime += 5000; loginService.OnValidationSuccess += onSuggestionValidationSuccess; loginService.OnValidationFailed += onSuggestionValidationFailed; suggestedNames.Add(currentSuggestedUsername); loginService.ValidateUsernamePassword(currentSuggestedUsername, "testing123"); yield return(null); } else { isNameSuggestionValidationDone = true; } }