RatAttack: made case list thread safe

My specific setup leads to lots of incoming cases at once when starting VA after boot, when the IRC backlog is parsed.

Probably not relevant in the wild, but still a huge 🤦.
This commit is contained in:
alterNERDtive 2022-06-03 16:45:12 +02:00
parent 6ec8d7c35e
commit bb8d1067b5
4 changed files with 12 additions and 5 deletions

View file

@ -6,6 +6,13 @@
variables (`~<name>`) not working as intended. This was introduced in
refactoring work that was done for 4.4.
## RatAttack 6.3.2
### Fixed
* Made case list thread safe. Probably only ever impacted my own specific setup,
but still a huge 🤦.
-----
# 4.4 (2022-05-31)

View file

@ -1 +1 @@
4.4
4.4.1

View file

@ -20,7 +20,7 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Text.RegularExpressions;
@ -33,7 +33,7 @@ namespace RatAttack
/// </summary>
public class RatAttack
{
private static readonly Version VERSION = new ("6.3.1");
private static readonly Version VERSION = new ("6.3.2");
private static readonly Regex RatsignalRegex = new (
@"^RATSIGNAL Case #(?<number>\d+) (?<platform>(PC|Xbox|Playstation))(?<oxygen> \(Code Red\))?(?<odyssey> \(Odyssey\))? CMDR (?<cmdr>.+) System: (None|u\u200bnknown system|""(?<system>.+)"" \((?<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_\[\]\-]+))? \((PC|XB|PS)_SIGNAL\)\v*$");
@ -42,7 +42,7 @@ namespace RatAttack
private static VoiceAttackLog? log;
private static VoiceAttackCommands? commands;
private static Dictionary<int, RatCase> CaseList { get; } = new ();
private static ConcurrentDictionary<int, RatCase> CaseList { get; } = new ();
private static dynamic? VA { get; set; }

View file

@ -39,7 +39,7 @@ namespace alterNERDtive
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "F off :)")]
public class BasePlugin
{
private static readonly Version VERSION = new ("4.4");
private static readonly Version VERSION = new ("4.4.1-dev");
private static readonly Dictionary<Guid, string> Profiles = new ()
{