Просмотр исходного кода

MMO-19371: 优化pvp传送日志

meijun 3 лет назад
Родитель
Сommit
9f0221b4f3

+ 9 - 1
XmdsCommonServer/Plugin/XmdsVirtual/XmdsVirtual.cs

@@ -131,6 +131,9 @@ namespace XmdsCommonServer.Plugin
 		//恢复MP状态,不可打断
 		public int mRecoverMPLeftTimes;
 
+		//PVP触发的玩家id
+		public string mPvpTriggerPlayerId;
+
         //战斗状态变更通知.
         public delegate void OnCombatChangeEvent(BattleStatus status);
         public event OnCombatChangeEvent OnHandleCombatChangeEvent
@@ -1117,7 +1120,12 @@ namespace XmdsCommonServer.Plugin
 
         protected virtual void ChangeCombatStateFromAtk(XmdsVirtual target)
         {
-            var s = target.IsPlayerUnit() ? BattleStatus.PVP : BattleStatus.PVE;
+            var s = BattleStatus.PVE;
+			if (target.IsPlayerUnit())
+			{
+				s = BattleStatus.PVP;
+				this.mPvpTriggerPlayerId = target.mUnit.PlayerUUID;
+			}
             SetCombatState(s);
         }
 

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

@@ -233,7 +233,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() + ", " 
-						+ playerVirtual.GetHateSystem().GetHatePlayerInfo());
+						+ playerVirtual.GetHateSystem().GetHatePlayerInfo() + ", 触发PVP玩家:" + playerVirtual.mPvpTriggerPlayerId);
 
 				}
 			}

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

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