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 | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 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 4ff972f..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,6 +90,7 @@
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' #进入时等级
@@ -1574,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)
@@ -1729,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):
--
Gitblit v1.8.0