diff --git a/TGS.Server/Instance/Interop.cs b/TGS.Server/Instance/Interop.cs index 3d934d4322..f24f3101f1 100644 --- a/TGS.Server/Instance/Interop.cs +++ b/TGS.Server/Instance/Interop.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Net; @@ -74,8 +75,14 @@ namespace TGS.Server List tmp = new List(); try { - foreach(var I in JsonConvert.DeserializeObject>>(json)) - tmp.Add(new ServerChatCommand(I.Key, (string)I.Value[CCPHelpText], ((int)I.Value[CCPAdminOnly]) == 1, (int)I.Value[CCPRequiredParameters])); + foreach (var I in JsonConvert.DeserializeObject>(json)) + { + var innerDick = ((JObject)I.Value).ToObject>(); + var helpText = (string)innerDick[CCPHelpText]; + var adminOnly = ((long)innerDick[CCPAdminOnly]) == 1; + var requiredParams = (int)((long)innerDick[CCPRequiredParameters]); + tmp.Add(new ServerChatCommand(I.Key, helpText, adminOnly, requiredParams)); + } ServerChatCommands = tmp; } catch { }