void OnLogin(bool success) { if (success) { Application.LoadLevel("UserDetailsScene"); } else { errorMsg = GamedoniaBackend.getLastError().ToString(); Debug.Log(errorMsg); } }
void OnCreateUser(bool success) { if (success) { GamedoniaUsers.LoginUserWithEmail(email.ToLower(), password, OnLogin); } else { errorMsg = GamedoniaBackend.getLastError().ToString(); Debug.Log(errorMsg); } }
void OnGetMe(bool success, GDUserProfile userProfile) { if (success) { this.userProfile = userProfile; } else { errorMsg = GamedoniaBackend.getLastError().ToString(); Debug.Log(errorMsg); } }
void OnResetPassword(bool success) { if (success) { errorMsg = "Password reset successfully, please check your email for instructions on how to complete the process."; Debug.Log(errorMsg); } else { errorMsg = GamedoniaBackend.getLastError().ToString(); Debug.Log(errorMsg); } }
void OnGetMe(bool success, GDUserProfile userProfile) { if (success) { LoggedInUser = userProfile; // Set playerprefs, store so we dont need to use http requests when we dont need it PlayerManager.I.player.playerID = LoggedInUser._id; // Player id fillExistingProfile(); } else { errorMsg = GamedoniaBackend.getLastError().ToString(); } }
void OnFacebookLogin(bool success) { if (success) { // Optional stuff if you want to store the Facebook username inside the Gamedonia user profile Dictionary <string, object> profile = new Dictionary <string, object>(); profile.Add("nickname", fbUserName); profile.Add("registerDate", DateTime.Now); GamedoniaUsers.UpdateUser(profile, OnLogin); } else { errorMsg = GamedoniaBackend.getLastError().ToString(); Debug.Log(errorMsg); } }
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); } }