private void ExistingCustomer() { ApiObjectFactory.GetObject <ResellerClub.Interface.IDomain>(); // ResellerClub.BusinessLogic.Customer customer = new ResellerClub.BusinessLogic.Customer(authUser, authPassword); ResellerClub.Interface.ICustomer customer = ApiObjectFactory.GetObject <ResellerClub.Interface.ICustomer>(); // customer.GetCustomerDetailByUserName(Request["input_email"]); trRegistrationForm.Style["display"] = "none"; trUserOption.Style["display"] = ""; if (customer.ValidateCustomer(Request["input_email"], Request["password"])) { Guid sessionFID = Guid.NewGuid(); SessionM["Customer"] = customer; SessionM["SessionFID"] = sessionFID; ResellerClub.Interface.ISessionLogger sessionLogger = ApiObjectFactory.GetObject <ResellerClub.Interface.ISessionLogger>(); sessionLogger.Insert(sessionFID, SessionM.AspSessionId(), customer.CusInfo.Email, UserIPAddress()); RedirectAfterLogin(); } else { divError.Style["display"] = ""; divError.InnerHtml = "<div>Invalid Email ID or Password</div>"; } }
void OnEnable() { DontDestroyOnLoad(this); #if UNITY_IPHONE && !UNITY_EDITOR SessionM.GetInstance().SetCallback(this); #endif }
// Unity Lifecycle private void Awake() { SetSessionMNative(); GameObject.DontDestroyOnLoad(this.gameObject); instance = this; SetLogLevel(logLevel); }
private void OnMouseDown() { //The user has clicked on the toast, so we should let SessionM know they want to claim it. //SessionM will take care of the rest (opening the portal.) //However, we'll want to reset our Toast so the user doesn't click on it again. ResetToastPosition(); SessionM.GetInstance().NotifyClaimed(); }
//Helper Methods private void LerpToast() { float positionPercentage = 1f; switch (toastState) { case ToastState.Toasting: toastTimer += Time.deltaTime; positionPercentage = toastTimer / TOAST_ANIMATION_TIME; if (positionPercentage > 1f) { positionPercentage = 1f; toastState = ToastState.Displaying; toastTimer = 0f; } this.transform.position = Vector3.Lerp(offScreenPosition.position, onScreenPosition.position, positionPercentage); break; case ToastState.Displaying: toastTimer += Time.deltaTime; if (toastTimer > TOAST_DISPLAY_TIME) { toastState = ToastState.Untoasting; toastTimer = 0f; } break; case ToastState.Untoasting: toastTimer += Time.deltaTime; positionPercentage = toastTimer / TOAST_ANIMATION_TIME; if (positionPercentage > 1f) { positionPercentage = 1f; toastState = ToastState.Offscreen; toastTimer = 0f; //Our Native Achievement has come and gone without the user clicking on it //We need to notify SessionM that the achievment was dismissed. SessionM.GetInstance().NotifyDismissed(); } this.transform.position = Vector3.Lerp(onScreenPosition.position, offScreenPosition.position, positionPercentage); break; default: Debug.LogWarning("Invalid Toast State in LerpToast."); break; } }
public ISessionM_iOS(SessionM sessionMParent) { sessionMGameObject = sessionMParent; if (sessionMParent.iosAppId != null) { SetServiceRegion(SessionM.serviceRegion); StartSession(null); SetLogLevel(sessionMParent.logLevel); } CreateListenerObject(); }
public ISessionM_Android(SessionM sessionMParent) { sessionMGameObject = sessionMParent; initAndroidInstance(); CreateListenerObject(); if (sessionMGameObject.androidAppId != null) { SetServiceRegion(SessionM.serviceRegion); StartSession(null); } }
private void RegisterCustomer() { if (!ValidateInput()) { return; } ResellerClub.Interface.ICustomer customer = ApiObjectFactory.GetObject <ResellerClub.Interface.ICustomer>(); // ResellerClub.Interface.Messages.ICustomerInfoMessage cusInfo = new ResellerClub.BusinessLogic.Messages.CustomerInfoMessage(); customer.CusInfo.Name = input_fullname.Value; customer.CusInfo.Password = passwd.Value; customer.CusInfo.Company = input_companyname.Value; customer.CusInfo.Country = country.Value; customer.CusInfo.State = string.Compare(Request[stateSelect.UniqueID], "other", StringComparison.InvariantCultureIgnoreCase) == 0 ? Request[input_otherState.UniqueID] : Request[stateSelect.UniqueID]; customer.CusInfo.City = select_city.Value; customer.CusInfo.ZipCode = input_zip.Value; customer.CusInfo.PhoneNumber = input_phone.Value; customer.CusInfo.PhoneCountryCode = input_phone_cc.Value; customer.CusInfo.AddressLine1 = input_address1.Value; customer.CusInfo.Email = username.Value; customer.CusInfo.Language = "en"; try { customer.Register(); customer.GetCustomerDetailByUserName(username.Value); Guid sessionFID = Guid.NewGuid(); SessionM["Customer"] = customer; SessionM["SessionFID"] = sessionFID; ResellerClub.Interface.ISessionLogger sessionLogger = ApiObjectFactory.GetObject <ResellerClub.Interface.ISessionLogger>(); sessionLogger.Insert(sessionFID, SessionM.AspSessionId(), customer.CusInfo.Email, UserIPAddress()); if (UserCart.Items.Count > 0) { Response.Redirect(Application["rootPath"].ToString() + "/Payment/PaymentOption.aspx"); } else { Response.Redirect(Application["rootPath"].ToString() + "/Home.aspx"); } } catch (ResellerClub.BusinessLogic.ServerException ex) { ShowErrorMessage(ex.Message); } }
private void _sessionM_HandleUpdatedUnclaimedAchievementMessage(string message) { IAchievementData achievementData = SessionM.GetAchievementData(message); //Register Event if (NotifyUnclaimedAchievementDataUpdated != null) { NotifyUnclaimedAchievementDataUpdated(achievementData); } if (callback != null) { callback.NotifyUnclaimedAchievementDataUpdated(nativeParent, achievementData); } }
public static SessionM GetInstance() { if (instance == null) { SessionM existingSessionM = GameObject.FindObjectOfType <SessionM>(); if (existingSessionM == null) { Debug.LogError("There is no SessionM GameObject set up in the scene. Please add one and set it up as per the SessionM Plug-In Documentation."); return(null); } existingSessionM.SetSessionMNative(); instance = existingSessionM; } return(instance); }
private void UserChanged(IDictionary <string, object> userInfo) { UserData user = SessionM.GetInstance().GetUserData(); if (user == null) { return; } optOutLabel.text = "Opt Out: " + user.IsOptedOut().ToString(); isRegisteredLabel.text = "Is Registered: " + user.IsRegistered(); isLoggedInLabel.text = "Is Logged In: " + user.IsLoggedIn(); pointBalanceLabel.text = "Point Balance: " + user.GetUserPointBalance(); unclaimedAchCountLabel.text = "Unclaimed Achievement Count: " + user.GetUnclaimedAchievementCount(); unclaimedAchValueLable.text = "Unclaimed Achievement Value: " + user.GetUnclaimedAchievementValue(); }
public ISessionM_iOS(SessionM sessionMParent) { sessionMGameObject = sessionMParent; SetShouldAutoUpdateAchievementsList(SessionM.shouldAutoUpdateAchievementsList); SetMessagesEnabled(SessionM.shouldEnableMessages); SetLogLevel(sessionMParent.logLevel); if (SessionM.serviceRegion == ServiceRegion.Custom) { SetServerType(SessionM.serverURL); } else { SetServiceRegion(SessionM.serviceRegion); } if (SessionM.shouldAutoStartSession && sessionMParent.iosAppId != null) { StartSession(sessionMParent.iosAppId); } CreateListenerObject(); }
//Exposed Methods public void ShowAchievementToast(string achievementTitle, int mPointValue, string achievementMessage) { //Exit this call if there is currently an active Toast //(This shouldn't occur because we have notified SessionM we are currently displaying an achievement.) if (toastState != ToastState.Offscreen) { return; } titleText.text = achievementTitle; mPointsText.text = "mPoints: " + mPointValue.ToString(); messageText.text = achievementMessage; toastState = ToastState.Toasting; toastTimer = 0f; //Notify SessionM We are about to display the achievment. SessionM.GetInstance().NotifyPresented(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["login"] != null) { if (Request.QueryString["login"] == "1") { divHeaderPlaceOrder.Visible = false; OderDetail1.Visible = false; } if (Request.QueryString["login"] == "2") { SessionM.Abandon(); Response.Redirect(Application["rootPath"].ToString() + "/Home.aspx"); } } if (SessionM["Customer"] != null) { Response.Redirect(Application["rootPath"].ToString() + "/Payment/PaymentOption.aspx"); } HideParentPageHeading(); CurrentModule = ModuleNames.Domain; divError.Style["display"] = "none"; trRegistrationForm.Style["display"] = "none"; if (IsPostBack) { trRegistrationForm.Style["display"] = ""; trUserOption.Style["display"] = "none"; if (Request["existing_submit"] != null) { ExistingCustomer(); } if (Request["new_submit"] != null) { NewCustomer(); } } }
private void UpdateBadge() { int badgeCount = SessionM.GetInstance().GetUnclaimedAchievementCount(); if (badgeVisible == false && badgeCount > 0) { ShowBadge(); } if (badgeVisible == true && badgeCount == 0) { HideBadge(); } if (badgeCount > 99) { badgeCount = 99; } badgeText.text = badgeCount.ToString(); }
void OnDisable() { #if UNITY_IPHONE && !UNITY_EDITOR SessionM.GetInstance().SetCallback(null); #endif }
//Unity Lifecycle private void Awake() { //Set service region before SessionM instance is activated SessionM.SetServiceRegion(ServiceRegion.USA); sessionM.gameObject.SetActive(true); }