/// <summary> /// 同一カテゴリのキーワードをまとめて生成する /// </summary> /// <param name="keywords">キーワード</param> /// <param name="category">カテゴリ</param> /// <returns>生成したキーワードオブジェクト</returns> public static AnalyzeKeyword[] CreateKeywords( string[] keywords, KewordTypes category) { var list = new List <AnalyzeKeyword>(); foreach (var k in keywords) { list.Add(new AnalyzeKeyword() { Keyword = k, Category = category }); } return(list.ToArray()); }
/// <summary> /// ネットワークログを格納する /// </summary> /// <param name="logInfo">ログ情報</param> /// <param name="keywordType">キーワードのタイプ</param> private void StoreNewwork( LogLineEventArgs logInfo, KewordTypes keywordType) { var log = default(CombatLog); var targetLogLine = logInfo.logLine.Substring(15); var match = keywordType == KewordTypes.NetworkAbility ? ConstantKeywords.NetworkAbility.Match(targetLogLine) : ConstantKeywords.NetworkAOEAbility.Match(targetLogLine); if (match.Success) { var actorID = match.Groups["id"].ToString(); var victimID = match.Groups["victim_id"].ToString(); var actor = match.Groups["actor"].ToString(); var action = match.Groups["skill"].ToString(); var victim = match.Groups["victim"].ToString(); var victimJobName = this.ToNameToJob(victim); if (IgnoreNewworkActions.Any(x => string.Equals(x, action, StringComparison.OrdinalIgnoreCase))) { return; } var raw = logInfo.logLine.Substring(0, 15) + match.Value; raw = raw .Replace(actorID, ActorIDPlaceholder) .Replace(victimID, PCIDPlaceholder); if (!string.IsNullOrEmpty(victim)) { raw = raw.Replace(victim, victimJobName); } log = new CombatLog() { TimeStamp = logInfo.detectedTime, Raw = raw, Actor = actor, Skill = action, Activity = keywordType == KewordTypes.NetworkAbility ? $"{action} Sign" : $"{action} Sign-AOE", LogType = keywordType == KewordTypes.NetworkAbility ? LogTypes.NetworkAbility : LogTypes.NetworkAOEAbility, }; if (!this.ToStoreActor(log.Actor)) { return; } } if (log != null) { if (this.CurrentCombatLogList.Any(x => Math.Abs((x.TimeStamp - log.TimeStamp).TotalSeconds) <= 1.0 && x.RawWithoutTimestamp == log.RawWithoutTimestamp)) { return; } log.Text = log.Activity; log.SyncKeyword = log.RawWithoutTimestamp; this.StoreLog(log); } }