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]));
 }
示例#2
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]));
 }
示例#3
0
 public PacketLogWriter(string filename, LogHeader header)
     : this(new FileStream(filename, FileMode.CreateNew, FileAccess.Write, FileShare.Read), true, header)
 {
 }
示例#4
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();
 }
示例#6
0
 internal PacketLogReader(Stream stream)
 {
     _stream = stream;
     Header  = new LogHeader();
     ReadHeader();
 }
示例#7
0
 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);
         });
 }