From eb27e5fd31f73b998a4bbd85511a31e40b8c61b7 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 21 十一月 2025 17:03:47 +0800
Subject: [PATCH] 0312 关闭游戏内日志
---
Main/System/Battle/BattleManager.cs | 36 +++++++++++++++++++++++++++++-------
1 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 23bd7dc..13c35bb 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -2,6 +2,7 @@
using UnityEngine;
using LitJson;
using System;
+using System.Linq;
public class BattleManager : GameSystemManager<BattleManager>
{
@@ -146,6 +147,7 @@
{
if (!allow)
{
+ _package.socketType = ServerType.MainFight;
packQueue.Enqueue(_package);
}
}
@@ -168,6 +170,7 @@
List<GameNetPackBasic> newPackList = ParseBattlePackList(string.Empty, packQueueSnapshot);
+#if UNITY_EDITOR
Action printNewPack = () =>
{
string temp = "After AnalysisPackQueueAndDistribute newPackList count: " + newPackList.Count + "\n";
@@ -190,7 +193,7 @@
};
printNewPack();
-
+#endif
// HashSet<int> skipIndexes = new HashSet<int>();
// // 杩欓噷宸茬粡鏄寜鐓equeue鐨勯『搴忎簡
@@ -276,11 +279,11 @@
public static List<GameNetPackBasic> ParseBattlePackList(string guid, List<GameNetPackBasic> packQueueSnapshot)
{
var list = CustomHB426CombinePack.CombineToSkillPackFromList(guid, packQueueSnapshot);
- string str = "ParseBattlePackList \n";
- for (int i = 0; i < list.Count; i++)
- {
- str += " " + list[i].GetType().Name + "\n";
- }
+ // string str = "ParseBattlePackList \n";
+ // for (int i = 0; i < list.Count; i++)
+ // {
+ // str += " " + list[i].GetType().Name + "\n";
+ // }
// BattleDebug.LogError(str);
return list;
@@ -491,10 +494,17 @@
isCreate = false;
}
else
- {
+ {
BattleDebug.LogError("鎴樺満宸插瓨鍦� 鍏堣繘琛岄攢姣�");
battleField.Destroy();
}
+ }
+
+ var bf = GetBattleFieldByMapID(MapID);
+ if (bf != null && !string.IsNullOrEmpty(guid))
+ {
+ BattleDebug.LogError("鐩稿悓鍦板浘ID鐨勬垬鍦哄凡瀛樺湪 鍏堣繘琛岄攢姣�");
+ bf.Destroy();
}
if (isCreate)
@@ -652,4 +662,16 @@
}
return null;
}
+
+ public void DestroyAllBattleField()
+ {
+ var battleFieldsList = battleFields.Values.ToList();
+ foreach (var battleField in battleFieldsList)
+ {
+ if (battleField == null)
+ continue;
+ battleField.Destroy();
+ }
+ }
+
}
\ No newline at end of file
--
Gitblit v1.8.0