示例#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)
示例#2
0
    def fini(self, clientPrb=None, woEvents=False):
        self._hasEntity = False
        self._settings = None
        super(PrbDispatcher, self).fini(clientPrb, woEvents)
        if self._limits is not None:
            self._limits.clear()
            self._limits = None
        if not woEvents:
            try:
                self._invokeListeners('onPrbFunctionalFinished')
            except:
                LOG_CURRENT_EXCEPTION()

        self.clear()
        if clientPrb is None:
            clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            clientPrb.onSettingUpdated -= self.prb_onSettingUpdated
            clientPrb.onTeamStatesReceived -= self.prb_onTeamStatesReceived
            clientPrb.onPlayerStateChanged -= self.prb_onPlayerStateChanged
            clientPrb.onPlayerRosterChanged -= self.prb_onPlayerRosterChanged
            clientPrb.onPlayerAdded -= self.prb_onPlayerAdded
            clientPrb.onPlayerRemoved -= self.prb_onPlayerRemoved
            clientPrb.onKickedFromQueue -= self.prb_onKickedFromQueue
        return FUNCTIONAL_FLAG.UNDEFINED
示例#3
0
 def fini(self, clientPrb = None, woEvents = False):
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingsReceived -= self.prb_onSettingsReceived
         clientPrb.onRosterReceived -= self.prb_onRosterReceived
     return FUNCTIONAL_FLAG.UNDEFINED
示例#4
0
    def fini(self, clientPrb = None, woEvents = False):
        self._hasEntity = False
        self._settings = None
        super(PrbDispatcher, self).fini(clientPrb, woEvents)
        if self._limits is not None:
            self._limits.clear()
            self._limits = None
        if not woEvents:
            try:
                self._invokeListeners('onPrbFunctionalFinished')
            except:
                LOG_CURRENT_EXCEPTION()

        self.clear()
        if clientPrb is None:
            clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            clientPrb.onSettingUpdated -= self.prb_onSettingUpdated
            clientPrb.onTeamStatesReceived -= self.prb_onTeamStatesReceived
            clientPrb.onPlayerStateChanged -= self.prb_onPlayerStateChanged
            clientPrb.onPlayerRosterChanged -= self.prb_onPlayerRosterChanged
            clientPrb.onPlayerAdded -= self.prb_onPlayerAdded
            clientPrb.onPlayerRemoved -= self.prb_onPlayerRemoved
            clientPrb.onKickedFromQueue -= self.prb_onKickedFromQueue
        return FUNCTIONAL_FLAG.UNDEFINED
示例#5
0
 def fini(self, clientPrb=None, woEvents=False):
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingsReceived -= self.prb_onSettingsReceived
         clientPrb.onRosterReceived -= self.prb_onRosterReceived
     return FUNCTIONAL_FLAG.UNDEFINED
示例#6
0
 def _canAddPlayers(self):
     clientPrb = prb_getters.getClientPrebattle()
     result = False
     if clientPrb is not None:
         settings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
         rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
         result, _ = limits.MaxCount().check(rosters, 1, settings.getTeamLimits(1))
     return result
示例#7
0
 def _canAddPlayers(self):
     clientPrb = prb_getters.getClientPrebattle()
     result = False
     if clientPrb is not None:
         settings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
         rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
         result, _ = MaxCount().check(rosters, 1, settings.getTeamLimits(1))
     return result
示例#8
0
 def pe_onPrebattleJoined(self):
     if prb_getters.getClientPrebattle() is not None:
         self.__setLegacy(self.__requestCtx.getFlags())
     else:
         LOG_ERROR('ClientPrebattle is not defined')
         self.__setDefault()
         g_eventDispatcher.loadHangar()
     return
示例#9
0
 def pe_onPrebattleJoined(self):
     if prb_getters.getClientPrebattle() is not None:
         flags = self.__requestCtx.getFlags()
         self.__setFunctional(CreateFunctionalCtx(_CTRL_TYPE.PREBATTLE, flags=flags))
     else:
         LOG_ERROR("ClientPrebattle is not defined")
         self.__requestCtx.stopProcessing(result=False)
     return
示例#10
0
 def pe_onPrebattleJoined(self):
     if prb_getters.getClientPrebattle() is not None:
         flags = self.__requestCtx.getFlags()
         self.__setFunctional(
             CreateFunctionalCtx(_CTRL_TYPE.PREBATTLE, flags=flags))
     else:
         LOG_ERROR('ClientPrebattle is not defined')
         self.__requestCtx.stopProcessing(result=False)
     return
示例#11
0
 def fini(self, clientPrb=None, ctx=None, woEvents=False):
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingsReceived -= self.prb_onSettingsReceived
         clientPrb.onRosterReceived -= self.prb_onRosterReceived
     return super(LegacyInitEntity, self).fini(clientPrb=clientPrb,
                                               ctx=ctx,
                                               woEvents=woEvents)
示例#12
0
 def join(self, ctx, callback = None):
     if prb_getters.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_join(ctx.getID())
     else:
         LOG_ERROR('First, player has to confirm exit from the current prebattle', prb_getters.getPrebattleType())
         if callback:
             callback(False)
     return
示例#13
0
 def _canAddPlayers(self):
     """
     Can new player be added to team according to max limit
     """
     clientPrb = prb_getters.getClientPrebattle()
     result = False
     if clientPrb is not None:
         settings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
         rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
         result, _ = MaxCount().check(rosters, 1, settings.getTeamLimits(1))
     return result
示例#14
0
 def init(self, clientPrb = None, ctx = None):
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingsReceived += self.prb_onSettingsReceived
         clientPrb.onRosterReceived += self.prb_onRosterReceived
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             self.prb_onSettingsReceived()
         if prb_getters.getPrebattleRosters(prebattle=clientPrb):
             self.prb_onRosterReceived()
     return FUNCTIONAL_FLAG.UNDEFINED
示例#15
0
 def init(self, clientPrb=None, ctx=None):
     result = super(EpicBattleTrainingEntity, self).init(clientPrb=clientPrb)
     g_eventBus.addListener(ViewEventType.LOAD_VIEW, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onPlayerGroupChanged += self.__prb_onPlayerGroupChanged
     self.__enterTrainingRoom(True)
     g_eventDispatcher.addEpicTrainingToCarousel(False)
     result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_WINDOW)
     result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_PAGE)
     return result
 def init(self, clientPrb=None, ctx=None):
     result = super(LegacyInitEntity, self).init(clientPrb=clientPrb, ctx=ctx)
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingsReceived += self.prb_onSettingsReceived
         clientPrb.onRosterReceived += self.prb_onRosterReceived
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             self.prb_onSettingsReceived()
         if prb_getters.getPrebattleRosters(prebattle=clientPrb):
             self.prb_onRosterReceived()
     return result
示例#17
0
 def pe_onPrebattleJoined(self):
     """
     Player event listener for prebattle join. Sets entity to proper legacy or
     resets to default.
     """
     if prb_getters.getClientPrebattle() is not None:
         self.__setLegacy(self.__requestCtx.getFlags())
     else:
         LOG_ERROR('ClientPrebattle is not defined')
         self.__setDefault()
         g_eventDispatcher.loadHangar()
     return
示例#18
0
 def canAssignToTeam(self, team = 1):
     result = super(BattleSessionPermissions, self).canAssignToTeam(team)
     if not result:
         return False
     else:
         clientPrb = prb_getters.getClientPrebattle()
         result = False
         if clientPrb is not None:
             settings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
             rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(clientPrb, settings)
             result, _ = TeamNoPlayersInBattle(prbType).check(rosters, team, settings.getTeamLimits(team))
         return result
示例#19
0
 def canAssignToTeam(self, team = 1):
     result = super(BattleSessionPrbPermissions, self).canAssignToTeam(team)
     if not result:
         return False
     else:
         clientPrb = prb_getters.getClientPrebattle()
         result = False
         if clientPrb is not None:
             settings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
             rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(clientPrb, settings)
             result, _ = limits.TeamNoPlayersInBattle(prbType).check(rosters, team, settings.getTeamLimits(team))
         return result
示例#20
0
 def create(self, ctx, callback = None):
     if prb_cooldown.validatePrbCreationCooldown():
         if callback is not None:
             callback(False)
     elif prb_getters.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_createCompany(ctx.isOpened(), ctx.getComment(), ctx.getDivision())
         prb_cooldown.setPrbCreationCooldown()
     else:
         LOG_ERROR('First, player has to confirm exit from the current prebattle', prb_getters.getPrebattleType())
         if callback is not None:
             callback(False)
     return
示例#21
0
    def init(self, clientPrb=None, ctx=None):
        result = super(EpicBattleTrainingEntity, self).init(clientPrb=clientPrb)
        add = g_eventBus.addListener
        for event in self.__loadEvents:
            add(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        if clientPrb is None:
            clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            clientPrb.onPlayerGroupChanged += self.__prb_onPlayerGroupChanged
        self.__enterTrainingRoom(True)
        result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_WINDOW)
        result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_PAGE)
        return result
示例#22
0
 def __createByAccountState(self, ctx):
     clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             prbSettings = prb_getters.getPrebattleSettings(
                 prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(settings=prbSettings)
             clazz = None
             clazz = collectLegacyEntity(prbType)
             if clazz:
                 return clazz(prbSettings)
         else:
             return LegacyInitEntity()
     return self.__createByPrbType(ctx)
示例#23
0
    def __checkPrebattleLockedVehicle(self):
        clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
            for rId, roster in rosters.iteritems():
                if BigWorld.player().id in roster:
                    vehCompDescr = roster[BigWorld.player().id].get('vehCompDescr', '')
                    if len(vehCompDescr):
                        vehDescr = vehicles.VehicleDescr(vehCompDescr)
                        vehicle = g_itemsCache.items.getItemByCD(vehDescr.type.compactDescr)
                        if vehicle is not None:
                            return vehicle.invID

        return 0
示例#24
0
    def __checkPrebattleLockedVehicle(self):
        clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
            for rId, roster in rosters.iteritems():
                if BigWorld.player().id in roster:
                    vehCompDescr = roster[BigWorld.player().id].get('vehCompDescr', '')
                    if len(vehCompDescr):
                        vehDescr = vehicles.VehicleDescr(vehCompDescr)
                        vehicle = g_itemsCache.items.getItemByCD(vehDescr.type.compactDescr)
                        if vehicle is not None:
                            return vehicle.invID

        return 0
示例#25
0
    def __checkPrebattleLockedVehicle(self):
        from gui.prb_control import prb_getters
        clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            rosters = prb_getters.getPrebattleRosters(prebattle=clientPrb)
            for _, roster in rosters.iteritems():
                if BigWorld.player().id in roster:
                    vehCompDescr = roster[BigWorld.player().id].get('vehCompDescr', '')
                    if vehCompDescr:
                        vehDescr = VehicleDescr(vehCompDescr)
                        vehicle = self.itemsCache.items.getItemByCD(vehDescr.type.compactDescr)
                        if vehicle is not None:
                            return vehicle.invID

        return 0
 def init(self, clientPrb=None, ctx=None):
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingUpdated += self.prb_onSettingUpdated
         clientPrb.onRosterReceived += self.prb_onRosterReceived
         clientPrb.onTeamStatesReceived += self.prb_onTeamStatesReceived
         clientPrb.onPlayerStateChanged += self.prb_onPlayerStateChanged
         clientPrb.onPlayerRosterChanged += self.prb_onPlayerRosterChanged
         clientPrb.onPlayerAdded += self.prb_onPlayerAdded
         clientPrb.onPlayerRemoved += self.prb_onPlayerRemoved
         clientPrb.onKickedFromQueue += self.prb_onKickedFromQueue
     else:
         LOG_ERROR('ClientPrebattle is not defined')
     return super(LegacyEntity, self).init(clientPrb, ctx)
示例#27
0
 def fini(self, clientPrb=None, ctx=None, woEvents=False):
     super(EpicBattleTrainingEntity, self).fini(clientPrb=clientPrb, ctx=ctx, woEvents=woEvents)
     clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onPlayerGroupChanged -= self.__prb_onPlayerGroupChanged
     g_eventBus.removeListener(ViewEventType.LOAD_VIEW, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)
     if not woEvents:
         aliasToLoad = [PREBATTLE_ALIASES.EPICBATTLE_LIST_VIEW_PY, PREBATTLE_ALIASES.EPIC_TRAINING_ROOM_VIEW_PY]
         if not self.canSwitch(ctx) and g_eventDispatcher.needToLoadHangar(ctx, self.getModeFlags(), aliasToLoad):
             g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeEpicTrainingFromCarousel(False)
         self.storage.suspend()
     else:
         g_eventDispatcher.removeEpicTrainingFromCarousel(False, closeWindow=False)
     return FUNCTIONAL_FLAG.UNDEFINED
示例#28
0
 def create(self, ctx, callback = None):
     if not isinstance(ctx, prb_ctx.TrainingSettingsCtx):
         LOG_ERROR('Invalid context to create training', ctx)
         if callback is not None:
             callback(False)
     elif prb_cooldown.validatePrbCreationCooldown():
         if callback is not None:
             callback(False)
     elif prb_getters.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_createTraining(ctx.getArenaTypeID(), ctx.getRoundLen(), ctx.isOpened(), ctx.getComment())
         prb_cooldown.setPrbCreationCooldown()
     else:
         LOG_ERROR('First, player has to confirm exit from the current prebattle', prb_getters.getPrebattleType())
         if callback is not None:
             callback(False)
     return
示例#29
0
 def create(self, ctx, callback=None):
     if prb_cooldown.validatePrbCreationCooldown():
         if callback is not None:
             callback(False)
     elif prb_getters.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_createCompany(ctx.isOpened(),
                                             ctx.getComment(),
                                             ctx.getDivision())
         prb_cooldown.setPrbCreationCooldown()
     else:
         LOG_ERROR(
             'First, player has to confirm exit from the current prebattle',
             prb_getters.getPrebattleType())
         if callback is not None:
             callback(False)
     return
示例#30
0
 def create(self, ctx, callback=None):
     if not isinstance(ctx, TrainingSettingsCtx):
         LOG_ERROR('Invalid context to create training', ctx)
         if callback is not None:
             callback(False)
     elif not self.canCreate():
         if callback is not None:
             callback(False)
     elif prb_getters.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_createTraining(ctx.getArenaTypeID(), ctx.getRoundLen(), ctx.isOpened(), ctx.getComment())
         cooldown.setPrbCreationCooldown()
     else:
         LOG_ERROR('First, player has to confirm exit from the current prebattle', prb_getters.getPrebattleType())
         if callback is not None:
             callback(False)
     return
示例#31
0
 def init(self, clientPrb = None, ctx = None):
     self._hasEntity = True
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingUpdated += self.prb_onSettingUpdated
         clientPrb.onRosterReceived += self.prb_onRosterReceived
         clientPrb.onTeamStatesReceived += self.prb_onTeamStatesReceived
         clientPrb.onPlayerStateChanged += self.prb_onPlayerStateChanged
         clientPrb.onPlayerRosterChanged += self.prb_onPlayerRosterChanged
         clientPrb.onPlayerAdded += self.prb_onPlayerAdded
         clientPrb.onPlayerRemoved += self.prb_onPlayerRemoved
         clientPrb.onKickedFromQueue += self.prb_onKickedFromQueue
         self._invokeListeners('onPrbFunctionalInited')
     else:
         LOG_ERROR('ClientPrebattle is not defined')
     return FUNCTIONAL_FLAG.UNDEFINED
示例#32
0
    def fini(self, clientPrb=None, ctx=None, woEvents=False):
        super(EpicBattleTrainingEntity, self).fini(clientPrb=clientPrb, ctx=ctx, woEvents=woEvents)
        clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            clientPrb.onPlayerGroupChanged -= self.__prb_onPlayerGroupChanged
        remove = g_eventBus.removeListener
        for event in self.__loadEvents:
            remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        if not woEvents:
            if not self.canSwitch(ctx):
                g_eventDispatcher.loadHangar()
            g_eventDispatcher.removeTrainingFromCarousel(False)
            self.storage.suspend()
        else:
            g_eventDispatcher.removeTrainingFromCarousel(False, closeWindow=False)
        return FUNCTIONAL_FLAG.UNDEFINED
 def fini(self, clientPrb=None, ctx=None, woEvents=False):
     self._settings = None
     result = super(LegacyEntity, self).fini(clientPrb, ctx=ctx, woEvents=woEvents)
     if self._limits is not None:
         self._limits.clear()
         self._limits = None
     self.clear()
     if clientPrb is None:
         clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         clientPrb.onSettingUpdated -= self.prb_onSettingUpdated
         clientPrb.onTeamStatesReceived -= self.prb_onTeamStatesReceived
         clientPrb.onPlayerStateChanged -= self.prb_onPlayerStateChanged
         clientPrb.onPlayerRosterChanged -= self.prb_onPlayerRosterChanged
         clientPrb.onPlayerAdded -= self.prb_onPlayerAdded
         clientPrb.onPlayerRemoved -= self.prb_onPlayerRemoved
         clientPrb.onKickedFromQueue -= self.prb_onKickedFromQueue
     return result
示例#34
0
    def _getPlayersStateStats(self, rosterKey):
        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)
示例#35
0
 def __createByAccountState(self, ctx):
     """
     Tries to create entity by current account state.
     Args:
         ctx: creation request context.
     
     Returns:
         new prebattle legacy entity
     """
     clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             prbSettings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(settings=prbSettings)
             clazz = None
             if prbType in _SUPPORTED_ENTITY:
                 clazz = _SUPPORTED_ENTITY[prbType]
             if clazz:
                 return clazz(prbSettings)
         else:
             return LegacyInitEntity()
     return self.__createByPrbType(ctx)
示例#36
0
 def _createByAccountState(self, ctx):
     created = None
     clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             prbSettings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(settings=prbSettings)
             clazz = None
             if prbType in _SUPPORTED_FUNCTIONAL:
                 clazz = _SUPPORTED_FUNCTIONAL[prbType]
             ctx.removeFlags(FUNCTIONAL_FLAG.PREBATTLE_BITMASK)
             ctx.addFlags(FUNCTIONAL_FLAG.PREBATTLE)
             if clazz:
                 created = clazz(prbSettings)
             else:
                 LOG_ERROR('Prebattle with given type is not supported', prbType)
                 created = not_supported.NotSupportedFunctional()
         elif not ctx.hasFlags(FUNCTIONAL_FLAG.PREBATTLE_INIT):
             ctx.removeFlags(FUNCTIONAL_FLAG.PREBATTLE_BITMASK)
             ctx.addFlags(FUNCTIONAL_FLAG.PREBATTLE_INIT)
             created = default.PrbInitFunctional()
     else:
         created = self._createByPrbType(ctx)
     return created
 def prb_onPropertyUpdated(self, propertyName):
     propertyValue = prb_getters.getClientPrebattle().properties[propertyName]
     LOG_DEBUG('prb_onPropertyUpdated', propertyName, propertyValue)
     self._invokeListeners('onPropertyUpdated', self, propertyName, propertyValue)