From d7a89759df90fcad6c5553c2227baf73ea9154cf Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 10 七月 2026 16:50:56 +0800
Subject: [PATCH] 129 【战斗】战斗系统- 请求分解汇总成一个包发送,避免瞬间发包太多被踢

---
 Main/System/Main/AutoFightModel.cs |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/Main/System/Main/AutoFightModel.cs b/Main/System/Main/AutoFightModel.cs
index acaf4e3..7e7b97f 100644
--- a/Main/System/Main/AutoFightModel.cs
+++ b/Main/System/Main/AutoFightModel.cs
@@ -373,6 +373,14 @@
         ChangeAutoEvent?.Invoke();
     }
 
+    //鏀堕泦瑕佸垎瑙g殑瑁呭锛屼竴娆℃�у彂閫�
+    public List<ushort> decompEquipOPList = new List<ushort>();
+    bool openCollectEquipForDeCom = false;
+
+    public void SetCollectEquipForDeComState(bool isOpen)
+    {
+        openCollectEquipForDeCom = isOpen;
+    }
 
     //鑷姩澶勭悊瑁呭锛岄渶瑕佺瓑寰呯┛鎴磋繑鍥瀎alse锛屽叾浠栨儏鍐佃繑鍥瀟rue
     public bool TryAutoFightDoEquip(ItemModel item)
@@ -387,7 +395,18 @@
 
         if (showFightPower <= 0)
         {
-            EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1);
+            if (openCollectEquipForDeCom)
+            {
+                //鎵撳紑閲囬泦锛屽悗缁竴娆℃�у垎瑙�
+                ushort dropIndex = (ushort)item.gridIndex;
+                if (!decompEquipOPList.Contains(dropIndex))
+                    decompEquipOPList.Add((ushort)item.gridIndex);
+            }
+            else
+            {
+                //鍗曟鍒嗚В
+                EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1);
+            }
             return true;
         }
         else

--
Gitblit v1.8.0