From c783fee21bb40e1ada1c0375897b326dbf9c0ddd Mon Sep 17 00:00:00 2001 From: nxiaoxiao <3247747442@qq.com> Date: Wed, 14 Aug 2024 20:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0pingpong=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E8=B0=83=E6=95=B4=E6=94=B6=E5=88=B0=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E4=BF=A1=E6=81=AF=E7=9A=84=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Instructs/Instruct.cs | 3 ++- MapServer.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Instructs/Instruct.cs b/Instructs/Instruct.cs index bd5997a..c37ec24 100644 --- a/Instructs/Instruct.cs +++ b/Instructs/Instruct.cs @@ -52,6 +52,7 @@ namespace OMS.NET.Instructs "get_presence" => JsonSerializer.Deserialize(root.GetRawText(), options), "get_mapData" => JsonSerializer.Deserialize(root.GetRawText(), options), "get_mapLayer" => JsonSerializer.Deserialize(root.GetRawText(), options), + "ping" => JsonSerializer.Deserialize(root.GetRawText(), options), //广播指令 "broadcast" => classValue switch @@ -61,7 +62,7 @@ namespace OMS.NET.Instructs _ => JsonSerializer.Deserialize(root.GetRawText(), options) }, _ => null - } ?? throw new JsonException("反序列化失败"); + } ?? throw new JsonException($"{typeValue} 反序列化失败"); return instruct; } else diff --git a/MapServer.cs b/MapServer.cs index 2731691..dac8d62 100644 --- a/MapServer.cs +++ b/MapServer.cs @@ -12,7 +12,7 @@ namespace OMS.NET private IPEndPoint iPEndPoint = new(IPAddress.Any, 0); protected override async void OnMessage(MessageEventArgs e) { - GlobalArea.Log.Info(this.ID + " " + this.Context.UserEndPoint.ToString() + ":" + e.Data); + GlobalArea.Log.Debug(this.ID + " " + this.Context.UserEndPoint.ToString() + ":" + e.Data); Instruct? instruct = Instruct.JsonStringParse(e.Data); if (instruct != null) {