void WurmTimerDescriptors_RemovedCustomTimer(object sender, WurmTimerDescriptors.RemovedTimerEventArgs e) { foreach (var timergroup in TimerGroups) { timergroup.RemoveDeletedCustomTimer(e.NameID); } }
//happens before Initialize public void ApplyCustomTimerOptions(WurmTimerDescriptors.CustomTimerOptions options) { Options = options; }
void ProcessLinesForCooldownTriggers(List<string> lines, WurmTimerDescriptors.CustomTimerOptions.Condition condition, bool liveLogs) { foreach (string line in lines) { RegexOptions opt = new RegexOptions(); if (!Options.IsRegex) opt = RegexOptions.IgnoreCase; if (Regex.IsMatch(line, condition.RegexPattern, opt)) { if (liveLogs) { TriggerCooldown(DateTime.Now); } else { DateTime startDate; if (Aldurcraft.WurmOnline.WurmLogsManager.Searcher.WurmLogSearcherAPI.TryParseDateTimeFromSearchResultLine(line, out startDate)) { TriggerCooldown(startDate); } else Logger.LogInfo("parse error, custom timer ID: " + this.TimerID + "; Line: " + line, this); } } } }