|
@@ -133,8 +133,8 @@ namespace ET.Server
|
|
|
{
|
|
|
int unitType = Convert.ToInt32(msg.SelectToken("unitType"));
|
|
|
// 攻击者
|
|
|
- long hitFinalPlayerId = Convert.ToInt64(msg.SelectToken("hitFinal"));
|
|
|
- long belongPlayerId = Convert.ToInt64(msg.SelectToken("belongPlayerId"));
|
|
|
+ long hitFinalPlayerId = msg.SelectToken("hitFinal").ToString() == "" ? 0 : Convert.ToInt64(msg.SelectToken("hitFinal"));
|
|
|
+ long belongPlayerId = msg.SelectToken("belongPlayerId").ToString() == "" ? 0 : Convert.ToInt64(msg.SelectToken("belongPlayerId"));
|
|
|
long[] atkAssistantList = JsonConvert.DeserializeObject<long[]>(Convert.ToString(msg.SelectToken("atkAssistantList")) ?? string.Empty);
|
|
|
WNPlayer hitFinalPlayer = null;
|
|
|
|
|
@@ -151,8 +151,8 @@ namespace ET.Server
|
|
|
|
|
|
switch (unitType)
|
|
|
{
|
|
|
- // 怪物死亡
|
|
|
case 0:
|
|
|
+ // 怪物死亡
|
|
|
int unitTemplateId = Convert.ToInt32(msg.SelectToken("unitTemplateId"));
|
|
|
Monster monsterProp = MonsterCategory.Instance.Get(unitTemplateId);
|
|
|
if (monsterProp == null)
|
|
@@ -164,11 +164,24 @@ namespace ET.Server
|
|
|
map.GetComponent<MapEventComponent>().OnUnitDead(monsterProp, map);
|
|
|
}
|
|
|
break;
|
|
|
- // 玩家死亡
|
|
|
case 1:
|
|
|
+ // 玩家死亡
|
|
|
+ long unitPlayerId = Convert.ToInt64(msg.SelectToken("unitPlayerId"));
|
|
|
+
|
|
|
+ if (hitFinalPlayerId <= 0)
|
|
|
+ {
|
|
|
+ // 被boss杀死
|
|
|
+ int attackerTemplateId = Convert.ToInt32(msg.SelectToken("attackerTemplateId"));
|
|
|
+ Log.Debug($"玩家死亡...被boss杀死...playerId={unitPlayerId}, bossId={attackerTemplateId}");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // 被玩家杀死
|
|
|
+ Log.Debug($"玩家死亡...被玩家杀死...playerId={unitPlayerId}, 攻击者={hitFinalPlayerId}");
|
|
|
+ }
|
|
|
break;
|
|
|
- // 宠物死亡
|
|
|
case 2:
|
|
|
+ // 宠物死亡
|
|
|
break;
|
|
|
}
|
|
|
}
|