public PacketLogWriter(Stream stream, bool ownsStream, LogHeader header) { _stream = stream; _ownsStream = ownsStream; BlockHelper.WriteBlock(_stream, BlockType.MagicBytes, new ArraySegment<byte>(Encoding.ASCII.GetBytes("TeraConnectionLog"))); BlockHelper.WriteBlock(_stream, BlockType.Region, new ArraySegment<byte>(Encoding.UTF8.GetBytes(header.Region))); BlockHelper.WriteBlock(_stream, BlockType.Start, new ArraySegment<byte>(new byte[0])); }
public PacketLogWriter(Stream stream, bool ownsStream, LogHeader header) { _stream = stream; _ownsStream = ownsStream; BlockHelper.WriteBlock(_stream, BlockType.MagicBytes, new ArraySegment <byte>(LogHelper.Encoding.GetBytes(LogHelper.MagicBytes))); BlockHelper.WriteBlock(_stream, BlockType.Region, new ArraySegment <byte>(Encoding.UTF8.GetBytes(header.Region))); BlockHelper.WriteBlock(_stream, BlockType.Start, new ArraySegment <byte>(new byte[0])); }
public PacketLogWriter(string filename, LogHeader header) : this(new FileStream(filename, FileMode.CreateNew, FileAccess.Write, FileShare.Read), true, header) { }
internal PacketLogReader(Stream stream) { _stream = stream; Header = new LogHeader(); ReadHeader(); }
void _teraSniffer_NewConnection(Server server) { InvokeAction(() => { var header = new LogHeader { Region = server.Region }; _logWriter = new PacketLogWriter(string.Format("{0}.TeraLog", DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture)), header); ConnectionList.Items.Clear(); ConnectionList.Items.Add(string.Format("New connection to {0}started...", server.Name)); _teraData = _basicTeraData.DataForRegion(server.Region); }); }