Ver código fonte

【优化】战报日志只输出一条,避免日志log过多,刷屏

johnclot69 1 ano atrás
pai
commit
d7c429b80a

+ 12 - 4
Common/CommonAI/Zone/EventTrigger/EventAdapter.cs

@@ -364,13 +364,21 @@ namespace CommonAI.Zone.EventTrigger
 				int timeUse = System.Environment.TickCount - startTick + checkTimeUse;
 				bool needNotice = JSGServerProfile.RecordTrigger(this.ZoneAPI, this.Name, timeUse, true);
 
-				if (GlobalData.GAME_BS_TEST) //内部测试标记开放了
+				if (!"单位受到伤害,发送战报".Equals(this.Name) || GlobalData.BattleReportEventLogCnt == 0)
 				{
-					log.Warn("--事件: " + this.ZoneAPI.UUID + ", " + this.ZoneAPI.GetSceneID() + ", act:" + this.Name);
+					if (GlobalData.GAME_BS_TEST) //内部测试标记开放了
+					{
+						log.Warn("--事件: " + this.ZoneAPI.UUID + ", " + this.ZoneAPI.GetSceneID() + ", act:" + this.Name);
+					}
+					else if(needNotice)
+					{
+						log.Debug("--事件: " + this.ZoneAPI.UUID + ", " + this.ZoneAPI.GetSceneID() + ", act:" + this.Name);
+					}
 				}
-				else if(needNotice)
+				
+				if ("单位受到伤害,发送战报".Equals(this.Name))
 				{
-					log.Debug("--事件: " + this.ZoneAPI.UUID + ", " + this.ZoneAPI.GetSceneID() + ", act:" + this.Name);
+					GlobalData.BattleReportEventLogCnt += 1;
 				}
 #endif
 			}

+ 2 - 0
Common/CommonAI/data/ComData.cs

@@ -281,6 +281,8 @@ namespace CommonAI.Data
 
 		//测试配置
 		public static bool GAME_BS_TEST = false;
+		//战报日志输出计数,只输出一条日志: 单位受到伤害,发送战报
+		public static int BattleReportEventLogCnt = 0;
 	}
 
 	public class GSCreateAreaData