def init(self, ctx = None): result = super(RandomQueueFunctional, self).init(ctx) g_gameCtrl.captcha.onCaptchaInputCanceled += self.onCaptchaInputCanceled if self.isInQueue(): g_eventDispatcher.loadBattleQueue() result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_PAGE) return result
def init(self, ctx = None): result = super(EventBattlesQueueFunctional, self).init(ctx) g_gameCtrl.captcha.onCaptchaInputCanceled += self.onCaptchaInputCanceled if self.isInQueue(): g_eventDispatcher.loadBattleQueue() result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_PAGE) return result
def prb_onTeamStatesReceived(self): super(EventSquadFunctional, self).prb_onTeamStatesReceived() g_eventDispatcher.updateUI() if self.getPlayerInfo().isReady() or self.isCreator(): if self.getTeamState(team=1).isInQueue(): g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar()
def prb_onTeamStatesReceived(self): super(CompanyFunctional, self).prb_onTeamStatesReceived() g_eventDispatcher.updateUI() playerInfo = self.getPlayerInfo() if playerInfo.isReady() or self.isCreator(): if self.getTeamState(team=1).isInQueue() and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1: g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar()
def prb_onTeamStatesReceived(self): super(CompanyFunctional, self).prb_onTeamStatesReceived() g_eventDispatcher.updateUI() playerInfo = self.getPlayerInfo() if playerInfo.isReady() or self.isCreator(): if self.getTeamState(team=1).isInQueue( ) and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1: g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar()
def init(self, ctx=None): self.storage.release() if ctx is not None: initCtx = ctx.getInitCtx() fromEventSquad = isinstance(initCtx, EventSquadSettingsCtx) if not fromEventSquad or not initCtx.getKeepCurrentView(): if self.getPlayerInfo().isReady and self.getFlags().isInQueue(): g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar() return super(EventBattleSquadEntity, self).init(ctx)
def setUnitChanged(self, loadHangar=False): flags = self._entity.getFlags() if self._entity.getPlayerInfo().isReady and flags.isInQueue(): _, unit = self._entity.getUnit() pInfo = self._entity.getPlayerInfo() vInfos = unit.getMemberVehicles(pInfo.dbID) if vInfos is not None: g_currentVehicle.selectVehicle(vInfos[0].vehInvID) g_eventDispatcher.loadBattleQueue() elif loadHangar: g_eventDispatcher.loadHangar() return
def init(self, clientPrb = None, ctx = None): result = super(CompanyFunctional, self).init(clientPrb=clientPrb) playerInfo = self.getPlayerInfo() if self.getTeamState(team=1).isInQueue() and playerInfo.isReady() and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1: g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar() g_eventDispatcher.loadCompany() result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_WINDOW) result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_PAGE) g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED, self.__handleCarouselInited, scope=EVENT_BUS_SCOPE.LOBBY) g_eventDispatcher.updateUI() return result
def init(self, clientPrb=None, ctx=None): result = super(CompanyEntity, self).init(clientPrb=clientPrb, ctx=ctx) playerInfo = self.getPlayerInfo() if self.getTeamState(team=1).isInQueue() and playerInfo.isReady( ) and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1: g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar() g_eventDispatcher.loadCompany() result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_WINDOW) result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_PAGE) g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED, self.__handleCarouselInited, scope=EVENT_BUS_SCOPE.LOBBY) self.eventsCache.companies.onCompanyStateChanged += self.__onCompanyStateChanged return result
def executeInit(self, ctx): initResult = FUNCTIONAL_INIT_RESULT.UNDEFINED if self._functional.getPlayerInfo().isReady and self._functional.getFlags().isInQueue(): g_eventDispatcher.loadBattleQueue() initResult = FUNCTIONAL_INIT_RESULT.LOAD_PAGE squadCtx = None if ctx is not None: isCreationCtx = ctx.getRequestType() is REQUEST_TYPE.CREATE if isCreationCtx: accountsToInvite = ctx.getAccountsToInvite() showInvitesWindow = True if accountsToInvite: showInvitesWindow = False self._functional.request(SendInvitesCtx(accountsToInvite, '')) squadCtx = {'showInvitesWindow': showInvitesWindow} g_eventDispatcher.loadSquad(squadCtx, self.__getTeamReady()) return initResult
def executeInit(self, ctx): initResult = FUNCTIONAL_FLAG.UNDEFINED if self._entity.getPlayerInfo().isReady and self._entity.getFlags().isInQueue(): g_eventDispatcher.loadBattleQueue() initResult = FUNCTIONAL_FLAG.LOAD_PAGE squadCtx = None if ctx is not None: initCtx = ctx.getInitCtx() if initCtx is not None and initCtx.getRequestType() is REQUEST_TYPE.CREATE: accountsToInvite = initCtx.getAccountsToInvite() showInvitesWindow = True if accountsToInvite: showInvitesWindow = False self.processInvites(accountsToInvite) squadCtx = {'showInvitesWindow': showInvitesWindow} self._loadWindow(squadCtx) return initResult
def executeInit(self, ctx): initResult = FUNCTIONAL_FLAG.UNDEFINED if self._functional.getPlayerInfo().isReady and self._functional.getFlags().isInQueue(): g_eventDispatcher.loadBattleQueue() initResult = FUNCTIONAL_FLAG.LOAD_PAGE squadCtx = None if ctx is not None: isCreationCtx = ctx.getRequestType() is REQUEST_TYPE.CREATE if isCreationCtx: accountsToInvite = ctx.getAccountsToInvite() showInvitesWindow = True if accountsToInvite: showInvitesWindow = False self._functional.request(SendInvitesCtx(accountsToInvite, "")) self._showInviteSentMessage(accountsToInvite) squadCtx = {"showInvitesWindow": showInvitesWindow} self._loadWindow(squadCtx) return initResult
def init(self, clientPrb = None, ctx = None): result = super(EventSquadFunctional, self).init(clientPrb=clientPrb) (isCreationCtx, accountsToInvite,) = (False, []) if ctx is not None: isCreationCtx = ctx.getRequestType() is REQUEST_TYPE.CREATE if isCreationCtx: accountsToInvite = ctx.getAccountsToInvite() if self.getPlayerInfo().isReady() and self.getTeamState(team=1).isInQueue(): g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar() g_eventDispatcher.loadEventSquad(isInvitesOpen=isCreationCtx and not accountsToInvite, isReady=self.__isTeamRead()) g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED, self.__handleCarouselInited, scope=EVENT_BUS_SCOPE.LOBBY) result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_WINDOW) result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_PAGE) g_eventDispatcher.updateUI() if accountsToInvite: self.request(SendInvitesCtx(accountsToInvite, '')) return result
def executeInit(self, ctx): initResult = FUNCTIONAL_INIT_RESULT.UNDEFINED if self._functional.getPlayerInfo( ).isReady and self._functional.getFlags().isInQueue(): g_eventDispatcher.loadBattleQueue() initResult = FUNCTIONAL_INIT_RESULT.LOAD_PAGE squadCtx = None if ctx is not None: isCreationCtx = ctx.getRequestType() is REQUEST_TYPE.CREATE if isCreationCtx: accountsToInvite = ctx.getAccountsToInvite() showInvitesWindow = True if accountsToInvite: showInvitesWindow = False self._functional.request( SendInvitesCtx(accountsToInvite, '')) squadCtx = {'showInvitesWindow': showInvitesWindow} g_eventDispatcher.loadSquad(squadCtx, self.__getTeamReady()) return initResult
def onEnqueued(self, *args): super(HistoricalQueueFunctional, self).onEnqueued(*args) self.__requestCtx.stopProcessing(True) g_eventDispatcher.loadBattleQueue() g_eventDispatcher.updateUI()
def setUnitChanged(self): flags = self._entity.getFlags() if self._entity.getPlayerInfo().isReady and flags.isInQueue(): g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar()
def _goToQueueUI(self): g_eventDispatcher.loadBattleQueue() return FUNCTIONAL_FLAG.LOAD_PAGE
def onEnqueued(self): super(RandomQueueFunctional, self).onEnqueued() self.__requestCtx.stopProcessing(True) g_eventDispatcher.loadBattleQueue() g_eventDispatcher.updateUI()
def setUnitChanged(self, flags): if flags.isInQueueChanged(): if self._functional.getPlayerInfo().isReady and flags.isInQueue(): g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar()
def setUnitChanged(self, data = None): if self._functional.getPlayerInfo().isReady and self._functional.getFlags().isInQueue(): g_eventDispatcher.loadBattleQueue() else: g_eventDispatcher.loadHangar()
def onEnqueued(self): super(EventBattlesQueueFunctional, self).onEnqueued() self.__requestCtx.stopProcessing(True) g_eventDispatcher.loadBattleQueue() g_eventDispatcher.updateUI()