RatAttack: changed RATSIGNAL separator from | to \x02

Apparently `|` are valid in CMDR names. So now we’re using a proper separator character instead.
This commit is contained in:
alterNERDtive 2020-12-19 13:26:04 +01:00
parent a9a1a84aa7
commit 6f51333bd4

View file

@ -55,6 +55,7 @@ namespace RatAttack
{ {
public string Signal { get; set; } public string Signal { get; set; }
public bool Announce { get; set; } public bool Announce { get; set; }
private readonly char separator = '\x02';
public Ratsignal() public Ratsignal()
=> (Signal, Announce) = ("", false); => (Signal, Announce) = ("", false);
@ -66,7 +67,7 @@ namespace RatAttack
{ {
try try
{ {
string[] parts = serialization.Split('|'); string[] parts = serialization.Split(separator);
Signal = parts[0]; Signal = parts[0];
Announce = Boolean.Parse(parts[1]); Announce = Boolean.Parse(parts[1]);
} }
@ -77,7 +78,7 @@ namespace RatAttack
} }
public override string ToString() public override string ToString()
=> $"{Signal}|{Announce}"; => $"{Signal}{separator}{Announce}";
} }
private static int ParseRatsignal(string ratsignal) private static int ParseRatsignal(string ratsignal)