From 2e1b0969fb141b9677230a56f9c29020362a5eab Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 03 九月 2018 15:08:01 +0800
Subject: [PATCH] Fix: 1819 玩家切地图,家族等级数据同步会异常(修复仙盟心法切图后无法升级的bug);
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
index d6f129b..2c45b06 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
@@ -20,6 +20,7 @@
import IPY_GameWorld
import NetPackCommon
import ChPyNetSendPack
+import PlayerActivity
import PlayerControl
import IpyGameDataPY
import NPCCommon
@@ -80,6 +81,10 @@
if not g_familyOwnerBossHurt:
g_familyOwnerBossHurt = FamilyOwnerBossHurt()
return g_familyOwnerBossHurt
+
+def IsHorsePetRobBoss(bossID):
+ ## 是否骑宠争夺bossID
+ return bossID in IpyGameDataPY.GetFuncEvalCfg("FairyGrabBossID", 1)
def OnGMPrintFamilyOwnerBossHurt(curPlayer, curNPC):
## GM显示仙盟归属boss伤血信息
@@ -181,6 +186,12 @@
hurtName = familyName if hurtType == FamilyHurtObjType_Family else playerName
objHurtDict[hurtID] = FamilyHurtObj(familyID, hurtType, hurtID, hurtName)
hurtObj = objHurtDict[hurtID]
+
+ # 玩家对该boss第一次造成伤害
+ if hurtType == FamilyHurtObjType_Player and hurtObj.hurtValue == 0 and hurtValue:
+ if IsHorsePetRobBoss(curBoss.GetNPCID()):
+ PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRobBoss)
+
hurtObj.hurtValue += hurtValue
GameWorld.DebugLog(" 更新伤血%s: hurtType=%s,hurtID=%s,hurtValue=%s"
% (mark, hurtType, hurtID, hurtObj.hurtValue), playerID)
@@ -311,7 +322,7 @@
GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "FamilyOwnerBossInfo", syncMsg, len(syncMsg))
# 伤血在NPCCommon统一清
- return
+ return ownerFamilyName
def RefreshFamilyOwnerNPCHurt(npcControl, curNPC, tick, refreshInterval):
## 仙盟归属boss刷新伤血列表
@@ -401,7 +412,7 @@
for clearHurtFamilyID in clearHurtFamilyIDList:
npcFamilyNowHurtDict.pop(clearHurtFamilyID, 0)
- npcFamilyPlayerIDDict.pop(clearHurtFamilyID, 0)
+ #npcFamilyPlayerIDDict.pop(clearHurtFamilyID, 0)
GameWorld.Log("清除仙盟伤血: lineID=%s,objID=%s,bossID=%s" % (lineID, objID, bossID))
# 排序
@@ -498,6 +509,13 @@
key = (lineID, objID, bossID)
hurtMgr = GetFamilyHurtMgr()
+
+ # 同步对骑宠争夺boss有伤血的玩家ID到GameServer
+ if IsHorsePetRobBoss(bossID):
+ familyHurtPlayerIDListDict = hurtMgr.familyPlayerIDDict.get(key, {})
+ syncMsg = str([bossID, familyHurtPlayerIDListDict])
+ GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "HorsePetRobBossHurtPlayer", syncMsg, len(syncMsg))
+
hurtMgr.ClearNPCHurt(key)
GameWorld.DebugLog("ClearFamilyOwnerBossHurt lineID=%s, objID=%s, bossID=%s" % (lineID, objID, bossID))
--
Gitblit v1.8.0