示例#1
0
        public string GenerateErrorLog(Main.Session s, string exception)
        {
            Privacy.Remove(s);
            var version = string.Join(".", Application.ProductVersion.Split('.').Take(2));
            var api     = CompressApi(string.Join("\r\n", s.Lines));
            var result  = $"{{{{{{\r\n{DateTime.Now:g} {version}\r\n{exception}\r\n{api}\r\n}}}}}}";

            File.WriteAllText("error.log", result);
            return(result);
        }
示例#2
0
        private void ProcessRequest(HttpProxy.Session session)
        {
            var url = session.Request.PathAndQuery;

            if (!url.Contains("kcsapi/"))
            {
                return;
            }
            var s = new Session(url, session.Request.BodyAsString, session.Response.BodyAsString);

            Privacy.Remove(s);
            if (s.Response == null || !s.Response.StartsWith("svdata="))
            {
                WriteDebugLog(s);
                return;
            }
            s.Response = UnEscapeString(s.Response.Remove(0, "svdata=".Length));
            WriteDebugLog(s);
            ProcessRequestMain(s);
        }
示例#3
0
        public string GenerateBattleErrorLog()
        {
            foreach (var s in _battleApiLog)
            {
                Privacy.Remove(s);
            }
            var version = string.Join(".", Application.ProductVersion.Split('.').Take(2));
            var api     = CompressApi(string.Join("\r\n",
                                                  new[] { BattleStartSlots() }.Concat(_battleApiLog.SelectMany(s => s.Lines))));
            var rank   = _sniffer.Battle.DisplayedResultRank;
            var status = string.Join("\r\n", new[]
            {
                rank.IsError ? $"{rank.Assumed}->{rank.Actual}" : "",
                HpDiffLog()
            }.Where(s => !string.IsNullOrEmpty(s)));
            var result = $"{{{{{{\r\n{DateTime.Now:g} {version}\r\n{status}\r\n{api}\r\n}}}}}}";

            File.WriteAllText("error.log", result);
            return(result);
        }