Example #1
0
        public static string jdsjPay(string sGameAbbre, int iUserID, string sUserName, int iPayPoints, string sPhone, int iGUserID)
        {
            int    iMoney  = iPayPoints / 10;
            string sTranIP = ProvideCommon.GetRealIP();
            string sTranID = TransGBLL.GameSalesInit(sGameAbbre, iPayPoints, sUserName, sPhone, iGUserID, sTranIP);
            string sTGRes  = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre).ToString();

            if (sTGRes != "0")
            {
                return(sTGRes);
            }
            string sRes    = Pay(iGUserID.ToString(), iMoney, sTranID, sGameAbbre);
            string sReturn = string.Empty;

            try
            {
                JSONObject json   = JSONConvert.DeserializeObject(sRes);
                string     status = json["status"].ToString();
                if (status == "400")
                {
                    sReturn = string.Format("0|{0}", sTranID);
                }
                else
                {
                    sReturn = sRes;
                }
            }
            finally
            {
                JSONConvert.clearJson();
            }
            return(sReturn);
        }
Example #2
0
        public static string jyPay(string sGameAbbre, int iUserID, string sUserName, int iPayPoints, string sPhone, int iGUserID)
        {
            decimal dMoney  = (Convert.ToDecimal(iPayPoints)) / 10;
            string  sTranIP = ProvideCommon.GetRealIP();
            string  sTranID = TransGBLL.GameSalesInit(sGameAbbre, iPayPoints, sUserName, sPhone, iGUserID, sTranIP);
            string  sTGRes  = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre).ToString();

            if (sTGRes != "0")
            {
                return(sTGRes);
            }
            string sRes    = Pay(iGUserID.ToString(), dMoney, sTranID, sGameAbbre);
            string sReturn = string.Empty;
            string intRes  = ProvideCommon.getJsonValue("status", sRes).Trim();

            if (intRes == "1")
            {
                sReturn = string.Format("0|{0}", sTranID);
            }
            else
            {
                sReturn = sRes;
            }
            return(sReturn);
        }
Example #3
0
        public static string ServerJsonSelByGame(string sGameAbbre)
        {
            string sUrl  = string.Format("http://db.dao50.com/data/server/{0}.txt", sGameAbbre);
            string sJson = ProvideCommon.GetPageInfo(sUrl, "UTF-8");

            return(sJson);
        }
Example #4
0
        public static string khbdQucikPay(string sGameAbbre, string sUserName, decimal dPrice, string sTranID)
        {
            int iUserID     = UserBll.UserIDSel(sUserName);
            int iUserPoints = UserPointsBLL.UPointSel(iUserID);
            int iGamePoints = Convert.ToInt32(dPrice * 10);

            if (iUserPoints < iGamePoints)
            {
                return("-2");
            }
            string sRes     = Pay(iUserID.ToString(), dPrice, sTranID, sGameAbbre);
            string sPayCode = ProvideCommon.getJsonValue("code", sRes);
            string sReturn  = string.Empty;

            if (sPayCode == "0" || sPayCode == "2")
            {
                int iGRes = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre);
                if (iGRes == 0)
                {
                    sReturn = "0";
                }
                else
                {
                    sReturn = "-1";
                }
            }
            else
            {
                sReturn = sRes;
            }
            return(sReturn);
        }
Example #5
0
        public static string Pay(string sUserID, decimal dMoney, string sOrderID, string sGame)
        {
            string op_id      = "115";
            string sid        = GetServerID(sGame);
            string account    = sUserID;
            int    iMoney     = Convert.ToInt32(dMoney);
            int    iGameMoney = iMoney * 10;
            //int iGameMoney = Convert.ToInt32(dMoney * 10);
            string game_money = iGameMoney.ToString();
            string u_money    = iMoney.ToString();
            string time       = ProvideCommon.getTime().ToString();
            string sAuth      = string.Format("op_id={0}&sid={1}&game_id=36&account={2}&order_id={3}&game_money={4}&u_money={5}&time={6}",
                                              op_id, sid, account, sOrderID, game_money, u_money, time);
            string sBase64Auth = Base64.EncodeBase64(sAuth);
            string sVerify     = ProvideCommon.MD5(string.Format("{0}{1}", sBase64Auth, key));
            string sPayUrl     = string.Format("http://up.uuzu.com/api/commonAPI/charge?auth={0}&verify={1}", sBase64Auth, sVerify);
            string sRes        = ProvideCommon.GetPageInfo(sPayUrl);
            string user_ip     = ProvideCommon.GetRealIP();
            int    iUserID     = 0;

            int.TryParse(sUserID, out iUserID);
            GamePayBLL.GamePayAdd(user_ip, sPayUrl, sOrderID, sRes, sGame, iUserID);
            string sCode = ProvideCommon.getJsonValue("status", sRes);

            return(sCode);
        }
Example #6
0
        public static string Pay(string sUserID, decimal dMoney, string sOrderID, string sGame)
        {
            string        spid     = "dao50";//平台id
            string        gameid   = "4";
            string        serverid = GetServerID(sGame);
            string        key      = "qrEyrtZc9aBW0z5i";
            int           iMoney   = Convert.ToInt32(dMoney * 100);//单位:分
            string        user_ip  = ProvideCommon.GetRealIP();
            string        ctime    = ProvideCommon.getTime().ToString();
            string        orderid  = sOrderID.Substring(0, 32);
            StringBuilder sbText   = new StringBuilder();

            sbText.AppendFormat("{0}|", spid);
            sbText.AppendFormat("{0}|", gameid);
            sbText.AppendFormat("{0}|", serverid);
            sbText.AppendFormat("{0}|", sUserID);
            sbText.AppendFormat("{0}|", orderid);
            sbText.AppendFormat("{0}|", iMoney.ToString());
            sbText.AppendFormat("{0}|", user_ip);
            sbText.AppendFormat("{0}|", ctime);
            sbText.Append(key);
            string sign = ProvideCommon.MD5(sbText.ToString()).ToLower();//md5(spid|gameid|serverid|userid|orderid|money|userip|ctime|key)
            string sUrl = string.Format("http://mid.gamefy.cn/union_mid/charge?userid={0}&spid={1}&gameid={2}&serverid={3}&orderid={4}&money={5}&userip={6}&ctime={7}&sign={8}",
                                        sUserID, spid, gameid, serverid, orderid, iMoney.ToString(), user_ip, ctime, sign);
            string sRes    = ProvideCommon.GetPageInfo(sUrl.ToString());
            int    iUserID = 0;

            int.TryParse(sUserID, out iUserID);
            GamePayBLL.GamePayAdd(user_ip, sUrl, sOrderID, sRes, sGame, iUserID);
            return(sRes);
        }
Example #7
0
        public static string Pay(string sUserID, decimal dMoney, string sOrderID, string sGame)
        {
            string        SECURITY_TICKET_PAY = "59cffe0f86ceb8bda13947b277f47ddc";
            int           golden   = Convert.ToInt32(dMoney) * 10;
            string        tstamp   = ProvideCommon.getTime().ToString();
            string        serverid = GetServerID(sGame);
            StringBuilder sbText   = new StringBuilder();

            sbText.Append(SECURITY_TICKET_PAY);
            sbText.AppendFormat("golden{0}", golden);
            sbText.AppendFormat("loginname{0}", sUserID);
            sbText.AppendFormat("orderid{0}", sOrderID);
            sbText.AppendFormat("serverid{0}", serverid);
            sbText.AppendFormat("tstamp{0}", tstamp);
            string ticket  = ProvideCommon.MD5(sbText.ToString());
            string TranURL = string.Format("http://s{0}.khbd.dao50.com:9130/ops/addpay/ops/addpay", serverid);

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("orderid={0}&loginname={1}&golden={2}&tstamp={3}&ticket={4}&serverid={5}",
                                sOrderID, sUserID, golden, tstamp, ticket, serverid);
            string sRes    = ProvideCommon.GetPageInfoByPost(TranURL, sbText.ToString(), "UTF-8");
            string user_ip = ProvideCommon.GetRealIP();
            int    iUserID = 0;

            int.TryParse(sUserID, out iUserID);
            string sUrl = string.Format("{0}?{1}", TranURL, sbText.ToString());

            GamePayBLL.GamePayAdd(user_ip, sUrl, sOrderID, sRes, sGame, iUserID);
            return(sRes);
        }
Example #8
0
        public static string GetNewCode(string sUserID, string sGameAbbre, string sCodeType)
        {
            string        spid       = "lin";
            string        time       = ProvideCommon.getTime().ToString();
            string        server_num = GetServerID(sGameAbbre);
            string        key        = "5c22fb494ba87294287fe5e743a7fe07";
            StringBuilder sbText     = new StringBuilder();

            sbText.AppendFormat("{0}", sUserID);
            sbText.AppendFormat("{0}", spid);
            sbText.AppendFormat("{0}", server_num);
            sbText.AppendFormat("{0}", sCodeType);//0:新手卡 1:手机绑定卡
            sbText.AppendFormat("{0}", time);
            sbText.AppendFormat("{0}", key);
            string sSign = ProvideCommon.MD5(sbText.ToString());//($user.$spid.$server_num.$type.$time.KEY)

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("http://s{0}.ahxx.dao50.com/getcard.php?", server_num);
            sbText.AppendFormat("spid={0}", spid);
            sbText.AppendFormat("&user={0}", sUserID);
            sbText.AppendFormat("&server_num={0}", server_num);
            sbText.AppendFormat("&type={0}", sCodeType);
            sbText.AppendFormat("&time={0}", time);
            sbText.AppendFormat("&sign={0}", sSign);

            string sRes = ProvideCommon.GetPageInfo(sbText.ToString(), "UTF-8");

            return(sRes);
        }
Example #9
0
        protected void RegButton_Click(object sender, EventArgs e)
        {
            string sAccount  = CYRequest.GetFormString("txz").Trim();
            string sPassWord = CYRequest.GetFormString("pwdtwo").Trim();

            string sValCode = Request["ValCode"].ToString();
            string sRes     = ValCheckCode(sValCode);

            if (sRes != "0")
            {
                StringBuilder sbText = new StringBuilder();
                sbText.Append("<script>alert('");
                sbText.Append(sRes);
                sbText.Append("')</script>");
                sMsg = sbText.ToString();
                return;
            }

            string sValMessage = UserBll.RegCheck(sAccount, sPassWord);

            if (sValMessage != "")
            {
                sMsg = sValMessage;
                return;
            }

            int iUID = UserBll.UserReg(sAccount, sPassWord);

            if (-1 == iUID)
            {
                sMsg = "<script>alert('注册失败,请重试!')</script>";
                return;
            }
            else if (iUID > 999)
            {
                string   sQuestion = CYRequest.GetString("question");
                string   sAnswer   = CYRequest.GetString("answer");
                string   sEmail    = CYRequest.GetString("email");
                string   sName     = CYRequest.GetString("realname");
                string   sCrednnum = CYRequest.GetString("credennum");
                UserInfo uiObject  = new UserInfo();
                uiObject.Credennum = sCrednnum;
                uiObject.Answer    = sAnswer;
                uiObject.Email     = sEmail;
                uiObject.Name      = sName;
                uiObject.question  = sQuestion;
                uiObject.regip     = ProvideCommon.GetRealIP();
                uiObject.uid       = iUID;
                UserInfoBLL.UserInfoAdd(uiObject);
                string sPageUrl = Request.Url.ToString();
                LoginStateSet(sAccount, iUID, sPageUrl);
                string sWUrl   = WebConfig.BaseConfig.sWUrl;
                string sWWWUrl = string.Format("{0}/{1}?un={2}", sWUrl, "usercookie.aspx", sAccount);
                string sKey    = ConfigurationManager.AppSettings["UserValKey"].ToString();
                string sBBSUrl = DiscuzUserI.BBSLogin(sAccount, sPassWord, sKey);
                string sJSUrl  = string.Format("<script src='{0}'></script><script src='{1}'></script>", sBBSUrl, sWWWUrl);
                sMsg = string.Format("{0}<script>alert('注册成功!');location.href='http://www.dao50.com/';</script>", sJSUrl);
                return;
            }
        }
Example #10
0
        public static string Login(string sUserID, string sGame, string sClient)
        {
            string        spid       = "lin";
            string        server_num = GetServerID(sGame);
            string        fcm        = "1";
            string        time       = ProvideCommon.getTime().ToString();
            string        key        = "5c22fb494ba87294287fe5e743a7fe07";
            StringBuilder sbText     = new StringBuilder();

            sbText.AppendFormat("{0}", sUserID);
            sbText.AppendFormat("{0}", server_num);
            sbText.AppendFormat("{0}", key);
            sbText.AppendFormat("{0}", time);
            string sign = ProvideCommon.MD5(sbText.ToString());//md5 ( username . server_num . KEY . time )

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("http://s{0}.ahxx.dao50.com/login.php?", server_num);
            sbText.AppendFormat("spid={0}", spid);
            sbText.AppendFormat("&username={0}", sUserID);
            sbText.AppendFormat("&server_num={0}", server_num);
            sbText.AppendFormat("&fcm={0}", fcm);
            sbText.AppendFormat("&time={0}", time);
            sbText.AppendFormat("&sign={0}", sign);
            sbText.AppendFormat("&client={0}", sClient);
            return(sbText.ToString());
        }
Example #11
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string        key        = "5c22fb494ba87294287fe5e743a7fe07";
            string        spid       = "lin";
            string        server_num = GetServerID(sGameAbbre);
            StringBuilder sbText     = new StringBuilder();

            sbText.AppendFormat("{0}", sUserID);
            sbText.AppendFormat("{0}", server_num);
            sbText.AppendFormat("{0}", key);
            string sign = ProvideCommon.MD5(sbText.ToString());//($username.$server_num.KEY)

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("http://s{0}.ahxx.dao50.com/user.php?", server_num);
            sbText.AppendFormat("spid={0}", spid);
            sbText.AppendFormat("&username={0}", sUserID);
            sbText.AppendFormat("&server_num={0}", server_num);
            sbText.AppendFormat("&sign={0}", sign);
            string sRes    = ProvideCommon.GetPageInfo(sbText.ToString());
            string sReturn = string.Empty;

            switch (sRes)
            {
            case "0":
            case "5":
                sReturn = "1";
                break;

            default:
                sReturn = "0";
                break;
            }
            return(sReturn);
        }
Example #12
0
        public static string QuickPayBegin(string sOrderID, string sAccount, decimal dPrice, string sGame)
        {
            string sprec    = string.Format("{0}/Pay/QuickVCallBack.aspx", ProvideCommon.GetRootURI()); //换成商户接收地址
            string spcustom = sGame;                                                                    //  需要 Server.UrlEncode编码  '客户自定义 30字符内 只能是数字、字母或数字字母的组合。不能用汉字。

            return(PayDirect(sOrderID, sAccount, dPrice, spcustom, sprec));
        }
Example #13
0
        public static string Login(string sUserID, string sGameName)
        {
            string        sLoginTime = ProvideCommon.getTime().ToString();
            string        sKey       = "long_dao50_gs_KEY_Ker9744JJelorerJEIrADw84er21WKREtKekw";
            StringBuilder sbText     = new StringBuilder();

            sbText.Append(sUserID);
            sbText.Append(sLoginTime);
            sbText.Append(sKey);
            string sFlag = Common.ProvideCommon.MD5(sbText.ToString()).ToLower();//md5($username.$time.$key) 这里传递的md5字串为小写字母

            sbText.Remove(0, sbText.Length);
            sbText.Append(LoginGameUrl(sGameName));
            sbText.Append("?username="******"&time=");
            sbText.Append(sLoginTime);
            sbText.Append("&isAdult=1");
            sbText.Append("&flag=");
            sbText.Append(sFlag);
            sbText.Append("&agent=dao50");
            string sServer = ServerName(sGameName);

            sbText.AppendFormat("&server={0}", sServer);
            return(sbText.ToString());
        }
Example #14
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string        user     = sUserID;
            string        sGameNum = ServerName(sGameAbbre);
            StringBuilder sbText   = new StringBuilder();
            string        TranURL  = string.Format("http://pay.my9yu.com/long/query/dao50/{0}/by/username", sGameNum);

            sbText.Append(TranURL);
            sbText.AppendFormat("?name={0}", user);
            string sJsonRes = ProvideCommon.GetPageInfo(sbText.ToString());
            string sRes     = GetReturn(sJsonRes);
            string sReturn  = string.Empty;

            switch (sRes)
            {
            case "-1":
                sReturn = "1";
                break;

            default:
                sReturn = sRes;
                break;
            }
            return(sReturn);
        }
Example #15
0
 public void ProcessRequest(HttpContext context)
 {
     if (context.Request.HttpMethod == "POST")
     {
         string  sChannle = CYRequest.GetFormString("Channel");
         string  sPhone   = CYRequest.GetFormString("Phone");
         string  sAccount = CYRequest.GetFormString("Account");
         string  sPrice   = CYRequest.GetFormString("Price");
         decimal dPrice   = 0;
         decimal.TryParse(sPrice, out dPrice);
         string sCount = CYRequest.GetFormString("Count");
         int    iCount = 0;
         int.TryParse(sCount, out iCount);
         string sGame = CYRequest.GetFormString("Game");
         string sUrl  = string.Empty;
         if (sGame == "" || sGame == "unsafe string")
         {
             sUrl = YeePayBuy.PayBegin(sChannle, sPhone, sAccount, dPrice, iCount);
         }
         else
         {
             string  sGameName  = sGame.Split('|')[0];
             string  sTranIP    = ProvideCommon.GetRealIP();
             string  sPTranID   = TransPBLL.PointSalesInit(sChannle, sPhone, sAccount, dPrice, iCount, sTranIP);//订单号
             int     iPayUserID = UserBll.UserIDSel(sAccount);
             decimal dFeeScale  = ChannelBLL.FeeScaleSel(sChannle);
             //int iPrice = Convert.ToInt32(dPrice);
             int    iGamePoints = Convert.ToInt32(dPrice * 10 * dFeeScale);
             string sGTranID    = TransGBLL.GameSalesInit(sGameName, iGamePoints, sAccount, sPhone, iPayUserID, sTranIP);
             TranQuickBLL.TranQuickAdd(sGTranID, sPTranID);
             sUrl = YeePayBuy.QuickPayBegin(sPTranID, sChannle, sAccount, dPrice, sGame);
         }
         context.Response.Redirect(sUrl, true);
     }
 }
Example #16
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string        serverid = GetServerID(sGameAbbre);
            string        ts       = ProvideCommon.getTime().ToString();
            string        key      = "308494a405f92ca02c74d562aed83ce3";
            StringBuilder sbText   = new StringBuilder();

            sbText.AppendFormat("{0}|", sUserID);
            sbText.AppendFormat("{0}|", ts);
            sbText.AppendFormat("{0}|", serverid);
            sbText.Append(key);
            string ticket = ProvideCommon.MD5(sbText.ToString());//md5(“$accname|$ts|$serverid|密钥”)

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("http://s{0}.yjxy.dao50.com/intf/general/get_user_info.php?", serverid);
            sbText.AppendFormat("accname={0}", sUserID);
            sbText.AppendFormat("&ts={0}", ts);
            sbText.AppendFormat("&serverid={0}", serverid);
            sbText.AppendFormat("&sign={0}", ticket);
            string sUrl    = sbText.ToString();
            string sRes    = ProvideCommon.GetPageInfo(sUrl);
            string sReturn = string.Empty;

            if (sRes.IndexOf("\"ret\":1") > -1)
            {
                sReturn = "1";
            }
            else
            {
                sReturn = "0";
            }
            return(sReturn);
        }
Example #17
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string        spid     = "dao50";//平台id
            string        gameid   = "4";
            string        serverid = GetServerID(sGameAbbre);
            string        key      = "qrEyrtZc9aBW0z5i";
            StringBuilder sbText   = new StringBuilder();

            sbText.AppendFormat("{0}|", spid);
            sbText.AppendFormat("{0}|", gameid);
            sbText.AppendFormat("{0}|", serverid);
            sbText.AppendFormat("{0}|", sUserID);
            sbText.Append(key);
            string sign    = ProvideCommon.MD5(sbText.ToString()).ToLower();//sign = md5(spid|gameid|serverid|userid|key)
            string sHost   = GetDomain(sGameAbbre);
            string preUrl  = string.Format("http://mid.gamefy.cn/union_mid/query_user?userid={0}&spid={1}&gameid={2}&serverid={3}&sign={4}", sUserID, spid, gameid, serverid, sign);
            string sRes    = ProvideCommon.GetPageInfo(preUrl);
            string sReturn = string.Empty;
            string sRet    = ProvideCommon.getJsonValue("code", sRes);

            if (sRet == "2001")
            {
                sReturn = "1";
            }
            else
            {
                sReturn = sRet;
            }
            return(sReturn);
        }
Example #18
0
        public static string Pay(string sUserID, decimal dMoney, string sOrderID, string sGame)
        {
            string        paytime  = ProvideCommon.getTime().ToString();
            int           iMoney   = Convert.ToInt32(dMoney);
            int           gold     = iMoney * 10;
            string        serverid = GetServerID(sGame);
            string        key      = "308494a405f92ca02c74d562aed83ce3";
            StringBuilder sbText   = new StringBuilder();

            sbText.AppendFormat("{0}|", sUserID);
            sbText.AppendFormat("{0}|", paytime);
            sbText.AppendFormat("{0}|", gold.ToString());
            sbText.AppendFormat("{0}|", serverid);
            sbText.Append(key);

            string sSign = ProvideCommon.MD5(sbText.ToString());//md5(“$accname|$paytime|$gold|$serverid|密钥”)

            sbText.Remove(0, sbText.Length);
            string sGamePayUrl = string.Format("http://s{0}.yjxy.dao50.com/intf/general/pay.php", serverid);

            sbText.AppendFormat("accname={0}&paytime={1}&gold={2}&billno={3}&serverid={4}&sign={5}",
                                sUserID, paytime, gold.ToString(), sOrderID, serverid, sSign);
            string sRes    = ProvideCommon.GetPageInfoByPost(sGamePayUrl, sbText.ToString(), "UTF-8");
            string sTranIP = ProvideCommon.GetRealIP();
            int    iUserID = 0;

            int.TryParse(sUserID, out iUserID);
            string sUrl = string.Format("{0}?{1}", sGamePayUrl, sbText.ToString());

            GamePayBLL.GamePayAdd(sTranIP, sUrl, sOrderID, sRes, sGame, iUserID);
            return(sRes);
        }
Example #19
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string        server_id = GetServerID(sGameAbbre);//游戏各个分区的编号,一区为1,二区为2
            string        sKey      = "1ovPBxOkGKX";
            StringBuilder sbText    = new StringBuilder();

            sbText.AppendFormat("{0}{1}{2}", sUserID, server_id, sKey);

            string sign = ProvideCommon.MD5(sbText.ToString());//md5($u.$s.$key)

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("http://s{0}.nz.dao50.com/api/active.php?u={1}&s={0}&sign={2}", server_id, sUserID, sign);
            string sUrl    = sbText.ToString();
            string sRes    = ProvideCommon.GetPageInfo(sUrl);
            string sReturn = string.Empty;

            if (sRes == "0")
            {
                sReturn = "1";
            }
            else
            {
                sReturn = "0";
            }
            return(sReturn);
        }
Example #20
0
        public static string yjxyQucikPay(string sGameAbbre, string sUserName, decimal dPrice, string sTranID)
        {
            int    iUserID  = UserBll.UserIDSel(sUserName);
            string sRes     = Pay(iUserID.ToString(), dPrice, sTranID, sGameAbbre);
            string sJsonRes = ProvideCommon.getJsonValue("ret", sRes);
            string sReturn  = string.Empty;

            switch (sJsonRes)
            {
            case "0":
                int iGRes = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre);
                if (iGRes == 0)
                {
                    sReturn = "0";
                }
                else
                {
                    sReturn = "-1";
                }
                break;

            case "2":
                TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre);
                sReturn = "0";
                break;

            default:
                sReturn = sRes;
                break;
            }
            return(sReturn);
        }
Example #21
0
        public static string khbdPay(string sGameAbbre, int iUserID, string sUserName, int iPayPoints, string sPhone, int iGUserID)
        {
            int    iMoney  = iPayPoints / 10;
            string sTranIP = ProvideCommon.GetRealIP();
            string sTranID = TransGBLL.GameSalesInit(sGameAbbre, iPayPoints, sUserName, sPhone, iGUserID, sTranIP);
            string sTGRes  = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre).ToString();

            if (sTGRes != "0")
            {
                return(sTGRes);
            }
            string sRes     = Pay(iGUserID.ToString(), iMoney, sTranID, sGameAbbre);
            string sPayCode = ProvideCommon.getJsonValue("code", sRes);
            string sReturn  = string.Empty;

            if (sPayCode == "0" || sPayCode == "2")
            {
                sReturn = string.Format("0|{0}", sTranID);
            }
            else
            {
                sReturn = sRes;
            }
            return(sReturn);
        }
Example #22
0
        public static string sgljPay(string sGameAbbre, int iUserID, string sUserName, int iPayPoints, string sPhone, int iGUserID)
        {
            int    iMoney  = iPayPoints / 10;
            string sTranIP = ProvideCommon.GetRealIP();
            string sTranID = TransGBLL.GameSalesInit(sGameAbbre, iPayPoints, sUserName, sPhone, iGUserID, sTranIP);
            string sTGRes  = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre).ToString();

            if (sTGRes != "0")
            {
                return(sTGRes);
            }
            string sRes = Pay(iGUserID.ToString(), iMoney, sTranID, sGameAbbre);

            ///成功返回0|订单号,失败返回游戏失败结果
            string sReturn = string.Empty;

            switch (sRes)
            {
            case "0":
            case "-6":
                sReturn = string.Format("0|{0}", sTranID);
                break;

            default:
                sReturn = sRes;
                break;
            }
            return(sReturn);
        }
Example #23
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string sReturn = string.Empty;
            string op_id   = "115";
            string sid     = GetServerID(sGameAbbre);
            string account = sUserID;
            string time    = ProvideCommon.getTime().ToString();
            string sAuth   = string.Format("op_id={0}&sid={1}&game_id=36&account={2}&time={3}",
                                           op_id, sid, account, time);
            string sBase64Auth = Base64.EncodeBase64(sAuth);
            string sVerify     = ProvideCommon.MD5(string.Format("{0}{1}", sBase64Auth, key));
            string sPayUrl     = string.Format("http://up.uuzu.com/api/commonAPI/roleverify?auth={0}&verify={1}", sBase64Auth, sVerify);
            string sRes        = ProvideCommon.GetPageInfo(sPayUrl);

            try
            {
                JSONObject json  = JSONConvert.DeserializeObject(sRes);
                string     sCode = json["status"].ToString();
                switch (sCode)
                {
                case "8":
                    sReturn = "1";
                    break;

                default:
                    sReturn = sRes;
                    break;
                }
            }
            finally
            {
                JSONConvert.clearJson();
            }
            return(sReturn);
        }
Example #24
0
        public static string Login(string sUserID, string sGame)
        {
            string        ubpartnerid  = "dao50";
            string        gameid       = "912000";
            string        serverid     = getServerID(sGame);
            string        username     = sUserID;
            string        idcard       = "1";
            string        eventtime    = DateTime.Now.ToString("yyyyMMddhhmmss");
            string        ubpartnerkey = "365ub-W6W1YKETLVH;JN?@=BI1CVT.G:<Tdao50";
            StringBuilder sbText       = new StringBuilder();

            sbText.AppendFormat(string.Format("ubpartnerid={0}&", ubpartnerid));
            sbText.AppendFormat(string.Format("gameid={0}&", gameid));
            sbText.AppendFormat(string.Format("serverid={0}&", serverid));
            sbText.AppendFormat(string.Format("username={0}&", username));
            sbText.AppendFormat(string.Format("idcard={0}&", idcard));
            sbText.AppendFormat(string.Format("eventtime={0}&", eventtime));
            sbText.AppendFormat(string.Format("ubpartnerkey={0}", ubpartnerkey));
            //MD5("ubpartnerid=&gameid=&serverid=&username=&idcard=&eventtime=&ubpartnerkey=".ToUpper()).ToUpper();
            string sSign = ProvideCommon.MD5(sbText.ToString().ToUpper()).ToUpper();

            sbText.Remove(0, sbText.Length);
            sbText.Append("http://api.365ub.com/loginbygetmethod.ashx?");
            sbText.AppendFormat("ubpartnerid={0}", ubpartnerid);
            sbText.AppendFormat("&gameid={0}", gameid);
            sbText.AppendFormat("&serverid={0}", serverid);
            sbText.AppendFormat("&username={0}", sUserID);
            sbText.AppendFormat("&idcard={0}", idcard);
            sbText.AppendFormat("&eventtime={0}&realname=", eventtime);
            sbText.AppendFormat("&sign={0}", sSign);
            return(sbText.ToString());
        }
Example #25
0
        public static string zsgPay(string sGameAbbre, int iUserID, string sUserName, int iPayPoints, string sPhone, int iGUserID)
        {
            decimal dMoney  = Convert.ToDecimal(iPayPoints / 10);
            string  sTranIP = ProvideCommon.GetRealIP();
            string  sTranID = TransGBLL.GameSalesInit(sGameAbbre, iPayPoints, sUserName, sPhone, iGUserID, sTranIP);
            string  sTGRes  = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre).ToString();

            if (sTGRes != "0")
            {
                return(sTGRes);
            }
            string sRes    = Pay(iGUserID.ToString(), dMoney, sTranID, sGameAbbre);
            string sReturn = string.Empty;

            switch (sRes)
            {
            case "1":
            case "-6":
                sReturn = string.Format("0|{0}", sTranID);
                break;

            default:
                sReturn = sRes;
                break;
            }
            return(sReturn);
        }
Example #26
0
        private const string key = "{b779f2dd-d532-3566-e0ab-9d3312f20919}";//"{D4EE863A-3714-4EE9-9F04-C7E3DC3E9924}";

        public static string Login(string sUserID, string sGame, string sSource)
        {
            string user    = sUserID;
            string time    = ProvideCommon.getTime().ToString();//标准时间戳
            int    iUserID = 0;

            int.TryParse(sUserID, out iUserID);
            string        sRegDate  = UserBll.RegTimeSel(iUserID);
            string        sRegDateC = ProvideCommon.getTime(DateTime.Parse(sRegDate)).ToString();
            StringBuilder sbText    = new StringBuilder();

            sbText.Append(user);
            sbText.AppendFormat("_{0}_", time);
            string hash = string.Empty;

            if (sSource != null && sSource.Length > 0)
            {
                sbText.AppendFormat("{0}_", sSource);
            }
            sbText.Append(key);
            hash = ProvideCommon.MD5(sbText.ToString());//md5(user_time_平台密钥)
            sbText.Remove(0, sbText.Length);
            string serverdomain = GetDomain(sGame);

            sbText.AppendFormat("http://{0}/login_api.php?", serverdomain);
            sbText.AppendFormat("user={0}&", user);
            sbText.AppendFormat("time={0}&", time);
            sbText.AppendFormat("hash={0}&", hash);
            sbText.AppendFormat("source={0}&", sSource);
            sbText.AppendFormat("regdate={0}&", sRegDateC);
            sbText.Append("non_kid=1");
            string sUrl = sbText.ToString();

            return(sUrl);
        }
Example #27
0
        public static string GameisLogin(string sUserID, string sGameAbbre)
        {
            string serverid = GetServerID(sGameAbbre);

            StringBuilder sbText = new StringBuilder();
            string        site   = GetSite(sGameAbbre);//"jydao50_0001"; //+serverid;

            sbText.AppendFormat("http://assist{0}.jy.dao50.com/rolelist?", serverid);
            sbText.AppendFormat("username={0}&", sUserID);
            sbText.AppendFormat("site={0}", site);
            string sUrl    = sbText.ToString();
            string sRes    = ProvideCommon.GetPageInfo(sUrl).Trim();
            string sReturn = string.Empty;
            string intRes  = ProvideCommon.getJsonValue("status", sRes).Trim();

            if (intRes == "0")
            {
                sReturn = "1";
            }
            else
            {
                sReturn = "0";
            }
            return(sReturn);
        }
Example #28
0
        public static string Pay(string sUserID, decimal dMoney, string sOrderID, string sGame)
        {
            string        user   = sUserID;
            string        order  = sOrderID;
            int           gold   = Convert.ToInt32((dMoney * 10));//充值元宝,比例1:10,即1RMB=10元宝
            string        domain = GetDomain(sGame);
            StringBuilder sbText = new StringBuilder();

            sbText.Append(user);
            sbText.AppendFormat("_{0}_", gold);
            sbText.AppendFormat("{0}_", order);
            sbText.AppendFormat("{0}_", domain);
            sbText.Append(key);
            string sign = ProvideCommon.MD5(sbText.ToString());//sign的值为md5(user_gold_order_domain_平台密钥) 算法生成的哈希值(小写)

            sbText.Remove(0, sbText.Length);
            string serverdomain = GetDomain(sGame);
            string TranURL      = "http://api.sxd.xd.com/api/buygold.php";

            sbText.Append(TranURL);
            sbText.AppendFormat("?user={0}&", user);
            sbText.AppendFormat("domain={0}&", domain);
            sbText.AppendFormat("order={0}&", sOrderID);
            sbText.AppendFormat("gold={0}&", gold);
            sbText.AppendFormat("sign={0}", sign);
            string sRes    = ProvideCommon.GetPageInfo(sbText.ToString());
            int    iUserID = 0;

            int.TryParse(sUserID, out iUserID);
            string user_ip = ProvideCommon.GetRealIP();

            GamePayBLL.GamePayAdd(user_ip, sbText.ToString(), sOrderID, sRes, sGame, iUserID);
            return(sRes);
        }
Example #29
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;
     }
 }
Example #30
0
        public static string Pay(string sUserID, int iMoney, string sOrderID, string sGame)
        {
            string        type     = "dao50";
            string        serverid = GetServerID(sGame);
            string        key      = "VViVnYZgpwrXMMQtqYUCsLqVGSuuQsUy";
            string        time     = DateTime.Now.ToString("yyyyMMddHHmmss");
            int           point    = iMoney * 10;//游戏虚拟货币数量
            StringBuilder sbText   = new StringBuilder();

            sbText.AppendFormat("uid={0}&uname={0}&serverid={1}&point={2}&amount={3}&oid={4}&time={5}&type={6}&key={7}",
                                sUserID, serverid, point, iMoney, sOrderID, time, type, key);
            string sign = ProvideCommon.MD5(sbText.ToString());//md5("uid=&uname=&serverid=&point=&amount=&oid=&time=&type=&key=");

            sbText.Remove(0, sbText.Length);
            //string format = "plain";//默认json可选值plain、xml
            string TranURL = "http://user.jdsj.dao50.com/VouchV2/AddGameCoin";

            sbText.AppendFormat("uid={0}&uname={0}&serverid={1}&point={2}&amount={3}", sUserID, serverid, point, iMoney);
            sbText.AppendFormat("&oid={0}&time={1}&type={2}&sign={3}", sOrderID, time, type, sign);
            string sRes    = ProvideCommon.GetPageInfoByPost(TranURL, sbText.ToString(), "UTF-8");
            int    iUserID = 0;

            int.TryParse(sUserID, out iUserID);
            string sUrl    = string.Format("{0}?{1}", TranURL, sbText.ToString());
            string user_ip = ProvideCommon.GetRealIP();

            GamePayBLL.GamePayAdd(user_ip, sUrl, sOrderID, sRes, sGame, iUserID);
            return(sRes);
        }