コード例 #1
0
        public static string DecodeAndMapJson(string wwwText)
        {
            JsonData result = new JsonData();

            try
            {
                if (wwwText.StartsWith("#"))
                {
                    using (MemoryStream memoryStream = new MemoryStream(AuthCode.DecodeWithGzip(wwwText.Substring(1), ProgrameData.sign)))
                    {
                        using (Stream stream = new GZipInputStream(memoryStream))
                        {
                            using (StreamReader streamReader = new StreamReader(stream, Encoding.Default))
                            {
                                result = JsonMapper.ToObject(streamReader);
                                return(result.ToJson());
                            }
                        }
                    }
                }
                string text2 = AuthCode.Decode(wwwText, ProgrameData.sign);

                result = JsonMapper.ToObject(text2);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            return(result.ToJson());
        }
コード例 #2
0
 /// <summary>
 /// 검열해제 패킷으로 수정
 /// </summary>
 /// <param name="body"></param>
 /// <returns></returns>
 private string ForgeUncensorMode(string body)
 {
     if (string.IsNullOrEmpty(UserData.sign))
     {
         return("");
     }
     try
     {
         log.Debug("검열해제 모드 시도 중...");
         string decodeBody = AuthCode.Decode(body, UserData.sign);
         if (string.IsNullOrEmpty(decodeBody))
         {
             return("");
         }
         JObject response = Parser.Json.ParseJObject(decodeBody);
         if (response != null && response.ContainsKey("naive_build_gun_formula"))
         {
             response["naive_build_gun_formula"] = "130:130:130:30";
             log.Debug("검열해제 모드 설정");
             return(response.ToString(Formatting.None));
         }
     }
     catch (Exception ex)
     {
         log.Error(ex);
     }
     return("");
 }
コード例 #3
0
 public static string Decode(string m, string s)
 {
     try
     {
         if (m.StartsWith("#"))
         {
             using (MemoryStream stream = new MemoryStream(AuthCode.DecodeWithGzip(m.Substring(1), s)))
             {
                 using (Stream stream2 = new GZipInputStream(stream))
                 {
                     using (StreamReader reader = new StreamReader(stream2, Encoding.UTF8))
                     {
                         return(reader.ReadToEnd());
                     }
                 }
             }
         }
         return(AuthCode.Decode(m, s));
     }
     catch (Exception e)
     {
         MessageBox.Show("Maybe Signtoken is incorrect. Check your signtoken.\n[Error Details]\n" + e.ToString(), "Decode Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(e.ToString());
     }
 }
コード例 #4
0
 /// <summary>
 /// 랜덤부관 패킷으로 수정
 /// </summary>
 /// <param name="body"></param>
 /// <param name="newBody"></param>
 /// <returns></returns>
 private string ForgeRandomAdjutant(string body)
 {
     if (string.IsNullOrEmpty(UserData.sign))
     {
         return("");
     }
     try
     {
         log.Debug("랜덤부관 시도 중...");
         string decodeBody = AuthCode.Decode(body, UserData.sign);
         if (string.IsNullOrEmpty(decodeBody))
         {
             return("");
         }
         JObject response = Parser.Json.ParseJObject(decodeBody);
         if (response != null && response.ContainsKey("user_record"))
         {
             string randomAdjutant = GameData.Doll.GetRandomAdjutant(response);
             if (!string.IsNullOrEmpty(randomAdjutant))
             {
                 log.Debug("랜덤부관 설정");
                 response["user_record"]["adjutant"] = randomAdjutant;
             }
             return(response.ToString(Formatting.None));
         }
     }
     catch (Exception ex)
     {
         log.Error(ex);
     }
     return("");
 }