3724 【BUG】【2.0】快速连续点击进入草园不弹结算(优化自定义场景采集判断,优化进入自定义场景验证)
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 自定义场景采集OK
|
| | | ## 自定义场景采集OK,需自带是否允许采集的判断
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCustomSceneCollectOK"))
|
| | |
|
| | | if callFunc:
|
| | | callFunc(curPlayer, mapID, lineID, npcID)
|
| | | return callFunc(curPlayer, mapID, lineID, npcID)
|
| | |
|
| | | return
|
| | |
|
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 自定义场景采集OK,需自带是否允许采集的判断
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
|
| | | return curState == PlayerFairyDomain.FDEventState_Visiting
|
| | |
|
| | | def DecCustomSceneNPCCount(curPlayer, npcID):
|
| | | ## 减少草园自定义场景NPC,默认减少一个
|
| | | mapID = GetGrasslandMapID(curPlayer)[0]
|
| | |
| | | return
|
| | | return True
|
| | |
|
| | | ## 自定义场景采集OK
|
| | | ## 自定义场景采集OK,需自带是否允许采集的判断
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | |
|
| | | curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
|
| | |
| | |
|
| | | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
|
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_FairyTreasure, lineID, 1, overDict)
|
| | | return
|
| | | return True
|
| | |
|
| | |
|
| | |
| | | #};
|
| | | def OnGetCustomSceneCollectAward(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | npcID = clientData.NPCID
|
| | | if not curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | GameWorld.DebugLog("非自定义场景中,无法获取定义采集奖励!")
|
| | | GameWorld.ErrLog("非自定义场景中,无法获取定义采集奖励!", playerID)
|
| | | return
|
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | lineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | GameWorld.DebugLog("前端场景采集: mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID))
|
| | | GameWorld.Log("前端场景采集: mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID), playerID)
|
| | | if not mapID:
|
| | | GameWorld.ErrLog("无自定义场景地图ID,不允许采集!", playerID)
|
| | | return
|
| | |
|
| | | if mapID:
|
| | | #if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
|
| | | # return
|
| | | FBLogic.OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID)
|
| | | if not FBLogic.OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | GameWorld.ErrLog("自定义场景地图不允许采集! mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID), playerID)
|
| | | return
|
| | |
|
| | | collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
|
| | | if collectNPCIpyData:
|
| | |
| | |
|
| | | def DoEnterCustomScene(curPlayer, mapID, lineID, tick):
|
| | | ## 进入自定义场景状态
|
| | | |
| | | resultPack = ChPyNetSendPack.tagMCStartCustomSceneResult()
|
| | | resultPack.MapID = mapID
|
| | | resultPack.FuncLineID = lineID
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.Log("玩家请求进入自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | curMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | curLineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | if mapID == curMapID and lineID == curLineID:
|
| | | GameWorld.Log(" 玩家当前已经在自定义场景中!无需重新请求!", playerID)
|
| | | result = 1
|
| | | else:
|
| | | GameWorld.Log(" 玩家当前在不同的自定义场景中!不允许进入!curMapID=%s,curLineID=%s" |
| | | % (curMapID, curLineID), playerID)
|
| | | result = 0
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, result)
|
| | | return
|
| | |
|
| | | #进入副本通用检查
|
| | | if mapID:
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | if PlayerControl.CheckMoveToFB(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, tick) != ShareDefine.EntFBAskRet_OK:
|
| | | resultPack.Result = 0
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 0)
|
| | | return
|
| | |
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | |
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1) # 由于前端不一定有发mapID,所以这里额外记录这个状态,不能直接用mapID判断
|
| | | PlayerControl.SetCustomMap(curPlayer, mapID, lineID)
|
| | | GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if mapID:
|
| | | FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
|
| | |
|
| | | #通知进入状态
|
| | | resultPack.Result = 1
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 1)
|
| | | return
|
| | |
|
| | | def StartCustomSceneResult(curPlayer, mapID, lineID, result):
|
| | | if result != 1:
|
| | | DoExitCustomScene(curPlayer)
|
| | | resultPack = ChPyNetSendPack.tagMCStartCustomSceneResult()
|
| | | resultPack.MapID = mapID
|
| | | resultPack.FuncLineID = lineID
|
| | | resultPack.Result = result
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | return
|
| | |
|