Exemple #1
0
        public static string getReturnInfo(returnJson jr)
        {
            string url  = GameConfigMgr.Instance().getString("360UrlCb", "http://www.youyisigame.com:8036/Service.aspx/Pay360");
            string info = getReturnInfo(jr.id, jr.name, url);

            return(info);
        }
Exemple #2
0
        void Pay360()
        {
            const string  urlLogin   = "******";
            var           cache      = new PersonalCacheStruct <PayUserInfoEx>();
            PayUserInfoEx pui        = cache.FindKey(theUserId.ToString());
            string        json       = "";
            returnJson    jr         = null;
            int           happyIndex = -1;

            if (pui == null)
            {
                // 回调后。
                string sendURL = urlLogin +
                                 HttpUtility.UrlEncode("access_token", Encoding.UTF8) + "=" +
                                 HttpUtility.UrlEncode(requestPack.token, Encoding.UTF8) + "&" +
                                 HttpUtility.UrlEncode("fields=id,name,avatar,sex,area", Encoding.UTF8);
                try
                {
                    json       = utils.HttpPost(sendURL, "");
                    jr         = JsonHelper.ParseFromJson <returnJson>(json);
                    happyIndex = getHappyIndex(requestPack.typeUser, jr.id);
                    pui        = getPUI(json, happyIndex);
                    cache.Add(pui);
                }
                catch (System.Exception e)
                {
                    json = "{}";
                    jr   = JsonHelper.ParseFromJson <returnJson>(json);
                    ConsoleLog.showErrorInfo(0, e.Message);
                }
            }
            else
            {
                json       = pui.InfoExt;
                jr         = JsonHelper.ParseFromJson <returnJson>(json);
                happyIndex = getHappyIndex(requestPack.typeUser, jr.id);
            }

            if (json == "{}")
            {
                responsePack.errorCode = (byte)Response1005Pack.EnumErrorCode.token_error;
            }
            else
            {
                responsePack.typeUser     = requestPack.typeUser;
                responsePack.result       = getReturnInfo(jr);
                responsePack.the3rdUserId = (uint)happyIndex;
                responsePack.errorCode    = (byte)Response1005Pack.EnumErrorCode.ok;
            }
        }
Exemple #3
0
 public static string getReturnInfo(returnJson jr)
 {
     string url = GameConfigMgr.Instance().getString("360UrlCb", "http://www.youyisigame.com:8036/Service.aspx/Pay360");
     string info = getReturnInfo(jr.id,jr.name,url);
     return info;
 }