Browse Source

【优化】日志

meijun 3 years ago
parent
commit
ea6adf87f8

+ 1 - 1
Common/CommonAI/CommonAI.csproj

@@ -40,7 +40,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>..\..\Library\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;PATH_NO_SQRT;JSG_DMG_LOG;JSGProfile</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;PATH_NO_SQRT;JSGProfile</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>

+ 6 - 2
Common/CommonAI/Zone/Helper/HateSystem.cs

@@ -254,8 +254,12 @@ namespace CommonAI.Zone.Helper
 				if (unitList[i].Unit.IsPlayer)
 				{
 					hateInfo = hateInfo + "_" + unitList[i].Unit.PlayerUUID;
-				}				
-			}
+				}
+                else
+                {
+                    hateInfo = hateInfo + "#" + unitList[i].Unit.Info.ID;
+                }
+            }
 
 			return hateInfo;
 		}

+ 1 - 12
Common/CommonAI/Zone/Instance/InstanceUnit.API.cs

@@ -201,19 +201,8 @@ namespace CommonAI.Zone.Instance
 			int finalHP = ReduceHP(-hp, sender, source, sendHit);
 
 			//排除怪物回血
-#if JSG_DMG_LOG
-			if(this.IsPlayer)
-			{
-				int atkPropID = (source == null || source.Attack == null || source.Attack.Properties == null) ? 0 : source.Attack.Properties.GetAttackID();
-				if (atkPropID != 9999901 && (finalHP < -100000000 || finalHP > 100000000) && !(this.IsMonster && hp == this.MaxHP))
-				{
-					string stackInfo = new StackTrace().ToString();
-					log.Error("伤害异常: " + finalHP + ", ID" + this.Info.ID + ", " + (sender == null ? "-1" : sender.PlayerUUID)
-						+ JSGModule.GetAttackSourceDes(source) + ", " + stackInfo);
-				}
-			}
-#endif
 
+			JSGHackerModule.PrintDmgInfo(this, sender, source, hp, finalHP);
 			return finalHP;
 		}
 

+ 1 - 2
Common/CommonAI/Zone/Instance/InstanceUnit.cs

@@ -487,7 +487,7 @@ namespace CommonAI.Zone.Instance
             if (IsDead() && (!IsStateDead))
             {
                 changeState(new StateDead(this, this, false), true);
-                log.Warn("额外调用死亡逻辑:" + this.PlayerUUID + ", " + this.mZone.GetSceneID() + ", " + this.Info.ID);
+                log.Warn("手动调用死亡逻辑2:" + this.PlayerUUID + ", " + this.mZone.GetSceneID() + ", " + this.Info.ID);
 
                 Parent.cb_unitDeadCallBack(this, this);
                 queueEvent(new UnitDeadEvent(ID, this.ID, false, mInfo.RebirthTimeMS));
@@ -841,7 +841,6 @@ namespace CommonAI.Zone.Instance
         {
             try
             {
-                mDeadTime = Parent.PassTimeMS;
                 onDead(attacker);
                 Parent.cb_unitDeadCallBack(this, attacker);
 

+ 3 - 2
Common/CommonAI/Zone/Instance/InstanceZone.cs

@@ -1426,7 +1426,8 @@ namespace CommonAI.Zone.Instance
             {
                 if (obj.mProcessDeadCallbackTime > CommonLang.CUtils.localTimeMS)
                 {
-                    log.Warn("cb_unitDeadCallBack 跳过:" + obj.mProcessDeadCallbackTime + ", " + obj.Parent.GetSceneID() + ", ID:" + obj.Info.ID + ", " + obj.PlayerUUID);
+                    long processTime = CommonLang.TimeUtil.GetTimestampMS() - (CommonLang.CUtils.localTimeMS - (obj.mProcessDeadCallbackTime - 60000));
+                    log.Warn("cb_unitDeadCallBack 跳过:" + processTime + ", " + obj.Parent.GetSceneID() + ", ID:" + obj.Info.ID + ", UID:" + obj.PlayerUUID);
                     return;
                 }
 
@@ -1446,7 +1447,7 @@ namespace CommonAI.Zone.Instance
                         (attacker == null ? -1 : attacker.Info.ID) + ", UUID" + (attacker == null ? "null" : attacker.PlayerUUID) + ", " + obj.mProcessDeadCallbackTime);
                 }
                 obj.mProcessDeadCallbackTime = CommonLang.CUtils.localTimeMS + 60000;
-                obj.mDeadTime = CommonLang.CUtils.localTimeMS;
+                obj.mDeadTime = this.PassTimeMS;
 
                 statisticForceDead(obj);
                 LastHittedUnit = obj;

+ 40 - 17
Common/CommonAI/ZoneServer/JSGModule/JSGHackerModule.cs

@@ -7,6 +7,7 @@ using CommonLang.Log;
 using CommonLang.Vector;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using static CommonAI.ZoneClient.ClientStruct;
@@ -14,27 +15,49 @@ using static CommonAI.ZoneClient.ClientStruct;
 
 namespace CommonAI.ZoneServer.JSGModule
 {
-	public class JSGHackerModule
-	{
-		protected static readonly Logger log = LoggerFactory.GetLogger("JSGHackerModule");
-		public static void OnPlayerKillMonster(InstanceUnit attacker, InstanceUnit monster)
+    public class JSGHackerModule
+    {
+        protected static readonly Logger log = LoggerFactory.GetLogger("JSGHackerModule");
+        public static void OnPlayerKillMonster(InstanceUnit attacker, InstanceUnit monster)
         {
 #if JSGProfile
             try
             {
-				InstancePlayer player = (InstancePlayer)(attacker.IsPlayer ? attacker : attacker.Virtual.GetMasterUnit());
-				if (player == null)
-				{
-					log.Info("OnPlayerKillMonster player not exist:" + attacker.Parent.GetSceneID() + ", mID:" + monster.Info.ID + ", PID: "+ attacker.PlayerUUID);
-					return;
-				}
-				player.Virtual.OnPlayerKillMonster(monster);				
-			}
-			catch(Exception e)
+                InstancePlayer player = (InstancePlayer)(attacker.IsPlayer ? attacker : attacker.Virtual.GetMasterUnit());
+                if (player == null)
+                {
+                    log.Info("OnPlayerKillMonster player not exist:" + attacker.Parent.GetSceneID() + ", mID:" + monster.Info.ID + ", PID: " + attacker.PlayerUUID);
+                    return;
+                }
+                player.Virtual.OnPlayerKillMonster(monster);
+            }
+            catch (Exception e)
             {
-				log.Warn("CI OnPlayerKillMonster catch:", e);
-            }			
+                log.Warn("CI OnPlayerKillMonster catch:", e);
+            }
 #endif
-		}
-	}
+        }
+
+        public static void PrintDmgInfo(InstanceUnit unit, InstanceUnit sender, AttackSource source, int hp, int finalHP)
+        {
+#if JSGProfile
+            try
+            {
+                if (!unit.IsPlayer){ return;}
+
+                int atkPropID = (source == null || source.Attack == null || source.Attack.Properties == null) ? 0 : source.Attack.Properties.GetAttackID();
+                if (atkPropID != 9999901 && (finalHP < -100000000 || finalHP > 100000000) && !(unit.IsMonster && hp == unit.MaxHP))
+                {
+                    string stackInfo = new StackTrace().ToString();
+                    log.Error("伤害异常: " + finalHP + ", ID" + unit.Info.ID + ", " + (sender == null ? "-1" : sender.PlayerUUID)
+                        + JSGModule.GetAttackSourceDes(source) + ", " + stackInfo);
+                }
+            }
+            catch (Exception e)
+            {
+                log.Warn("JSGHackerModule PrintDmgInfo:", e);
+            }
+#endif
+        }
+    }
 }

+ 126 - 8
XmdsCommonServer/Plugin/JSGModule/JSGXmdsHackerModule.cs

@@ -1,12 +1,17 @@
-using CommonAI.Zone.Instance;
+using CommonAI.Zone.Formula;
+using CommonAI.Zone.Helper;
+using CommonAI.Zone.Instance;
+using CommonAI.ZoneServer.JSGModule;
 using CommonLang;
 using CommonLang.Log;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using XmdsCommon.Plugin;
+using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
 using static CommonAI.ZoneClient.ClientStruct;
 using static XmdsCommonServer.Plugin.XmdsVirtual;
 
@@ -14,8 +19,10 @@ namespace XmdsCommonServer.Plugin.JSGXmdsModule
 {
     public class JSGXmdsHackerModule
     {
+#if JSGProfile
         protected static readonly Logger log = LoggerFactory.GetLogger("JSGXmdsHackerModule");
 
+        /** 玩家击杀怪物 */
         public static void OnPlayerKillMonster(InstancePlayer attacker, InstanceUnit monster)
         {
             //玩家属性打印
@@ -25,15 +32,15 @@ namespace XmdsCommonServer.Plugin.JSGXmdsModule
 
             log.Info("ID:" + attacker.PlayerUUID + ", 所在场景:" + attacker.Parent.GetSceneID());
 
-            log.Info(", 当前血:" + attacker.CurrentHP + ",基础:" + oldProp.MaxAttack + ", " + oldProp.Defence + ", " + oldProp.MaxHP 
-                +  ", 攻防血" + CurProp.MaxAttack + ", " + CurProp.Defence + ", " + CurProp.MaxHP + ", 妖:" + CurProp.monsterAtk + ", " + CurProp.monsterDef 
-                + ", 妖比:" + CurProp.monsterAtkPer + ", " + CurProp.monsterDefPer) ;
+            log.Info(", 当前血:" + attacker.CurrentHP + ",基础:" + oldProp.MaxAttack + ", " + oldProp.Defence + ", " + oldProp.MaxHP
+                + ", 攻防血" + CurProp.MaxAttack + ", " + CurProp.Defence + ", " + CurProp.MaxHP + ", 妖:" + CurProp.monsterAtk + ", " + CurProp.monsterDef
+                + ", 妖比:" + CurProp.monsterAtkPer + ", " + CurProp.monsterDefPer);
 
             log.Info("扩展属性1, 增减伤:" + CurProp.AllDmgAdd + ", " + CurProp.AllDmgReduce + ", 玩家增减伤:" + CurProp.PlayerDamageAdd + ", " + CurProp.PlayerDamageReduce
-                + ", 神器伤:" + CurProp.ArtifactMainPer + ", boss伤害:" + CurProp.ToBossCritRate + ", " + CurProp.ToBossCritDamage + ", 杀意:" + CurProp.KillValuePer 
+                + ", 神器伤:" + CurProp.ArtifactMainPer + ", boss伤害:" + CurProp.ToBossCritRate + ", " + CurProp.ToBossCritDamage + ", 杀意:" + CurProp.KillValuePer
                 + ", 吸血" + CurProp.NormalAtkLeech + ", " + CurProp.ActiveAtkLeech + ", 怪伤害:" + CurProp.monsterDamageAdd + ", " + CurProp.monsterDamageReduce);
 
-            log.Info("扩展属性1, 暴击率:" + CurProp.CritRate + ", 爆伤:" + CurProp.CritDamage + ", 回血:" + CurProp.MaxHPReborn + ", 韧性:" + CurProp.CtrlTimeReduce 
+            log.Info("扩展属性1, 暴击率:" + CurProp.CritRate + ", 爆伤:" + CurProp.CritDamage + ", 回血:" + CurProp.MaxHPReborn + ", 韧性:" + CurProp.CtrlTimeReduce
                 + ", CD缩减:" + CurProp.SkillCD + ", 治疗效果:" + CurProp.HealEffect + ", " + CurProp.HealedEffect + ", 移攻速:" + CurProp.MoveSpeed + ", " + CurProp.AttackSpeed + ", 技伤:" + CurProp.SkillDamageAdd);
 
             UnitBuffStatus[] buffStatus = attacker.GetCurrentBuffStatus();
@@ -49,10 +56,10 @@ namespace XmdsCommonServer.Plugin.JSGXmdsModule
             float rate1 = oldProp.MaxAttack == 0 ? 1 : (float)(CurProp.MaxAttack) / oldProp.MaxAttack;
             float rate2 = oldProp.Defence == 0 ? 1 : CurProp.Defence / oldProp.Defence;
             float rate3 = oldProp.MaxHP == 0 ? 1 : CurProp.MaxHP / oldProp.MaxHP;
-            if(rate1 > 1.2f || rate2 > 1.2f || rate3 > 1.2f)
+            if (rate1 > 1.2f || rate2 > 1.2f || rate3 > 1.2f)
             {
                 HashMap<int, PropChangeOperation> playerProps = playerVir.GetChangePropMap();
-                foreach(PropChangeOperation chgProp in playerProps.Values)
+                foreach (PropChangeOperation chgProp in playerProps.Values)
                 {
                     log.Info("玩家变更属性:" + chgProp.ToString());
                 }
@@ -62,5 +69,116 @@ namespace XmdsCommonServer.Plugin.JSGXmdsModule
                 log.Info("无特别异常属性!");
             }
         }
+
+        /** 玩家伤害监测输出 */
+        public static void CheckAndPrintDamageLog(int damageBaseValue, XmdsVirtual attacker, XmdsVirtual hitter, AttackSource source, int damage,
+            double DefCoef, int damageReduce, int addDamage, int artifaceMainDamage)
+        {
+#if JSGProfile
+            try
+            {
+                do
+                {
+                    if (damageBaseValue > 50 && (damage <= 1 || damage > 20000))
+                    {
+                        //如果基础防御或者伤害过高,就是测试号了
+                        XmdsUnitProp attckOriginProp = attacker.GetOriginProp();
+                        if (hitter.MirrorProp.Defence > 0 && attckOriginProp.Defence /hitter.MirrorProp.Defence > 10)
+                        {
+                            break;
+                        }
+                        
+                        if(attckOriginProp.MaxAttack <= 0)
+                        {
+                            log.Warn("攻击者最大攻击属性异常:" + attacker.mUnit.Parent.GetSceneID() + ", " + attckOriginProp.MaxAttack);
+                        }
+                        else if(damage * 1.0f / attckOriginProp.MaxAttack < 2)
+                        {
+                            break;
+                        }
+
+                        XmdsSkillType FromSkillType = source == null ? XmdsSkillType.none : source.FromSkillType;
+                        XmdsVirtual.FormatLog(LoggerLevel.ERROR, "1. 伤害异常 : {0}, {1}, {2}, 实际伤害值:{3}, 防御信息:{4}, {5}, {6}", attacker.mInfo.Name, hitter.mInfo.Name,
+                            FromSkillType, damage, hitter.MirrorProp.Defence, attacker.MirrorProp.IgnoreDefense, attacker.MirrorProp.IgnoreDefensePer);
+
+                        int spellInfo = source.FromSpell == null ? 0 : source.FromSpell.ID;
+                        XmdsVirtual.FormatLog(LoggerLevel.ERROR, "2. 伤害异常 : {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}",
+                            damageBaseValue, DefCoef, damageReduce, addDamage, artifaceMainDamage, spellInfo, attacker.mUnit.PlayerUUID, hitter.mUnit.PlayerUUID);
+
+                        //XmdsVirtual.FormatLog(LoggerLevel.ERROR, "3. 伤害异常受击防御 : {0},攻击穿透:{1},防御系数:{2},杀意信息:{3},{4}",
+                        //	hitter.MirrorProp.Defence, attacker.MirrorProp.IgnoreDefensePer, GetDefenceAddition(hitter.GetStateLv()),
+                        //	hitter.MirrorProp.KillValuePer, attacker.MirrorProp.KillValuePer);
+                    }
+                } while (false);               
+            }
+            catch (Exception e)
+            {
+                log.Error("JSGXmdsHackerModule PrintDamageInfo catch: " + e);
+            }
+#endif
+        }
+
+        /** 玩家伤害监测输出 */
+        public static void PrintAttrErrorInfo(XmdsVirtual unit, UnitAttributeType Type, int value1, int value2)
+        {
+#if JSGProfile
+            try
+            {
+                bool needPrint = false;
+                switch (Type) 
+                {
+                    case UnitAttributeType.Defence:
+                        needPrint = value1 > value2 * 4;
+                        break;
+                    case UnitAttributeType.MaxHP:
+                        needPrint = value1 > value2 * 1.5;
+                        break;
+                    default:
+                        needPrint = value1 > 10000;
+                        break;
+                }
+
+                if (needPrint)
+                {
+                    string stackInfo = new StackTrace().ToString();
+                    XmdsVirtual.FormatLog(LoggerLevel.ERROR, "属性异常异常 : UID:{0}, {1}, {2}, {3}, {4}", unit.mUnit.PlayerUUID, Type, value1, value2, stackInfo);
+                }               
+            }
+            catch (Exception e)
+            {
+                XmdsVirtual.FormatLog(LoggerLevel.ERROR, "PrintAttrErrorInfo异常:" + Type + ", " + value1 + ", " + value2 + ", " + e);
+            }
+#endif
+        }
+
+        public static void CheckAndPrintDmgWarn(string flag, XmdsVirtual attacker, XmdsVirtual hitter, float sourceDmg, float finalDmg, AttackSource source)
+        {
+#if JSGProfile
+            try
+            {
+                if (source == null || source.Attack == null || source.Attack.Properties.GetAttackID() == XmdsBattleSkill.DefaultSkillScriptID)
+                {
+                    return;
+                }
+
+                int checkValue = (source != null && source.Attack != null && source.Attack.Properties.GetAttackID() / 100 == 1104)
+                    ? attacker.mUnit.CurrentHP : attacker.MirrorProp.GetFinalAttack(hitter == null ? false : hitter.mUnit.IsMonster);
+
+                if (finalDmg / sourceDmg > 5.0f || finalDmg / checkValue > 60)
+                {
+                    log.Warn(flag + ", dmg: " + (int)finalDmg + ", src: " + (int)sourceDmg + ", attackerAtk: " + attacker.MirrorProp.MaxAttack + ", "
+                        + attacker.MirrorProp.MaxMonsterAttack + ", atkHP:" + attacker.mUnit.CurrentHP
+                        + ", AttackInfo:[" + attacker.mUnit.Info.ID + ", UUID: " + attacker.mUnit.PlayerUUID
+                        + "], hitterInfo:[" + hitter.mUnit.Info.ID + ", UUID: " + hitter.mUnit.PlayerUUID + ", " + JSGModule.GetAttackSourceDes(source));
+                }
+            }
+            catch (Exception e)
+            {
+                log.Error("CheckAndPrintDmgWarn catch: ", e);
+            }
+#endif
+        }
+
+#endif
     }
 }

+ 3 - 16
XmdsCommonServer/Plugin/XmdsSkillTemplate/DamageCalculator/XmdsDamageCalculator.cs

@@ -8,6 +8,7 @@ using System;
 using System.Diagnostics;
 using XmdsCommon.Message;
 using XmdsCommon.Plugin;
+using XmdsCommonServer.Plugin.JSGXmdsModule;
 
 namespace XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator
 {
@@ -417,22 +418,6 @@ namespace XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator
 			float artifaceDmgChgFinal = GetFinalDamageValue(artifaceMainDamage);
 			int damage = CUtils.CastInt(damageBaseValue * (1.0f - DefCoef) * allDmgChgFinal * monsterDmgChgFinal * playerDmgChgFinal * artifaceDmgChgFinal * monsterAtkPer);
 
-			//异常日志输出--justsogo
-#if JSG_DMG_LOG
-			if (damageBaseValue > 50 && (damage <= 1 || damage > 30000000))
-			{
-				XmdsVirtual.FormatLog(LoggerLevel.ERROR, "----1. 伤害异常 : {0}, {1}, {2}, {3}, 防御信息:{4}, {5}, {6}", attacker.mInfo.Name, hitter.mInfo.Name,
-					FromSkillType, damage, hitter.MirrorProp.Defence, attacker.MirrorProp.IgnoreDefense, attacker.MirrorProp.IgnoreDefensePer);
-
-				int spellInfo = source.FromSpell == null ? 0 : source.FromSpell.ID;
-				XmdsVirtual.FormatLog(LoggerLevel.ERROR, "2. 伤害异常 : {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}",
-					damageBaseValue, DefCoef, damageReduce, addDamage, artifaceMainDamage, spellInfo, attacker.mUnit.PlayerUUID, hitter.mUnit.PlayerUUID);
-
-				//XmdsVirtual.FormatLog(LoggerLevel.ERROR, "3. 伤害异常受击防御 : {0},攻击穿透:{1},防御系数:{2},杀意信息:{3},{4}",
-				//	hitter.MirrorProp.Defence, attacker.MirrorProp.IgnoreDefensePer, GetDefenceAddition(hitter.GetStateLv()),
-				//	hitter.MirrorProp.KillValuePer, attacker.MirrorProp.KillValuePer);
-			}
-#endif
 			//Console.WriteLine("受击ID: " + hitter.mUnit.ID + ", " + damage);
 			if (attacker.IsPlayerUnit())
 			{
@@ -447,6 +432,8 @@ namespace XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator
 				damage = CUtils.CastInt(damage * (1 + (attacker.mUnit.Level - hitter.mUnit.Level) * BOSS_LEVEL_SUBDUE_K));
 			}
 
+			//异常日志输出监测输出
+			JSGXmdsHackerModule.CheckAndPrintDamageLog(damageBaseValue, attacker, hitter, source, damage, DefCoef, damageReduce, addDamage, artifaceMainDamage);
 			return Math.Max(damage, 1);
 		}
 

+ 6 - 25
XmdsCommonServer/Plugin/XmdsVirtual/XmdsVirtual.Event.cs

@@ -13,6 +13,7 @@ using CommonAI.Data;
 using XmdsCommonSkill.Plugin.CardSkill;
 using XmdsCommon.JSGModule.Interface;
 using CommonAI.ZoneServer.JSGModule;
+using XmdsCommonServer.Plugin.JSGXmdsModule;
 
 namespace XmdsCommonServer.Plugin
 {
@@ -1131,9 +1132,9 @@ namespace XmdsCommonServer.Plugin
                     }                   
 
                     damage = hitend.m_hit.Invoke(damage, target, this, source, ref result, damageType, hitend.m_skill, ref isEndDispatch);
-//#if JSG_DMG_LOG
-//					this.CheckAndPrintDmgWarn("DispatchHitOtherEvent", this, target, sourceDmg, damage, source);
-//#endif
+
+                    //检测伤害输出异常
+                    JSGXmdsHackerModule.CheckAndPrintDmgWarn("HitOther", this, target, sourceDmg, damage, source);
 					if (isEndDispatch)
                     {
                         break;
@@ -1143,25 +1144,6 @@ namespace XmdsCommonServer.Plugin
             return damage;
         }
 
-//		private void CheckAndPrintDmgWarn(string flag, XmdsVirtual attacker, XmdsVirtual hitter, float sourceDmg, float finalDmg, AttackSource source)
-//		{
-//			if(source == null || source.Attack == null || source.Attack.Properties.GetAttackID() == XmdsBattleSkill.DefaultSkillScriptID)
-//			{
-//				return;
-//			}
-
-//			int checkValue = (source != null && source.Attack != null && source.Attack.Properties.GetAttackID() / 100 == 1104)
-//				? attacker.mUnit.CurrentHP : attacker.MirrorProp.GetFinalAttack(hitter == null ? false : hitter.mUnit.IsMonster);
-
-//			if (finalDmg / sourceDmg > 5.0f || finalDmg / checkValue > 60)
-//			{
-//				log.Warn(flag + ", dmg: " + (int)finalDmg + ", src: " + (int)sourceDmg + ", attackerAtk: " + attacker.MirrorProp.MaxAttack + ", "
-//					+ attacker.MirrorProp.MaxMonsterAttack + ", atkHP:" + mUnit.CurrentHP
-//					+ ", AttackInfo:[" + attacker.mUnit.Info.ID + ", UUID: " + attacker.mUnit.PlayerUUID
-//					+ "], hitterInfo:[" + hitter.mUnit.Info.ID + ", UUID: " + hitter.mUnit.PlayerUUID + ", " + JSGModule.GetAttackSourceDes(source));
-//			}			
-//		}
-
 		/// <summary>
 		///受击者监听:受到伤害. 
 		/// </summary>
@@ -1199,9 +1181,8 @@ namespace XmdsCommonServer.Plugin
                     }
 
                     damage = hitend.m_hit.Invoke(damage, this, attacker, source, ref result, damageType, hitend.m_skill, ref isEndDispatch);
-//#if JSG_DMG_LOG
-//					this.CheckAndPrintDmgWarn("DispatchHitDamageEvent", attacker, this, sourceDmg, damage, source);
-//#endif
+
+                    JSGXmdsHackerModule.CheckAndPrintDmgWarn("HitDamage", attacker, this, sourceDmg, damage, source);
 					if (isEndDispatch)
                     {
                         break;

+ 7 - 41
XmdsCommonServer/Plugin/XmdsVirtual/XmdsVirtual.cs

@@ -1725,10 +1725,7 @@ namespace XmdsCommonServer.Plugin
                         this.MirrorProp.BaseDefence += opt.Value;
                     }
 					//攻击异常日志
-					if (this.MirrorProp.Defence > this.GetOriginProp().Defence * 5)
-					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.Defence, this.GetOriginProp().Defence);
-					}
+                    JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.Defence, this.GetOriginProp().Defence);
 					break;
                 case UnitAttributeType.CritRate:
                     this.MirrorProp.CritRate += opt.Value;
@@ -1744,10 +1741,7 @@ namespace XmdsCommonServer.Plugin
                     }
                     mUnit.SetMaxHP(this.MirrorProp.MaxHP, true);
 					//攻击异常日志
-					if (this.MirrorProp.MaxHP > this.GetOriginProp().MaxHP * 3)
-					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.MaxHP, this.GetOriginProp().MaxHP);
-					}
+                    JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.MaxHP, this.GetOriginProp().MaxHP);
 					break;
                 case UnitAttributeType.Attack:
                     if (opt.OpType == PropChangeOperation.OperateType.Percent)
@@ -1761,7 +1755,7 @@ namespace XmdsCommonServer.Plugin
 					//攻击异常日志
 					if (this.MirrorProp.MaxAttack > this.GetOriginProp().MaxAttack * 3)
 					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.MaxAttack, this.GetOriginProp().MaxAttack);
+                        JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.MaxAttack, this.GetOriginProp().MaxAttack);
 					}
 					break;
                 case UnitAttributeType.HealedEffect:
@@ -1773,10 +1767,7 @@ namespace XmdsCommonServer.Plugin
                 case UnitAttributeType.PlayerDamageReduce:
                     this.MirrorProp.PlayerDamageReduce += opt.Value;
 					// 免伤异常日志
-					if(this.MirrorProp.PlayerDamageReduce > 10000)
-					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.PlayerDamageReduce, opt.Value);
-					}
+                    JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.PlayerDamageReduce, opt.Value);
                     break;				
 				case UnitAttributeType.MoveSpeed:
                     this.MirrorProp.MoveSpeed += GetOpValueFloat(zup.MoveSpeed, opt.Value, opt.OpType);
@@ -1816,10 +1807,7 @@ namespace XmdsCommonServer.Plugin
                 case UnitAttributeType.PlayerDamageAdd:
                     this.MirrorProp.PlayerDamageAdd += opt.Value;
 					// 伤害增加异常日志
-					if (this.MirrorProp.PlayerDamageAdd > 10000)
-					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.PlayerDamageAdd, opt.Value);
-					}
+					JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.PlayerDamageAdd, opt.Value);
 					break;
 				case UnitAttributeType.MonsterDamageAdd:
 					this.MirrorProp.monsterDamageAdd += opt.Value;
@@ -1830,18 +1818,12 @@ namespace XmdsCommonServer.Plugin
 				case UnitAttributeType.AllDmgAdd:
 					this.MirrorProp.AllDmgAdd += opt.Value;
 					// 伤害增加异常日志
-					if (this.MirrorProp.AllDmgAdd > 10000)
-					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.AllDmgAdd, opt.Value);
-					}
+                    JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.AllDmgAdd, opt.Value);
 					break;
 				case UnitAttributeType.AllDmgReduce:
 					this.MirrorProp.AllDmgReduce += opt.Value;
 					// 伤害增加异常日志
-					if (this.MirrorProp.AllDmgReduce > 13000)
-					{
-						this.PrintAttrErrorInfo(opt.Type, this.MirrorProp.AllDmgReduce, opt.Value);
-					}
+                    JSGXmdsHackerModule.PrintAttrErrorInfo(this, opt.Type, this.MirrorProp.AllDmgReduce, opt.Value);
 					break;
 				case UnitAttributeType.SetMaxHP:
                     this.MirrorProp.BaseMaxHP = opt.Value;
@@ -1915,22 +1897,6 @@ namespace XmdsCommonServer.Plugin
             }
         }
 
-		private void PrintAttrErrorInfo(UnitAttributeType Type, int value1, int value2)
-		{
-#if JSG_DMG_LOG
-			try
-			{
-				string stackInfo = new StackTrace().ToString();
-				XmdsVirtual.FormatLog(LoggerLevel.ERROR, "属性异常异常 : UID:{0}, {1}, {2}, {3}, {4}", this.mUnit.PlayerUUID, Type, value1, value2, stackInfo);
-			}
-			catch(Exception e)
-			{
-				XmdsVirtual.FormatLog(LoggerLevel.ERROR, "PrintAttrErrorInfo异常:" + Type + ", " + value1 + ", " + value2 + ", " + e);
-			}
-#endif       
-		}
-
-
         private int GetOpValue(float UnitProp, float changeValue, PropChangeOperation.OperateType type)
         {
             float ret = 0;

+ 2 - 2
XmdsCommonServer/XmdsCommonServer.csproj

@@ -19,7 +19,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>..\Library\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;JSG_CARD_TEST_KILL;JSG_DMG_LOG</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;JSG_CARD_TEST_KILL;JSGProfile</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>
@@ -31,7 +31,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>..\Library\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;JSGProfile</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>

+ 1 - 1
XmdsServerCS/XmdsServerEdgeJS/Zone/ZoneService.cs

@@ -234,7 +234,7 @@ namespace XmdsServerEdgeJS.Zone
 				{
 					resCode = 1;
 					XmdsVirtual playerVirtual = player.BindingActor.Virtual as XmdsVirtual;
-					log.Warn("PVP状态下传送2:" + playerVirtual.mUnit.PlayerUUID + ", 场景ID: " + playerVirtual.mUnit.Parent.GetSceneID() + ", " 
+					log.Warn("PVP状态下传送2:" + playerVirtual.mUnit.PlayerUUID + ", 场景ID: " + playerVirtual.mUnit.Parent.GetSceneID() + ",hateInfo: " 
 						+ playerVirtual.GetHateSystem().GetHatePlayerInfo() + ", 触发PVP玩家:" + playerVirtual.mPvpTriggerPlayerId);
 
 				}

+ 1 - 1
XmdsServerCS/XmdsServerEdgeJS/Zone/ZoneServiceICE.cs

@@ -225,7 +225,7 @@ namespace XmdsServerEdgeJS.Zone
                     if (resCode == 1)
                     {
                         XmdsVirtual playerVirtual = player.BindingActor.Virtual as XmdsVirtual;
-                        log.Warn("PVP状态下传送1:" + playerVirtual.mUnit.PlayerUUID + ", 场景ID: " + playerVirtual.mUnit.Parent.GetSceneID() + ", " +
+                        log.Warn("PVP状态下传送1:" + playerVirtual.mUnit.PlayerUUID + ", 场景ID: " + playerVirtual.mUnit.Parent.GetSceneID() + ", hateInfo:" +
                             playerVirtual.GetHateSystem().GetHatePlayerInfo() + ", 触发PVP玩家:" + playerVirtual.mPvpTriggerPlayerId);
                     }
                 }

+ 1 - 1
XmdsVSPlugins/XmdsCommonSkill/Plugin/Buffs/XmdsBuff_PropChange.cs

@@ -54,7 +54,7 @@ namespace XmdsCommonSkill.Plugin.Buffs
             int v = (state.OverlayLevel + 1) * CurrentValue;
             ChangeProp(hitter, CurentChangeType, v);
 
-			int valueMax = hitter.IsPlayerUnit() ? 10000 : 25000;
+			int valueMax = hitter.mUnit.IsPlayer ? 10000 : 25000;
 			if(state.OverlayLevel > 10 || v > valueMax)
 			{
 				log.Warn("XmdsBuff_PropChange信息输出:" + this.BindBuffID + ", 层:" + state.OverlayLevel + ", " + CurentChangeType + ", 值:" + v +