From dff0ab95f15c1a3131999ec8954a7f440abd2fa5 Mon Sep 17 00:00:00 2001 From: Hazim Bin Ijaz Date: Thu, 3 Apr 2025 23:35:35 +0500 Subject: [PATCH] Changed constants to the same Playfab Backend --- Assets/GoogleSigninSDK/GoogleSignInManager.cs | 4 ++-- .../Shared/Public/Resources/PlayFabSharedSettings.asset | 4 ++-- Assets/Scripts/Dev/GameConstants.cs | 4 +++- Assets/Scripts/Dev/PlayFab/PlayFabInit.cs | 2 +- Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs | 2 +- Assets/Scripts/GameScene.cs | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Assets/GoogleSigninSDK/GoogleSignInManager.cs b/Assets/GoogleSigninSDK/GoogleSignInManager.cs index 0858b99a..f62a8759 100644 --- a/Assets/GoogleSigninSDK/GoogleSignInManager.cs +++ b/Assets/GoogleSigninSDK/GoogleSignInManager.cs @@ -130,10 +130,10 @@ public class GoogleSignInManager : MonoBehaviour private void LoginToPlayFab(string authCode) { - PlayFabSettings.staticSettings.TitleId = "1F528E"; + PlayFabSettings.staticSettings.TitleId = GameConstants.PlayfabTitleId; var request = new LoginWithGoogleAccountRequest { - TitleId = "1F528E", + TitleId = GameConstants.PlayfabTitleId, ServerAuthCode = authCode, CreateAccount = true }; diff --git a/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset b/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset index dc0c4f98..f4ba0bbb 100644 --- a/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset +++ b/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset @@ -12,8 +12,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 093286084a3d1994a9c28281a1c38b1d, type: 3} m_Name: PlayFabSharedSettings m_EditorClassIdentifier: - TitleId: 7D3B9 - DeveloperSecretKey: U4C66QH1S7DKJH1CAEBMICAZ1KJU5E97YZ5BRU6OOREYUE9AJD + TitleId: + DeveloperSecretKey: ProductionEnvironmentUrl: RequestType: 0 DisableDeviceInfo: 0 diff --git a/Assets/Scripts/Dev/GameConstants.cs b/Assets/Scripts/Dev/GameConstants.cs index 489837dd..c7326d7f 100644 --- a/Assets/Scripts/Dev/GameConstants.cs +++ b/Assets/Scripts/Dev/GameConstants.cs @@ -2,11 +2,13 @@ public class GameConstants { - public static string LevelCompletedStatsKey = "LevelsCompleted"; + public static string GameNamePrefix = "PiPuzzle"; + public static string LevelCompletedStatsKey = GameNamePrefix+"_LevelsCompleted"; public static string NameEnteredCheckKey = "IsNameEntered"; public static string AvatarSelectedCheckKey = "AvatarSelected"; public static string AvatarSelectedIndex = "AvatarSelectedIndex"; public static string DisplayNameKey = "DisplayName"; + public static string PlayfabTitleId = "168AE2"; #region MyRegion diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs index 381fab08..7e6c9a27 100644 --- a/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs +++ b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs @@ -7,7 +7,7 @@ using UnityEngine.SceneManagement; public class PlayFabInit : MonoBehaviour { - public string playFabTitleId = "7D3B9"; // Replace with your PlayFab Title ID + public string playFabTitleId = "168AE2"; // Replace with your PlayFab Title ID //void Start() //{ diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs b/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs index a5881cef..4bd3ef93 100644 --- a/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs +++ b/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs @@ -27,7 +27,7 @@ public class PlayFabLeaderboards : MonoBehaviour public void UpdateLevelCompletionTime(string tier, int levelNumber, int completionTimeInSeconds) { - string statisticName = $"{tier}_Level_{levelNumber}_Time"; + string statisticName = $"{GameConstants.GameNamePrefix}_{tier}_Level_{levelNumber}_Time"; var request = new UpdatePlayerStatisticsRequest { diff --git a/Assets/Scripts/GameScene.cs b/Assets/Scripts/GameScene.cs index 4d421684..cfc62aae 100644 --- a/Assets/Scripts/GameScene.cs +++ b/Assets/Scripts/GameScene.cs @@ -95,7 +95,7 @@ public class GameScene : MonoBehaviour public void ShowLeaderboardPopup() { levelLeaderboardPopup.Open(); - string statisticName = $"{GameManager.CurrentLevelGroupIndex + 1}_Level_{GameManager.CurrentLevelNo}_Time"; + string statisticName = $"{GameConstants.GameNamePrefix}_{GameManager.CurrentLevelGroupIndex + 1}_Level_{GameManager.CurrentLevelNo}_Time"; PlayFabManager.Instance.playFabLeaderboards.GetLeaderboardByKey(statisticName, OnLBSuccess, OnLBFail); }