void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { if (method == PlayFabAPIMethods.GetAccountInfo || method == PlayFabAPIMethods.LinkAndroidDeviceID || method == PlayFabAPIMethods.UnlinkAndroidDeviceID || method == PlayFabAPIMethods.LinkIOSDeviceID || method == PlayFabAPIMethods.UnlinkIOSDeviceID) { EvaluateAccountInfo(); } }
void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { if(method == PlayFabAPIMethods.GetAccountInfo || method == PlayFabAPIMethods.LinkAndroidDeviceID || method == PlayFabAPIMethods.UnlinkAndroidDeviceID || method == PlayFabAPIMethods.LinkIOSDeviceID || method == PlayFabAPIMethods.UnlinkIOSDeviceID) { EvaluateAccountInfo(); } }
public void CloseLoadingPrompt(PlayFabAPIMethods method) { List <OutgoingAPICounter> waiting = this.waitingOnRequests.FindAll((i) => { return(i.method == method); }); OutgoingAPICounter itemToRemove = null; for (int z = 0; z < waiting.Count; z++) { // in absence of a true GUID request system, we will get the oldest requests to prevent timeouts if (itemToRemove != null && waiting[z].outgoingGameTime > itemToRemove.outgoingGameTime) { // shouldnt be too many times where there are multiple requests of the same type. itemToRemove = waiting[z]; } else if (itemToRemove == null) { //first and likly only match itemToRemove = waiting[z]; } } if (itemToRemove != null) { this.waitingOnRequests.Remove(itemToRemove); HideTint(); this.loadingPrompt.CloseLoadingPrompt(); } }
public static void RequestLoadingPrompt(PlayFabAPIMethods method) { if (RaiseLoadingPromptRequest != null) { RaiseLoadingPromptRequest(method); } }
private IEnumerator OutgoingApiTimeoutCallback() { while (this.waitingOnRequests.Count > 0) { for (var z = 0; z < this.waitingOnRequests.Count; z++) { if (Time.time > (this.waitingOnRequests[z].outgoingGameTime + this.timeOutLength)) { // time has elapsed for this request, until we can handle this more specifically, we can only reload the scene, and hope for the best. PlayFabAPIMethods capturedDetails = this.waitingOnRequests[z].method; PF_Bridge.RaiseCallbackError(string.Format("API Call: {0} Timed out after {1} seconds.", capturedDetails, this.timeOutLength), this.waitingOnRequests[z].method, MessageDisplayStyle.error); Action <bool> afterConfirmation = (bool response) => { if (response == false) { // user clicked cancel (to reload); Debug.LogErrorFormat("Reloading scene due {0} API timing out.", capturedDetails); SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name); } }; //modifing //DialogCanvasController.RequestConfirmationPrompt("Caution! Bravery Required!", string.Format("API Call: {0} Timed out. \n\tACCEPT: To proceed, may cause client instability. \n\tCANCEL: To reload this scene and hope for the best.", capturedDetails), afterConfirmation); } } // tick once per second while we have outbound requests. (keep enabled while debugging this feature) Debug.Log(string.Format("{0}", (int)Time.time % 2 == 0 ? "Tick" : "Tock")); yield return(new WaitForSeconds(1f)); } // outgoing request queue empty this.timeOutCallback = null; yield break; }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (method) { case PlayFabAPIMethods.MakePurchase: // refresh after purchase. if (PF_PlayerData.activeCharacter == null) { PF_PlayerData.GetUserAccountInfo(); } else { PF_PlayerData.GetCharacterInventory(PF_PlayerData.activeCharacter.characterDetails.CharacterId); } break; case PlayFabAPIMethods.GetCharacterInventory: DialogCanvasController.RequestStore(this.StoreName.text); break; case PlayFabAPIMethods.GetAccountInfo: DialogCanvasController.RequestStore(this.StoreName.text); break; } }
/// <summary> /// The standard way to notify listeners that a PF call has failed /// </summary> /// <param name="details"> a string that can be used so send any additional custom information </param> /// <param name="method"> enum that maps to the call that just completed successfully </param> /// <param name="style"> error will throw the standard error box, none will eat the message and output to console </param> public static void RaiseCallbackError(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { if (OnPlayFabCallbackError != null) { OnPlayFabCallbackError(details, method, style); } }
private void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (method) { case PlayFabAPIMethods.GetTitleData_General: CheckPushStatus(); break; } }
void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { if (method == PlayFabAPIMethods.GetAccountInfo) { SaveUserAccountInfo(); SaveLoginPathway(); } }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { if (details.Contains("Encounters Loaded!") && method == PlayFabAPIMethods.GetTitleData) { this.isEncounterListAvailable = true; } CheckToContinue(); }
void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { if (method == PlayFabAPIMethods.RegisterPlayFabUser) { Debug.Log("Account Created, logging in with new account."); PlayFabLoginCalls.RequestSpinner(); PlayFabLoginCalls.LoginWithUsername(user.text, pass1.text); } }
void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { if(method == PlayFabAPIMethods.RegisterPlayFabUser) { Debug.Log("Account Created, logging in with new account."); PlayFabLoginCalls.RequestSpinner(); PlayFabLoginCalls.LoginWithUsername(user.text, pass1.text); } }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (method) { case PlayFabAPIMethods.GetCharacterReadOnlyData: _isCharacterDataLoaded = true; break; } CheckToContinue(); }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (method) { case PlayFabAPIMethods.GetCharacterInventory: //var items = PF_GamePlay.QuestProgress.ItemsGranted; //PF_GamePlay.ActiveQuest.levelData. Debug.Log("Enable ViewItems Button."); break; } }
void HandlePlayFabError(string message, PlayFabAPIMethods method) { if(message.Contains("createAccount = true") && method == PlayFabAPIMethods.LoginWithDeviceId) { Debug.Log("Prompt to continue with Create new account."); this.passwordPrompt.gameObject.SetActive(false); this.countdown.gameObject.SetActive(false); this.newAccountPrompt.gameObject.SetActive(true); this.isCounting = false; } }
void HandlePlayFabError(string message, PlayFabAPIMethods method) { if (message.Contains("createAccount = true") && method == PlayFabAPIMethods.LoginWithDeviceId) { Debug.Log("Prompt to continue with Create new account."); this.passwordPrompt.gameObject.SetActive(false); this.countdown.gameObject.SetActive(false); this.newAccountPrompt.gameObject.SetActive(true); this.isCounting = false; } }
private void HandlePlayfabCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle displayStyle) { if (method == PlayFabAPIMethods.DrawCharacterToUser) { ShowGrantedCharacterImage(details); debugText.text = details; PF_PlayerData.GetUserAccountInfo(); } if (method == PlayFabAPIMethods.GetAccountInfo) { vcText.text = PF_PlayerData.virtualCurrency["NT"].ToString(); CanPlayerDraw(); } }
private void OnPlayfabCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle displayStyle) { if (method == PlayFabAPIMethods.SavePlayerInfo) { //PF_PlayerData.GetCharacterDataById(selectedSlot.saved.characterDetails.CharacterId); PF_PlayerData.GetCharacterData(); } else if (method == PlayFabAPIMethods.GetCharacterReadOnlyData) { RefreshData(); equipController.Refresh(); } }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (method) { case PlayFabAPIMethods.GetTitleData_General: maxUniSlots = PF_GameData.Classes.Count; if (maxUniSlots > 3) { Debug.LogWarning("Currently configured to only allow 3 playable unicorn classes."); } Init(); break; } }
public void HandleLoadingPromptRequest(PlayFabAPIMethods method) { if (waitingOnRequests.Count == 0) { //ShowTint(); loadingPrompt.RaiseLoadingPrompt(); } waitingOnRequests.Add(new OutgoingAPICounter { method = method, outgoingGameTime = Time.time }); if (_timeOutCallback == null) { _timeOutCallback = StartCoroutine(OutgoingApiTimeoutCallback()); } }
private void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle displayStyle) { if (details != missionName) { return; } if (method == PlayFabAPIMethods.GetPlayerLeaderboard) { SetPlayerScore(); } else if (method == PlayFabAPIMethods.GetFriendsLeaderboard) { SetHighestRankScore(); } }
public void HandleCallbackError(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (style) { case MessageDisplayStyle.error: string errorMessage = string.Format("CALLBACK ERROR: {0}: {1}", method, details); //ShowTint(); this.errorPrompt.RaiseErrorDialog(errorMessage); CloseLoadingPromptAfterError(); break; default: CloseLoadingPrompt(method); Debug.Log(string.Format("CALLBACK ERROR: {0}: {1}", method, details)); break; } }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { switch (method) { case PlayFabAPIMethods.GetTitleData_General: case PlayFabAPIMethods.GetAccountInfo: isTitleDataLoaded |= method == PlayFabAPIMethods.GetTitleData_General; isPlayerInventoryLoaded |= method == PlayFabAPIMethods.GetAccountInfo; int extraCount = 0; InventoryCategory temp; if (PF_PlayerData.inventoryByCategory != null && PF_PlayerData.inventoryByCategory.TryGetValue("ExtraCharacterSlot", out temp)) { extraCount = temp.count; } maxCharacterSlots = PF_GameData.StartingCharacterSlots + extraCount; break; case PlayFabAPIMethods.GetAllUsersCharacters: isPlayerCharatersLoaded = true; PF_PlayerData.GetCharacterData(); PF_PlayerData.GetCharacterStatistics(); break; case PlayFabAPIMethods.DeleteCharacter: ResetDataChecks(); GameController.CharacterSelectDataRefresh(); break; case PlayFabAPIMethods.GrantCharacterToUser: ResetDataChecks(); GameController.CharacterSelectDataRefresh(); break; case PlayFabAPIMethods.GetCharacterReadOnlyData: isCharacterDataLoaded = true; break; case PlayFabAPIMethods.GetUserStatistics: isUserStatsLoaded = true; break; } CheckToInit(); }
private void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle displayStyle) { switch (method) { case PlayFabAPIMethods.GetTitleData: break; case PlayFabAPIMethods.GetAccountInfo: isAccountInfoLoaded = true; break; case PlayFabAPIMethods.GetCharacterReadOnlyData: isCharacterDataLoaded = true; SetSavedTeamData(); break; case PlayFabAPIMethods.UpdateUserData: isUserDataUpdated = true; SetSavedTeamData(); teamUiController.Init(); break; case PlayFabAPIMethods.GrantCharacterToUser: PF_PlayerData.GetPlayerCharacters(() => { PF_PlayerData.GetCharacterData(() => { CheckIsNewPlayer(); }); }); break; } CheckToContinue(); }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { }
void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { StopSpinner(); this.errorLog.color = Color.white; this.errorLog.text = string.Empty; }
void HandlePlayFabError(string message, PlayFabAPIMethods method) { StopSpinner(); this.errorLog.color = Color.yellow; this.errorLog.text = message; }
void HandleCallbackSuccess(string message, PlayFabAPIMethods method) { if(method == PlayFabAPIMethods.GetAccountInfo) { SaveUserAccountInfo(); SaveLoginPathway(); } }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { CloseLoadingPrompt(method); }
public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style) { CloseLoadingPrompt(method); //Debug.Log(string.Format("{0} completed successfully.", method.ToString())); }