Example #1
0
        private void SaveLog()
        {
            if (!NeedToSave)
            {
                return;
            }
            NeedToSave = false;
            if (AnalysisType == AnalysisTypeEnum.Unknown)
            {
                return;
            }
            if (AnalysisType == AnalysisTypeEnum.LogFile)
            {
                MessageBox.Show("Saving saved log is retarded");
                return;
            }
            var header = new LogHeader {
                Region = Version.ToString()
            };
            PacketLogWriter writer = new PacketLogWriter(string.Format("{0}.TeraLog", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss_" + Version, CultureInfo.InvariantCulture)), header);

            foreach (var message in OpcodeFinder.Instance.AllPackets)
            {
                writer.Append(message.Value);
            }
            writer.Dispose();
            MessageBox.Show("Saved");
        }
Example #2
0
        public void Stop(GameProxy[] proxies)
        {
            foreach (var proxy in proxies)
            {
                proxy.Processor.RemoveRawHandler(PacketLogHandler);
            }

            _writer.Dispose();

            _log.Basic("Packet logger plugin stopped");
        }
Example #3
0
        private void SaveToTmpFile(string version, Queue <Message> packetsCopyStorage, string filename)
        {
            var header = new LogHeader {
                Region = version
            };
            PacketLogWriter writer = new PacketLogWriter(filename, header);

            foreach (var message in packetsCopyStorage)
            {
                ParsedMessage parsedMessage = PacketProcessor.Instance.MessageFactory.Create(message);
                parsedMessage = WipeoutSensitiveData(parsedMessage);
                writer.Append(message);
            }
            writer.Dispose();
        }
Example #4
0
        public void Stop()
        {
            _writer.Dispose();

            _log.Basic("Packet logger plugin stopped");
        }
Example #5
0
 public void DisableLogging()
 {
     logWriter.Dispose();
     logWriter = null;
 }