internal async Task StartLogReader() { _powerLog.Clear(); _gameState = GameState.InMenu; FoundLog = false; if (string.IsNullOrEmpty(HearthstoneDir)) { HearthstoneDir = await Util.GetHearthstoneDir(); } var readerInfo = new LogReaderInfo() { StartsWithFilters = new[] { "GameState." }, FilePath = Path.Combine(HearthstoneDir, "Logs", "Power.log"), Name = "Power" }; _logWatcher = new LogWatcher(readerInfo, 500); _logWatcher.OnNewLine += OnLogWatcherOnOnNewLine; _logWatcher.OnLogFound += LogWatcherOnOnLogFound; var entry = _logWatcher.FindEntryPoint("tag=GOLD_REWARD_STATE", "End Spectator"); _logWatcher.Start(entry); }
public LogWatcher(LogReaderInfo info, int readDelay = 100) { _info = info; _readDelay = readDelay; }