Closed loicteixeira closed 7 years ago
Script used by @Voyder_Rozann.
// Do not pay attention to the "ImageEffect, Bloom... Etc..."
// It's just for viewing correctly the GameJolt Log In menu.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.ImageEffects;
public class Restart_API : MonoBehaviour
{
public Camera cam1;
public static bool isSignedIn;
public int LoggedIn;
private void Start()
{
cam1.gameObject.GetComponent<Bloom>().bloomThreshold = 1f;
LoggedIn = PlayerPrefs.GetInt("LOGIN1", 0);
if (LoggedIn == 0)
{
GameJolt.UI.Manager.Instance.ShowSignIn((bool success) =>
{
if (success)
{
LoggedIn = 1;
cam1.gameObject.GetComponent<Bloom>().bloomThreshold = 0.6f;
}
else
{
LoggedIn = 2;
cam1.gameObject.GetComponent<Bloom>().bloomThreshold = 0.6f;
}
});
}
}
private void OnApplicationQuit()
{
LoggedIn = 0;
}
private void OnDestroy()
{
PlayerPrefs.SetInt("LOGIN1", LoggedIn);
}
private void Update()
{
if (GameJolt.API.Manager.Instance.CurrentUser != null)
{
isSignedIn = true;
}
if (LoggedIn == 1 || LoggedIn == 2)
{
cam1.gameObject.GetComponent<Bloom>().bloomThreshold = 0.6f;
}
}
}
Can't reproduce.
FWIW, the API does not use SSL so I wonder if this was a network issue, with GameJolt trying some redirects?
The user confirmed that the issue was caused by the PlayerPrefs and that after erasing them, everything worked again.
Reported by @Voyder_Rozann on GameJolt.
An SSL error shows after login in:
And about 5s later, the client crashed with
too many threads
.