public override void Process(GenieResponseWrapper inWrapper) { if (inWrapper.getStatus() == "successful") { Logger.Log("Successfully found the current user: {0}!", inWrapper.getStringResult("uid")); Genie.instance.GetUserResult(true, inWrapper); } else { Logger.Log("Unable to find current user."); Genie.instance.GetUserResult(false, inWrapper); } }
private void SetUserProfile(GenieResponseWrapper inResponse) { UserID = inResponse.getStringResult("uid"); SaveData.instance.SetUserID(UserID); m_UserProfileLoaded = true; string handle = inResponse.getStringResult("handle", string.Empty); IsAnonymousUser = UserID == EMPTY_UID || String.IsNullOrEmpty(handle); if (!IsAnonymousUser) { UserData = new JSONClass(); UserData["gender"] = inResponse.getStringResult("gender", string.Empty); UserData["age"] = inResponse.getIntResult("age").ToStringLookup(); UserData["standard"] = inResponse.getIntResult("standard").ToStringLookup(); UserLanguage = inResponse.getStringResult("language", string.Empty); Logger.Log("Handle: \"{0}\"\nLanguage: \"{1}\"\nData: {2}", handle, UserLanguage, UserData.ToFormattedString()); } LogStart(); }
public override void Process(GenieResponseWrapper inWrapper) { if (inWrapper.getStatus() == "successful") { string uid = inWrapper.getStringResult("uid"); if (uid != Genie.I.UserID) { Logger.Log("User changed partway through - restarting the application."); Genie.I.LogEnd(); Genie.instance.GetUserResult(true, inWrapper); AndroidHelper.RestartActivity(); } } else { AndroidToast.Show("Please sign back into Genie."); AndroidHelper.KillActivity(); } }