def addSpecBattlesToCarousel(self): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel') return currCarouselItemCtx = _defCarouselItemCtx._replace(label=LAZY_CHANNEL.SPECIAL_BATTLES, order=channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES), isNotified=True, criteria={POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.BATTLE_SESSION_LIST_WINDOW_PY}, openHandler=self.loadBattleSessionList) self.__fireEvent(ChannelManagementEvent(clientID, PreBattleChannelEvent.REQUEST_TO_ADD, currCarouselItemCtx._asdict()))
def addSpecBattlesToCarousel(self): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel') return currCarouselItemCtx = _defCarouselItemCtx._replace(label=LAZY_CHANNEL.SPECIAL_BATTLES, order=channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES), isNotified=True, criteria={POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.BATTLE_SESSION_LIST_WINDOW_PY}, openHandler=self.loadBattleSessionList) self._fireEvent(ChannelManagementEvent(clientID, PreBattleChannelEvent.REQUEST_TO_ADD, currCarouselItemCtx._asdict()))
def addCompaniesToCarousel(): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES) if not clientID: LOG_ERROR('Client ID not found', 'addCompaniesToCarousel') return else: g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_ADD, { 'label': LAZY_CHANNEL.COMPANIES, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.COMPANIES), 'criteria': { POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent( events.ShowWindowEvent.SHOW_COMPANIES_WINDOW) }, 'openHandler': loadCompaniesWindow }), scope=EVENT_BUS_SCOPE.LOBBY) return
def addSpecBattlesToCarousel(): clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel') return else: g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_ADD, { 'label': LAZY_CHANNEL.SPECIAL_BATTLES, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES), 'criteria': { POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent( events.ShowWindowEvent.SHOW_BATTLE_SESSION_LIST) }, 'openHandler': loadBattleSessionList }), scope=EVENT_BUS_SCOPE.LOBBY) return
def removeSpecBattlesFromCarousel(self): clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'removeSpecBattlesFromCarousel') return self._fireEvent( ChannelManagementEvent(clientID, PreBattleChannelEvent.REQUEST_TO_REMOVE))
def removeSpecBattlesFromCarousel(): clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'removeSpecBattlesFromCarousel') return g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_REMOVE), scope=EVENT_BUS_SCOPE.LOBBY)
def acceptInvite(self): yield lambda callback: callback(None) prbID = self._inviteInfo.getID() invite = self.prbAutoInvites.getInvite(prbID) postActions = [actions.LeavePrbModalEntity()] finishActions = [_DisableNotify(channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES))] if g_preDefinedHosts.isRoamingPeriphery(invite.peripheryID): success = yield DialogsInterface.showI18nConfirmDialog('changeRoamingPeriphery') if not success: return self.prbPeripheriesHandler.join(invite.peripheryID, JoinBattleSessionCtx(prbID, invite.prbType, 'prebattle/join'), postActions, finishActions)
def acceptInvite(self): yield lambda callback: callback(None) prbID = self._inviteInfo.getID() invite = self.prbAutoInvites.getInvite(prbID) postActions = [] if self.prbDispatcher.hasModalEntity(): postActions.append(actions.LeavePrbModalEntity()) finishActions = [_DisableNotify(channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES))] if g_preDefinedHosts.isRoamingPeriphery(invite.peripheryID): success = yield DialogsInterface.showI18nConfirmDialog('changeRoamingPeriphery') if not success: return self.prbPeripheriesHandler.join(invite.peripheryID, JoinBattleSessionCtx(prbID, invite.prbType, 'prebattle/join'), postActions, finishActions)
def addCompaniesToCarousel(): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES) if not clientID: LOG_ERROR('Client ID not found', 'addCompaniesToCarousel') return else: g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': LAZY_CHANNEL.COMPANIES, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.COMPANIES), 'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_COMPANIES_WINDOW)}, 'openHandler': loadCompaniesWindow}), scope=EVENT_BUS_SCOPE.LOBBY) return
def addSpecBattlesToCarousel(): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel') return else: g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': LAZY_CHANNEL.SPECIAL_BATTLES, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES), 'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_BATTLE_SESSION_LIST)}, 'openHandler': loadBattleSessionList}), scope=EVENT_BUS_SCOPE.LOBBY) return
def notifySpecialBattleWindow(self): clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'notifySpecialBattleWindow') return self.__fireEvent(events.ChannelManagementEvent( clientID, events.ChannelManagementEvent.REQUEST_TO_CHANGE, { 'key': 'isNotified', 'value': True, 'isShowByReq': True, 'showIfClosed': True }), scope=EVENT_BUS_SCOPE.LOBBY)
def restoreBattleSessionList(self): viewContainer = self.app.containerManager window = viewContainer.getView( WindowLayer.WINDOW, { POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.BATTLE_SESSION_LIST_WINDOW_PY }) if window is None: clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'restoreBattleSessionList') return self.__fireEvent( events.ChannelManagementEvent( clientID, ChannelCarouselEvent.OPEN_BUTTON_CLICK, {'clientID': clientID})) return
def getClientID(self): return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
def removeSpecBattlesFromCarousel(self): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'removeSpecBattlesFromCarousel') return self._fireEvent(ChannelManagementEvent(clientID, PreBattleChannelEvent.REQUEST_TO_REMOVE))
def removeSpecBattlesFromCarousel(): clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'removeSpecBattlesFromCarousel') return g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_REMOVE), scope=EVENT_BUS_SCOPE.LOBBY)
def getClientID(self): return channel_num_gen.getClientID4LazyChannel( self.proto.messages.getCompanyRoomName())
def rqActivateLazyChannel(name, component): clientID = channel_num_gen.getClientID4LazyChannel(name) if not clientID: LOG_ERROR("Client ID is not found", name) else: rqActivateChannel(clientID, component)
def rqExitFromLazyChannel(name): clientID = channel_num_gen.getClientID4LazyChannel(name) if not clientID: LOG_ERROR('Client ID is not found', name) else: rqExitFromChannel(clientID)
def rqDeactivateLazyChannel(name): clientID = channel_num_gen.getClientID4LazyChannel(name) if not clientID: LOG_ERROR('Client ID is not found', name) else: rqDeactivateChannel(clientID)
def getClientID(self): return channel_num_gen.getClientID4LazyChannel(self.proto.messages.getCompanyRoomName())
def getClientID(self): return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES)
def getClientID(self): return channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES)