def doAction(self, action=None, dispatcher=None): result = False if action is None or action.actionName == PREBATTLE_ACTION_NAME.JOIN_RANDOM_QUEUE or action.actionName == PREBATTLE_ACTION_NAME.UNDEFINED: if isParentControlActivated(): events_dispatcher.showParentControlNotification() else: self.__doJoin(action=action) result = True return result
def doAction(self, action = None, dispatcher = None): result = False if action is None or action.actionName == PREBATTLE_ACTION_NAME.JOIN_RANDOM_QUEUE or action.actionName == PREBATTLE_ACTION_NAME.UNDEFINED: if isParentControlActivated(): events_dispatcher.showParentControlNotification() else: self.__doJoin(action=action) result = True return result
def _setTeamReady(self, ctx, callback = None): if isParentControlActivated(): events_dispatcher.showParentControlNotification() if callback: callback(False) return isValid, notValidReason = self._limits.isTeamValid() if isValid: ctx.startProcessing(callback) BigWorld.player().prb_teamReady(ctx.getTeam(), ctx.isForced(), ctx.getGamePlayMask(), ctx.onResponseReceived) else: LOG_ERROR('Team is invalid', notValidReason) if callback: callback(False) SystemMessages.pushMessage(messages.getInvalidTeamMessage(notValidReason, functional=self), type=SystemMessages.SM_TYPE.Error)
def _setPlayerReady(self, ctx, callback = None): if isParentControlActivated(): events_dispatcher.showParentControlNotification() if callback: callback(False) return isValid, notValidReason = self._limits.isVehicleValid() if not isValid: SystemMessages.pushMessage(messages.getInvalidVehicleMessage(notValidReason, self), type=SystemMessages.SM_TYPE.Error) if callback: callback(False) return rosterKey = self.getRosterKey() team, assigned = decodeRoster(rosterKey) if assigned and self.getTeamState(team=team).isInQueue(): LOG_ERROR('Account assigned and team is ready or locked') if callback: callback(False) return ctx.startProcessing(callback) BigWorld.player().prb_ready(ctx.getVehicleInventoryID(), ctx.onResponseReceived)