From d42896d1fe05ba65cf3bf537075c3d00467dfbb8 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 11 七月 2019 11:38:48 +0800
Subject: [PATCH] 860312 混服或合服情况下需要指定修改的平台和服务器,Serverid不填写代表不改变只替换spid
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 113 +++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 86 insertions(+), 27 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
index 87eea65..62e70f9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -90,12 +90,15 @@
Over_grade = 'grade' #评级(5-S,4-A,3-B,2-C,1-D)
Over_itemInfo = 'itemInfo' #物品列表 [{"ItemID":101, "ItemCount":10, "IsBind":1, "IsSuite":1, "UserData":"自定义属性字符串"}]
Over_succItemInfo = 'succItemInfo' #物品列表
+Over_firstPassItem = 'firstPassItem' #物品列表
Over_score = 'score' #已获得积分
Over_extrScore = 'extrScore' #已获得额外积分
Over_enterLV = 'enterLV' #进入时等级
Over_leaderID = 'leaderID' #渡劫玩家ID
Over_xianyuanCoin = 'xianyuanCoin' #获得仙缘币信息 [获得仙缘币数, 没有获得的原因] 原因: 1-达到助战次数上限,2-达到每日获得仙缘币上限
Over_helpPlayer = 'helpPlayer' #助战玩家信息 {"玩家ID":{玩家信息key:value, ...}, ...}
+Over_ownerID = 'ownerID' #归属玩家ID
+Over_ownerName = 'ownerName' #归属玩家名
#副本行为
(
@@ -163,6 +166,10 @@
def CheckCanEnterFBComm(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, reqEnterCnt=1, isNotify=True, isTeamAsk=False):
# 可否进入副本通用检查, 扫荡通用
playerID = curPlayer.GetPlayerID()
+
+ if not FBLogic.OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
+ return ShareDefine.EntFBAskRet_OK
+
# 总表通用检查
if fbIpyData:
#开服天开放检查
@@ -202,15 +209,6 @@
if isNotify:
PlayerControl.NotifyCode(curPlayer, "FbLV", [mapID])
return ShareDefine.EntFBAskRet_LVLimit
-
- #职业阶判断
- jobRankLimit = fbLineIpyData.GetJobRankLimit()
- if jobRankLimit and PlayerControl.GetJobRank(curPlayer) < jobRankLimit:
- GameWorld.Log("玩家职业阶级不足, 无法进入副本!mapID=%s,lineID=%s,jobRank=%s < jobRankLimit=%s"
- % (mapID, lineID, PlayerControl.GetJobRank(curPlayer), jobRankLimit), playerID)
- if isNotify:
- PlayerControl.NotifyCode(curPlayer, "SingleEnterJob", [mapID])
- return ShareDefine.EntFBAskRet_JobRankLimit
#门票判断
if not GetFBEnterTicket(curPlayer, mapID, lineID, fbLineIpyData, reqEnterCnt, isTeamAsk)[0]:
@@ -449,18 +447,18 @@
# @return
def SetFBPropertyMark(propertyMark, setPlayer=None):
GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_PropertyMark, propertyMark + 1) # 存储时+1才能判断是否存储过
- if setPlayer != None:
- PlayerControl.SetFBFuncLineID(setPlayer, propertyMark)
- GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID())
- return
-
- playerManager = GameWorld.GetMapCopyPlayerManager()
- for index in xrange(playerManager.GetPlayerCount()):
- curPlayer = playerManager.GetPlayerByIndex(index)
- if not curPlayer.GetPlayerID():
- continue
- PlayerControl.SetFBFuncLineID(curPlayer, propertyMark)
- GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID())
+# if setPlayer != None:
+# PlayerControl.SetFBFuncLineID(setPlayer, propertyMark)
+# GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID())
+# return
+#
+# playerManager = GameWorld.GetMapCopyPlayerManager()
+# for index in xrange(playerManager.GetPlayerCount()):
+# curPlayer = playerManager.GetPlayerByIndex(index)
+# if not curPlayer.GetPlayerID():
+# continue
+# PlayerControl.SetFBFuncLineID(curPlayer, propertyMark)
+# GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID())
return
## 是否已经扣除入场券/进入次数等
@@ -474,6 +472,15 @@
# @return
def SetHadDelTicket(curPlayer, delSign=1):
GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsDelTicket, delSign)
+ return
+
+## 自定义场景阶段
+def GetCustomMapStep(curPlayer, mapID, lineID):
+ return curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID))
+def SetCustomMapStep(curPlayer, mapID, lineID, step):
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID), step)
+ if step == ChConfig.CustomMapStep_Over:
+ PlayerControl.SetCustomMap(curPlayer, 0, 0)
return
def GetCurSingleFBPlayer():
@@ -1021,6 +1028,35 @@
#可以进入
return True
#---------------------------------------------------------------------
+def Sync_FBNPC(mapID=0, npcIDList=[], curPlayer=None):
+ ## 同步当前副本NPC给副本中的所有玩家
+ if not mapID:
+ mapID = GameWorld.GetMap().GetMapID()
+ mapID = GetRecordMapID(mapID)
+ npcCntDict = {}
+ gameNPCManager = GameWorld.GetNPCManager()
+ for index in xrange(gameNPCManager.GetNPCCount()):
+ curNPC = gameNPCManager.GetNPCByIndex(index)
+ npcID = curNPC.GetNPCID()
+ if not npcID:
+ continue
+ if curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
+ continue
+ if npcIDList and npcID not in npcIDList:
+ continue
+ npcCntDict[npcID] = npcCntDict.get(npcID, 0) + 1
+
+ if curPlayer:
+ NPCCommon.SyncNPCCntInfo(curPlayer, mapID, npcCntDict)
+ else:
+ playerManager = GameWorld.GetMapCopyPlayerManager()
+ for i in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(i)
+ if curPlayer.GetID() == 0:
+ continue
+ NPCCommon.SyncNPCCntInfo(curPlayer, mapID, npcCntDict)
+ return npcCntDict
+
##获得地图上的NPC列表
# @param 无参数
# @return 返回值, NPC实例列表[curNPC,curNPC,,,,,]
@@ -1539,24 +1575,39 @@
maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
maxCanAdd = max(0, maxDayTimes - (maxCnt-enterCnt))
#GameWorld.DebugLog('封魔坛最大可恢复次数 %s'%maxCanAdd)
- if not maxCanAdd:
- return
+
curTime = int(time.time())
- recoverInterval = IpyGameDataPY.GetFuncCfg('FBCntRegainInterval')
lastRegainTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
+ if not lastRegainTime:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, curTime)
+ return
+ recoverInterval = IpyGameDataPY.GetFuncCfg('FBCntRegainInterval')
needTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID)
if not needTime:
needTime = recoverInterval
passTime = curTime - lastRegainTime
if passTime < needTime:
return
- recoverCnt = min(maxCanAdd, 1 + (passTime-needTime) / recoverInterval) # 恢复次数
+ recoverCnt = 1 + (passTime-needTime) / recoverInterval # 恢复次数
+ if recoverCnt > maxCanAdd:
+ #记录超出的次数,用于资源找回
+ beyondTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainOverTime % mapID)
+ updBeyondTimes = recoverCnt - maxCanAdd + beyondTimes
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainOverTime % mapID, updBeyondTimes)
+ if not maxCanAdd:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, curTime)
+ GameWorld.DebugLog(' 封魔坛恢复次数 记录超出的次数addOverCnt=%s, updBeyondTimes=%s'%(recoverCnt-maxCanAdd, updBeyondTimes))
+
+ if not maxCanAdd:
+ return
+ recoverCnt = min(maxCanAdd, recoverCnt)
+
enterCntKey = ChConfig.Def_Player_Dict_EnterFbCntDay % mapID
newEnterCnt = max(0, enterCnt-recoverCnt)
PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, newEnterCnt)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID, 0)
if recoverCnt == maxCanAdd:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, curTime)
else:
startTime = curTime- (passTime-needTime)%recoverInterval
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, startTime)
@@ -1694,6 +1745,7 @@
if mapID in [ChConfig.Def_FBMapID_SealDemon]:
newEnterCnt = max(0, dayTimes - (maxCnt - enterCnt))
PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, newEnterCnt)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainOverTime % mapID, 0)
GameWorld.DebugLog(" 特殊副本已进入次数更新: newEnterCnt=%s" % newEnterCnt)
elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_ZhuXianBoss):
@@ -2001,7 +2053,7 @@
def AddFbEncourageBuff(curPlayer, key, tick, ownerID=0):
curPlayerID = curPlayer.GetID()
GameWorld.Log("AddFbEncourageBuff() curPlayerID=%s" % curPlayerID)
-
+ ownerID = ownerID or curPlayer.GetID()
gameFB = GameWorld.GetGameFB()
encourageLV = gameFB.GetPlayerGameFBDictByKey(ownerID, key)
if not encourageLV:
@@ -2409,4 +2461,11 @@
fbHelpFunc(curPlayer, tick)
return
+def GetCrossDynamicLineMapZoneID():
+ ## 获取跨服动态线路地图本线路跨服分区
+ return GameWorld.GetGameWorld().GetPropertyID() / 10000
+
+def GetCrossDynamicLineMapFuncLineID():
+ ## 获取跨服动态线路地图本线路功能线路ID
+ return GameWorld.GetGameWorld().GetPropertyID() % 10000 / 10
--
Gitblit v1.8.0