|
@@ -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
|
|
|
}
|
|
|
}
|