diff --git a/Application/RCon/RConConnection.cs b/Application/RCon/RConConnection.cs index 3520d79c1..ad91246ae 100644 --- a/Application/RCon/RConConnection.cs +++ b/Application/RCon/RConConnection.cs @@ -219,7 +219,7 @@ namespace IW4MAdmin.Application.RCon else { - splitStatusStrings.Add(responseString.Replace(config.CommandPrefixes.RConResponse, "")); + splitStatusStrings.Add(responseString.Replace(config.CommandPrefixes.RConResponse, "").TrimEnd('\0')); } } diff --git a/SharedLibraryCore/Utilities.cs b/SharedLibraryCore/Utilities.cs index a0eb98904..69e7bd96b 100644 --- a/SharedLibraryCore/Utilities.cs +++ b/SharedLibraryCore/Utilities.cs @@ -669,10 +669,10 @@ namespace SharedLibraryCore Dictionary dict = null; - if (values.Length % 2 == 0 && values.Length > 1) + if (values.Length > 1) { dict = new Dictionary(); - for (int i = 0; i < values.Length; i += 2) + for (int i = values.Length % 2 == 0 ? 0 : 1; i < values.Length; i += 2) { dict.Add(values[i], values[i + 1]); } @@ -754,7 +754,9 @@ namespace SharedLibraryCore } var response = await server.RemoteConnection.SendQueryAsync(RCon.StaticHelpers.QueryType.GET_INFO); - string combinedResponse = string.Join('\\', response.Where(r => r.Length > 0 && r[0] == '\\')); + string combinedResponse = response.Length > 1 ? + string.Join('\\', response.Where(r => r.Length > 0 && r[0] == '\\')) : + response[0]; return combinedResponse.DictionaryFromKeyValue(); }