public static void Extract(string dir, string outFile) { using (writer = new IndentTextWriter(outFile)) { GenericLogParser.ParseDir(SniffitztLogConverter.Extract, dir, ExtractVehicleIds); } }
public static void Extract(string dir, string outFile) { using (writer = new IndentTextWriter(outFile)) { GenericLogParser.ParseDir(SniffitztLogConverter.Extract, dir, new LogHandler(opcode => opcode == RealmServerOpCode.SMSG_INITIALIZE_FACTIONS, HandleInitFactions), new LogHandler(opcode => opcode == RealmServerOpCode.SMSG_SET_FACTION_STANDING, UpdateReputations), new LogHandler(opcode => opcode == RealmServerOpCode.SMSG_TRAINER_LIST, HandleTrainerList), new LogHandler(HandleUpdates) ); } }
protected override void OnLoad() { if (m_selectedDir == null) { m_selectedDir = new DirectoryInfo(ToolConfig.PAToolDefaultDir); } else { m_selectedDir = new DirectoryInfo(SelectedDirPath); } m_selectedDir.MKDirs(); if (OutputFilePath == null) { OutputFilePath = ToolConfig.PAToolDefaultOutputFile; } if (OpCodeExcAndFilters == null) { OpCodeExcAndFilters = new List <string>(); } if (OpCodeExcOrFilters == null) { OpCodeExcOrFilters = new List <string>(); } if (OpCodeIncAndFilters == null) { OpCodeIncAndFilters = new List <string>(); } if (OpCodeIncOrFilters == null) { OpCodeIncOrFilters = new List <string>(); } if (SelectedFiles == null) { SelectedFiles = new List <FileInfo>(); } foreach (var file in SelectedFiles.ToArray().Where(file => !file.Exists)) { SelectedFiles.Remove(file); } m_parser = new GenericLogParser(m_LogParseHandler, new LogHandler(DefaultOpCodeValidator, HandlePackets, HandleUpdatePackets)); //if (needsSave) //{ // Save(); //} }
static void Main(string[] args) { // Parse all files in the dir "/logs" using the KSniffer-log-format and // hand all SMSG_GAMEOBJECT_QUERY_RESPONSE packets to the HandleGOQueryPackets - method GenericLogParser.ParseDir(KSnifferLogConverter.ExtractSingleLine, "/logs", opcode => opcode == RealmServerOpCode.SMSG_GAMEOBJECT_QUERY_RESPONSE, HandleGOQueryPackets); // Parse all files in the dir "/logs" using the KSniffer-log-format (with all of a packet's content in a single line) and // hand all Quest-related packets to the HandleQuestPackets - method GenericLogParser.ParseDir(KSnifferLogConverter.ExtractSingleLine, "/logs", opcode => opcode.ToString().Contains("QUEST"), HandleQuestPackets); // Parse all files in the dir "/logs" using the Sniffitzt-log-format and // hand all Update-packets to the HandleUpdatePackets - method // NOTE: Update packets are different from all other kinds of packets and therefore get special treatment GenericLogParser.ParseDir(SniffitztLogConverter.Extract, "/logs", HandleUpdatePackets); }