diff --git a/plugins/RatAttack/RatAttack.cs b/plugins/RatAttack/RatAttack.cs index b872437..07ceba4 100644 --- a/plugins/RatAttack/RatAttack.cs +++ b/plugins/RatAttack/RatAttack.cs @@ -1,5 +1,5 @@ // -// Copyright 2019–2022 alterNERDtive. +// Copyright 2019–2024 alterNERDtive. // // This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous. // @@ -36,7 +36,7 @@ namespace RatAttack private static readonly Version VERSION = new ("6.4.1"); private static readonly Regex RatsignalRegex = new ( - @"^RATSIGNAL Case #(?\d+) (?(PC|Xbox|Playstation))( )?(?LEG|HOR|ODY)?(? \(Code Red\))? – CMDR (?.+) – System: (None|u\u200bnknown system|""(?.+)""(? \u26A0) \((?([a-zA-Z0-9\s\(\)\-/]*(~?[0-9,\.]+ LY (""[a-zA-Z\-]+"" of|from) [a-zA-Z0-9\s\*\-]+)?( \([a-zA-Z\s]+\))?|Not found in galaxy database|Invalid system name))\)(? \(((?.*) )?Permit Required\))?) – Language: (?[a-zA-z0-9\x7f-\xff\-\(\)&,\s\.]+)( – Nick: (?[a-zA-Z0-9_\[\]\-\^]+))? \((LEG|HOR|ODY|XB|PS)_SIGNAL\)\v*$"); + @"^RATSIGNAL Case #(?\d+) (?(PC|Xbox|Playstation))( )?(?LEG|HOR|ODY)?(? \(Code Red\))? – CMDR (?.+) – System: (None|u\u200bnknown system|""(?.+)""(? \u26a0\ufe0f)? \((?([a-zA-Z0-9\s\(\)\-/]*(~?[0-9,\.]+ LY (""[a-zA-Z\-]+"" of|from) [a-zA-Z0-9\s\*\-]+)?( \([a-zA-Z\s]+\))?|Not found in galaxy database|Invalid system name))\)(? \(((?.*) )?Permit Required\))?) – Language: (?[a-zA-z0-9\x7f-\xff\-\(\)&,\s\.]+)( – Nick: (?[a-zA-Z0-9_\[\]\-\^]+))? \((LEG|HOR|ODY|XB|PS)_SIGNAL\)\v*$"); private static PipeServer? ratsignalPipe; private static VoiceAttackLog? log; @@ -183,7 +183,7 @@ namespace RatAttack string cmdr = match.Groups["cmdr"].Value; string? language = match.Groups["language"].Value; string? system = match.Groups["system"].Value; - bool warning = match.Groups["system"].Value; + bool warning = match.Groups["system"].Success; string? systemInfo = match.Groups["systemInfo"].Value; bool permitLocked = match.Groups["permit"].Success; string? permitName = match.Groups["permitName"].Value; @@ -198,7 +198,7 @@ namespace RatAttack system = "None"; } - Log.Debug($"New rat case: CMDR “{cmdr}” in “{system}”{warning ? " ⚠️ " : string.Empty}{(!string.IsNullOrEmpty(systemInfo) ? $" ({systemInfo})" : string.Empty)} on {platform}{(!string.IsNullOrEmpty(mode) ? $" ({mode})" : string.Empty)}, permit locked: {permitLocked}{(permitLocked && !string.IsNullOrEmpty(permitName) ? $" (permit name: {permitName})" : string.Empty)}, code red: {codeRed} (#{number})."); + Log.Debug($"New rat case: CMDR “{cmdr}” in “{system}”{(warning ? " ⚠️ " : string.Empty)}{(!string.IsNullOrEmpty(systemInfo) ? $" ({systemInfo})" : string.Empty)} on {platform}{(!string.IsNullOrEmpty(mode) ? $" ({mode})" : string.Empty)}, permit locked: {permitLocked}{(permitLocked && !string.IsNullOrEmpty(permitName) ? $" (permit name: {permitName})" : string.Empty)}, code red: {codeRed} (#{number})."); CaseList[number] = new RatCase(cmdr, language, system, warning, systemInfo, permitLocked, permitName, platform, mode, codeRed, number); @@ -413,7 +413,7 @@ namespace RatAttack { public RatCase(string cmdr, string? language, string? system, bool warning, string? systemInfo, bool permitLocked, string? permitName, string platform, string mode, bool codeRed, int number) => (this.Cmdr, this.Language, this.System, this.Warning, this.SystemInfo, this.PermitLocked, this.PermitName, this.Platform, this.Mode, this.CodeRed, this.Number) - = (cmdr, language, system, warning systemInfo, permitLocked, permitName, platform, mode, codeRed, number); + = (cmdr, language, system, warning, systemInfo, permitLocked, permitName, platform, mode, codeRed, number); public string Cmdr { get; }