Ejemplo n.º 1
0
        public JObject UserHotInfo(string auth, string qquin, string vaid)
        {
            try
            {
                string referer = @"http://game.tgp.qq.com/lol/profile/v1602/overview.shtml?qquin=#qquin#&area_id=#area_id#"
                                 .Replace("#qquin#", qquin)
                                 .Replace("#area_id#", vaid);

                string url = "http://api.pallas.tgp.qq.com/core/get_user_hot_info?callback=jQuery111106649491745047271_#jqueryext#&area_id=#area_id#&qquin=#qquin#&_=#t#"
                             .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                             .Replace("#area_id#", vaid)
                             .Replace("#qquin#", qquin)
                             .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());

                JObject jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JObject>());
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("UserHotInfo", ex);
                return(APILib.Error(ex.Message));
            }
        }
Ejemplo n.º 2
0
        public JObject UserExtInfo(string auth, string qquin, string vaid)
        {
            try
            {
                string para = @"[[7,{""item_num"":1,""items"":[{""qquin"":""#qquin#"",""area_id"":""#vaid#""}]}],[28,{""qquin"":""#qquin#"",""area_id"":""#vaid#""}],[29,{""qquin"":""#qquin#"",""area_id"":""#vaid#"",""top_mvp_type"":0}],[35,{""qquin"":""#qquin#"",""area_id"":""#vaid#"",""champion_id"":0}],[36,{""qquin"":""#qquin#"",""area_id"":""#vaid#""}]]"
                              .Replace("#qquin#", qquin)
                              .Replace("#vaid#", vaid);

                string referer = @"http://game.tgp.qq.com/lol/profile/v1602/overview.shtml?qquin=#qquin#&area_id=#area_id#"
                                 .Replace("#qquin#", qquin)
                                 .Replace("#area_id#", vaid);

                string url = @"http://api.pallas.tgp.qq.com/core/tcall?callback=jQuery17206660636231168173_#jqueryext#&p=#p#&_cache_time=#cache_time#"
                             .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                             .Replace("#p#", para)
                             .Replace("#cache_time#", "300");
                JObject jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JArray>());
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("UserExtInfo", ex);
                return(APILib.Error(ex.Message));
            }
        }
Ejemplo n.º 3
0
        public JObject GetMastery(string auth, string qquin, string vaid)
        {
            Random random  = new Random();
            string referer = @"http://game.tgp.qq.com/lol/profile/v1602/talent.html?nid=45&qquin=#qquin#&area_id=#area_id#"
                             .Replace("#qquin#", qquin)
                             .Replace("#area_id#", vaid);

            string url = @"http://api.pallas.tgp.qq.com/core/get_player_mastery_spell?callback=jQuery#jquery#_#jqueryext#&area_id=#area_id#&qquin=#qquin#&get_type=2&dtag=runes&_=#t#"
                         .Replace("#jquery#", "1111009980190638452" + random.Next(10, 99))
                         .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                         .Replace("#t#", DateHelper.ConvertDateTime2Long12(DateTime.Now).ToString())
                         .Replace("#qquin#", qquin)
                         .Replace("#area_id#", vaid);
            JObject jo = null;

            try
            {
                jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JObject>());
                return(json);
            }
            catch (Exception ex)
            {
                if (jo != null)
                {
                    return(APILib.Iced(jo));
                }

                LogHelper.LogInfo(referer + "\n" + url + "\n" + "return json is null");
                LogHelper.LogError("GetMastery", ex);
                return(APILib.Error("接口 GetMastery 调用错误"));
            }
        }
Ejemplo n.º 4
0
        public JObject CombatList(string auth, string qquin, string vaid, int pagesize, int p)
        {
            try
            {
                string para = @"[[3,{""qquin"":""#qquin#"",""area_id"":""#area_id#"",""bt_num"":""0"",""bt_list"":[],""champion_id"":0,""offset"":#offset#,""limit"":#limit#,""mvp_flag"":-1}]]"
                              .Replace("#qquin#", qquin)
                              .Replace("#area_id#", vaid)
                              .Replace("#limit#", pagesize.ToString())
                              .Replace("#offset#", (p * pagesize).ToString());

                string callback = "jQuery17209483979241204745_#jqueryext#"
                                  .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());

                string referer = @"http://api.tgp.qq.com/profile/v1602/overview.shtml?vuin=#vuin#&vaid=#vaid#"
                                 .Replace("#vuin#", qquin)
                                 .Replace("#vaid#", vaid);

                string url = @"http://api.pallas.tgp.qq.com/core/tcall?callback=#callback#&p=#p#&_=#t#"
                             .Replace("#callback#", HttpUtility.UrlEncode(callback))
                             .Replace("#p#", HttpUtility.UrlEncode(para))
                             .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());

                JObject jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JArray>());

                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("CombatList", ex);

                return(APILib.Error(ex.Message));
            }
        }
Ejemplo n.º 5
0
        public JObject BattleSummaryInfo(string auth, string qquin, string vaid)
        {
            Random random = new Random();
            string p      = @"[[14,{""battle_type"":-1,""qquin"":""#qquin#"",""area_id"":""#area_id#""}],[44,{""sid"":5,""qquin"":""#qquin#"",""area_id"":""#area_id#""}],[44,{""sid"":4,""qquin"":""#qquin#"",""area_id"":""#area_id#""}],[44,{""sid"":3,""qquin"":""#qquin#"",""area_id"":""#area_id#""}],[44,{""sid"":2,""qquin"":""#qquin#"",""area_id"":""#area_id#""}],[44,{""sid"":1,""qquin"":""#qquin#"",""area_id"":""#area_id#""}]]"
                            .Replace("#qquin#", qquin)
                            .Replace("#area_id#", vaid);
            string referer = @"http://game.tgp.qq.com/lol/profile/v1602/overview.shtml?qquin=#qquin#&area_id=#area_id#";
            string url     = @"http://api.pallas.tgp.qq.com/core/tcall?callback=jQuery#jquery#_#jqueryext#&p=#p#&_cache_time=#cache_time#"
                             .Replace("#p#", HttpUtility.UrlEncode(p))
                             .Replace("#jquery#", "1111009980190638452" + random.Next(10, 99))
                             .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                             .Replace("#t#", DateHelper.ConvertDateTime2Long12(DateTime.Now).ToString())
                             .Replace("#cache_time#", "300");;
            JObject jo = null;

            try
            {
                jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JArray>());
                return(json);
            }
            catch (Exception ex)
            {
                if (jo != null)
                {
                    return(APILib.Iced(jo));
                }

                LogHelper.LogInfo(referer + "\n" + url + "\n" + "return json is null");
                LogHelper.LogError("BattleSummaryInfo", ex);
                return(APILib.Error("接口 BattleSummaryInfo 调用错误"));
            }
        }
Ejemplo n.º 6
0
 public static JObject CallRemoteAPI(string url)
 {
     try
     {
         JObject    result     = new JObject();
         HttpClient httpClient = new HttpClient();
         httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
         HttpResponseMessage response = httpClient.GetAsync(url).Result;
         if (response.IsSuccessStatusCode)
         {
             result = response.Content.ReadAsAsync <JObject>().Result;
         }
         return(result);
     }
     catch (Exception ex)
     {
         return(APILib.Error(ex.Message));
     }
 }
Ejemplo n.º 7
0
        public JObject GameDetail(string auth, string qquin, string vaid, string gameid)
        {
            Random random = new Random();
            string para   = @"""area_id"":""#area_id#"",""game_id"":#game_id#"
                            .Replace("#area_id#", vaid)
                            .Replace("#game_id#", gameid)
                            .Replace(@"""", HttpUtility.UrlEncode(@""""));


            string referer = @"http://game.tgp.qq.com/lol/profile/v1602/history.shtml?qquin=#vuin#&area_id=#vaid#&game_id=#game_id#&battle_type=0&champion_id=0&cur_page=1"
                             .Replace("#vuin#", qquin)
                             .Replace("#vaid#", vaid)
                             .Replace("#game_id#", gameid);


            string url = @"http://api.pallas.tgp.qq.com/core/get_battle_info?p={#p#}&callback=jQuery#jquery#_#jqueryext#&_=#t#"
                         .Replace("#dtag#", qquin)
                         .Replace("#p#", para)
                         .Replace("#jquery#", "1111015899130702018" + random.Next(100, 999))
                         .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                         .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());
            JObject jo = null;

            try
            {
                jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JObject>());
                return(json);
            }
            catch (Exception ex)
            {
                if (jo != null)
                {
                    return(APILib.Iced(jo));
                }

                LogHelper.LogInfo(referer + "\n" + url + "\n" + "return json is null");
                LogHelper.LogError("GameDetail", ex);
                return(APILib.Error("接口 GameDetail 调用错误"));
            }
        }
Ejemplo n.º 8
0
        public JObject UserChampion(string auth, string qquin, string vaid)
        {
            string p = @"[[35,{""area_id"":""#area_id#"",""qquin"":""#qquin#""}]]"
                       .Replace("#qquin#", qquin)
                       .Replace("#area_id#", vaid);

            Random random  = new Random();
            string referer = @"http://game.tgp.qq.com/lol/profile/v1602/my_champs.shtml?nid=44&qquin=#qquin#&area_id=#area_id#"
                             .Replace("#qquin#", qquin)
                             .Replace("#area_id#", vaid);


            string url = @"http://api.pallas.tgp.qq.com/core/tcall?callback=jQuery#jquery#_#jqueryext#&p=#p#&_=#t#"
                         .Replace("#jquery#", "1111009980190638452" + random.Next(10, 99))
                         .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                         .Replace("#p#", HttpUtility.UrlEncode(p))
                         .Replace("#t#", DateHelper.ConvertDateTime2Long12(DateTime.Now).ToString())
                         .Replace("#qquin#", qquin)
                         .Replace("#area_id#", vaid);
            JObject jo = null;

            try
            {
                jo = APILib.GetJSON(referer, url, auth);
                //正常调用并返回
                JObject json = APILib.Iced(jo["data"].ToObject <JArray>());
                return(json);
            }
            catch (Exception ex)
            {
                if (jo != null)
                {
                    return(APILib.Iced(jo));
                }

                LogHelper.LogInfo(referer + "\n" + url + "\n" + "return json is null");
                LogHelper.LogError("UserChampion", ex);
                return(APILib.Error("接口 UserChampion 调用错误"));
            }
        }
Ejemplo n.º 9
0
 public static JObject CallRemoteAPI(string TOKEN, string url)
 {
     try
     {
         JObject    result     = new JObject();
         HttpClient httpClient = new HttpClient();
         httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
         httpClient.DefaultRequestHeaders.TryAddWithoutValidation("DAIWAN-API-TOKEN", TOKEN);
         httpClient.DefaultRequestHeaders.TryAddWithoutValidation("DAIWAN-API-TOKEN-ENCRYPTION", "RSA");
         HttpResponseMessage response = httpClient.GetAsync(url).Result;
         if (response.IsSuccessStatusCode)
         {
             result = response.Content.ReadAsAsync <JObject>().Result;
         }
         return(result);
     }
     catch (Exception ex)
     {
         LogHelper.LogError(ex);
         return(APILib.Error(ex.Message));
     }
 }
Ejemplo n.º 10
0
        public JObject Free(string auth)
        {
            try
            {
                string referer = @"http://game.tgp.qq.com/lol/champions/v1605/lib.shtml";
                string url     = @"http://lol.qq.com/biz/hero/free.js?t=#t#&_=#t#"
                                 .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());
                string host = "lol.qq.com";

                string jsonrawdata = APILib.GetJSONRawData(host, referer, url, auth);

                string  reg     = @"""data"":\s*({.*}),(\r\n)*\s*""";
                string  result  = CommonLib.TextHelper.MatchContent(reg, jsonrawdata, RegexOptions.Multiline, 1);
                JObject jobject = JObject.Parse(result);
                JObject json    = APILib.Iced(jobject);
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("Free", ex);
                return(APILib.Error(ex.Message));
            }
        }
Ejemplo n.º 11
0
        public JObject UserArea(string auth, string keyword)
        {
            try
            {
                string referer = @"http://game.tgp.qq.com/lol/search/v1603/search.html?kw=#kw#"
                                 .Replace("#kw#", HttpUtility.UrlEncode(keyword));

                string url = @"http://api.pallas.tgp.qq.com/core/search_player?callback=jQuery1111026891932846046984_#jqueryext#&key=#key#&_=#t#"
                             .Replace("#jqueryext#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                             .Replace("#key#", HttpUtility.UrlEncode(keyword))
                             .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());

                JArray  jarray = new JArray();
                JObject jo     = APILib.GetJSON(referer, url, auth);
                JObject json   = APILib.Iced(jo["data"].ToObject <JArray>());
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("UserArea", ex);
                return(APILib.Error(ex.Message));
            }
        }
Ejemplo n.º 12
0
 public static JObject CallRemoteAPI_Post(string TOKEN, string url, JObject postdata)
 {
     try
     {
         JObject    result     = new JObject();
         HttpClient httpClient = new HttpClient();
         httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
         httpClient.DefaultRequestHeaders.TryAddWithoutValidation("DAIWAN-API-TOKEN", TOKEN);
         // 构造POST参数
         HttpContent         postContent = new StringContent(postdata.ToString(), Encoding.UTF8);
         HttpResponseMessage response    = httpClient.PostAsJsonAsync <JObject>(url, postdata).Result;
         if (response.IsSuccessStatusCode)
         {
             result = response.Content.ReadAsAsync <JObject>().Result;
         }
         return(result);
     }
     catch (Exception ex)
     {
         LogHelper.LogError("Area", ex);
         return(APILib.Error(ex.Message));
     }
 }
Ejemplo n.º 13
0
        public JObject ChampionRank(string auth, string championid, int p)
        {
            try
            {
                string referer = @"http://game.tgp.qq.com/lol/champions/v1605/rank.shtml";
                string url     = @"http://img.lol.qq.com/js/cevRank/#championid#/#p#.js?t=#t#"
                                 .Replace("#championid#", championid)
                                 .Replace("#p#", p.ToString())
                                 .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());

                string  host        = "img.lol.qq.com";
                string  jsonrawdata = APILib.GetJSONRawData(host, referer, url, auth);
                string  reg         = @"""data"":\s*({.*}),(\r\n)*\s*""";
                string  result      = CommonLib.TextHelper.MatchContent(reg, jsonrawdata, RegexOptions.Multiline, 1);
                JObject jobject     = JObject.Parse(result);
                JObject json        = APILib.Iced(jobject);
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("ChampionRank", ex);
                return(APILib.Error(ex.Message));
            }
        }