hxp
2025-01-10 14dbb617cf425d0a08f7ca4c7b367c5cc90f3ee3
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/Bossall.py
@@ -18,25 +18,41 @@
import GameWorldBoss
import GameWorld
import time
import CrossBoss
## 执行逻辑
#  @param curPlayer 当前玩家
#  @param gmList []
#  @return None
def OnExec(curPlayer, gmList):
    bossIDList = []
    for i, bossInfo in enumerate(PyGameData.g_sortBOSSRefreshList):
        bossID, killedTime, refreshTime = bossInfo
        isAlive = GameWorldBoss.__GetIsAlive(bossID)
        if isAlive:
            continue
        refreshTime = 0
        killedTime = 0
        PyGameData.g_sortBOSSRefreshList[i] = [bossID, killedTime, refreshTime]
        bossIDList.append(bossID)
    curTime = int(time.time())
    PyGameData.g_sortBOSSRefreshList.sort(key=lambda asd:max(0, asd[2] - (curTime - asd[1])))
    bossIDList = __Bossall()
    GameWorld.DebugAnswer(curPlayer, "重生boss:%s" % bossIDList)
    return
def OnMergeServerExec(cmdMsgList, tick):
    bossIDList = __Bossall()
    GameWorld.DebugLog("重生boss:%s" % bossIDList)
    return
def OnGetMergeParam(curPlayer):
    return []
def __Bossall():
    isCrossServer = GameWorld.IsCrossServer()
    bossIDList = []
    for bossInfo in PyGameData.g_sortBOSSRefreshList:
        bossID = bossInfo[0]
        if isCrossServer:
            zoneID = bossInfo[3]
            isAlive = CrossBoss.__GetCrossBossIsAlive(zoneID, bossID)
        else:
            isAlive = GameWorldBoss.__GetIsAlive(bossID)
        if isAlive:
            continue
        bossInfo[1] = 0
        bossInfo[2] = 0
        bossIDList.append(bossID)
    curTime = int(time.time())
    PyGameData.g_sortBOSSRefreshList.sort(key=lambda asd:max(0, asd[2] - (curTime - asd[1])))
    return bossIDList