Exemplo n.º 1
0
        //
        static Fetch()
        {
            m_soapHeaderUC = UCConfigs.GetConfig();

            accountsData = new AccountsFacade();

            GetProtectionQuestions();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化页面基类
        /// </summary>
        public UCPageBase()
        {
            aideWebsiteFacade = new NativeWebFacade();
            aideUserFacade    = new AccountsFacade();

            LogonUrl    = "../Login.aspx";
            RawUrl      = Utils.GameRequest.GetUrl();
            RedirectUrl = Utility.UrlDecode(GameRequest.GetQueryString("redirectUrl"));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初始化页面基类
        /// </summary>
        public UCPageBase()
        {
            this.m_isOnLine  = Fetch.IsUserOnline();
            this.m_stationID = Fetch.StationID;

            aideWebsiteFacade = new GameWebFacade();
            aideUserFacade    = new AccountsFacade();

            LogonUrl    = "../Login.aspx";
            RawUrl      = Utils.GameRequest.GetUrl();
            RedirectUrl = Utility.UrlDecode(GameRequest.GetQueryString("redirectUrl"));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 生成序列号
        /// </summary>
        public void CreateSerialNumber( )
        {
            string numberList;
            bool   j = true;

            while (j)
            {
                numberList = string.Empty;
                Random rd = new Random( );
                for (int i = 0; i < 9; i++)
                {
                    numberList = numberList + rd.Next(1, 9).ToString( );
                }
                AccountsFacade accountsFacade = new AccountsFacade( );
                if (!accountsFacade.PasswordIDIsEnable(numberList))
                {
                    SerialNumber = Convert.ToInt32(numberList);
                    j            = false;
                }
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// 大厅登陆写入cookie
 /// </summary>
 public static string PalaformWriteCookie()
 {
     if (HttpContext.Current.Request.Cookies["Accounts"] != null && HttpContext.Current.Request.Cookies["Password"] != null)
     {
         string accounts = HttpContext.Current.Request.Cookies["Accounts"].Value.ToString();
         string password = HttpContext.Current.Request.Cookies["Password"].Value.ToString();
         password = password.Trim();
         accounts = accounts.Trim();
         UserInfo suInfo = new UserInfo(0, accounts, 0, password.Trim());
         suInfo.LastLogonIP = GameRequest.GetUserIP();
         AccountsFacade accountsFacade = new AccountsFacade();
         Message        umsg           = accountsFacade.Logon(suInfo, true);
         if (umsg.Success)
         {
             UserInfo ui = umsg.EntityList[0] as UserInfo;
             ui.LogonPass = password.Trim();
             Fetch.SetUserCookie(ui.ToUserTicketInfo());
             return(Fetch.GetCookie(Fetch.UC_COOKIE_LOGON_TOKEN));
         }
     }
     return("");
 }
Exemplo n.º 6
0
        /// <summary>
        /// 获取用户对象
        /// </summary>
        /// <returns></returns>
        public static UserTicketInfo GetUserCookie()
        {
            string plaintext = Fetch.GetCookie(Fetch.UC_COOKIE_LOGON_TOKEN);

            //平台跳转判断是否登录
            if (HttpContext.Current.Request.Cookies["Accounts"] != null && HttpContext.Current.Request.Cookies["Password"] != null && TextUtility.EmptyTrimOrNull(plaintext))
            {
                string accounts = HttpContext.Current.Request.Cookies["Accounts"].Value.ToString();
                string password = HttpContext.Current.Request.Cookies["Password"].Value.ToString();
                password = password.Trim();
                accounts = accounts.Trim();
                UserInfo suInfo = new UserInfo(0, accounts, 0, password.Trim());
                suInfo.LastLogonIP = GameRequest.GetUserIP();
                AccountsFacade accountsFacade = new AccountsFacade();
                Message        umsg           = accountsFacade.Logon(suInfo, true);
                if (umsg.Success)
                {
                    UserInfo ui = umsg.EntityList[0] as UserInfo;
                    ui.LogonPass = password.Trim();
                    Fetch.SetUserCookie(ui.ToUserTicketInfo());
                    plaintext = Fetch.GetCookie(Fetch.UC_COOKIE_LOGON_TOKEN);
                }
            }

            if (TextUtility.EmptyTrimOrNull(plaintext))
            {
                return(null);
            }

            string jsonText = Utils.AES.Decrypt(plaintext, CookieEncryptKey);

            if (TextUtility.EmptyTrimOrNull(jsonText))
            {
                return(null);
            }

            return(UserTicketInfo.DeserializeObject(jsonText));
        }