https and auth token rollover
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user