Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         string sGameAbbre = CYRequest.GetString("gn");
         if (!ProvideCommon.valTime(DateTime.Now.ToString(), ServerBLL.ServerTimeSel(sGameAbbre)))
         {
             Response.Write("1");
             return;
         }
         int iUserID = GetUserID();
         if (iUserID > 999)
         {
             string sUserID       = iUserID.ToString();
             string sGameLoginUrl = string.Format("app://loadgame:{0},{1}|{2}&from_launcher=1", sUserID, sGameAbbre, sjsgGame.Login(sUserID, sGameAbbre));
             if (GameLogin(sGameAbbre))
             {
                 GameLoginBLL.GameLoginAdd(iUserID, sGameAbbre, ProvideCommon.GetRealIP(), sGameLoginUrl);
             }
             Response.Write(sGameLoginUrl);
         }
     }
     else
     {
         Response.Write("2");
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         string sGameAbbre = CYRequest.GetString("gn");
         if (!ProvideCommon.valTime(DateTime.Now.ToString(), ServerBLL.ServerTimeSel(sGameAbbre)))
         {
             Response.Write("<script>alert('即将开服,敬请期待!');location.href='ahxycl.aspx';</script>");
             return;
         }
         int iUserID = GetUserID();
         if (iUserID > 999)
         {
             string sUserID       = iUserID.ToString();
             string sServerID     = sGameAbbre.Replace("ahxy", "");
             string sServerName   = ServerBLL.ServerNameSelByAbbre(sGameAbbre);
             string sGameLoginUrl = string.Format("app://loadgame:{0}服-{1}-{2}|{3}&from_launcher=1",
                                                  sServerID, sServerName, sUserID, ahxyGame.Login(sUserID, sGameAbbre));
             if (GameLogin(sGameAbbre))
             {
                 GameLoginBLL.GameLoginAdd(iUserID, sGameAbbre, ProvideCommon.GetRealIP(), sGameLoginUrl);
             }
             Response.Write(string.Format("<script>window.location ='{0}';</script>", sGameLoginUrl));
         }
     }
     else
     {
         Response.Write("<script>alert('用户状态不存在,请登陆!');location.href='ahxycl.aspx';</script>");
         return;
     }
 }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (LoginSessionVal() || isLoginCookie())
            {
                string sGameAbbre = CYRequest.GetString("gn");
                if (!ProvideCommon.valTime(DateTime.Now.ToString(), ServerBLL.ServerTimeSel(sGameAbbre)))
                {
                    Response.Write("<script>alert('即将开服,敬请期待!');location.href='jycl.aspx';</script>");
                    return;
                }
                int      iUserID     = GetUserID();
                DateTime dtLoginTime = GetLoginTime();
                if (!PWDUpdateBLL.PwdUpdateVal(iUserID, dtLoginTime))
                {
                    ClearUsersInfo();
                    string sJs = "<script>alert('密码已改,请重新登陆!');location.href='jyc.html';</script>";
                    Response.Write(sJs);
                    return;
                }
                string sClient = "pc";
                string sUrl    = jyGame.Login(iUserID.ToString(), sGameAbbre, sClient);
                if (GameLogin(sGameAbbre))
                {
                    GameLoginBLL.GameLoginAdd(iUserID, sGameAbbre, ProvideCommon.GetRealIP(), sUrl);
                }


                Response.Redirect(sUrl, true);
                return;
            }
            else
            {
                Server.Transfer("jycl.aspx", false);
            }
        }
Ejemplo n.º 4
0
        private void gamelogin(string sGameAbbre, int iUserID)
        {
            string sSource = string.Empty;
            string sUrl    = string.Empty;
            string client  = "pc";

            sUrl = sssgGame.Login(iUserID.ToString(), sGameAbbre, sSource, client);
            GameLoginBLL.GameLoginAdd(iUserID, sGameAbbre, ProvideCommon.GetRealIP(), sUrl);
            Response.Redirect(sUrl, true);
        }
Ejemplo n.º 5
0
        protected string jyGameCL(string sAccount, string sGame, string pc)
        {
            int    iUserID = UserBll.UserIDSel(sAccount);
            string sRes    = string.Empty;

            if (iUserID > 999)
            {
                sRes = jyGame.Login(iUserID.ToString(), sGame, pc);
                GameLoginBLL.GameLoginAdd(iUserID, sGame, ProvideCommon.GetRealIP(), sRes);
            }
            return(sRes);
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         string sGameAbbre = CYRequest.GetString("gn");
         int    iUserID    = GetUserID();
         string sUrl       = zsgGame.Login(iUserID.ToString(), sGameAbbre);
         if (GameLogin(sGameAbbre))
         {
             GameLoginBLL.GameLoginAdd(iUserID, sGameAbbre, ProvideCommon.GetRealIP(), sUrl);
         }
         Response.Write(string.Format("<script>location.href='{0}'</script>", sUrl));
         return;
     }
     else
     {
         Server.Transfer("zsgcl.aspx", false);
     }
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         string sGameAbbre = CYRequest.GetString("gn");
         if (!ProvideCommon.valTime(DateTime.Now.ToString(), ServerBLL.ServerTimeSel(sGameAbbre)))
         {
             Response.Write("<script>alert('即将开服,敬请期待!');location.href='nzLogin.aspx';</script>");
             return;
         }
         int    iUserID = GetUserID();
         string sUrl    = nzGame.Login(iUserID.ToString(), sGameAbbre, "pc");
         if (GameLogin(sGameAbbre))
         {
             GameLoginBLL.GameLoginAdd(iUserID, sGameAbbre, ProvideCommon.GetRealIP(), sUrl);
         }
         Response.Redirect(sUrl, false);
         return;
     }
     else
     {
         Server.Transfer("nzLogin.aspx", false);
     }
 }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //直接跳转游戏
            if (!Page.IsPostBack)
            {
                string sGameName = CYRequest.GetString("gn");
                if (sGameName.Length < 2)
                {
                    Response.Redirect(string.Format("http://www.dao50.com/yxzx/?gn={0}", sGameName), false);
                }
                else if (LoginSessionVal() || isLoginCookie())
                {
                    int    iUserID  = GetUserID();
                    string sUserID  = string.Empty;
                    string sAccount = GetAccount();
                    if (!ValUserState(iUserID, sAccount))
                    {
                        iUserID = UserBll.UserIDSel(sAccount);
                        if (iUserID < 1000 || (!ValUserState(iUserID, sAccount)))
                        {
                            //Response.Write(string.Format("<script>alert('用户名:{2}与数字ID:{3}不一致,请重新登录!谢谢!');location.href='{0}/Default.aspx?gn={1}';</script>", sRootUrl, sGameName, sAccount, iUserID));
                            ClearUsersInfo();
                            return;
                        }
                    }
                    string sUserIP = ProvideCommon.GetRealIP();
                    if (!ProvideCommon.GameIPVal(sUserIP))
                    {
                        return;
                    }
                    string sStartTime = DateTime.Now.ToString();
                    string sEndTime   = ServerBLL.ServerTimeSel(sGameName);
                    string sGame      = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd();
                    sUserID = iUserID.ToString();
                    if (!ProvideCommon.valTime(sStartTime, sEndTime))
                    {
                        if (!UserBll.AdminUserVal(iUserID))
                        {
                            string sWUrl = WebConfig.BaseConfig.sWUrl;
                            Response.Redirect(string.Format("{0}/jjkf", sWUrl), true);
                            return;
                        }
                    }
                    else if (sGame == "dxz")
                    {
                        int iAddDay = 15;//过期时间
                        if (!ProvideCommon.SeverTimeVal(sEndTime, iAddDay) && !TransPBLL.UserIsTranVal(iUserID) && !dxzGame.GameisLoginVal(sUserID, sGameName))
                        {
                            //Response.Write(dxzGame.GameisLoginTest(sUserID,sGameName));
                            return;
                        }
                    }
                    switch (sGame)
                    {
                    case "lj":
                        sUrl = ljGame.Login(sUserID, sGameName);
                        break;

                    case "yjxy":
                        sUrl = yjxyGame.Login(sUserID, sGameName);
                        break;

                    case "sq":
                        sUrl = sqGame.Login(sUserID, sGameName, false);
                        break;

                    case "dxz":
                        sUrl = dxzGame.Login(sUserID, sGameName);
                        break;

                    case "djj":
                        sUrl = djjGame.Login(sUserID, sGameName);
                        break;

                    case "txj":
                        sUrl = txjGame.Login(sUserID, sGameName);
                        break;

                    case "sjsg":
                        sUrl = sjsgGame.Login(sUserID, sGameName);
                        break;

                    case "tzcq":
                        sUrl = tzcqGame.Login(sUserID, sGameName);
                        break;

                    case "by":
                        sUrl = byGame.Login(sUserID, sGameName);
                        break;

                    case "swjt":
                        sUrl = swjtGame.Login(sUserID, sGameName);
                        break;

                    case "gcld":
                        sUrl = gcldGame.Login(sUserID, sGameName);
                        break;

                    case "khbd":
                        sUrl = khbdGame.Login(sUserID, sGameName);
                        break;

                    case "hyjft":
                        sUrl = hyjftGame.Login(sUserID, sGameName);
                        break;

                    case "nslm":
                        sUrl = nslmGame.Login(sUserID, sGameName);
                        break;

                    case "dtgzt":
                        sUrl = tgztGame.Login(sUserID, sGameName);
                        break;

                    case "mhxy":
                        sUrl = mhxyGame.Login(sUserID, sGameName);
                        break;

                    case "qxz":
                        sUrl = qxzGame.Login(sUserID, sGameName);
                        break;

                    case "qszg":
                        sUrl = qszgGame.Login(sUserID, sGameName);
                        break;

                    case "wwsg":
                        sUrl = wwsgGame.Login(sUserID, sGameName);
                        break;

                    case "dntg":
                        sUrl = dntgGame.Login(sUserID, sGameName, "");
                        break;

                    case "jy":
                        sUrl = jyGame.Login(sUserID, sGameName, "");
                        break;

                    case "sskc":
                        sUrl = sskcGame.Login(sUserID, sGameName, "");
                        break;

                    case "ktpd":
                        sUrl = ktpdGame.Login(sUserID, sGameName, "", "");
                        break;

                    case "mhtj":
                        sUrl = mhtjGame.Login(sUserID, sGameName, "");
                        break;

                    case "jjp":
                        sUrl = jjpGame.Login(sUserID, sGameName);
                        break;

                    case "sgyjz":
                        if (sAccount.IndexOf("banhaotest") < 0 && sGameName == "sgyjz999")
                        {
                            sUrl = "";
                        }
                        else
                        {
                            string fcm         = string.Empty;
                            string sfcmAccount = "banhaotest1|banhaotest2|banhaotest3|banhaotest9|banhaotest10";
                            if (sfcmAccount.IndexOf(sAccount) > -1)
                            {
                                fcm = "0";
                            }
                            else
                            {
                                fcm = "2";
                            }
                            sUrl = sgyjzGame.Login(sUserID, sGameName, fcm);
                        }
                        break;

                    case "dtgzter":
                        sUrl = tgzt2Game.Login(sUserID, sGameName);
                        break;

                    case "zwx":
                        sUrl = zwxGame.Login(sUserID, sGameName);
                        break;

                    default:
                        sUrl = string.Format("{0}|{1}|{2}", sGameName, sGame, sUserID);
                        break;
                    }
                    if (sUrl.Length > 5 && sUrl.IndexOf("http") > -1)
                    {
                        if (GameLogin(sGameName))
                        {
                            GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                        }
                        Response.Redirect(sUrl, true);
                    }
                    else
                    {
                        Response.Redirect(string.Format("http://www.dao50.com/fwqwh/?url={0}", Server.UrlEncode(sUrl)), true);
                    }
                }
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string sGameName = CYRequest.GetString("gn");
                if (sGameName.Length < 2)
                {
                    Response.Redirect("http://www.wanyouxi123.com/togameerr.html?code=gameisnull", false);
                    return;
                }
                string sStartTime = DateTime.Now.ToString();
                string sEndTime   = ServerBLL.ServerTimeSel(sGameName);
                if (!ProvideCommon.valTime(sStartTime, sEndTime))
                {
                    Response.Redirect("http://www.wanyouxi123.com/togameerr.html?code=gamenobegin", true);
                    return;
                }
                if (LoginSessionVal() || isLoginCookie())
                {
                    int    iUserID  = GetUserID();
                    string sUserID  = string.Empty;
                    string sAccount = GetAccount();
                    if (!ValUserState(iUserID, sAccount))
                    {
                        iUserID = UserBll.UserIDSel(sAccount);
                        if (iUserID < 1000 || (!ValUserState(iUserID, sAccount)))
                        {
                            ClearUsersInfo();
                            return;
                        }
                    }
                    sUserID = iUserID.ToString();
                    string sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd();
                    string sUrl  = string.Empty;
                    switch (sGame)
                    {
                    case "lj":
                        sUrl = ljGame.Login(sUserID, sGameName);
                        break;

                    case "yjxy":
                        sUrl = yjxyGame.Login(sUserID, sGameName);
                        break;

                    case "sq":
                        bool bRes = GameLogin(sGameName);
                        sUrl = sqGame.Login(sUserID, sGameName, bRes);
                        break;

                    case "dxz":
                        sUrl = dxzGame.Login(sUserID, sGameName);
                        break;

                    case "djj":
                        sUrl = djjGame.Login(sUserID, sGameName);
                        break;

                    case "txj":
                        sUrl = txjGame.Login(sUserID, sGameName);
                        break;

                    case "sjsg":
                        sUrl = sjsgGame.Login(sUserID, sGameName);
                        break;

                    case "tzcq":
                        sUrl = tzcqGame.Login(sUserID, sGameName);
                        break;

                    case "by":
                        sUrl = byGame.Login(sUserID, sGameName);
                        break;

                    case "swjt":
                        sUrl = swjtGame.Login(sUserID, sGameName);
                        break;

                    case "gcld":
                        sUrl = gcldGame.Login(sUserID, sGameName);
                        break;

                    case "khbd":
                        sUrl = khbdGame.Login(sUserID, sGameName);
                        break;

                    case "hyjft":
                        sUrl = hyjftGame.Login(sUserID, sGameName);
                        break;

                    case "nslm":
                        sUrl = nslmGame.Login(sUserID, sGameName);
                        break;

                    case "tgzt":
                        sUrl = tgztGame.Login(sUserID, sGameName);
                        break;

                    case "mhxy":
                        sUrl = mhxyGame.Login(sUserID, sGameName);
                        break;

                    case "qxz":
                        sUrl = qxzGame.Login(sUserID, sGameName);
                        break;

                    case "qszg":
                        sUrl = qszgGame.Login(sUserID, sGameName);
                        break;

                    case "wwsg":
                        sUrl = wwsgGame.Login(sUserID, sGameName);
                        break;

                    case "dntg":
                        sUrl = dntgGame.Login(sUserID, sGameName, "");
                        break;

                    case "jy":
                        sUrl = jyGame.Login(sUserID, sGameName, "");
                        break;

                    case "sskc":
                        sUrl = sskcGame.Login(sUserID, sGameName, "");
                        break;

                    case "ktpd":
                        sUrl = ktpdGame.Login(sUserID, sGameName, "", "");
                        break;

                    case "mhtj":
                        sUrl = mhtjGame.Login(sUserID, sGameName, "");
                        break;

                    case "dtgzt":
                        sUrl = tgztGame.Login(sUserID, sGameName);
                        break;

                    case "sgyjz":
                        if (sAccount.IndexOf("banhaotest") > -1)
                        {
                            string fcm         = string.Empty;
                            string sfcmAccount = "banhaotest1|banhaotest2|banhaotest3|banhaotest9|banhaotest10";
                            if (sfcmAccount.IndexOf(sAccount) > -1)
                            {
                                fcm = "0";
                            }
                            else
                            {
                                fcm = "2";
                            }
                            sUrl = sgyjzGame.Login(sUserID, sGameName, fcm);
                        }
                        else
                        {
                            sUrl = sgyjzGame.Login(sUserID, sGameName, "2");
                        }
                        break;

                    case "dtgzter":
                        sUrl = tgzt2Game.Login(sUserID, sGameName);
                        break;

                    case "zwx":
                        sUrl = zwxGame.Login(sUserID, sGameName);
                        break;

                    default:
                        sUrl = string.Format("{0}|{1}|{2}", sGameName, sGame, sUserID);
                        break;
                    }
                    if (sUrl.Length > 5 && sUrl.IndexOf("http") > -1)
                    {
                        if (GameLogin(sGameName))
                        {
                            GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                        }
                        Response.Redirect(sUrl, true);
                    }
                    else
                    {
                        Response.Redirect(string.Format("http://www.wanyouxi123.com/togameerr.html?code=gameurlerr&{0}", sUrl), true);
                    }
                }
                else
                {
                    string sMultiPP = CYRequest.GetString("pp");
                    if (sMultiPP.Length < 10)
                    {
                        Response.Write("pp length is small");
                        return;
                    }
                    string sAccount = CYRequest.GetString("un");
                    int    iUserID  = UserBll.UserIDSel(sAccount);
                    if (ProvideCommon.valMultiPP(iUserID, sMultiPP))
                    {
                        string sUserID = iUserID.ToString();
                        string sGame   = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd();
                        string sUrl    = string.Empty;
                        switch (sGame)
                        {
                        case "lj":
                            sUrl = ljGame.Login(sUserID, sGameName);
                            break;

                        case "yjxy":
                            sUrl = yjxyGame.Login(sUserID, sGameName);
                            break;

                        case "sq":
                            bool bRes = GameLogin(sGameName);
                            sUrl = sqGame.Login(sUserID, sGameName, bRes);
                            break;

                        case "dxz":
                            sUrl = dxzGame.Login(sUserID, sGameName);
                            break;

                        case "djj":
                            sUrl = djjGame.Login(sUserID, sGameName);
                            break;

                        case "txj":
                            sUrl = txjGame.Login(sUserID, sGameName);
                            break;

                        case "sjsg":
                            sUrl = sjsgGame.Login(sUserID, sGameName);
                            break;

                        case "tzcq":
                            sUrl = tzcqGame.Login(sUserID, sGameName);
                            break;

                        case "by":
                            sUrl = byGame.Login(sUserID, sGameName);
                            break;

                        case "swjt":
                            sUrl = swjtGame.Login(sUserID, sGameName);
                            break;

                        case "gcld":
                            sUrl = gcldGame.Login(sUserID, sGameName);
                            break;

                        case "khbd":
                            sUrl = khbdGame.Login(sUserID, sGameName);
                            break;

                        case "hyjft":
                            sUrl = hyjftGame.Login(sUserID, sGameName);
                            break;

                        case "nslm":
                            sUrl = nslmGame.Login(sUserID, sGameName);
                            break;

                        case "dtgzt":
                            sUrl = tgztGame.Login(sUserID, sGameName);
                            break;

                        case "mhxy":
                            sUrl = mhxyGame.Login(sUserID, sGameName);
                            break;

                        case "qxz":
                            sUrl = qxzGame.Login(sUserID, sGameName);
                            break;

                        case "qszg":
                            sUrl = qszgGame.Login(sUserID, sGameName);
                            break;

                        case "wwsg":
                            sUrl = wwsgGame.Login(sUserID, sGameName);
                            break;

                        case "dntg":
                            sUrl = dntgGame.Login(sUserID, sGameName, "");
                            break;

                        case "jy":
                            sUrl = jyGame.Login(sUserID, sGameName, "");
                            break;

                        case "sskc":
                            sUrl = sskcGame.Login(sUserID, sGameName, "");
                            break;

                        case "ktpd":
                            sUrl = ktpdGame.Login(sUserID, sGameName, "", "");
                            break;

                        case "mhtj":
                            sUrl = mhtjGame.Login(sUserID, sGameName, "");
                            break;

                        case "sgyjz":
                            if (sAccount.IndexOf("banhaotest") > -1)
                            {
                                string fcm         = string.Empty;
                                string sfcmAccount = "banhaotest1|banhaotest2|banhaotest3|banhaotest9|banhaotest10";
                                if (sfcmAccount.IndexOf(sAccount) > -1)
                                {
                                    fcm = "0";
                                }
                                else
                                {
                                    fcm = "2";
                                }
                                sUrl = sgyjzGame.Login(sUserID, sGameName, fcm);
                            }
                            break;

                        case "dtgzter":
                            sUrl = tgzt2Game.Login(sUserID, sGameName);
                            break;

                        case "zwx":
                            sUrl = zwxGame.Login(sUserID, sGameName);
                            break;

                        default:
                            sUrl = string.Format("{0}|{1}|{2}", sGameName, sGame, sUserID);
                            break;
                        }
                        if (sUrl.Length > 5 && sUrl.IndexOf("http") > -1)
                        {
                            if (GameLogin(sGameName))
                            {
                                GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                            }
                            Response.Redirect(sUrl, true);
                        }
                        else
                        {
                            Response.Redirect(string.Format("http://www.wanyouxi123.com/togameerr.html?code=gameurlerr&{0}", sUrl), true);
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string account   = CYRequest.GetString("account");
            string agentid   = CYRequest.GetString("agentid");
            string gameabbre = CYRequest.GetString("gameabbre");
            string tstamp    = CYRequest.GetString("tstamp");

            if (account.Length > 20 || account.Length < 6)
            {
                Response.Write("2");
                return;
            }

            TimeSpan tsNow    = new TimeSpan(DateTime.Now.Ticks);
            long     lTime    = long.Parse(tstamp + "0000000");
            TimeSpan tsGet    = new TimeSpan(lTime);
            DateTime dtGet    = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).Add(tsGet);
            int      iMinutes = 0;

            if (dtGet > DateTime.Now)
            {
                TimeSpan tsgetSpan = new TimeSpan(dtGet.Ticks);
                iMinutes = tsgetSpan.Subtract(tsNow).Minutes;
            }
            else
            {
                iMinutes = tsNow.Subtract(tsGet).Minutes;
            }


            if (iMinutes > 10)
            {
                DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
                Response.Write(string.Format("3|{0}|{1}:{2}|{3}", iMinutes, DateTime.Now.ToString(), dtGet, tstamp));
                return;
            }

            string sign = CYRequest.GetString("sign");//md5(account + agentid + gameabbre + tstamp + TICKEY_LOGIN)
            int    pid  = 0;

            int.TryParse(agentid, out pid);
            if (pid < 1)
            {
                Response.Write("4");
                return;
            }
            string        TICKEY_LOGIN = PartnerBLL.PartnerKeySel(pid);
            StringBuilder sbText       = new StringBuilder(50);

            sbText.Append(account);
            sbText.Append(agentid);
            sbText.Append(gameabbre);
            sbText.Append(tstamp);
            sbText.Append(TICKEY_LOGIN);
            string sValSign = ProvideCommon.MD5(sbText.ToString());

            if (sign == sValSign)
            {
                string sPageUrl      = Request.Url.ToString();
                string sPartnerAbbre = PartnerBLL.PartnerAbbreSel(pid);
                if (sPartnerAbbre == null || sPartnerAbbre.Length < 1)
                {
                    Response.Write("5");
                    return;
                }
                string sAccountC     = string.Format("{0}:{1}", sPartnerAbbre, account);
                string sAccountLogin = GetAccount();
                string sUserIP       = ProvideCommon.GetRealIP();
                int    iUserID;
                if (sAccountC != sAccountLogin)
                {
                    //1.检查帐号是否存在
                    iUserID = PartnerUserBLL.PartnerUserIDSel(account, pid);
                    if (iUserID < 1000)
                    {
                        //2.不存在,则注册帐号
                        int iUID = UserBll.UserReg(sAccountC, "");
                        if (iUID < 1000)
                        {
                            Response.Write("6");
                            return;
                        }
                        else
                        {
                            int iRow = PartnerUserBLL.PartnerUserAdd(pid, sUserIP, iUID, account);
                            if (iRow < 1)
                            {
                                Response.Write("7");
                                return;
                            }
                        }
                        iUserID = iUID;
                        LoginStateSet(sAccountC, iUID, sPageUrl);
                    }
                    else
                    {
                        LoginStateSet(sAccountC, iUserID, sPageUrl);
                    }
                }
                else
                {
                    iUserID = GetUserID();
                    if (!ValUserState(iUserID, sAccountC))
                    {
                        iUserID = UserBll.UserIDSel(sAccountC);
                        if (iUserID < 1000 || (!ValUserState(iUserID, sAccountC)))
                        {
                            ClearUsersInfo();
                            Response.Write("10");
                            return;
                        }
                        else
                        {
                            ClearUsersInfo();
                            LoginStateSet(sAccountC, iUserID, sPageUrl);
                        }
                    }
                }

                string sGame   = GameInfoBLL.GameInfoAbbreSel(gameabbre).TrimEnd();
                string sUrl    = string.Empty;
                string sUserID = iUserID.ToString();
                if (iUserID > 1000)
                {
                    switch (sGame)
                    {
                    case "sssg":
                        string sSource = string.Empty;
                        string client  = "web";
                        sUrl = sssgGame.Login(sUserID, gameabbre, sSource, client);
                        break;

                    case "sxd":
                        sUrl = sxdGame.Login(sUserID, gameabbre, "");
                        break;

                    case "tssg":
                        sUrl = tssgGame.Login(sUserID, gameabbre, "");
                        break;

                    case "lj":
                        sUrl = ljGame.Login(sUserID, gameabbre);
                        break;

                    case "yjxy":
                        sUrl = yjxyGame.Login(sUserID, gameabbre);
                        break;

                    case "mjcs":
                        sUrl = mjcsGame.Login(sUserID, gameabbre);
                        break;

                    case "sq":
                        sUrl = sqGame.Login(sUserID, gameabbre, true);
                        break;

                    case "hzw":
                        sUrl = hzwGame.Login(sUserID, gameabbre);
                        break;

                    case "xlfc":
                        sUrl = xlfcGame.Login(sUserID, gameabbre);
                        break;

                    default:
                        Response.Write("8");
                        break;
                    }
                }
                else
                {
                    ClearUsersInfo();
                    Response.Write("11");
                    return;
                }
                if (sUrl != null && sUrl.Length > 5)
                {
                    GameLoginBLL.GameLoginAdd(iUserID, gameabbre, sUserIP, sUrl);
                    Response.Redirect(sUrl, true);
                }
            }
            else
            {
                Response.Write("9");
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string ip = ProvideCommon.GetRealIP();

            sGameName = CYRequest.GetString("gn");
            if (sGameName == "" || sGameName == "unsafe string")
            {
                Response.Redirect(string.Format("{0}/yxzx", sWUrl), false);
            }
            else
            {
                if (LoginSessionVal() || isLoginCookie())
                {
                    int    iUserID  = GetUserID();
                    string sUserID  = string.Empty;
                    string sAccount = GetAccount();
                    if (!ValUserState(iUserID, sAccount))
                    {
                        iUserID = UserBll.UserIDSel(sAccount);
                        if (iUserID < 1000 || (!ValUserState(iUserID, sAccount)))
                        {
                            Response.Write(string.Format("<script>alert('用户名:{2}与数字ID:{3}不一致,请重新登录!谢谢!');location.href='{0}/Default.aspx?gn={1}';</script>", sRootUrl, sGameName, sAccount, iUserID));
                            ClearUsersInfo();
                            return;
                        }
                    }
                    else
                    {
                        DateTime dtLoginTime = GetLoginTime();
                        if (!PWDUpdateBLL.PwdUpdateVal(iUserID, dtLoginTime))
                        {
                            ClearUsersInfo();
                            Response.Redirect(string.Format("{0}/Default.aspx", sRootUrl), true);
                            return;
                        }
                    }

                    int iUserPoints = GetUPoints();
                    if (iUserPoints > 0)
                    {
                        UserPointsBLL.UPointCheck(iUserID);
                    }

                    sUserID = iUserID.ToString();
                    string sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd();
                    switch (sGame)
                    {
                    case "sssg":
                        string sSource = string.Empty;
                        string client  = string.Empty;
                        if (CYRequest.GetString("client") != "pc")
                        {
                            client = "web";
                        }
                        else
                        {
                            client = CYRequest.GetString("client");
                        }
                        sUrl = sssgGame.Login(sUserID, sGameName, sSource, client);
                        if (GameLogin(sGameName))
                        {
                            GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                        }
                        if (client == "pc")
                        {
                            Response.Redirect(sUrl, true);
                            return;
                        }
                        else
                        {
                            sGameName = string.Empty;
                        }
                        break;

                    case "sxd":
                        sUrl    = sxdGame.Login(sUserID, sGameName, "");
                        iHeight = 635;
                        if (GameLogin(sGameName))
                        {
                            GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                        }
                        sGameName = string.Empty;
                        break;

                    default:
                        Response.Redirect(string.Format("wan.aspx?gn={0}", sGameName), true);
                        break;
                    }
                    sTitle = ServerBLL.ServerTitleSel(CYRequest.GetString("gn"));
                    if (sTitle.Length > 11)
                    {
                        ssTitle = sTitle.Substring(0, 11);
                    }
                    else
                    {
                        ssTitle = sTitle;
                    }
                }
                else
                {
                    Response.Write(string.Format("<script>alert('用户状态有误或没有登录,请重新登录!谢谢!');location.href='{0}/Default.aspx?gn={1}';</script>", sRootUrl, sGameName));
                }
            }
        }