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=31&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); string sCode = ProvideCommon.getJsonValue("status", sRes); switch (sCode) { case "8": sReturn = "1"; break; default: sReturn = sRes; break; } return(sReturn); }
public static string yjxyPay(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 sJsonRes = ProvideCommon.getJsonValue("ret", sRes); string sReturn = string.Empty; switch (sJsonRes) { case "0": case "2": sReturn = string.Format("0|{0}", sTranID); break; default: sReturn = sRes; break; } return(sReturn); }
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); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string serverid = GetServerID(sGameAbbre); string ts = ProvideCommon.getTime().ToString(); string key = "ySfWw4F0AVyK7TqyfxPnjOtuVCZLOvSu"; StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}", sUserID); sbText.AppendFormat("{0}", ts); sbText.AppendFormat("{0}", key); string ticket = ProvideCommon.MD5(sbText.ToString());//md5(“$accname|$ts|$serverid|密钥”) sbText.Remove(0, sbText.Length); sbText.AppendFormat("http://s{0}.wwsg.dao50.com/api/union/user_info.php?", serverid); sbText.AppendFormat("username={0}", sUserID); sbText.AppendFormat("&time={0}", ts); sbText.AppendFormat("&flag={0}", ticket); string sUrl = sbText.ToString(); string sRes = ProvideCommon.GetPageInfo(sUrl); string sJsonRes = ProvideCommon.getJsonValue("code", sRes); string sReturn = string.Empty; switch (sJsonRes) { case "-3": sReturn = "1"; break; default: sReturn = "0"; break; } return(sReturn); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string sReturn = string.Empty; string platform = "dao50"; string gkey = "qfz"; string skey = GetServerID(sGameAbbre); string time = ProvideCommon.getTime().ToString(); StringBuilder sbText = new StringBuilder(); sbText.Append(sUserID); sbText.Append(platform); sbText.Append(gkey); sbText.Append(skey); sbText.Append(time); sbText.Append("#"); string lkey = "XV1IHNkM2FzZGZrIG8g(*(*^986j2lu2lu8$aWdu1fhi"; sbText.Append(lkey); string sign = ProvideCommon.MD5(sbText.ToString());//$uid.$platform.$gkey.$skey.$time.'#'.$lkey string sQueryUrl = string.Format("http://{0}.qfz.dao50.com/checkuser.html?uid={1}&platform={1}&gkey={2}&skey={3}&time={4}&sign={5}", skey, sUserID, platform, gkey, skey, time, sign); string sRes = ProvideCommon.GetPageInfo(sQueryUrl); string sErrNo = ProvideCommon.getJsonValue("errno", sRes); if (sRes == "-1") { sReturn = "1"; } else { sReturn = sRes; } return(sReturn); }
public static string jjpQucikPay(string sGameAbbre, string sUserName, decimal dPrice, string sTranID) { int iUserID = UserBll.UserIDSel(sUserName); string sRes = Pay(iUserID.ToString(), dPrice, sTranID, sGameAbbre); string sress = ProvideCommon.getJsonValue("code", sRes).Trim(); string sReturn = string.Empty; switch (sress) { case "1000": int iGRes = TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre); if (iGRes == 0) { sReturn = "0"; } else { sReturn = "-1"; } break; //case "4": // TransGBLL.GameSalesCommit(sTranID, sUserName, sGameAbbre); // sReturn = "0"; // break; default: sReturn = sRes; break; } return(sReturn); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string key = "siawVVD8vDf834jFiek"; string server_num = GetServerID(sGameAbbre); StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}", sUserID); sbText.AppendFormat("{0}", key); string sign = ProvideCommon.MD5(sbText.ToString());//($username.$server_num.KEY) sbText.Remove(0, sbText.Length); sbText.AppendFormat("http://s{0}.jjp.dao50.com/pay/QueryInfo?", server_num); sbText.AppendFormat("account={0}", sUserID); sbText.AppendFormat("&sign={0}", sign); string sRes = ProvideCommon.GetPageInfo(sbText.ToString()); string sReturn = string.Empty; string ssres = ProvideCommon.getJsonValue("code", sRes); switch (ssres) { case "1001": sReturn = "1"; break; default: sReturn = "0"; break; } return(sReturn); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string serverid = GetServerID(sGameAbbre); StringBuilder sbText = new StringBuilder(); string timestamp = ProvideCommon.getTime().ToString(); string agentid = "24"; string key = "Wfe^j*3Hi2"; string sign = ProvideCommon.MD5(key + timestamp + sUserID); sbText.Append("http://bleach.sina.gametrees.com/api/dao50/info.player.php?"); sbText.AppendFormat("user_name={0}", sUserID); sbText.AppendFormat("&agentid={0}", agentid); sbText.AppendFormat("&serverid=s{0}", serverid); sbText.AppendFormat("&t={0}", timestamp); sbText.AppendFormat("&s={0}", sign); string sUrl = sbText.ToString(); string sRes = ProvideCommon.GetPageInfo(sUrl).Trim(); string sReturn = string.Empty; string intRes = ProvideCommon.getJsonValue("error_code", sRes).Trim(); if (intRes == "1001") { sReturn = "1"; } else { sReturn = "0"; } return(sReturn); }
public static string GetRoleId(string sUserID, string sGameAbbre) { string user_id = sUserID; string server_id = GetServerID(sGameAbbre); string time = ProvideCommon.getTime().ToString(); string key = "b906592f135016f44c3b194180268e21"; StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}", server_id); sbText.AppendFormat("{0}", user_id); sbText.AppendFormat("{0}", time); sbText.AppendFormat("{0}", key); string ticket = ProvideCommon.MD5(sbText.ToString());//md5(“$accname|$ts|$serverid|密钥”) sbText.Remove(0, sbText.Length); sbText.AppendFormat("{0}", "http://open.zuiwuji.com/api/dao50/role_query.php?"); sbText.AppendFormat("server_id={0}", server_id); sbText.AppendFormat("&time={0}", time); sbText.AppendFormat("&user_id={0}", user_id); sbText.AppendFormat("&sign={0}", ticket); string sUrl = sbText.ToString(); string sRes = ProvideCommon.GetPageInfo(sUrl); string ssRes = ProvideCommon.getJsonValue("id", sRes).Trim(); string sReturn = string.Empty; if (!string.IsNullOrEmpty(ssRes)) { sReturn = ssRes; } return(sReturn); }
public static string GetNickName(string sAccessToken, string sOpenID) { string sQQInfoUrl = string.Format("https://graph.qq.com/user/get_user_info?access_token={0}&oauth_consumer_key={1}&openid={2}", sAccessToken, sAppID, sOpenID); string sQQInfoReturn = ProvideCommon.GetPageInfo(sQQInfoUrl).Trim(); string sNickName = ProvideCommon.getJsonValue("nickname", sQQInfoReturn).Trim(); return(sNickName); }
public static string Login(string sUserID, string sGame) { string pfid = "12"; //平台id string LOGIN_KEY = "=TZ=::dao50::Login::KEY::(!~*k0KkEkQ8~!)"; string sSHALOGINKEY = ProvideCommon.SHA1(LOGIN_KEY).ToLower(); //"01ee72e03689fda8456f7e9486e937904364ebf1"; string serverid = sGame.Replace("tzcq", "s"); string tstamp = ProvideCommon.getTime().ToString(); string fcm = "1"; StringBuilder sbText = new StringBuilder(); sbText.Append(pfid); sbText.Append(sUserID); sbText.Append(sUserID); sbText.Append(serverid); sbText.Append(tstamp); sbText.Append(fcm); sbText.Append(sSHALOGINKEY); string sig = ProvideCommon.SHA1(sbText.ToString()).ToLower();//sha1(pfid + uid + name + serverid+ tstamp + fcm + sha1(LOGIN_KEY)) string sHost = GetDomain(sGame); string preUrl = string.Format("http://{0}/prelogin.php?pfid={1}&uid={2}&name={2}&serverid={3}&tstamp={4}&fcm={5}&sig={6}", sHost, pfid, sUserID, serverid, tstamp, fcm, sig); string sRes = ProvideCommon.GetPageInfo(preUrl); string sUrl = string.Empty; if (sRes.IndexOf("\"ret\":0") > -1) { string ticket = ProvideCommon.getJsonValue("ticket", sRes); sUrl = string.Format("http://{0}/platformlogin.php?pfid={1}&uid={2}&name={2}&serverid={3}&tstamp={4}&ticket={5}", sHost, pfid, sUserID, serverid, tstamp, ticket); //try //{ // JSONObject json = JSONConvert.DeserializeObject(sRes); // string ticket = json["ticket"].ToString(); // sUrl = string.Format("http://{0}/platformlogin.php?pfid={1}&uid={2}&name={2}&serverid={3}&tstamp={4}&ticket={5}", sHost, pfid, sUserID, serverid, tstamp, ticket); //} //catch (Exception ex) //{ // System.Text.StringBuilder sbErrText = new System.Text.StringBuilder(); // string sPath = @"D:\usercenter\Log\tzcq"; // sbErrText.AppendFormat("ErrMes:{0},", ex.Message); // sbErrText.AppendFormat("Url:{0},", preUrl); // sbErrText.AppendFormat("Res:{0}。", sRes); // ProvideCommon pcObject = new ProvideCommon(); // pcObject.WriteLogFile(sPath, "loginerr", sbErrText.ToString()); //} //finally //{ // JSONConvert.clearJson(); //} } else { sUrl = string.Format("http://www.dao50.com/fwqwh/?{0}|{1}", preUrl, sbText.ToString()); } return(sUrl); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string serverid = GetServerID(sGameAbbre); string HTTPType = "GET"; string platform = "dao50"; string sURI = string.Format("/{0}/player_info", platform); //string sHost = string.Format("http://s{0}.sxj.dao50.com", serverid); string sHost = "http://203.195.183.207:9502"; string sServer = "S" + serverid; string ts = ProvideCommon.getTime().ToString(); string appkey = "0c61f6f0cc964deb925373260ef530fc&"; StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("time={0}", ts); sbText.AppendFormat("&userid={0}", sUserID); sbText.AppendFormat("&zoneid={0}", serverid); string sUrlEnQuery = UrlReplace(HttpUtility.UrlEncode(sbText.ToString())); string sURLEnURI = UrlReplace(HttpUtility.UrlEncode(sURI)); Common.HmacSha1.Hasher hs = new HmacSha1.Hasher(); string data = HTTPType + "&" + sURLEnURI + "&" + sUrlEnQuery; hs.HashKey = System.Text.Encoding.Default.GetBytes(appkey); hs.HashText = data; string sShaCode = hs.HMACSHA1Hasher(); string ticket = UrlReplace(HttpUtility.UrlEncode(sShaCode));//md5(“$accname|$ts|$serverid|密钥”) sbText.Remove(0, sbText.Length); sbText.AppendFormat("{0}{1}?", sHost, sURI); sbText.AppendFormat("time={0}", ts); sbText.AppendFormat("&userid={0}", sUserID); sbText.AppendFormat("&zoneid={0}", serverid); sbText.AppendFormat("&checksum={0}", ticket); string sUrl = sbText.ToString(); string sRes = ProvideCommon.GetPageInfo(sUrl); string ssRes = ProvideCommon.getJsonValue("ret", sRes).Trim(); string sReturn = string.Empty; switch (ssRes) { case "-2": sReturn = "1"; break; default: //sReturn = "1"; sReturn = "0"; break; } return(sReturn); }
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=7&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(); //} string sCode = ProvideCommon.getJsonValue("status", sRes); switch (sCode) { case "8": sReturn = "1"; break; default: sReturn = sRes; break; } return(sReturn); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string channel = "19"; string server = ServerName(sGameAbbre); string sKey = "0b4c853574e51142"; Random rNum = new Random(); int iCur = rNum.Next(0, sKey.Length - 1); string cur = iCur.ToString(); StringBuilder sbText = new StringBuilder(); sbText.Append(sKey.Substring(0, iCur)); sbText.Append(channel); sbText.Append(server); sbText.Append(sUserID); sbText.Append(sKey.Substring(iCur)); string sSign = Common.ProvideCommon.MD5(sbText.ToString());//md5(substr($channelKey,0,$cur).$channel.$server.$account.substr($channelKey,$cur)) sbText.Remove(0, sbText.Length); string sQueryUrl = "http://gm.qxz.youxi567.com/rest/wl_query_user.php"; sbText.Append(sQueryUrl); sbText.AppendFormat("?channel={0}&", channel); sbText.AppendFormat("server={0}&", server); sbText.AppendFormat("account={0}&", sUserID); sbText.AppendFormat("cur={0}&", cur); sbText.AppendFormat("key={0}", sSign); string sRes = ProvideCommon.GetPageInfo(sbText.ToString()); string sJsonRes = ProvideCommon.getJsonValue("success", sRes); string sReturn = string.Empty; if (sJsonRes == "-1") { sReturn = "1"; } else { sReturn = "0"; } return(sReturn); }
public static bool GameisLoginVal(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=8&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); string sCode = ProvideCommon.getJsonValue("status", sRes); bool bRes = false; if (sCode == "0") { bRes = true; } return(bRes); }
public static string GameisLogin(string sUserID, string sGameAbbre) { string pfid = "12";//平台id string PAY_KEY = "=TZ=::dao50::PayZL::KEY::*!!ieSi40OSigi2~!*"; string sSHAPAYKEY = ProvideCommon.SHA1(PAY_KEY).ToLower(); string serverid = sGameAbbre.Replace("tzcq", "s"); string tstamp = ProvideCommon.getTime().ToString(); StringBuilder sbText = new StringBuilder(); sbText.Append(pfid); sbText.Append(sUserID); sbText.Append(sUserID); sbText.Append(serverid); sbText.Append(tstamp); sbText.Append(sSHAPAYKEY); string sig = ProvideCommon.SHA1(sbText.ToString()).ToLower();//sha1(pfid + uid + name + serverid + tstamp + sha1(PAY_KEY)) string sHost = GetDomain(sGameAbbre); string preUrl = string.Format("http://{0}/queryuser.php?pfid={1}&uid={2}&name={2}&serverid={3}&tstamp={4}&sig={5}", sHost, pfid, sUserID, serverid, tstamp, sig); string sRes = ProvideCommon.GetPageInfo(preUrl); string sReturn = string.Empty; string sRet = ProvideCommon.getJsonValue("ret", sRes); if (sRet == "0") { string is_exist = ProvideCommon.getJsonValue("is_exist", sRes); if (is_exist == "0") { sReturn = "1"; } else { sReturn = sRes; } } else { sReturn = sRet; } //try //{ // JSONObject json = JSONConvert.DeserializeObject(sRes); // string sRet = json["ret"].ToString(); // if (sRet == "0") // { // string is_exist = json["is_exist"].ToString(); // if (is_exist == "0") // { // sReturn = "1"; // } // else // { // sReturn = sRes; // } // } // else // { // sReturn = sRet; // } //} //finally //{ // JSONConvert.clearJson(); //} return(sReturn); }