https and auth token rollover

This commit is contained in:
2026-04-25 00:58:07 +05:30
parent 217dacb54c
commit 8bc14d5fff
9 changed files with 1159 additions and 76 deletions
+23 -3
View File
@@ -52,9 +52,17 @@ public class MainMenuManager : MonoBehaviour
ccText.text = "";
rcText.text = "";
LoginManager.instance.GetUserData((success, error, user) => {
if(success){
if (success)
{
OnUserUpdated(user);
}
else
{
if (btnPlay != null)
btnPlay.interactable = false;
if (rcPlayText != null)
rcPlayText.text = string.IsNullOrEmpty(error) ? "Could not load profile. Try again." : error;
}
});
btnBuyUsd5.onClick.AddListener(() => OnBuy(RcPack.Usd5));
@@ -75,11 +83,23 @@ public class MainMenuManager : MonoBehaviour
btnPlay.onClick.AddListener(OnPlay);
}
void OnPlay(){
if(LoginManager.CurrentUser.rc < 21){
void OnPlay()
{
if (LoginManager.CurrentUser == null)
{
Debug.LogError("Play blocked: user profile not loaded.");
return;
}
if (LoginManager.CurrentUser.rc < 21)
{
Debug.LogError("Not enough RC to play");
return;
}
if (CupidLobby.instance == null)
{
Debug.LogError("Play blocked: CupidLobby is missing from this scene.");
return;
}
CupidLobby.instance.Matchmake();
}