def _sendBattleQueueRequest(self, vInvID=0, action=1): """ Sends enqueue or dequeue request for unit entity. Args: vInvID: vehicle inventory id action: action type where 1 is start and 0 is stop """ ctx = BattleQueueUnitCtx('prebattle/battle_queue', action=action) ctx.selectVehInvID = vInvID self._entity.request(ctx)
def autoSearchCancel(self, value): self.__currentState = value if value == CYBER_SPORT_ALIASES.AUTO_SEARCH_COMMANDS_STATE or value == CYBER_SPORT_ALIASES.AUTO_SEARCH_ERROR_STATE or value == CYBER_SPORT_ALIASES.AUTO_SEARCH_WAITING_PLAYERS_STATE: self.prbEntity.request(AutoSearchUnitCtx(action=0)) elif value == CYBER_SPORT_ALIASES.AUTO_SEARCH_CONFIRMATION_STATE: self.prbEntity.request(DeclineSearchUnitCtx()) elif value == CYBER_SPORT_ALIASES.AUTO_SEARCH_ENEMY_STATE: self.prbEntity.request(BattleQueueUnitCtx(action=0))
def execute(self): pInfo = self._entity.getPlayerInfo() if pInfo.isCommander(): stats = self._entity.getStats() _, unit = self._entity.getUnit() if self._canDoAutoSearch(unit, stats): if self._entity.isParentControlActivated(): return if self._entity.getFlags().isDevMode(): DialogsInterface.showDialog( rally_dialog_meta.UnitConfirmDialogMeta( PREBATTLE_TYPE.UNIT, 'startBattle'), lambda result: (self._entity.doBattleQueue( BattleQueueUnitCtx('prebattle/battle_queue')) if result else None)) else: ctx = AutoSearchUnitCtx('prebattle/auto_search') LOG_DEBUG('Unit request', ctx) self._entity.doAutoSearch(ctx) else: self._sendBattleQueueRequest() else: self._entity.togglePlayerReadyAction()
def _sendBattleQueueRequest(self, vInvID=0, action=1): ctx = BattleQueueUnitCtx('prebattle/battle_queue', action=action) ctx.selectVehInvID = vInvID LOG_DEBUG('Unit request', ctx) self._entity.doBattleQueue(ctx)
def _sendBattleQueueRequest(self, vInvID=0, action=1): self._entity.request(BattleQueueUnitCtx(action=action))