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); }
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); }
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); }