Exemplo n.º 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()))
Exemplo n.º 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()))
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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
Exemplo n.º 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))
Exemplo n.º 6
0
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)
Exemplo n.º 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)
Exemplo n.º 9
0
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
Exemplo n.º 10
0
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
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 13
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
Exemplo n.º 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))
Exemplo n.º 15
0
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)
Exemplo n.º 16
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(
         self.proto.messages.getCompanyRoomName())
Exemplo n.º 17
0
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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 20
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
Exemplo n.º 21
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(self.proto.messages.getCompanyRoomName())
Exemplo n.º 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)
Exemplo n.º 23
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES)
Exemplo n.º 24
0
 def getClientID(self):
     return channel_num_gen.getClientID4LazyChannel(
         LAZY_CHANNEL.SPECIAL_BATTLES)
Exemplo n.º 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)