Ejemplo n.º 1
0
    def _getPlayersStateStats(self, rosterKey):
        """
        Get players state stats
        Args:
            rosterKey: roster key mask
        """
        clientPrb = prb_getters.getClientPrebattle()
        notReadyCount = 0
        playersCount = 0
        limitMaxCount = 0
        haveInBattle = False
        if clientPrb:
            players = clientPrb.rosters.get(rosterKey, {})
            playersCount = len(players)
            team, assigned = decodeRoster(rosterKey)
            teamLimits = self._settings.getTeamLimits(team)
            limitMaxCount = teamLimits['maxCount'][not assigned]
            for _, accInfo in players.iteritems():
                state = accInfo.get('state', PREBATTLE_ACCOUNT_STATE.UNKNOWN)
                if not state & PREBATTLE_ACCOUNT_STATE.READY:
                    notReadyCount += 1
                    if not haveInBattle and state & PREBATTLE_ACCOUNT_STATE.IN_BATTLE:
                        haveInBattle = True

        return prb_items.PlayersStateStats(notReadyCount, haveInBattle, playersCount, limitMaxCount)
Ejemplo n.º 2
0
 def getPlayersStateStats(self):
     return prb_items.PlayersStateStats(0, False, 0, 0)
Ejemplo n.º 3
0
 def getPlayersStateStats(self):
     """
     Get current player's state stats.
     """
     return prb_items.PlayersStateStats(0, False, 0, 0)