From 9bdcc6b36e432272bd79d43b643e3614e73ef0f3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 14 一月 2019 16:12:44 +0800
Subject: [PATCH] 5722 【后端】【1.5】跨服BOSS开发(本服异兽之地Boss、跨服蓬莱仙境Boss 次数共享支持)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_AddKillBossCnt.py | 8 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py | 11 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossKillBoss.py | 51 +++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 1
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossSetPlayerAttrValue.py | 43 ++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossRealmPlayer.py | 51 +++++++
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py | 4
ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py | 31 ++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetBossKillCnt.py | 7 +
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py | 12 +
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py | 4
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py | 1
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py | 28 +++
ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py | 1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 108 +++++++++-----
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 1
17 files changed, 314 insertions(+), 52 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
index 417935e..420e17f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
@@ -376,6 +376,7 @@
Def_WorldKey_CrossPKZoneSeasonID = "CrossPKZoneSeasonID_%s" #跨服PK赛区对应赛季,跨服服务器控制,参数(zoneID)
Def_WorldKey_CrossPKZoneSeasonState = "CrossPKZoneSeasonState_%s" #跨服PK赛区赛季状态,跨服服务器控制,参数(zoneID)0-未开启,1-开启中,2-已结束
Def_WorldKey_CrossPKBillboardSyncTick = "CrossPKBillboardSyncTick_%s_%s" #跨服PK本赛季排行榜同步tick,参数(zoneID, seasonID)
+Def_WorldKey_CrossSetPlayerAttrTick = "CrossSetPlayerAttrTick" #同步设置跨服玩家属性值tick
#---------------------------------------------------------------------
#个人时间间隔
TYPE_Player_Tick_Requestkey = 0 # 玩家请求处理间隔
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py
index af21a5e..f2dec64 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py
@@ -20,6 +20,7 @@
import IpyGameDataPY
import ChPyNetSendPack
import CrossRealmPlayer
+import DataRecordPack
import PlayerControl
import NetPackCommon
import CrossRealmMsg
@@ -116,7 +117,8 @@
refreshTime = GetRecRefreshTime(bossRecData)
killedRecord = GetRecKilledRecord(bossRecData)
isAlive = __GetCrossBossIsAlive(zoneID, bossID)
- bossInfoList.append([zoneID, bossID, killedTime, refreshTime, killedRecord, isAlive])
+ killerExInfo = [] # 重连成功的信息同步不发送击杀者信息
+ bossInfoList.append([zoneID, bossID, killedTime, refreshTime, killedRecord, isAlive, killerExInfo])
if bossInfoList:
bossInfoDict = {"BossInfoType":"InitOK", "BossInfoList":bossInfoList}
@@ -124,12 +126,12 @@
return
-def DoCrossBossOnKilled(bossID, killPlayerName, realMapID, dataMapID, copyMapID):
+def DoCrossBossOnKilled(bossID, killPlayerName, realMapID, dataMapID, copyMapID, killerIDList):
## 跨服boss被杀
zoneIpyData = GetCrossBossZoneIpyData(realMapID, dataMapID, copyMapID)
zoneID = 0 if not zoneIpyData else zoneIpyData.GetZoneID()
- GameWorld.Log("击杀跨服boss: zoneID=%s,bossID=%s,realMapID=%s,dataMapID=%s,copyMapID=%s"
- % (zoneID, bossID, realMapID, dataMapID, copyMapID))
+ GameWorld.Log("击杀跨服boss: zoneID=%s,bossID=%s,realMapID=%s,dataMapID=%s,copyMapID=%s,killerIDList=%s"
+ % (zoneID, bossID, realMapID, dataMapID, copyMapID, killerIDList))
if not zoneID:
return
@@ -146,7 +148,8 @@
# 广播子服跨服boss被击杀
serverGroupIDList = zoneIpyData.GetServerGroupIDList()
killedRecord = GetRecKilledRecord(bossRecData)
- bossInfoList = [[zoneID, bossID, killedTime, refreshTime, killedRecord, isAlive]]
+ killerExInfo = [killerIDList, dataMapID]
+ bossInfoList = [[zoneID, bossID, killedTime, refreshTime, killedRecord, isAlive, killerExInfo]]
bossInfoDict = {"BossInfoType":"OnKilled", "BossInfoList":bossInfoList}
CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_CrossBossInfo, bossInfoDict, serverGroupIDList)
return
@@ -304,7 +307,7 @@
syncBOSSIDList = []
for bossInfo in bossInfoList:
- zoneID, bossID, killedTime, refreshTime, killedRecord, isAlive = bossInfo
+ zoneID, bossID, killedTime, refreshTime, killedRecord, isAlive, killerExInfo = bossInfo
bossRecData = __GetCrossBossRecData(zoneID, bossID)
SetRecKilledTime(bossRecData, killedTime)
SetRecRefreshTime(bossRecData, refreshTime)
@@ -312,6 +315,19 @@
__SetCrossBossIsAlive(zoneID, bossID, isAlive)
syncBOSSIDList.append(bossID)
+ if not killerExInfo:
+ continue
+
+ killerIDList, dataMapID = killerExInfo
+ for playerID in killerIDList:
+ killer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
+ if not killer:
+ GameWorld.ErrLog("击杀跨服boss时主服玩家不在线, playerID=%s,dataMapID=%s,bossID=%s" % (playerID, dataMapID, bossID))
+ DataRecordPack.SendEventPack("CrossBoss_Error", {"PlayerID":playerID, "Error":"MainServerOffline"})
+ continue
+ msgInfo = str([dataMapID, bossID])
+ killer.MapServer_QueryPlayerResult(0, 0, "CrossKillBoss", msgInfo, len(msgInfo))
+
Sync_CrossBossInfo(None, syncBOSSIDList)
return
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py
index 093eb59..145e62b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py
@@ -75,6 +75,9 @@
elif msgType == ShareDefine.ClientServerMsg_QueryNPCInfo:
PlayerQuery.ClientServerMsg_QueryNPCInfo(serverGroupID, msgData)
+ elif msgType == ShareDefine.ClientServerMsg_SetPlayerAttrValue:
+ MapServer_CrossSetPlayerAttrValue(msgData)
+
# 需要发送到地图服务器处理的
elif msgType in [ShareDefine.ClientServerMsg_Reborn]:
MapServer_CrossServerReceiveMsg(msgType, msgData, serverGroupID)
@@ -113,6 +116,15 @@
tagPlayer.MapServer_QueryPlayerResult(0, 0, "CrossServerReceiveMsg", msgInfo, len(msgInfo))
return
+def MapServer_CrossSetPlayerAttrValue(msgData):
+ for playerID, setAttrInfoList in msgData.items():
+ player = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
+ if not player:
+ return
+ msgInfo = str(setAttrInfoList)
+ player.MapServer_QueryPlayerResult(0, 0, "CrossSetPlayerAttrValue", msgInfo, len(msgInfo))
+ return
+
## ================================================================================================
def SendMsgToClientServer(msgType, dataMsg, serverGroupIDList=[]):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index 36086f0..3f4b0f6 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -103,9 +103,9 @@
if bossID <= 0:
return
- bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID = msgList
+ bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID, killerIDList = msgList
if GameWorld.IsCrossServer():
- CrossBoss.DoCrossBossOnKilled(bossID, killPlayerName, realMapID, dataMapID, copyMapID)
+ CrossBoss.DoCrossBossOnKilled(bossID, killPlayerName, realMapID, dataMapID, copyMapID, killerIDList)
return
mapID = dataMapID
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
index 794177d..fa29cda 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
@@ -95,6 +95,7 @@
#import ReloadModule
import CrossRealmPK
import CrossRealmMsg
+import CrossRealmPlayer
import PlayerFBHelpBattle
import PlayerFamilyRedPacket
import IpyGameDataPY
@@ -291,7 +292,8 @@
PlayerFamilyParty.FamilyParty_Process(tick)
# 帮主弹劾时钟调用
PlayerFamily.OnLeaderImpeachTick(tick)
-
+ #跨服玩家
+ CrossRealmPlayer.OnCrossProcess(tick)
#跨服PK匹配
CrossRealmPK.OnPKMatchProcess(tick)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
index 695f942..2ae44ba 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
@@ -352,5 +352,36 @@
curPlayer.MapServer_QueryPlayerResult(0, 0, "CrossGiveMoney", msgInfo, len(msgInfo))
return
+def SetCrossPlayerAttrValue(msgInfo, tick):
+ ## 设置跨服玩家属性值
+ playerID, setType, setDict, isDelay = msgInfo
+ if not PyGameData.g_crossSetPlayerAttr:
+ GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_CrossSetPlayerAttrTick, tick)
+ playerSetInfoList = PyGameData.g_crossSetPlayerAttr.get(playerID, [])
+ playerSetInfoList.append([setType, setDict])
+ PyGameData.g_crossSetPlayerAttr[playerID] = playerSetInfoList
+ if not isDelay:
+ __SendCrossServerSetPlayerAttr(0)
+ return
+
+def OnCrossProcess(tick):
+ __SendCrossServerSetPlayerAttr(tick)
+ return
+
+def __SendCrossServerSetPlayerAttr(tick):
+ if not PyGameData.g_crossSetPlayerAttr:
+ return
+
+ if tick:
+ # 延迟10秒一次性同步,主要是比如OnDay的时候当多个玩家同时跨服时,减少同步次数,延迟统一发送
+ if tick - GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_CrossSetPlayerAttrTick) < 10 * 1000:
+ return
+ GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_CrossSetPlayerAttrTick, tick)
+
+ CrossRealmMsg.SendMsgToCrossServer(ShareDefine.ClientServerMsg_SetPlayerAttrValue, PyGameData.g_crossSetPlayerAttr)
+ PyGameData.g_crossSetPlayerAttr = {}
+ return
+
+
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
index 72d7a71..9f9af8b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
@@ -505,6 +505,10 @@
CrossRealmMsg.SendMsgToClientServer(msgType, dataMsg, serverGroupIDList)
return
+ if callName == "SetCrossPlayerAttrValue":
+ CrossRealmPlayer.SetCrossPlayerAttrValue(eval(resultName), tick)
+ return
+
if callName == 'MergeWorldNotify':
country, msgMark, msgParamList, lineID, mergeMinOSD, mergeMaxOSD, mergeMapInfo = eval(resultName)
PlayerControl.MergeWorldNotify(country, msgMark, msgParamList, lineID, mergeMinOSD, mergeMaxOSD, mergeMapInfo, 1)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
index 5e91554..afebc34 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -97,4 +97,5 @@
g_crossMapNPCInfo = {} # 跨服地图NPC信息 {mapID:[tick, npcInfo], ...}
+g_crossSetPlayerAttr = {} # 跨服玩家更新玩家数据 {playerID:[[setType, setDict], ...], ...}
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 861350f..6b9592e 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1217,6 +1217,7 @@
ClientServerMsg_PKBillboard = "PKBillboard" # 跨服PK排行榜
ClientServerMsg_Reborn = "Reborn" # 复活
ClientServerMsg_QueryNPCInfo = "QueryNPCInfo" # 查询跨服地图NPC信息
+ClientServerMsg_SetPlayerAttrValue = "SetPlayerAttrValue" # 玩家属性数值更新
#角色改名结果
(
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py
index d4fa441..64ba75e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py
@@ -45,6 +45,8 @@
import DataRecordPack
import IpyGameDataPY
import ItemControler
+import CrossRealmPlayer
+import ShareDefine
import ChConfig
import FBLogic
import PlayerVip
@@ -500,9 +502,10 @@
## 过天
def OnDay(curPlayer):
#清空当天摸boss次数
+ setCrossDict = {}
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WorldBoss_HurtCnt, 0)
killBossCntLimitDict = IpyGameDataPY.GetFuncEvalCfg('KillBossCntLimit', 2, {})
- for index,limitCnt in killBossCntLimitDict.items():
+ for index, limitCnt in killBossCntLimitDict.items():
killCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Boss_KillCnt%index, 0)
#hasBuyKillCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Boss_KillCntBuyCnt%index, 0)
@@ -513,8 +516,14 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Boss_KillCntItemAddCnt % index, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Boss_KillCnt % index, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Boss_KillCntBuyCnt % index, 0)
+ if index == ShareDefine.Def_Boss_Func_Dogz:
+ setCrossDict.update({ChConfig.Def_PDict_Boss_KillCntItemAddCnt % index:0,
+ ChConfig.Def_PDict_Boss_KillCnt % index:0,
+ ChConfig.Def_PDict_Boss_KillCntBuyCnt % index:0,
+ })
NotifyAttackBossCnt(curPlayer)
+ CrossRealmPlayer.SetCrossPlayerNomalDict(curPlayer, setCrossDict)
return
## 登录处理
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_AddKillBossCnt.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_AddKillBossCnt.py
index a437b28..830b2a4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_AddKillBossCnt.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_AddKillBossCnt.py
@@ -10,13 +10,15 @@
# @version 1.0
#
#------------------------------------------------------------------------------
-"""Version = 2017-07-10 19:50"""
+#"""Version = 2017-07-10 19:50"""
#------------------------------------------------------------------------------
#导入
import ItemCommon
import PlayerControl
import ChConfig
import BossHurtMng
+import CrossRealmPlayer
+import ShareDefine
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
@@ -40,4 +42,8 @@
saveDataDict = {"bossTypeIndex":bossTypeIndex, 'addCnt':addCnt}
ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, ChConfig.ItemDel_AddKillBossCnt, saveDataDict)
PlayerControl.NotifyCode(curPlayer, 'WorldBossCountItem', [itemTypeID, bossTypeIndex, addCnt])
+
+ if bossTypeIndex == ShareDefine.Def_Boss_Func_Dogz:
+ setCrossDict = {ChConfig.Def_PDict_Boss_KillCntItemAddCnt % bossTypeIndex:itemAddKillCnt + addCnt}
+ CrossRealmPlayer.SetCrossPlayerNomalDict(curPlayer, setCrossDict, isDelay=False)
return True
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetBossKillCnt.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetBossKillCnt.py
index 4baf412..535c4ad 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetBossKillCnt.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetBossKillCnt.py
@@ -19,8 +19,11 @@
import BossHurtMng
import IpyGameDataPY
import PlayerControl
+import CrossRealmPlayer
+import ShareDefine
import GameWorld
import ChConfig
+
import math
def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
@@ -46,5 +49,9 @@
PlayerControl.NotifyCode(curPlayer, 'WorldBossCountItem', [itemTypeID, curKillCnt-newCnt, index])
ItemCommon.DelItem(curPlayer, curRoleItem, realUseCnt, True, ChConfig.ItemDel_ResetBossKillCnt)
+
+ if index == ShareDefine.Def_Boss_Func_Dogz:
+ setCrossDict = {ChConfig.Def_PDict_Boss_KillCnt % index:0, ChConfig.Def_PDict_Boss_KillCntBuyCnt % index:0}
+ CrossRealmPlayer.SetCrossPlayerNomalDict(curPlayer, setCrossDict, isDelay=False)
return True, realUseCnt
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 7229e00..86eec98 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -2094,13 +2094,13 @@
curNPC.GetDictByKey(ChConfig.Def_NPCDead_KillerID))
return
-def GameServer_KillGameWorldBoss(bossID, killPlayerName, hurtValue, isNotify=True):
+def GameServer_KillGameWorldBoss(bossID, killPlayerName, hurtValue, isNotify=True, killerIDList=[]):
dataMapID = GameWorld.GetGameWorld().GetMapID()
realMapID = GameWorld.GetGameWorld().GetRealMapID()
copyMapID = GameWorld.GetGameWorld().GetCopyMapID()
- killMsg = str([bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID])
+ killMsg = str([bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID, killerIDList])
GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'KillGameWorldBoss', killMsg, len(killMsg))
- GameWorld.DebugLog("Boss被击杀: bossID=%s,dataMapID=%s,realMapID=%s,copyMapID=%s" % (bossID, dataMapID, realMapID, copyMapID))
+ GameWorld.DebugLog("Boss被击杀: bossID=%s,dataMapID=%s,realMapID=%s,copyMapID=%s,killerIDList=%s" % (bossID, dataMapID, realMapID, copyMapID, killerIDList))
return
def GameServe_GameWorldBossState(bossID, isAlive):
@@ -2125,6 +2125,44 @@
GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID, 0)
return
+def OnPlayerKillBoss(curPlayer, npcID, mapID, isCrossServer):
+ killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
+ limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
+ if limitIndex != None:
+ #今日杀怪次数+1
+ key = ChConfig.Def_PDict_Boss_KillCnt % limitIndex
+ newCnt = curPlayer.NomalDictGetProperty(key, 0) + 1
+ PlayerControl.NomalDictSetProperty(curPlayer, key, newCnt)
+ BossHurtMng.NotifyAttackBossCnt(curPlayer, limitIndex)
+ GameWorld.DebugLog("今日杀怪次数 playerID=%s, newCnt=%s" % (curPlayer.GetPlayerID(), newCnt))
+
+ dataDict = {"objID":npcID, "bossID":npcID, "touchCnt":newCnt,
+ "AccID":curPlayer.GetAccID(), "PlayerID":curPlayer.GetPlayerID()}
+ DataRecordPack.SendEventPack("AddKillBossCnt", dataDict, curPlayer)
+
+ if isCrossServer:
+ return
+
+ if limitIndex == ShareDefine.Def_Boss_Func_World:
+ # 世界BOSS击杀成就
+ PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillWorldBoss, 1)
+ # 每日活动
+ PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
+ PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
+ PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
+ PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_WorldBOSS, 1)
+
+ if mapID == ChConfig.Def_FBMapID_BossHome:
+ #BOSS之家
+ # BOSS之家BOSS击杀成就
+ PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillBossHomeBoss, 1)
+ # 每日活动
+ PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_BOSSHome)
+ PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_BOSSHome, 1)
+ PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_BossHome, 1)
+ PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_BOSSHome, 1)
+ return
+
#################################################
## NPC控制定义
#
@@ -2144,6 +2182,7 @@
self.__Killer = None # 击杀者, 由各种规则得出, 一般也是物品归属的代表, 用于广播、记录等确保与归属一致
self.__AllKillerDict = {} # 所有击杀的玩家ID对应字典, 非队伍, 一般也是归属的拥有者
self.__FeelPlayerList = [] # 所有摸怪玩家列表,处理任务及某些逻辑用
+ self.__ownerPlayerList = [] # 归属者列表
self.__OwnerHurtType = 0
self.__OwnerHurtID = 0
@@ -3949,7 +3988,8 @@
if GetDropOwnerType(curNPC) == ChConfig.DropOwnerType_Family:
killerName = FamilyRobBoss.FamilyOwnerBossOnKilled(curNPC, self.__OwnerHurtID)
#KillerJob = 0 if not self.__Killer else self.__Killer.GetJob()
- GameServer_KillGameWorldBoss(curNPC.GetNPCID(), killerName, 0)
+ killerIDList = [player.GetPlayerID() for player in self.__ownerPlayerList]
+ GameServer_KillGameWorldBoss(curNPC.GetNPCID(), killerName, 0, True, killerIDList)
#===========================================================================================
# # 暗金boss
# if curNPC.GetIsBoss() == ChConfig.Def_NPCType_Boss_Dark:
@@ -4447,7 +4487,8 @@
dropPlayer = curPlayer
self.__KilledByPlayerSetPrize(curPlayer)
ownerPlayerList.append(curPlayer)
-
+ self.__ownerPlayerList = ownerPlayerList
+
#调用物品掉落
self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList)
@@ -4889,6 +4930,7 @@
self.__DoNormalTeamExp(curPlayer)
self.__KillNPCFuncEx(curPlayer, curNPC, maxHurtID, True)
+ self.__ownerPlayerList = ownerPlayerList
#调用物品掉落
self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList)
@@ -4917,6 +4959,7 @@
maxLV = curPlayerLV
dropPlayer = player
ownerPlayerList.append(player)
+ self.__ownerPlayerList = ownerPlayerList
if not ownerPlayerList:
GameWorld.Log("奖励归属仙盟,但是不存在可获得该奖励的成员!npcID=%s,hurtType=%s,hurtID=%s"
@@ -4957,48 +5000,31 @@
defObjType = curNPC.GetGameObjType()
mapFBType = GameWorld.GetMap().GetMapFBType()
mapID = FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID())
- playerID = curPlayer.GetPlayerID()
+ #playerID = curPlayer.GetPlayerID()
# 如果是NPC
- if defObjType == IPY_GameWorld.gotNPC:
+ if defObjType != IPY_GameWorld.gotNPC:
+ return
+
+ # 跨服服务器处理
+ if GameWorld.IsCrossServer():
#掉落归属
if mapFBType != IPY_GameWorld.fbtNull:
FBLogic.DoFB_DropOwner(curPlayer , curNPC)
- else:
- if curNPC.GetLV()>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
- PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC)
- killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
- limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
- if limitIndex != None:
- #今日杀怪次数+1
- key = ChConfig.Def_PDict_Boss_KillCnt % limitIndex
- newCnt = curPlayer.NomalDictGetProperty(key, 0) + 1
- PlayerControl.NomalDictSetProperty(curPlayer, key, newCnt)
- BossHurtMng.NotifyAttackBossCnt(curPlayer, limitIndex)
- GameWorld.DebugLog("今日杀怪次数 playerID=%s, newCnt=%s" % (curPlayer.GetPlayerID(), newCnt))
-
- dataDict = {"objID":curNPC.GetID(), "bossID":npcID, "touchCnt":newCnt,
- "AccID":curPlayer.GetAccID(), "PlayerID":curPlayer.GetPlayerID()}
- DataRecordPack.SendEventPack("AddKillBossCnt", dataDict, curPlayer)
- if limitIndex == 0:
- # 世界BOSS击杀成就
- PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillWorldBoss, 1)
- # 每日活动
- PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
- PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
- PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
- PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_WorldBOSS, 1)
- if ChConfig.IsGameBoss(curNPC) and mapID == ChConfig.Def_FBMapID_BossHome:
- #BOSS之家
- # BOSS之家BOSS击杀成就
- PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillBossHomeBoss, 1)
- # 每日活动
- PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_BOSSHome)
- PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_BOSSHome, 1)
- PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_BossHome, 1)
- PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_BOSSHome, 1)
+ if ChConfig.IsGameBoss(curNPC):
+ OnPlayerKillBoss(curPlayer, npcID, mapID, True)
+ return
+
+ #掉落归属
+ if mapFBType != IPY_GameWorld.fbtNull:
+ FBLogic.DoFB_DropOwner(curPlayer , curNPC)
+ else:
+ if curNPC.GetLV()>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
+ PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC)
+ if ChConfig.IsGameBoss(curNPC):
+ OnPlayerKillBoss(curPlayer, npcID, mapID, False)
return
#---------------------------------------------------------------------
@@ -5024,7 +5050,7 @@
#GameWorld.DebugLog("__MissionOnKillNPC isFeel=%s" % (isFeel), curPlayer.GetPlayerID())
killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
- isWorldBoos = limitIndex == 0
+ isWorldBoos = limitIndex == ShareDefine.Def_Boss_Func_World
if isFeel:
#击杀NPC触发摸怪任务事件
EventShell.EventRespons_OnKillByFeel(curPlayer, curNPC)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossRealmPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossRealmPlayer.py
index 13c75db..0b6b448 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossRealmPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossRealmPlayer.py
@@ -61,6 +61,57 @@
## 跨服服务器是否开放中
return GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerOpen)
+def SetCrossPlayerAttrValue(curPlayer, setDict, isDelay=True):
+ ''' 批量设置玩家属性值
+ @param setDict: 设置属性字典 {attrName:attrValue, ...}
+ @param isDelay: 是否延迟同步,比如OnDay更新的数值,可能多个玩家同时更新多个属性值,所以需要设置延迟统一同步,其他具体根据功能需要选择是否延迟
+ '''
+ if not setDict or not PlayerControl.GetCrossMapID(curPlayer):
+ return
+ playerID = curPlayer.GetPlayerID()
+ setType = "PlayerAttr"
+ msgList = str([playerID, setType, setDict, isDelay])
+ GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "SetCrossPlayerAttrValue", msgList, len(msgList))
+ GameWorld.DebugLog("更新跨服玩家属性: isDelay=%s,%s" % (isDelay, setDict), playerID)
+ return
+
+def SetCrossPlayerNomalDict(curPlayer, setDict, isDelay=True):
+ ''' 批量设置玩家字典值
+ @param setDict: 设置字典, 无 dictType 信息时默认类型0 {dictKey:dictValue, dictKey:[dictValue, dictType], ...}
+ @param isDelay: 是否延迟同步,比如OnDay更新的数值,可能多个玩家同时更新多个属性值,所以需要设置延迟统一同步,其他具体根据功能需要选择是否延迟
+ '''
+ if not setDict or not PlayerControl.GetCrossMapID(curPlayer):
+ return
+ playerID = curPlayer.GetPlayerID()
+ setType = "PlayerDict"
+ msgList = str([playerID, setType, setDict, isDelay])
+ GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "SetCrossPlayerAttrValue", msgList, len(msgList))
+ GameWorld.DebugLog("更新跨服玩家字典: isDelay=%s,%s" % (isDelay, setDict), playerID)
+ return
+
+def ClientServerMsg_SetPlayerAttrValue(curPlayer, playerSetInfoList):
+ ## 收到子服同步的设置跨服玩家属性值
+ playerID = curPlayer.GetPlayerID()
+ GameWorld.DebugLog("收到子服同步的设置跨服玩家属性值: %s" % playerSetInfoList, playerID)
+ for setType, setDict in playerSetInfoList:
+ if setType == "PlayerDict":
+ for dictKey, valeInfo in setDict.items():
+ if isinstance(valeInfo, int):
+ dictValue, dictType = valeInfo, 0
+ else:
+ dictValue, dictType = valeInfo
+ PlayerControl.NomalDictSetProperty(curPlayer, dictKey, dictValue, dictType)
+ GameWorld.DebugLog(" NomalDictSetProperty dictKey=%s, dictValue=%s, dictType=%s" % (dictKey, dictValue, dictType), playerID)
+ else:
+ for attrName, attrValue in setDict.items():
+ if hasattr(curPlayer, attrName):
+ getattr(curPlayer, attrName)(attrValue)
+ GameWorld.DebugLog(" curPlayer.%s(%s)" % (attrName, attrValue))
+ elif hasattr(PlayerControl, attrName):
+ getattr(PlayerControl, attrName)(curPlayer, attrValue)
+ GameWorld.DebugLog(" PlayerControl.%s(curPlayer, %s)" % (attrName, attrValue), playerID)
+ return
+
#// C1 04 主动退出跨服 #tagCMExitCrossRealm
#
#struct tagCMExitCrossRealm
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossKillBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossKillBoss.py
new file mode 100644
index 0000000..84c4538
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossKillBoss.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.RemoteQuery.GY_Query_CrossKillBoss
+#
+# @todo:跨服击杀boss
+# @author hxp
+# @date 2019-01-14
+# @version 1.0
+#
+# 详细描述: 跨服击杀boss
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-01-14 16:00"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+import NPCCommon
+
+#------------------------------------------------------------------------------
+## 跨服赛报名调用接口
+# @param query_Type 请求类型
+# @param query_ID 请求的玩家ID
+# @param packCMDList 发包命令
+# @param tick 当前时间
+# @return "True" or "False" or ""
+# @remarks 函数详细说明.
+def DoLogic(query_Type, query_ID, packCMDList, tick):
+ return
+
+
+#------------------------------------------------------------------------------
+## 执行结果
+# @param curPlayer 发出请求的玩家
+# @param callFunName 功能名称
+# @param funResult 查询的结果
+# @param tick 当前时间
+# @return None
+# @remarks 函数详细说明.
+def DoResult(curPlayer, callFunName, funResult, tick):
+ killerExInfo = eval(funResult)
+ dataMapID, bossID = killerExInfo
+ GameWorld.Log("GY_Query_CrossKillBoss dataMapID=%s, bossID=%s" % (dataMapID, bossID), curPlayer.GetPlayerID())
+ if not curPlayer:
+ return
+ NPCCommon.OnPlayerKillBoss(curPlayer, bossID, dataMapID, False)
+ return
+
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossSetPlayerAttrValue.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossSetPlayerAttrValue.py
new file mode 100644
index 0000000..869c296
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossSetPlayerAttrValue.py
@@ -0,0 +1,43 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.RemoteQuery.GY_Query_CrossSetPlayerAttrValue
+#
+# @todo:设置跨服玩家属性
+# @author hxp
+# @date 2019-01-14
+# @version 1.0
+#
+# 详细描述: 设置跨服玩家属性
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-01-14 16:00"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+import CrossRealmPlayer
+
+#------------------------------------------------------------------------------
+
+def DoLogic(query_Type, query_ID, packCMDList, tick):
+ return
+
+
+#------------------------------------------------------------------------------
+## 执行结果
+# @param curPlayer 发出请求的玩家
+# @param callFunName 功能名称
+# @param funResult 查询的结果
+# @param tick 当前时间
+# @return None
+# @remarks 函数详细说明.
+def DoResult(curPlayer, callFunName, funResult, tick):
+ playerID = curPlayer.GetPlayerID()
+ GameWorld.Log("GY_Query_CrossSetPlayerAttrValue %s" % funResult, playerID)
+ playerSetInfoList = eval(funResult)
+ CrossRealmPlayer.ClientServerMsg_SetPlayerAttrValue(curPlayer, playerSetInfoList)
+ return
+
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 861350f..6b9592e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1217,6 +1217,7 @@
ClientServerMsg_PKBillboard = "PKBillboard" # 跨服PK排行榜
ClientServerMsg_Reborn = "Reborn" # 复活
ClientServerMsg_QueryNPCInfo = "QueryNPCInfo" # 查询跨服地图NPC信息
+ClientServerMsg_SetPlayerAttrValue = "SetPlayerAttrValue" # 玩家属性数值更新
#角色改名结果
(
--
Gitblit v1.8.0