public void CheckInternetConnection() { checkedInternet = false; noInternet = false; GamedoniaBackend.isInternetConnectionAvailable(delegate(bool success) { if (success) { checkedInternet = true; } else { checkedInternet = true; noInternet = true; ShowNoInternetPopup(); } }); }
void OnCreateUser(bool success) { if (success) { GamedoniaUsers.LoginUserWithEmail(email.text, password.text, OnLogin); } else { Loader.I.disableLoader(); if (GamedoniaBackend.getLastError().code == 10001) { emailImg.DOColor(errorColor, 1); errorMsgText.text = "Dit e-mailadres is al in gebruik"; errorMsgText.DOFade(1, 1); } } }
public void OnLogin(bool success) { statusMsg = ""; if (success) { MatchManager.I.RemoveLocalMatches(); // Set playerprefs loggedIn to true so we dont need to log in again via http PlayerManager.I.player.loggedIn = true; PlayerManager.I.Save(); PlayerManager.I.LoadFriends(); if (!PlayerManager.I.player.createdProfile) { SceneManager.LoadScene("Profile_Create"); } else { SceneManager.LoadScene("Home"); } } else { loader.disableLoader(); errorMsg = GamedoniaBackend.getLastError().ToString(); int errorCode = GamedoniaBackend.getLastError().httpErrorCode; if (errorCode == 400 || errorCode == 401) { //email_input.GetComponent<Outline> ().effectColor = errorColor; //password_input.GetComponent<Outline> ().effectColor = errorColor; emailImg.DOColor(errorColor, 1); passwordImg.DOColor(errorColor, 1); } if (errorCode == 401) { errorLogin.SetActive(true); errorLoginImg.SetActive(true); } if (errorCode == -100) { SceneManager.LoadScene("noconnection"); } } }
/** CHECK FOR INTERNET CONNECTION **/ private void checkInternet() { GamedoniaBackend.isInternetConnectionAvailable(delegate(bool success) { if (success) { i_access = true; } else { int errorCode = GamedoniaBackend.getLastError().httpErrorCode; if (errorCode == -100) { SceneManager.LoadScene("noconnection"); } i_access = false; errorMsg = "No internet access"; Debug.Log(errorMsg); } }); }
void OnFacebookLogin(bool success) { if (success) { Debug.Log("searching or user"); GamedoniaUsers.GetMe(delegate(bool profilesuccess, GDUserProfile userProfile){ if (profilesuccess) { Debug.Log(userProfile); if (userProfile.profile.Count != 0) { if ((bool)userProfile.profile ["created_profile"]) { Debug.Log("exists continue to profile"); OnLogin(true); } else { addEmptyProfile(); } } else { addEmptyProfile(); } } else { //TODO Your fail processing } }); } else { errorMsg = GamedoniaBackend.getLastError().ToString(); Debug.Log(errorMsg); } }