JSGHackerModule.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Formula;
  4. using CommonAI.Zone.Helper;
  5. using CommonAI.Zone.Instance;
  6. using CommonLang.Log;
  7. using CommonLang.Vector;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using static CommonAI.ZoneClient.ClientStruct;
  13. //using System.Threading.Tasks;
  14. namespace CommonAI.ZoneServer.JSGModule
  15. {
  16. public class JSGHackerModule
  17. {
  18. protected static readonly Logger log = LoggerFactory.GetLogger("JSGHackerModule");
  19. public static void OnPlayerKillMonster(InstanceUnit attacker, InstanceUnit monster)
  20. {
  21. #if JSGProfile
  22. try
  23. {
  24. InstancePlayer player = (InstancePlayer)(attacker.IsPlayer ? attacker : attacker.Virtual.GetMasterUnit());
  25. if (player == null)
  26. {
  27. log.Info("OnPlayerKillMonster player not exist:" + attacker.PlayerUUID + ", " + attacker.Info.ID + ", SceneId:" + attacker.Parent.GetSceneID());
  28. return;
  29. }
  30. UnitSimpleProp simpleProp = player.Virtual.GetSimpleProp();
  31. //玩家属性打印
  32. log.Info("--------OnPlayerKillMonster print start:" + player.PlayerUUID + ", " + attacker.Parent.GetSceneID());
  33. log.Info("当前血:" + simpleProp.mCurHp + ", 攻防血" + simpleProp.mAtk + ", " + simpleProp.mDef + ", " + simpleProp.mMaxHP + ", 妖:" + simpleProp.mMonsterAtk + ", " + simpleProp.mMonsterDef);
  34. UnitBuffStatus[] buffStatus = player.GetCurrentBuffStatus();
  35. if(buffStatus != null)
  36. {
  37. foreach(UnitBuffStatus buffItem in buffStatus)
  38. {
  39. log.Info("玩家buff:" + buffItem.ToString());
  40. }
  41. }
  42. }
  43. catch(Exception e)
  44. {
  45. log.Warn("OnPlayerKillMonster catch:", e);
  46. }
  47. #endif
  48. }
  49. }
  50. }