public void Trace(NetState state) { // We don't have data, so nothing to trace if (_first.Length == 0) { return; } try { using var sw = new StreamWriter("unhandled-packets.log", true); sw.WriteLine("Client: {0}: Unhandled packet 0x{1:X2}", state, _first[0]); sw.FormatBuffer(_first, _second, Length); sw.WriteLine(); sw.WriteLine(); } catch { // ignored } }