protected override IEnumerator runTest() { while (dataEntityCollection.GetEntityByType <IncomingFriendInvitationData>().IsNull) { yield return(null); } string bobNewDisplayName = BaseFriendsIntegrationTest.CreateRandomName(); IUpdateDisplayNameResult updateDisplayNameResult = null; bobSession.LocalUser.UpdateDisplayName(bobNewDisplayName, delegate(IUpdateDisplayNameResult r) { updateDisplayNameResult = r; }); while (updateDisplayNameResult == null) { yield return(null); } IntegrationTestEx.FailIf(!updateDisplayNameResult.Success, "Failed to change Bob's display name to " + bobNewDisplayName); friendsService.AcceptFriendInvitation(aliceSession.LocalUser.IncomingFriendInvitations.First(), aliceSession.LocalUser); while (dataEntityCollection.GetEntityByType <FriendData>().IsNull) { yield return(null); } DataEntityHandle aliceFriendHandle = dataEntityCollection.GetEntityByType <FriendData>(); FriendData aliceFriendData = dataEntityCollection.GetComponent <FriendData>(aliceFriendHandle); DisplayNameData aliceDisplayNameData = dataEntityCollection.GetComponent <DisplayNameData>(aliceFriendHandle); IntegrationTestEx.FailIf(aliceFriendData.Friend.DisplayName.Text != bobNewDisplayName, $"The invitee friend data display name did not match changed display name 1. Actual: {aliceFriendData.Friend.DisplayName.Text}. Expected: {bobNewDisplayName}"); IntegrationTestEx.FailIf(aliceDisplayNameData.DisplayName != bobNewDisplayName, $"The invitee display name data display name did not match changed display name 1. Actual: {aliceDisplayNameData.DisplayName}. Expected: {bobNewDisplayName}"); }
protected virtual void dispatchUpdateDisplayNameError(IUpdateDisplayNameResult result) { if (this.OnUpdateDisplayNameError != null) { this.OnUpdateDisplayNameError(result); } }
public void OnUpdateDisplayNameError(IUpdateDisplayNameResult result) { ToggleInteraction(isInteractable: true); string errorMessage; if (result is IUpdateDisplayNameExistsResult) { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Acount.Displayname.Validation.AlreadyUsed"); } else if (result is IUpdateDisplayNameFailedModerationResult) { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Acount.Displayname.Validation.NotAllowed"); } else { errorMessage = ""; errorMessage += Service.Get <Localizer>().GetTokenTranslation("Account.Create.Validation.UnknownError"); } DisplayNameInputField.ShowError(errorMessage); Service.Get <ICPSwrveService>().Action("game.display_name_form.submit", "failed", result.ToString()); }