コード例 #1
0
        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>";
            }
        }
コード例 #2
0
    void OnEnable()
    {
        DontDestroyOnLoad(this);
#if UNITY_IPHONE && !UNITY_EDITOR
        SessionM.GetInstance().SetCallback(this);
#endif
    }
コード例 #3
0
    // Unity Lifecycle

    private void Awake()
    {
        SetSessionMNative();
        GameObject.DontDestroyOnLoad(this.gameObject);
        instance = this;
        SetLogLevel(logLevel);
    }
コード例 #4
0
 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();
 }
コード例 #5
0
    //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;
        }
    }
コード例 #6
0
    public ISessionM_iOS(SessionM sessionMParent)
    {
        sessionMGameObject = sessionMParent;

        if (sessionMParent.iosAppId != null)
        {
            SetServiceRegion(SessionM.serviceRegion);
            StartSession(null);
            SetLogLevel(sessionMParent.logLevel);
        }

        CreateListenerObject();
    }
コード例 #7
0
    public ISessionM_Android(SessionM sessionMParent)
    {
        sessionMGameObject = sessionMParent;
        initAndroidInstance();

        CreateListenerObject();

        if (sessionMGameObject.androidAppId != null)
        {
            SetServiceRegion(SessionM.serviceRegion);
            StartSession(null);
        }
    }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
    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);
        }
    }
コード例 #10
0
    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);
    }
コード例 #11
0
    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();
    }
コード例 #12
0
    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();
    }
コード例 #13
0
    //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();
    }
コード例 #14
0
        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();
                }
            }
        }
コード例 #15
0
    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();
    }
コード例 #16
0
    void OnDisable()
    {
#if UNITY_IPHONE && !UNITY_EDITOR
        SessionM.GetInstance().SetCallback(null);
#endif
    }
コード例 #17
0
    //Unity Lifecycle

    private void Awake()
    {
        //Set service region before SessionM instance is activated
        SessionM.SetServiceRegion(ServiceRegion.USA);
        sessionM.gameObject.SetActive(true);
    }