public static string CJBegin(int iUserID, string sGift, string sGameAbbre) { string sCJRes = string.Empty; int iNum = UserDWCJNum(iUserID); if (iNum > 0) { if (sGameAbbre.IndexOf("wssg") == 0) { string sServerID = GetServerID(sGameAbbre); int iServerID = 1; if (int.TryParse(sServerID, out iServerID)) { //抽奖开始 Random rdObject = new Random(); int iRandomNum = rdObject.Next(1, 30); string sGiftID = string.Empty; if (iRandomNum < 10) { sGiftID = string.Format("2930000{0}", iRandomNum); } else { sGiftID = string.Format("293000{0}", iRandomNum); } string sTranID = ProvideCommon.GenerateStringID(); string sRes = RechargePrize(iUserID.ToString(), sGiftID, sTranID, sGameAbbre); if (sRes == "1") { sCJRes = string.Format("0|{0}", iRandomNum.ToString()); GameGiftBLL.GameGiftAdd(iServerID, iUserID, sGift, "wssg", sGiftID, sTranID); } else if (sRes == "2") { sCJRes = "1"; } } else { sCJRes = "servererr"; } } else { sCJRes = "gameerr"; } } else { sCJRes = "numless"; } return(sCJRes); }
protected void Page_Load(object sender, EventArgs e) { if (Request.HttpMethod == "GET") { string sWebUrl = WebConfig.BaseConfig.sWUrl; string uniqueid = CYRequest.GetString("uniqueid"); string 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) { if (!NoRegLoginBLL.NoRegLoginUnionidSel(uniqueid)) { sMsg = "uniqueid重复"; 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) { string sPageUrl = Request.Url.ToString(); LoginStateSet(sUserName, iUID, sPageUrl); NoRegLoginBLL.NoRegLoginAdd(iUID, uniqueid, sGameName); NoRegLoginBLL.AddUserid(uniqueid, iUID.ToString()); if (sGameName.Length > 0) { sUrl = string.Format("/frame/g_mainframe_noreg.aspx?gn={0}", sGameName); return; } } else { sMsg = "注册失败"; return; } } else { sMsg = "sign error"; return; } } }
public static string AutoNameCreate(string sName) { if (UserBll.AccountIfAt(sName)) { int iRAutoNum = RNameAutoBLL.NumSelByName(sName); int iNum = iRAutoNum + 1; string sAccount = string.Format("{0}_{1}", sName, iNum);// RNameAutoBLL.RNameAutoAdd(sName, iNum); if (UserBll.AccountIfAt(sAccount)) { return(ProvideCommon.GenerateStringID()); } else { return(sAccount); } } else { return(sName); } }
public static string GetAccount(string sNickName) { string sAccount = string.Empty; if (sNickName.Length < 1) { sAccount = ProvideCommon.GenerateStringID(); } else { int iUserID = UserBll.UserIDSel(sNickName); if (iUserID > 999) { sAccount = RNameAutoBLL.AutoNameCreate(sNickName); } else { sAccount = sNickName; } } return(sAccount); }
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; } } }