Skip to content

Commit

Permalink
杂项
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellobaka committed Aug 17, 2022
1 parent bbe79eb commit 5f4462b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Another-Mirai-Native/ConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public static T GetConfig<T>(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))
Expand Down
4 changes: 2 additions & 2 deletions CQP/Clinet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>("Ws_ServerPort")}/amn");
ServerConnection = new($"ws://127.0.0.1:{ConfigHelper.GetConfig<int>("Ws_ServerPort")}/amn");
ServerConnection.OnOpen += ServerConnection_OnOpen;
ServerConnection.OnMessage += ServerConnection_OnMessage;
ServerConnection.OnClose += ServerConnection_OnClose;
Expand Down Expand Up @@ -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++;
Expand Down
2 changes: 2 additions & 0 deletions CQP/ConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public static T GetConfig<T>(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))
Expand Down

0 comments on commit 5f4462b

Please sign in to comment.