From 05999b9c77f009ac9a7e98366bc3d23fbb8e83e7 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 26 四月 2026 17:46:10 +0800
Subject: [PATCH] feat: 更新数据库连接配置和机器人任务处理逻辑

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
index 571cd45..15fd6f2 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
@@ -2,6 +2,7 @@
 using System.Text;
 using System.Text.Json;
 using System.IO;
+using WIDESEAWCS_Model.Models;
 
 namespace WIDESEAWCS_Tasks.SocketServer
 {
@@ -22,8 +23,7 @@
         /// <param name="client">TCP 瀹㈡埛绔繛鎺�</param>
         /// <param name="clientId">瀹㈡埛绔敮涓�鏍囪瘑</param>
         /// <param name="cancellationToken">鍙栨秷浠ょ墝</param>
-        /// <param name="robotCrane">鏈哄櫒浜虹姸鎬�</param>
-        public async Task HandleClientAsync(TcpClient client, string clientId, CancellationToken cancellationToken, RobotSocketState robotCrane)
+        public async Task HandleClientAsync(TcpClient client, string clientId, CancellationToken cancellationToken)
         {
             using (client)
             using (NetworkStream networkStream = client.GetStream())
@@ -59,6 +59,16 @@
                             break;
                         }
 
+                        // 鎸夊鎴风鍘婚噸锛氭鏌ユ槸鍚︿笌璇ュ鎴风涓婃娑堟伅鐩稿悓
+                        //lock (_syncRoot)
+                        //{
+                        //    if (_clientLastMessage.TryGetValue(clientId, out var prev) && message == prev)
+                        //    {
+                        //        continue;
+                        //    }
+                        //    _clientLastMessage[clientId] = message;
+                        //}
+
                         // 鏇存柊瀹㈡埛绔姸鎬�
                         UpdateClientStatus(clientId, message);
 
@@ -77,7 +87,7 @@
                             {
                                 // 鍒ゆ柇鏄惁涓� JSON 鏍煎紡
                                 bool isJsonFormat = TryParseJsonSilent(message);
-                                _ = MessageReceived.Invoke(message, isJsonFormat, client, robotCrane);
+                                _ = MessageReceived.Invoke(message, isJsonFormat, client);
                             }
                             catch { }
                         }

--
Gitblit v1.9.3