From ccdb6b538549bf7f9c6d0186686914b495739458 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 15 一月 2019 19:56:11 +0800
Subject: [PATCH] 5722 【后端】【1.5】跨服BOSS开发(删除异兽之地副本脚本逻辑,宝箱刷新改为配置到 RandomRefreshNPC 中)

---
 /dev/null                                                                                        |  225 ---------------------------------------------
 ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py                                     |    1 
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py                             |    6 -
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py                   |   39 -------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py |    5 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                  |    1 
 6 files changed, 2 insertions(+), 275 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index 3f4b0f6..5801e05 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -502,7 +502,6 @@
     state = gameWorld.GetDictByKey(ChConfig.Def_WorldKey_OperationActionState % ShareDefine.OperationActionName_BossReborn)
     if state:
         Sync_BossRebornPoint(curPlayer)
-    Sync_DogzNPCRefreshTime(curPlayer)
     return
 
 ## 地图启动ok通知
@@ -517,10 +516,6 @@
     if IsMapNeedBossShunt(0):
         GameWorld.SendCommMapServerMsg(ShareDefine.Def_Notify_WorldKey_BossShuntPlayer, PyGameData.g_bossShuntPlayerInfo)
         GameWorld.SendCommMapServerMsg(ShareDefine.Def_Notify_WorldKey_BossShuntLineState, PyGameData.g_bossShuntLineState)
-    #通知一个参数
-    bossID = IpyGameDataPY.GetFuncCfg('DogzFBRefreshCfg', 2)
-    onlineCnt = __GetBossOnlineHeroCnt(bossID)[0]
-    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_BossOnlineHeroCnt % bossID, onlineCnt)
     
     #仙盟击杀骑宠boss数
     if PyGameData.g_familyKillHorsePetRobBossCntDict:
@@ -655,8 +650,6 @@
     
     newNum = newOnlieCnt * 100 + unUpdataCnt
     PlayerDBGSEvent.SetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_GameWorldBossOnlineCnt % bossid, newNum)
-    if bossid == IpyGameDataPY.GetFuncCfg('DogzFBRefreshCfg', 2):
-        GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_BossOnlineHeroCnt % bossid, newOnlieCnt)
     GameWorld.DebugLog("设置计算boss刷新时间用的在线人数 Change:bossid=%s, beforeOnlineCnt = %s, newOnlieCnt = %s, unUpdataCnt=%s" % (bossid, beforeOnlineCnt, newOnlieCnt, unUpdataCnt))
     return
 
@@ -1080,38 +1073,6 @@
     packData.RebornCnt = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornCnt)
     playerManager = GameWorld.GetPlayerManager()
     if not curPlayer:
-        for i in xrange(playerManager.GetActivePlayerCount()):
-            curPlayer = playerManager.GetActivePlayerAt(i)
-            if curPlayer == None or not curPlayer.GetInitOK():
-                continue
-            if PlayerControl.GetIsTJG(curPlayer):
-                continue
-            NetPackCommon.SendFakePack(curPlayer, packData)
-    else:
-        if PlayerControl.GetIsTJG(curPlayer):
-            return
-        NetPackCommon.SendFakePack(curPlayer, packData)
-    return
-
-def Sync_DogzNPCRefreshTime(curPlayer=None):
-    #同步神兽副本NPC刷新时间
-    refreshTimeDict = PyGameData.g_dogzNPCRefreshTimeDict
-
-    if not refreshTimeDict:
-        return
-    curTime = int(time.time())
-    packData = ChPyNetSendPack.tagGCDogzNPCRefreshTime()
-    packData.InfoList=[]
-    for npcid, timeinfo in refreshTimeDict.items():
-        lastRefreshTime, nextNeedTime = timeinfo
-        remainTime = max(0, nextNeedTime - curTime + lastRefreshTime)
-        timeInfo = ChPyNetSendPack.tagDogzTimeInfoObj()
-        timeInfo.NPCID = npcid
-        timeInfo.RefreshSecond = remainTime
-        packData.InfoList.append(timeInfo)
-    packData.Cnt = len(packData.InfoList)
-    if not curPlayer:
-        playerManager = GameWorld.GetPlayerManager()
         for i in xrange(playerManager.GetActivePlayerCount()):
             curPlayer = playerManager.GetActivePlayerAt(i)
             if curPlayer == None or not curPlayer.GetInitOK():
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
index 9f9af8b..e32b133 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
@@ -852,11 +852,7 @@
     if callName =="AddBossRebornPoint":
         GameWorldBoss.AddBossRebornPoint(eval(resultName))
         return
-    #通知神兽副本NPC刷新时间
-    if callName =="DogzNPCTime":
-        PyGameData.g_dogzNPCRefreshTimeDict = eval(resultName)
-        GameWorldBoss.Sync_DogzNPCRefreshTime()
-        return
+    
 #---return分割线-----------------------------------------------------------------
 
     
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
index afebc34..c4dd49f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -77,7 +77,6 @@
 g_familyPartyTopInfo = [] #仙盟宴会答题王 [playerID,名字]
 g_partyheroAnswerDict = {} #仙盟宴会玩家答题数量 {playerid:答题数量,..}
 
-g_dogzNPCRefreshTimeDict = {} # 神兽副本NPC刷新时间{npcid:剩余刷新时间}
 g_bourseItemTradingTimeDict = {} # 物品开始交易的时间记录 {guid:tick}
 
 g_fbHelpBattleCheckInPlayerDict = {} # 副本助战玩家登记缓存 {playerID:HelpBattlePlayer, ...}
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 156f652..cb93d66 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1888,7 +1888,6 @@
                 'Guard':[Def_FBMapID_Guard], #守护副本
                 'SealDemon':[Def_FBMapID_SealDemon, Def_FBMapID_SealDemonEx], #封魔坛
                 'XMZZ':[Def_FBMapID_XMZZ], #仙魔之争
-                'Dogz':[Def_FBMapID_Dogz], #神兽副本
                 'CrossRealmPK':[Def_FBMapID_CrossRealmPK], #跨服竞技场
                 'GatherSoul':[Def_FBMapID_GatherSoul],#聚魂副本
                 }
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
deleted file mode 100644
index 06e1d50..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#-------------------------------------------------------------------------------
-#
-##@package GameWorldLogic.FBProcess.GameLogic_Dogz
-#
-# @todo:神兽地界
-# @author xdh
-# @date 2018-08-17
-# @version 1.0
-#
-# 详细描述: 神兽地界
-#
-#-------------------------------------------------------------------------------
-#"""Version = 2018-08-17 16:30"""
-#-------------------------------------------------------------------------------
-
-import GameWorld
-import IpyGameDataPY
-import IPY_GameWorld
-import ShareDefine
-import NPCCustomRefresh
-import SkillCommon
-import GameObj
-import time
-import random
-import ChConfig
-
-
-#{(标识点):[npcid,单个点数量,刷新间隔秒, 每次刷新只数, 第一次刷新只数, 总个数上限]}
-#{(101,102,103):[20302001,1,'20', 2, 10,30]}
-(
-Def_NPCID,
-Def_MaxCnt,
-Def_TimeFormula,
-Def_RefreshCnt,
-Def_FirstRefreshCnt,
-Def_TotalLimit,
-) = range(6)
-
-Map_Dogzfb_LastRefreshTime = "Dogzfb_LastRefreshTime%s"  # 刷新时间 参数npcid
-Map_Dogzfb_NextNeedTime = "NextNeedTime%s"  # 下次刷新需要时间 参数npcid
-Map_Dogzfb_LastCheckTick = "LastCheckTick"  # 上次检查时间
-Map_Dogzfb_NPCRemainCnt = 'NPCRemainCnt_%s'   # NPC剩余数量
-
-## 是否能够通过活动查询进入
-#  @param curPlayer 玩家实例
-#  @param mapID 地图ID
-#  @param lineID 线路id
-#  @param tick 时间戳
-#  @return 布尔值
-def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
-    return True
-
-
-## 查询地图是否开启
-#  @param tick 时间戳
-#  @return 布尔值
-def OnCanOpen(tick):
-    return True
-
-
-##查询是否可以进入地图
-# @param ask:请求结构体(IPY_BMChangeMapAsk)
-# @param tick:时间戳
-# @return IPY_GameWorld.cme 枚举
-def OnChangeMapAsk(ask, tick):
-    return IPY_GameWorld.cmeAccept
-
-
-## 进副本
-#  @param curPlayer
-#  @param tick
-#  @return None
-def DoEnterFB(curPlayer, tick):
-
-    return
-
-
-
-### 是否副本复活
-##  @param None
-##  @return 是否副本复活
-#def OnPlayerReborn():
-#    return False
-
-
-## 获得副本帮助信息
-#  @param curPlayer 当前玩家(被通知对象)
-#  @param tick 当前时间
-#  @return None
-def DoFBHelp(curPlayer, tick, isEnter=False):
-
-    return
-
-
-## 副本行为
-#  @param curPlayer 玩家
-#  @param actionType 行为类型
-#  @param actionInfo 行为信息
-#  @param tick 当前时间
-#  @return None
-def DoFBAction(curPlayer, actionType, actionInfo, tick):
-    
-    return
-
-##---副本总逻辑计时器---
-# @param tick:时间戳
-# @return 无意义
-# @remarks 副本总逻辑计时器
-def OnProcess(tick):
-    CheckRefreshBoss(tick)
-    return
-
-
-def CheckRefreshBoss(tick, isFirst=False):
-    gameFB = GameWorld.GetGameFB()
-    lastCheckTick = gameFB.GetGameFBDictByKey(Map_Dogzfb_LastCheckTick)
-    if not (isFirst or (lastCheckTick and tick - lastCheckTick > 1000)):
-        return
-    gameFB.SetGameFBDict(Map_Dogzfb_LastCheckTick, tick)
-    
-    dogzRefreshCfg = IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 1, {})
-    curTime = int(time.time())
-    gameWorld = GameWorld.GetGameWorld()
-    refreshDict = {}
-    for markInfo, refreshInfo in dogzRefreshCfg.items():
-        npcID = refreshInfo[Def_NPCID]
-        
-        nextNeedTime = gameWorld.GetGameWorldDictByKey(Map_Dogzfb_NextNeedTime % npcID)
-        if not nextNeedTime:
-            continue
-        lastRefreshTime = gameWorld.GetGameWorldDictByKey(Map_Dogzfb_LastRefreshTime % npcID)
-        if lastRefreshTime and curTime - lastRefreshTime < nextNeedTime:
-            #时间未到
-            continue
-        refreshDict[markInfo] = refreshInfo
-    if not refreshDict:
-        return
-    
-    npcCntDict = {}  #标识点对应数量
-    gameNPC = GameWorld.GetNPCManager()
-    for i in xrange(0, gameNPC.GetCustomNPCRefreshCount()):
-        npcRefresh = gameNPC.GetCustomNPCRefreshAt(i)
-        npcCnt = npcRefresh.GetCount()
-        if not npcCnt:
-            continue
-        rmark = npcRefresh.GetRefreshMark()
-        npcCntDict[rmark] = npcCntDict.get(rmark, 0) + npcRefresh.GetCount()
-    isNeedSync = False #是否需要通知
-    for markInfo, refreshInfo in refreshDict.items():
-        npcID = refreshInfo[Def_NPCID]
-        refreshCnt = refreshInfo[Def_FirstRefreshCnt] if isFirst else refreshInfo[Def_RefreshCnt]
-        gameWorld.SetGameWorldDict(Map_Dogzfb_LastRefreshTime % npcID, curTime)
-        maxCnt = refreshInfo[Def_MaxCnt]
-        markList = [markInfo] if isinstance(markInfo, int) else list(markInfo)
-        curTotalCnt = 0
-        for rMark in markList:
-            curTotalCnt += npcCntDict.get(rMark, 0)
-        refreshCnt = min(refreshCnt, refreshInfo[Def_TotalLimit] - curTotalCnt)
-        if refreshCnt > 0:
-            random.shuffle(markList)
-            for rMark in markList:
-                if refreshCnt <=0:
-                    break
-                curCnt = npcCntDict.get(rMark, 0)
-                if curCnt >= maxCnt:
-                    continue
-                needRefreshCnt = min(refreshCnt, maxCnt - curCnt)
-                refreshCnt -= needRefreshCnt
-                NPCCustomRefresh.SetNPCRefresh(rMark, [(npcID, needRefreshCnt)], needRefreshCnt + curCnt, needRefreshCnt)
-        
-        #计算下次多久刷新
-        __UpdateBossTime(npcID, refreshInfo[Def_TimeFormula])
-        if npcID in IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 3):
-            isNeedSync = True
-    #通知时间
-    if isNeedSync:
-        SyncNPCRefreshTime()
-    
-    return
-
-def OnOnlineCntChange(key, tick):
-    if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_Dogz:
-        return
-    bossid = IpyGameDataPY.GetFuncCfg('DogzFBRefreshCfg', 2)
-    if str(bossid) not in key:
-        return
-    gameFB = GameWorld.GetGameFB()
-    lastCheckTick = gameFB.GetGameFBDictByKey(Map_Dogzfb_LastCheckTick)
-    if not lastCheckTick:
-        dogzRefreshCfg = IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 1, {})
-        for refreshInfo in dogzRefreshCfg.values():
-            npcID = refreshInfo[Def_NPCID]
-            __UpdateBossTime(npcID, refreshInfo[Def_TimeFormula])
-        CheckRefreshBoss(tick, True)
-    return
-
-def __UpdateBossTime(npcID, formula):
-    gameWorldMgr = GameWorld.GetGameWorld()
-    onlineCnt = gameWorldMgr.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_BossOnlineHeroCnt)
-    nextTime = eval(formula)
-    gameWorldMgr.SetGameWorldDict(Map_Dogzfb_NextNeedTime % npcID, nextTime)
-    #GameWorld.DebugLog('    怪刷新间隔  npcID=%s, nextTime=%s'%(npcID, nextTime))
-    return
-
-def GetDogzNPCRefreshTime(curTime, npcID):
-    #获取NPC剩余刷新时间
-    gameWorldMgr = GameWorld.GetGameWorld()
-    lastRefreshTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_LastRefreshTime % npcID)
-    nextNeedTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_NextNeedTime % npcID)
-    return max(0, nextNeedTime - curTime + lastRefreshTime)
-
-def SyncNPCRefreshTime():
-    syncNPCIDList = IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 3)
-    syncDict = {}
-    for npcID in syncNPCIDList:
-        gameWorldMgr = GameWorld.GetGameWorld()
-        lastRefreshTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_LastRefreshTime % npcID)
-        nextNeedTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_NextNeedTime % npcID)
-        syncDict[npcID] = [lastRefreshTime, nextNeedTime]
-    msgStr = str(syncDict)
-    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'DogzNPCTime', msgStr, len(msgStr))
-    return
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
index 7f703a6..8458827 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -74,7 +74,6 @@
 import GameLogic_ElderBattlefield
 import GameLogic_FamilyBoss
 import GameLogic_FamilyWar
-import GameLogic_Dogz
 import OpenServerCampaign
 import PlayerCostRebate
 import PlayerActTotalRecharge
@@ -1409,9 +1408,7 @@
     # 活动buff状态变更
     elif key.startswith(ShareDefine.Def_Notify_WorldKey_ActionBuffState[:-2]):            
         PlayerAction.OnActionBuffStateChange(key, tick)
-    #boss刷新时间参数
-    elif key.startswith(ShareDefine.Def_Notify_WorldKey_BossOnlineHeroCnt[:-2]):
-        GameLogic_Dogz.OnOnlineCntChange(key, tick)
+        
 #===============================================================================
 #    ---修改为上述的 统一字典处理
 #    if msg == ChConfig.Def_Notify_Key_PurTalk:

--
Gitblit v1.8.0