From 79d9bf4cba48fa17448d9762fb4c66487b55a8d1 Mon Sep 17 00:00:00 2001 From: lanyi Date: Fri, 8 Oct 2021 14:10:13 +0200 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AnotherReplayReader.csproj | 4 ++-- Replay.cs | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/AnotherReplayReader.csproj b/AnotherReplayReader.csproj index 9cc1512..3bf032b 100644 --- a/AnotherReplayReader.csproj +++ b/AnotherReplayReader.csproj @@ -15,6 +15,7 @@ true false + true publish\ true Disk @@ -30,7 +31,6 @@ false true true - true AnyCPU @@ -180,7 +180,7 @@ False - Microsoft .NET Framework 4.6.1 %28x86 和 x64%29 + Microsoft .NET Framework 4.6.1 %28x86 and x64%29 true diff --git a/Replay.cs b/Replay.cs index 65ed3ac..74f672f 100644 --- a/Replay.cs +++ b/Replay.cs @@ -309,7 +309,10 @@ namespace AnotherReplayReader var entries = null as Dictionary; try { - entries = description.Split(';').Where(x => !string.IsNullOrWhiteSpace(x)).ToDictionary(x => x.Split('=')[0], x => x.Split('=')[1]); + var query = from splitted in description.Split(';') + where !string.IsNullOrWhiteSpace(splitted) + select splitted.Split(new[] { '=' }, 2); + entries = query.ToDictionary(x => x[0], x => x[1]); } catch(Exception exception) { @@ -319,9 +322,9 @@ namespace AnotherReplayReader try { _players = entries["S"].Split(':') - .TakeWhile(x => !string.IsNullOrWhiteSpace(x) && x[0] != 'X') - .Select(x => new Player(x.Split(','))) - .ToList(); + .TakeWhile(x => !string.IsNullOrWhiteSpace(x) && x[0] != 'X') + .Select(x => new Player(x.Split(','))) + .ToList(); } catch (Exception exception) {