public bool CrashReport(Exception e) { if (this == Clients.NoClient) { return(false); } if (e is ThreadAbortException) { return(false); } var st = new StackTrace(e, true); var frame = st.GetFrame(0); var line = frame.GetFileLineNumber(); Console.WriteLine(Strings.Repeat("=", System.Console.WindowWidth)); Console.WriteLine(ConsoleColor.Red, "OpenYS Has encountered an error"); Console.WriteLine(ConsoleColor.Red, "Thus, client &e" + Username + "&c has been disconnected."); Console.WriteLine(); Console.WriteLine(Debug.GetStackTrace(e)); Console.WriteLine(Strings.Repeat("=", System.Console.WindowWidth)); //Console.WriteLine("Preparing Email."); string[] Email = Emailing.PrepareBugReportEmail(e); Emailing.SendEmail(Email[0], Email[1]); Disconnect("Crash Detected, Disconnecting due to CrashReport(e)"); return(true); }
public bool BugReport(Exception e) { if (this == Clients.NoClient) { return(false); } if (e is ThreadAbortException) { return(false); } var st = new StackTrace(e, true); var frame = st.GetFrame(0); var line = frame.GetFileLineNumber(); Console.WriteLine(Strings.Repeat("=", System.Console.WindowWidth)); Console.WriteLine(ConsoleColor.Yellow, "OpenYS Has encountered an error"); Console.WriteLine(ConsoleColor.Yellow, "Thus, clients Packet Processing has been ignored."); Console.WriteLine(); Console.WriteLine(Debug.GetStackTrace(e)); Console.WriteLine(Strings.Repeat("=", System.Console.WindowWidth)); string[] Email = Emailing.PrepareBugReportEmail(e); Emailing.SendEmail(Email[0], Email[1]); return(true); }