Skip to content

Commit

Permalink
fix: typos & stuff, correct warning glyph
Browse files Browse the repository at this point in the history
  • Loading branch information
alterNERDtive committed May 11, 2024
1 parent d4f0162 commit 8a2091d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/RatAttack/RatAttack.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RatAttack.cs" company="alterNERDtive">
// Copyright 2019–2022 alterNERDtive.
// Copyright 2019–2024 alterNERDtive.
//
// This file is part of alterNERDtive VoiceAttack profiles for Elite Dangerous.
//
Expand Down Expand Up @@ -36,7 +36,7 @@ public class RatAttack
private static readonly Version VERSION = new ("6.4.1");

private static readonly Regex RatsignalRegex = new (
@"^RATSIGNAL Case #(?<number>\d+) (?<platform>(PC|Xbox|Playstation))( )?(?<mode>LEG|HOR|ODY)?(?<oxygen> \(Code Red\))? – CMDR (?<cmdr>.+) – System: (None|u\u200bnknown system|""(?<system>.+)""(?<warning> \u26A0) \((?<systemInfo>([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> \(((?<permitName>.*) )?Permit Required\))?) – Language: (?<language>[a-zA-z0-9\x7f-\xff\-\(\)&,\s\.]+)( – Nick: (?<nick>[a-zA-Z0-9_\[\]\-\^]+))? \((LEG|HOR|ODY|XB|PS)_SIGNAL\)\v*$");
@"^RATSIGNAL Case #(?<number>\d+) (?<platform>(PC|Xbox|Playstation))( )?(?<mode>LEG|HOR|ODY)?(?<oxygen> \(Code Red\))? – CMDR (?<cmdr>.+) – System: (None|u\u200bnknown system|""(?<system>.+)""(?<warning> \u26a0\ufe0f)? \((?<systemInfo>([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> \(((?<permitName>.*) )?Permit Required\))?) – Language: (?<language>[a-zA-z0-9\x7f-\xff\-\(\)&,\s\.]+)( – Nick: (?<nick>[a-zA-Z0-9_\[\]\-\^]+))? \((LEG|HOR|ODY|XB|PS)_SIGNAL\)\v*$");

private static PipeServer<Ratsignal>? ratsignalPipe;
private static VoiceAttackLog? log;
Expand Down Expand Up @@ -183,7 +183,7 @@ private static int ParseRatsignal(string ratsignal)
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;
Expand All @@ -198,7 +198,7 @@ private static int ParseRatsignal(string ratsignal)
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);

Expand Down Expand Up @@ -413,7 +413,7 @@ private class RatCase
{
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; }

Expand Down

0 comments on commit 8a2091d

Please sign in to comment.