Example #1
0
 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()))
Example #2
0
 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
Example #5
0
 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)
Example #8
0
 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
Example #11
0
 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)
Example #12
0
 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
Example #13
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
Example #14
0
 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)
Example #16
0
 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)
Example #18
0
def rqExitFromLazyChannel(name):
    clientID = channel_num_gen.getClientID4LazyChannel(name)
    if not clientID:
        LOG_ERROR('Client ID is not found', name)
    else:
        rqExitFromChannel(clientID)
Example #19
0
def rqDeactivateLazyChannel(name):
    clientID = channel_num_gen.getClientID4LazyChannel(name)
    if not clientID:
        LOG_ERROR('Client ID is not found', name)
    else:
        rqDeactivateChannel(clientID)
Example #20
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(self.proto.messages.getCompanyRoomName())
Example #22
0
def rqExitFromLazyChannel(name):
    clientID = channel_num_gen.getClientID4LazyChannel(name)
    if not clientID:
        LOG_ERROR('Client ID is not found', name)
    else:
        rqExitFromChannel(clientID)
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES)
Example #24
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(
         LAZY_CHANNEL.SPECIAL_BATTLES)
Example #25
0
def rqDeactivateLazyChannel(name):
    clientID = channel_num_gen.getClientID4LazyChannel(name)
    if not clientID:
        LOG_ERROR('Client ID is not found', name)
    else:
        rqDeactivateChannel(clientID)