From 41003de2a34a117d9aa286009742493e2aa9ff4b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 23 五月 2019 17:18:56 +0800
Subject: [PATCH] 6843 【后端】【2.0】缥缈仙域优化 6897 【后端】【2.0】缥缈仙域产出类型修改 6805 【后端】【2.0】副本前端化(缥缈宝藏、妖王、草园、VIPboss)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 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 d007905..0afee8e 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
@@ -473,6 +473,38 @@
     GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsDelTicket, delSign)
     return
 
+def SetCustomSceneStart(curPlayer, mapID, lineID):
+    ''' 设置前端自定义场景副本开始时间
+            某些自定义场景进入可能需要处理某些逻辑,比如扣门票、设置某些状态、完成成就等,这些逻辑在单次进入只能触发一次
+            需要记录一个开始状态,只在设置成功的时候进行处理这些逻辑,防止断线重连或重登重新进入自定义场景时,重复执行逻辑
+            该状态设置了一个有效期,暂时设定为15分钟,未完成场景有效期内重复进入不会重复触发
+            做超时是为了防止玩家没有正常结束场景导致未来的某个时间再次进入场景时无法正常触发进入需要额外处理的逻辑
+            需根据副本结束时机配置函数 SetCustomSceneOver 设置结束状态
+    @return: 设置成功返回True
+    '''
+    if GetCustomSceneState(curPlayer, mapID, lineID) == ChConfig.CustomSceneState_Fight:
+        return
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomSceneStartTime % (mapID, lineID), int(time.time()))
+    return True
+
+def GetCustomSceneState(curPlayer, mapID, lineID):
+    '''获取前端自定义场景状态
+    @return: 0-无,1-进行中,2-已结束
+    '''
+    startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomSceneStartTime % (mapID, lineID))
+    if not startTime:
+        return ChConfig.CustomSceneState_None
+    if startTime == ChConfig.CustomSceneState_Over:
+        return ChConfig.CustomSceneState_Over
+    # 保留15分钟
+    curTime = int(time.time())
+    return ChConfig.CustomSceneState_Fight if curTime - startTime < 15 * 60 else ChConfig.CustomSceneState_None
+
+def SetCustomSceneOver(curPlayer, mapID, lineID):
+    ## 设置前端自定义场景副本结束
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomSceneStartTime % (mapID, lineID), ChConfig.CustomSceneState_Over)
+    return
+
 def GetCurSingleFBPlayer():
     ''' 获取当前单人副本玩家 '''
     curPlayer = None

--
Gitblit v1.8.0