xdh
2018-09-26 d661f7bb084dacb9b6cb048cbb586881bdfcea6f
1889 神兽副本npc刷新时间通知修改
5个文件已修改
38 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -467,6 +467,7 @@
    state = gameWorld.GetDictByKey(ChConfig.Def_WorldKey_OperationActionState % ShareDefine.OperationActionName_BossReborn)
    if state:
        Sync_BossRebornPoint(curPlayer)
    Sync_DogzNPCRefreshTime(curPlayer)
    return
## 地图启动ok通知
@@ -1035,23 +1036,24 @@
        NetPackCommon.SendFakePack(curPlayer, packData)
    return
def Sync_DogzNPCRefreshTime(msgList):
def Sync_DogzNPCRefreshTime(curPlayer=None):
    #同步神兽副本NPC刷新时间
    playerID, refreshTimeDict = msgList
    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID) if playerID else None
    if playerID and not curPlayer:
        return
    refreshTimeDict = PyGameData.g_dogzNPCRefreshTimeDict
    if not refreshTimeDict:
        return
    curTime = int(time.time())
    packData = ChPyNetSendPack.tagGCDogzNPCRefreshTime()
    packData.InfoList=[]
    for npcid, rTime in refreshTimeDict.items():
    for npcid, timeinfo in refreshTimeDict.items():
        lastRefreshTime, nextNeedTime = timeinfo
        remainTime = max(0, nextNeedTime - curTime + lastRefreshTime)
        timeInfo = ChPyNetSendPack.tagDogzTimeInfoObj()
        timeInfo.NPCID = npcid
        timeInfo.RefreshSecond = rTime
        timeInfo.RefreshSecond = remainTime
        packData.InfoList.append(timeInfo)
    packData.Cnt = len(packData.InfoList)
    if not playerID:
    if not curPlayer:
        playerManager = GameWorld.GetPlayerManager()
        for i in xrange(playerManager.GetActivePlayerCount()):
            curPlayer = playerManager.GetActivePlayerAt(i)
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
@@ -767,7 +767,8 @@
        return
    #通知神兽副本NPC刷新时间
    if callName =="DogzNPCTime":
        GameWorldBoss.Sync_DogzNPCRefreshTime(eval(resultName))
        PyGameData.g_dogzNPCRefreshTimeDict = eval(resultName)
        GameWorldBoss.Sync_DogzNPCRefreshTime()
        return
#---return分割线-----------------------------------------------------------------
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -74,4 +74,6 @@
g_questionIDHistory = {}#出过的题记录 {familyid:[出过的题id,..]}
g_familyAnswerDict = {} #仙盟答题数量 {familyid:[答题数量,tick],..}
g_familyPartyTopInfo = [] #仙盟宴会答题王 [playerID,名字]
g_partyheroAnswerDict = {} #仙盟宴会玩家答题数量 {playerid:答题数量,..}
g_partyheroAnswerDict = {} #仙盟宴会玩家答题数量 {playerid:答题数量,..}
g_dogzNPCRefreshTimeDict = {} # 神兽副本NPC刷新时间{npcid:剩余刷新时间}
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
@@ -248,14 +248,15 @@
    nextNeedTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_NextNeedTime % npcID)
    return max(0, nextNeedTime - curTime + lastRefreshTime)
def SyncNPCRefreshTime(playerid=0):
    curTime = int(time.time())
def SyncNPCRefreshTime():
    syncNPCIDList = IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 3)
    syncDict = {}
    for npcID in syncNPCIDList:
        refreshTime = GetDogzNPCRefreshTime(curTime, npcID)
        syncDict[npcID] = refreshTime
    msgStr = str([playerid, syncDict])
        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
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -541,8 +541,6 @@
    GameFuncComm.DoFuncOpenLogic(curPlayer)
    # 神兽
    PlayerDogz.OnPlayerLogin(curPlayer)
    # 神兽副本
    GameLogic_Dogz.SyncNPCRefreshTime(curPlayer.GetID())
    # 骑宠
    FamilyRobBoss.OnPlayerLogin(curPlayer)