def getCurrentCycleID(self):
     now = self.__getNow()
     isCurrent, seasonInfo = season_common.getSeason(
         self.__getSeasonSettings().asDict(), now)
     if isCurrent:
         _, _, _, cycleID = seasonInfo
         return cycleID
     else:
         return None
Ejemplo n.º 2
0
def getShieldsConfig(rankedConfig, now):
    result = {}
    res, seasonInfo = season_common.getSeason(rankedConfig, now)
    if not res:
        return result
    _, _, seasonID, cycleID = seasonInfo
    season = rankedConfig['seasons'].get(seasonID)
    if season:
        cycle = season['cycles'].get(cycleID, {})
        result.update(cycle.get('shields', rankedConfig['shields']))
    return result
Ejemplo n.º 3
0
    def __getBattleRoyaleSettings(self):
        generalSettings = self.__serverSettings.battleRoyale
        cycleID = None
        now = time_utils.getCurrentLocalServerTimestamp()
        _, cycleInfo = season_common.getSeason(generalSettings.asDict(), now)
        if cycleInfo:
            _, _, _, cycleID = cycleInfo
        for season in generalSettings.seasons.values():
            if cycleID in season.get('cycles', {}):
                return generalSettings.replace(season).replace(
                    season['cycles'][cycleID])

        return generalSettings
 def getSeason(self):
     rankedConfig = self.__account.serverSettings['ranked_config']
     return season_common.getSeason(
         rankedConfig, time_utils.getCurrentLocalServerTimestamp())