Hello, I'm making my own multiplayer project with Photon Pun 2 and PlayFab. I started to make an account login system, but I need to somehow check its availability. I started to figure it out and there is an AccountNotFound error. How can I call it?
void Start() { ViborMenu.SetActive(true); PhotonNetwork.AuthValues = new AuthenticationValues(username); PhotonNetwork.AutomaticallySyncScene = true; username = PlayerPrefs.GetString("NickName"); LoginUsingCustomId(); PlayerNameAccount.text = PlayerPrefs.GetString("NickName"); score = PlayerPrefs.GetInt("Score"); lvlt.text = score.ToString() + "/100 LVL"; PanelOfRegistry.SetActive(true); selected10skin = PlayerPrefs.GetInt("selectedSkin1", 1); adminKeyVerifInt = PlayerPrefs.GetInt("AdminKeyActivation", 1); if (PlayerPrefs.HasKey("NickName")) { PanelOfRegistry.SetActive(false); } health = maxHealth; health = PlayerPrefs.GetInt("Score"); if (string.IsNullOrEmpty(PlayFabSettings.TitleId)) { PlayFabSettings.TitleId = "secret"; } } private void LoginUsingCustomId() ///hello { Debug.Log($" Login as{username}"); var request = new LoginWithCustomIDRequest {CustomId = username, CreateAccount = true}; PlayFabClientAPI.LoginWithCustomID(request, OnLoginCustomIdSucces, OnFailure); } private void UpdateDisplayName(string displayname) { var request = new UpdateUserTitleDisplayNameRequest {DisplayName = displayname}; PlayFabClientAPI.UpdateUserTitleDisplayName(request, OnDisplayNameSuccess, OnFailure); } private void OnLoginCustomIdSucces(LoginResult result) { Debug.Log($"не лох {username}"); UpdateDisplayName(username); } private void OnDisplayNameSuccess(UpdateUserTitleDisplayNameResult result) { } private void OnFailure(PlayFabError error) ///в { Debug.Log($"лох {error.GenerateErrorReport()}"); } public void SetUsername(string name) { username = PlayerNameAccount.text; } public void Login() { LoginUsingCustomId(); } public void Create() { if (UserNameInput.text != "") { PlayerNameAccount.text = UserNameInput.text; PlayerPrefs.SetString("NickName", PlayerNameAccount.text); PlayerPrefs.Save(); SceneManager.LoadScene("SampleScene"); score += 2; PlayerPrefs.SetInt("Score", score); Menu2.reference.CloseDialogForLogin(); } //PlayerNameAccount.text = UserNameInput.text; //PlayerPrefs.SetString("NickName", PlayerNameAccount.text); //PlayerPrefs.Save(); //SceneManager.LoadScene("SampleScene"); }