RatAttack: fixed language string parsing for numbers

This commit is contained in:
alterNERDtive 2021-03-10 19:57:37 +01:00
parent 26dd98f050
commit 71615e366c
2 changed files with 6 additions and 1 deletions

View file

@ -2,6 +2,11 @@
## RatAttack 6.2.1
### Fixed
* Fixed RATSIGNAL parsing for language strings that contain numbers (e.g.
“es-419”).
### Changed
* Removed the TTS prompt and logging from incoming invalid RATSIGNALs by

View file

@ -18,7 +18,7 @@ namespace RatAttack
private static alterNERDtive.util.PipeServer<Ratsignal>? ratsignalPipe;
private static readonly Regex RatsignalRegex = new Regex(
@"^RATSIGNAL - CMDR (?<cmdr>.+) - Reported System: (None|unknown system|""(?<system>.+)""(\x0314)? \((?<systemInfo>([a-zA-Z0-9\s\(\)\-~]*([0-9,\.]+ LY (""[a-zA-Z\-]+"" of|from) [a-zA-Z0-9\s\*]+)?|Not found in galaxy database|Invalid system name))\)(\x03)?(?<permit> \x037\(((?<permitName>.*) )?Permit Required\)\x03)?) - Platform: \x03(6|3|12)(?<platform>(PC|Xbox|Playstation))\x03 - O2: (\x034)?(?<oxygen>(NOT )?OK)\x03? - Language: (?<language>[a-zA-z\x7f-\xff\-\(\)\s]+)( - IRC Nick (?<nick>[a-zA-Z0-9_\[\]\-]+))? \(\x02Case #(?<number>\d+)\x02\) \((PC|XB|PS)_SIGNAL\)\v*$"
@"^RATSIGNAL - CMDR (?<cmdr>.+) - Reported System: (None|unknown system|""(?<system>.+)""(\x0314)? \((?<systemInfo>([a-zA-Z0-9\s\(\)\-~]*([0-9,\.]+ LY (""[a-zA-Z\-]+"" of|from) [a-zA-Z0-9\s\*]+)?|Not found in galaxy database|Invalid system name))\)(\x03)?(?<permit> \x037\(((?<permitName>.*) )?Permit Required\)\x03)?) - Platform: \x03(6|3|12)(?<platform>(PC|Xbox|Playstation))\x03 - O2: (\x034)?(?<oxygen>(NOT )?OK)\x03? - Language: (?<language>[a-zA-z0-9\x7f-\xff\-\(\)\s]+)( - IRC Nick (?<nick>[a-zA-Z0-9_\[\]\-]+))? \(\x02Case #(?<number>\d+)\x02\) \((PC|XB|PS)_SIGNAL\)\v*$"
);
private static VoiceAttackLog Log