From 43ec61799c5cc015c49ca6d0ace4b356f50a95af Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 16 五月 2019 15:40:25 +0800
Subject: [PATCH] 6805 【后端】【2.0】副本前端化(增加可否进入自定义场景通用判断,增加回包,木桩怪上限调整为10个)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py |   76 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py
index 7380b23..cf0ec44 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py
@@ -453,6 +453,82 @@
     FBLogic.OnClientStartFB(curPlayer, tick)
     return
 
+#// A2 31 前端开始自定义场景 #tagCMClientStartCustomScene
+#
+#struct    tagCMClientStartCustomScene
+#{
+#    tagHead        Head;
+#    DWORD        MapID;
+#    WORD        FuncLineID;
+#};
+def OnClientStartCustomScene(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    mapID = clientData.MapID
+    funcLineID = clientData.FuncLineID
+    DoEnterCustomScene(curPlayer, mapID, funcLineID, tick)
+    return
+
+#// A2 33 前端退出自定义场景 #tagCMClientExitCustomScene
+#
+#struct    tagCMClientExitCustomScene
+#{
+#    tagHead        Head;
+#};
+def OnClientExitCustomScene(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    DoExitCustomScene(curPlayer)
+    return
+
+def DoEnterCustomScene(curPlayer, mapID, lineID, tick):
+    ## 进入自定义场景状态
+    
+    resultPack = ChPyNetSendPack.tagMCStartCustomSceneResult()
+    resultPack.MapID = mapID
+    resultPack.FuncLineID = lineID
+    
+    #进入副本通用检查
+    fbIpyData = None if not mapID else FBCommon.GetFBIpyData(mapID)
+    fbLineIpyData = None if not mapID else FBCommon.GetFBLineIpyData(mapID, lineID)
+    if PlayerControl.CheckMoveToFB(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, tick) != ShareDefine.EntFBAskRet_OK:
+        resultPack.Result = 0
+        NetPackCommon.SendFakePack(curPlayer, resultPack)
+        return
+    
+    curPlayer.SetCanAttack(False)
+    curPlayer.SetVisible(False)
+    curPlayer.SetSight(0)
+    curPet = curPlayer.GetPetMgr().GetFightPet()
+    if curPet:
+        curPet.SetVisible(False)
+        
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1) # 由于前端不一定有发mapID,所以这里额外记录这个状态,不能直接用mapID判断
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneMapID, mapID)
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneLineID, lineID)
+    GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
+    if mapID:
+        FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
+        
+    #通知进入状态
+    resultPack.Result = 1
+    NetPackCommon.SendFakePack(curPlayer, resultPack)
+    return
+
+def DoExitCustomScene(curPlayer):
+    ## 退出自定义场景状态
+    curPlayer.SetCanAttack(True)
+    curPlayer.SetVisible(True)
+    curPlayer.SetSight(1)
+    curPlayer.RefreshView()
+    curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
+    curPlayer.RefreshView()
+    curPet = curPlayer.GetPetMgr().GetFightPet()
+    if curPet:
+        curPet.SetVisible(True)
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 0)
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneMapID, 0)
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneLineID, 0)
+    GameWorld.Log("玩家退出自定义场景!", curPlayer.GetPlayerID())
+    return
 
 #// B1 08 刷新自定义副本奖励 #tagCMRefreshCustomFBPrize
 #

--
Gitblit v1.8.0