public ActionResult ScoreSubmit(int type) { var key1 = LoginInfoModel.UserInfo != null ? LoginInfoModel.UserInfo.UserID:null; var key2 = LoginInfoModel.ykCookie; var key = key1 ?? key2; var data = new GameInfoBLL().GetGameData(key); if (!data.IsOver) { return(Json(new { Code = 2002, Msg = "游戏还未结束,再想想吧~" })); } if (type == 1) { if (key1 != null) { new GameInfoBLL().AddGameLog(LoginInfoModel.UserInfo, data.Score); } else { return(Json(new { Code = 2003, Msg = "游客朋友无法保存战绩哦~" })); } } data = new GameInfo(); new GameInfoBLL().RefNum(ref data); new GameInfoBLL().SetGameData(key, data); return(Json(new { Code = 2000, Msg = "操作成功" })); }
public ActionResult UserMove(int keyCode) { var key = LoginInfoModel.UserInfo != null ? LoginInfoModel.UserInfo.UserID : LoginInfoModel.ykCookie; var data = new GameInfoBLL().GetGameData(key); switch (keyCode) { case 37: new GameInfoBLL().MoveLeft(ref data); new GameInfoBLL().RefNum(ref data); break; case 38: new GameInfoBLL().MoveUP(ref data); new GameInfoBLL().RefNum(ref data); break; case 39: new GameInfoBLL().MoveRight(ref data); new GameInfoBLL().RefNum(ref data); break; case 40: new GameInfoBLL().MoveDown(ref data); new GameInfoBLL().RefNum(ref data); break; } //执行完用户操作指令后保存游戏状态 new GameInfoBLL().SetGameData(key, data); return(Json(new { Data = data.Data, Code = 2000, Score = data.Score })); }
public ActionResult GameOver() { var key = LoginInfoModel.UserInfo != null ? LoginInfoModel.UserInfo.UserID : LoginInfoModel.ykCookie; var data = new GameInfoBLL().GetGameData(key); data.IsOver = true; new GameInfoBLL().SetGameData(key, data); return(Json(new { Code = 2000, Msg = "游戏结束" })); }
protected void Page_Load(object sender, EventArgs e) { string sUserName = CYRequest.GetString("username"); string sPWD = CYRequest.GetString("pwd"); string sKey = CYRequest.GetString("key"); string sGameID = CYRequest.GetString("gameid"); string sServerid = CYRequest.GetString("serverid"); if (ValKey(sUserName, sPWD, sKey)) { string sState = UserBll.UserVal(sUserName, sPWD); if ("0" == sState) { int iUserID = UserBll.UserIDSel(sUserName); string sbbsKey = ConfigurationManager.AppSettings["UserValKey"].ToString(); string sUrl = DiscuzUserI.BBSLogin(sUserName, sPWD, sbbsKey); string sPageUrl = Request.Url.ToString(); LoginStateSet(sUserName, iUserID, sPageUrl); int iGameID = 0; int.TryParse(sGameID, out iGameID); int iServerID = 0; int.TryParse(sServerid, out iServerID); string sGameAbbre = GameBLL.GameAbbreSel(iGameID, iServerID).Trim(); string sGame = GameInfoBLL.GameInfoAbbreSel(sGameAbbre).TrimEnd(); string sGameUrl = string.Empty; switch (sGame) { case "sssg": string client = CYRequest.GetString("client"); sGameUrl = string.Format("{0}/GCenter/PlayGame.aspx?gn={1}&client={2}", sRootUrl, sGameAbbre, client); break; case "tssg": string fuid = CYRequest.GetString("fuid"); sGameUrl = string.Format("{0}/GCenter/PlayGame.aspx?gn={1}&fuid={2}", sRootUrl, sGameAbbre, fuid); break; default: sGameUrl = string.Format("{0}/GCenter/PlayGame.aspx?gn={1}", sRootUrl, sGameAbbre); break; } sMsg = string.Format("<script>location.href='{0}'</script><script src='{1}'></script>", sGameUrl, sUrl); } else { sMsg = string.Format("<script>alert('用户信息输入错误,验证失败!')</script><script>location.href='{0}/Default.aspx'</script>", sRootUrl); return; } } else { Response.Redirect("../Default.aspx", true); } }
private string getGameList() { List <GameInfo> lGObject = GameInfoBLL.GameInfoSel(); StringBuilder sbText = new StringBuilder(); foreach (GameInfo giObject in lGObject) { sbText.AppendFormat("<a href=http://www.dao50.com/yxzq/{0} target=_blank>{1}</a>", giObject.abbre, giObject.GameName); } return(sbText.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (Request.HttpMethod == "GET") { string sWebUrl = WebConfig.BaseConfig.sWUrl; string uniqueid = CYRequest.GetString("uniqueid"); sGameName = CYRequest.GetString("game"); string sign = CYRequest.GetString("sign"); string sKey = "1!s@k#d)}w[l<>"; StringBuilder sbText = new StringBuilder(); sbText.Append(uniqueid); sbText.Append(sGameName); sbText.Append(sKey); string sValSign = ProvideCommon.MD5(sbText.ToString()).ToLower(); if (sign == sValSign) { sServerName = ServerBLL.ServerTitleNoSNameSel(sGameName); if (!NoRegLoginBLL.NoRegLoginUnionidSel(uniqueid)) { //sMsg = "<script>alert('uniqueid 重复!')</script>"; sAccountT = GetAccount(); return; } string sUserName = string.Format("?{0}", ProvideCommon.GenerateStringID()); int iTypeID = 1; int iState = 1; string sPassWord = ""; int iUID = UserBll.UserReg(sUserName, sPassWord, iTypeID, iState); if (iUID > 1000) { sAccountT = sUserName; string sPageUrl = Request.Url.ToString(); LoginStateSet(sUserName, iUID, sPageUrl); NoRegLoginBLL.NoRegLoginAdd(iUID, uniqueid, sGameName); NoRegLoginBLL.AddUserid(uniqueid, iUID.ToString()); if (sGameName.Length > 0) { string sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd(); switch (sGame) { case "lj": case "yjxy": case "sq": case "hzw": case "xlfc": case "dxz": case "djj": case "zl": case "fswd2": case "txj": case "ljer": case "sjsg": case "tzcq": case "zsg": case "wssg": case "by": case "nz": case "mjcs": if (ProvideCommon.valTime(DateTime.Now.ToString(), ServerBLL.ServerTimeSel(sGameName))) { sQueryString = string.Format("?gn={0}", sGameName); sUrl = string.Format("/frame/g_mainframe_{0}.aspx{1}", sGame, sQueryString); } break; case "tssg": string fuid = CYRequest.GetString("fuid"); sQueryString = string.Format("?gn={0}&fuid={1}", sGameName, fuid); sUrl = string.Format("/frame/g_mainframe_{0}.aspx{1}", sGame, sQueryString); break; default: sUrl = string.Format("/GCenter/PlayGame.aspx?gn={0}", sGameName); break; } } else { Response.StatusCode = 301; Response.Status = "301 Moved Permanently"; Response.RedirectLocation = string.Format("{0}/yxzx/", sWebUrl); Response.End(); } } else { Response.Write("<script>alert('注册失败!');location.href='http://www.dao50.com/';</script>"); } } else { //sMsg = "<script>alert('sign error')</script>"; return; } } }
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); } } } }
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); } } } } }
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"); } }
protected string GameAllSel() { return(GameInfoBLL.GameInfoJsonSel()); }
public void ProcessRequest(HttpContext context) { string sAjaxType = CYRequest.GetString("AjaxType"); int iUserID = 0; switch (sAjaxType) { case "ValName": context.Response.Write(AccountVal(CYRequest.GetString("Account"))); break; case "GameAllSel": context.Response.Write(GameAllSel()); break; case "ServerSelByGame": context.Response.Write(ServerSelByGame(CYRequest.GetString("Abbre"))); break; case "ServerNumSelByGame": context.Response.Write(ServerNumSelByGame(CYRequest.GetString("Abbre"), CYRequest.GetString("Num"))); break; case "CodeTypeSel": context.Response.Write(CodeTypeSel(CYRequest.GetString("GameAbbre"))); break; case "CodeUrlSel": context.Response.Write(CodeUrlSel(CYRequest.GetString("Abbre"))); break; case "loginval": context.Response.Write(UserVal(CYRequest.GetString("username"), CYRequest.GetString("password"))); break; case "ServerNewSel": int iGameID = 0; int.TryParse(CYRequest.GetString("gameid"), out iGameID); if (iGameID > 0) { context.Response.Write(ServerNewSel(iGameID)); } break; case "ServerLoginLastSel": iGameID = 0; int.TryParse(CYRequest.GetString("gameid"), out iGameID); iUserID = UserBll.UserIDSel(CYRequest.GetString("account")); if (iGameID > 0 && iUserID > 999) { context.Response.Write(ServerLoginLastSel(iUserID, iGameID)); } break; case "NoticeSel": context.Response.Write(NoticeSel(CYRequest.GetString("abbre"))); break; case "sqGameCL": context.Response.Write(sqGameCL(CYRequest.GetString("account"), CYRequest.GetString("game"))); break; case "jyGameCL": context.Response.Write(jyGameCL(CYRequest.GetString("account"), CYRequest.GetString("game"), CYRequest.GetString("pc"))); break; case "sqUserInfo": context.Response.Write(sqUserInfos(CYRequest.GetString("account"), CYRequest.GetString("game"))); break; case "Top20PaySel": context.Response.Write(Top20PaySel()); break; case "Top20PayAllSel": context.Response.Write(Top20PayAllSel()); break; case "ServerJsonSelByGame": context.Response.Write(ServerJsonSelByGame((CYRequest.GetString("Game")))); break; case "HelpClassLJ2DLGGSel": context.Response.Write(HelpClassLJ2DLGGSel(CYRequest.GetString("ClassID"))); break; case "LoginSeverSel": context.Response.Write(LoginSeverSel(CYRequest.GetString("un"))); break; case "UserInfoSel": context.Response.Write(UserInfoSel(CYRequest.GetString("un"))); break; case "CodeTake": iUserID = UserBll.UserIDSel(CYRequest.GetString("un")); if (iUserID > 999) { string sTakeRes = string.Empty; string sGameAbbre = CYRequest.GetString("ServerAbbre"); string sGame = GameInfoBLL.GameInfoAbbreSel(sGameAbbre).TrimEnd(); switch (sGame) { case "sxd": sTakeRes = string.Format("0|{0}", sxdGame.GetNewCode(sGameAbbre, iUserID.ToString())); break; case "lj": if (CYRequest.GetString("CodeType") == "ljxsk") { sTakeRes = string.Format("0|{0}", ljGame.GetNewCode(sGameAbbre, iUserID.ToString())); } else { sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID); } break; case "swjt": sTakeRes = string.Format("0|{0}", swjtGame.GetNewCode(sGameAbbre, iUserID.ToString())); break; case "wwsg": sTakeRes = string.Format("0|{0}", wwsgGame.GetNewCode(iUserID.ToString(), sGameAbbre)); break; case "ktpd": sTakeRes = string.Format("0|{0}", ktpdGame.GetNewCode(iUserID.ToString(), sGameAbbre)); break; case "sgyjz": sTakeRes = string.Format("0|{0}", sgyjzGame.GetNewCode(iUserID.ToString(), sGameAbbre.ToString(), "")); break; case "zwx": if (CYRequest.GetString("CodeType") == "zwxxsk") { sTakeRes = string.Format("0|{0}", zwxGame.GetNewCode(iUserID.ToString(), sGameAbbre)); } else { sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID); } break; default: sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID); break; } context.Response.Write(sTakeRes); } break; case "FirstGift": context.Response.Write(FirstGift(CYRequest.GetString("gn"), CYRequest.GetString("un"), CYRequest.GetString("pp"), CYRequest.GetString("host"))); break; } }
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)); } } }
protected void Page_Load(object sender, EventArgs e) { //判断是否登陆 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))) { sHeight = "100%"; sGame = "lj"; 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; } } sUserID = iUserID.ToString(); sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd(); switch (sGame) { case "lj": case "yjxy": case "sq": case "hzw": case "xlfc": case "djj": case "zl": case "fswd2": case "txj": case "ljer": case "sjsg": case "tzcq": case "zsg": case "wssg": case "by": case "nz": case "dxz": case "mxqy": case "swjt": case "gcld": case "jdsj": case "tjz": case "khbd": case "sglj": case "hyjft": case "llsg": case "nslm": case "rxzt": case "ftz": case "ahxy": case "mhxy": case "sxj": case "zwj": case "qxz": case "qszg": case "wwsg": case "dntg": case "jy": case "sskc": case "ktpd": case "mhtj": case "dtgzt": case "ahxx": case "jjp": case "sgyjz": case "zwx": string sStartTime = DateTime.Now.ToString(); string sEndTime = ServerBLL.ServerTimeSel(sGameName); if (!ProvideCommon.valTime(sStartTime, sEndTime)) { Response.Redirect(string.Format("{0}/jjkf", sWUrl), true); return; } //else //{ // if(iUserID < 2000) // { // System.Text.StringBuilder sbText = new System.Text.StringBuilder(); // sbText.Append(Server.MapPath("~/Log")); // sbText.Append("/wan"); // string sPath = sbText.ToString(); // ProvideCommon pcObject = new ProvideCommon(); // sbText.Remove(0, sbText.Length); // sbText.AppendFormat("StartTime:{0}", sStartTime); // sbText.AppendFormat(";EndTime:{0}", sEndTime); // pcObject.WriteLogFile(sPath, "log", sbText.ToString()); // } //} sHeight = "100%"; sTitle = ServerBLL.ServerTitleSel(CYRequest.GetString("gn")); sQueryString = string.Format("?gn={0}", sGameName); break; case "mjcs": sHeight = "630px"; sTitle = ServerBLL.ServerTitleSel(CYRequest.GetString("gn")); sQueryString = string.Format("?gn={0}", sGameName); break; case "tssg": sHeight = "640px"; sTitle = ServerBLL.ServerTitleSel(CYRequest.GetString("gn")); string fuid = CYRequest.GetString("fuid"); sQueryString = string.Format("?gn={0}&fuid={1}", sGameName, fuid); break; default: sHeight = "100%"; Response.Redirect(string.Format("{0}/", sWUrl), true); break; } } else { Response.Redirect(string.Format("{0}/Default.aspx?gn={1}", sRootUrl, sGameName)); } } }
protected void Page_Load(object sender, EventArgs e) { int iUserID = GetUserID(); if (Request.HttpMethod == "POST" || Request.HttpMethod == "GET") { string sAjaxType = CYRequest.GetString("AjaxType"); switch (sAjaxType) { case "GLoginSel": Response.Write(GLoginSel()); break; case "CodeTake": if (iUserID > 999) { string sTakeRes = string.Empty; string sGameAbbre = CYRequest.GetString("ServerAbbre"); string sGame = GameInfoBLL.GameInfoAbbreSel(sGameAbbre).TrimEnd(); switch (sGame) { case "sxd": sTakeRes = string.Format("0|{0}", sxdGame.GetNewCode(sGameAbbre, iUserID.ToString())); break; case "lj": if (CYRequest.GetString("CodeType") == "ljxsk") { sTakeRes = string.Format("0|{0}", ljGame.GetNewCode(sGameAbbre, iUserID.ToString())); } else { sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID); } break; case "swjt": sTakeRes = string.Format("0|{0}", swjtGame.GetNewCode(sGameAbbre, iUserID.ToString())); break; case "wwsg": sTakeRes = string.Format("0|{0}", wwsgGame.GetNewCode(iUserID.ToString(), sGameAbbre)); break; case "ktpd": sTakeRes = string.Format("0|{0}", ktpdGame.GetNewCode(iUserID.ToString(), sGameAbbre)); break; case "sgyjz": sTakeRes = string.Format("0|{0}", sgyjzGame.GetNewCode(iUserID.ToString(), sGameAbbre.ToString(), "")); break; case "zwx": if (CYRequest.GetString("CodeType") == "zwxxsk") { sTakeRes = string.Format("0|{0}", zwxGame.GetNewCode(iUserID.ToString(), sGameAbbre)); } else { sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID); } break; default: sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID); break; } Response.Write(sTakeRes); } break; case "rmbpaygame": if (iUserID > 999) { Response.Write(RMBPayGame(iUserID)); } break; case "rmbpaywlb": if (iUserID > 999) { Response.Write(PTransUser(iUserID, 1, 1)); } break; case "wlbpaygame": if (iUserID > 999) { Response.Write(GTransUser(iUserID, 1, 1)); } break; case "HelpClassSel": if (iUserID > 999) { string sGameAbbre = CYRequest.GetString("gameabbre"); string sClassName = CYRequest.GetString("classname"); int iGameID = GameInfoBLL.GameInfoIDSel(sGameAbbre); Response.Write(HelpClassSel(iGameID, sClassName)); } break; case "HelpClassLJSel": if (iUserID > 999) { string sGameAbbre = CYRequest.GetString("gameabbre"); string sClassName = CYRequest.GetString("classname"); int iGameID = GameInfoBLL.GameInfoIDSel(sGameAbbre); Response.Write(HelpClassLJSel(iGameID, sClassName)); } break; case "AccountSel": if (iUserID > 999) { Response.Write(GetAccount()); } break; case "LoginSeverSel": if (iUserID > 999) { Response.Write(LoginSeverSel()); } break; case "LoginSeverSelAll": if (iUserID > 999) { Response.Write(LoginSeverSelAll()); } break; case "UserPointsSel": if (iUserID > 999) { Response.Write(UserPointsSel(iUserID)); } break; case "getReward": if (iUserID > 999) { Response.Write(getReward(CYRequest.GetString("gn"), iUserID)); } break; case "NoRegBind": if (iUserID > 999) { Response.Write(NoRegBind(CYRequest.GetString("account"), CYRequest.GetString("pw"))); } break; case "UserVal": Response.Write(UserVal(CYRequest.GetString("un"), CYRequest.GetString("pwd"))); break; case "ktpdGameCL": Response.Write(ktpdGameCL(iUserID, CYRequest.GetString("game"))); break; } } }
protected void Page_Load(object sender, EventArgs e) { string sTranID = CYRequest.GetQueryString("TranID"); int iPayUserID = TransGBLL.TransSelGUserIDByTID(sTranID); sPayAccount = UserBll.AccountSel(iPayUserID).Trim(); iGamePoints = TransGBLL.TransGamePointsSelByTID(sTranID); string sAbbre = CYRequest.GetQueryString("gn"); string sType = CYRequest.GetQueryString("type"); string sGAbbre = GameInfoBLL.GameInfoAbbreSel(sAbbre).Trim(); switch (sGAbbre) { case "sssg": sGameName = "盛世三国"; sGameM = "银(注:1000银=1锭)"; break; case "sxd": sGameName = "神仙道"; sGameM = "元宝"; break; case "lj": sGameName = "龙将"; sGameM = "金币"; break; case "yjxy": sGameName = "一剑轩辕"; sGameM = "元宝"; break; case "dxz": sGameName = "大侠传"; sGameM = "黄金"; break; case "djj": sGameName = "大将军"; sGameM = "黄金"; break; case "txj": sGameName = "天行剑"; sGameM = "元宝"; break; case "sjsg": sGameName = "神将三国"; sGameM = "元宝"; break; case "tzcq": sGameName = "天尊传奇"; sGameM = "元宝"; break; case "zsg": sGameName = "战三国"; sGameM = "元宝"; break; case "wssg": sGameName = "无双三国"; sGameM = "元宝"; break; case "by": sGameName = "霸域"; sGameM = "元宝"; break; case "mxqy": sGameName = "冒险契约"; sGameM = "金币"; break; case "swjt": sGameName = "神武九天"; sGameM = "元宝"; break; case "gcld": sGameName = "攻城掠地"; sGameM = "金币"; break; case "tjz": sGameName = "天劫传"; sGameM = "元宝"; break; case "khbd": sGameName = "葵花宝典"; sGameM = "元宝"; break; case "sglj": sGameName = "三国论剑"; sGameM = "通宝"; break; case "hyjft": sGameName = "火影疾风坛"; sGameM = "金币"; break; case "llsg": sGameName = "龙狼三国"; sGameM = "黄金"; break; case "nslm": sGameName = "女神联盟"; sGameM = "钻石"; break; case "rxzt": sGameName = "热血遮天"; sGameM = "元宝"; break; case "ahxy": sGameName = "暗黑西游"; sGameM = "元宝"; break; case "mhxy": sGameName = "梦回轩辕"; sGameM = "元宝"; break; case "sxj": sGameName = "神仙劫"; sGameM = "元宝"; break; case "zwj": sGameName = "最无极"; sGameM = "元宝"; break; case "qxz": sGameName = "群侠传"; sGameM = "元宝"; break; case "qszg": sGameName = "骑士战歌"; sGameM = "金币"; break; case "wwsg": sGameName = "威武三国"; sGameM = "元宝"; break; case "dntg": sGameName = "大闹天宫"; sGameM = "元宝"; break; case "ahxx": sGameName = "暗黑修仙"; sGameM = "元宝"; break; case "jjp": sGameName = "将军破"; sGameM = "元宝"; break; case "sgyjz": sGameName = "三国英杰传"; sGameM = "金币"; break; case "dtgzt": sGameName = "太古遮天"; sGameM = "元宝"; break; case "dtgzter": sGameName = "太古遮天2"; sGameM = "元宝"; break; } if ("q" == sType) { sAccount = sPayAccount; iUserPoints = UserPointsBLL.UPointAllSel(iPayUserID); } else { int iUserID = GetUserID(); if (iUserID > 999) { iUserPoints = UserPointsBLL.UPointAllSel(iUserID); sAccount = GetAccount(); } } SetPoints(iUserPoints); string sFromHost = GetFromHost(); if (sFromHost.Length > 5) { string sServerNum = sAbbre.Replace(sGAbbre, ""); string sQueryString = string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}", sTranID, sGameName, sServerNum, sPayAccount, sAccount, iGamePoints, iUserPoints, sGameM); string sEncodeQueryString = Server.UrlEncode(sQueryString); string sGoUrl = string.Format("http://{0}/PayGSucc.html?{1}", sFromHost, sEncodeQueryString); Response.Redirect(sGoUrl, true); return; } }