diff --git a/Another-Mirai-Native/ConfigHelper.cs b/Another-Mirai-Native/ConfigHelper.cs index 344e687..24069a8 100644 --- a/Another-Mirai-Native/ConfigHelper.cs +++ b/Another-Mirai-Native/ConfigHelper.cs @@ -36,6 +36,8 @@ public static T GetConfig(string sectionName) return (T)(object)""; if (typeof(T) == typeof(int)) return (T)(object)0; + if (typeof(T) == typeof(long)) + return default; if (typeof(T) == typeof(bool)) return (T)(object)false; if (typeof(T) == typeof(object)) diff --git a/CQP/Clinet.cs b/CQP/Clinet.cs index 966e307..cca8016 100644 --- a/CQP/Clinet.cs +++ b/CQP/Clinet.cs @@ -26,7 +26,7 @@ public Clinet() Instance = this; Directory.CreateDirectory("logs/cqp"); File.AppendAllLines("logs/cqp/log.txt", new string[] { $"[{DateTime.Now:G}] CQP Client Started" }); - ServerConnection = new($"ws://localhost:{ConfigHelper.GetConfig("Ws_ServerPort")}/amn"); + ServerConnection = new($"ws://127.0.0.1:{ConfigHelper.GetConfig("Ws_ServerPort")}/amn"); ServerConnection.OnOpen += ServerConnection_OnOpen; ServerConnection.OnMessage += ServerConnection_OnMessage; ServerConnection.OnClose += ServerConnection_OnClose; @@ -83,7 +83,7 @@ public ApiResult Send(WsServerFunction type, object data, bool queue = true) { if (timoutCount > timoutCountMax) { - queueObject.result = "{\"data\": \"\"callResult\": null\"}"; + queueObject.result = "{\"data\": \"\\\"callResult\\\": null\"}"; } Thread.Sleep(10); timoutCount++; diff --git a/CQP/ConfigHelper.cs b/CQP/ConfigHelper.cs index ea82649..3467167 100644 --- a/CQP/ConfigHelper.cs +++ b/CQP/ConfigHelper.cs @@ -36,6 +36,8 @@ public static T GetConfig(string sectionName) return (T)(object)""; if (typeof(T) == typeof(int)) return (T)(object)0; + if (typeof(T) == typeof(long)) + return default; if (typeof(T) == typeof(bool)) return (T)(object)false; if (typeof(T) == typeof(object))