Beispiel #1
0
 def init(self, clientPrb=None, ctx=None):
     super(BattleSessionFunctional, self).init(clientPrb=clientPrb)
     events_dispatcher.loadHangar()
     events_dispatcher.loadBattleSessionWindow(self.getPrbType())
     g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED,
                            self.__handleCarouselInited,
                            scope=EVENT_BUS_SCOPE.LOBBY)
Beispiel #2
0
 def prb_onTeamStatesReceived(self):
     super(SquadFunctional, self).prb_onTeamStatesReceived()
     events_dispatcher.updateUI()
     if self.getPlayerInfo().isReady() or self.isCreator():
         if self.getTeamState(team=1).isInQueue():
             events_dispatcher.loadBattleQueue()
         else:
             events_dispatcher.loadHangar()
Beispiel #3
0
 def prb_onTeamStatesReceived(self):
     super(SquadFunctional, self).prb_onTeamStatesReceived()
     events_dispatcher.updateUI()
     if self.getPlayerInfo().isReady() or self.isCreator():
         if self.getTeamState(team=1).isInQueue():
             events_dispatcher.loadBattleQueue()
         else:
             events_dispatcher.loadHangar()
Beispiel #4
0
 def prb_onTeamStatesReceived(self):
     super(CompanyFunctional, self).prb_onTeamStatesReceived()
     events_dispatcher.updateUI()
     playerInfo = self.getPlayerInfo()
     if playerInfo.isReady() or self.isCreator():
         if self.getTeamState(team=1).isInQueue() and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1:
             events_dispatcher.loadBattleQueue()
         else:
             events_dispatcher.loadHangar()
Beispiel #5
0
 def prb_onTeamStatesReceived(self):
     super(CompanyFunctional, self).prb_onTeamStatesReceived()
     events_dispatcher.updateUI()
     playerInfo = self.getPlayerInfo()
     if playerInfo.isReady() or self.isCreator():
         if self.getTeamState(team=1).isInQueue(
         ) and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1:
             events_dispatcher.loadBattleQueue()
         else:
             events_dispatcher.loadHangar()
Beispiel #6
0
 def init(self, clientPrb = None, ctx = None):
     super(SquadFunctional, self).init(clientPrb=clientPrb)
     isInvitesOpen = False
     if ctx is not None:
         isInvitesOpen = ctx.getRequestType() is REQUEST_TYPE.CREATE
     if self.getPlayerInfo().isReady() and self.getTeamState(team=1).isInQueue():
         events_dispatcher.loadBattleQueue()
     else:
         events_dispatcher.loadHangar()
     events_dispatcher.loadSquad(isInvitesOpen=isInvitesOpen)
     g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED, self.__handleCarouselInited, scope=EVENT_BUS_SCOPE.LOBBY)
     return
Beispiel #7
0
 def doAction(self, action, dispatcher = None):
     if action.actionName == PREBATTLE_ACTION_NAME.LEAVE_TRAINING_LIST:
         events_dispatcher.loadHangar()
     elif prb_control.getClientPrebattle() is None:
         self.__loadTrainingList()
     elif prb_control.isTraining():
         if dispatcher is not None:
             self.__loadTrainingRoom(dispatcher)
         else:
             LOG_ERROR('Dispatcher not found')
     else:
         LOG_ERROR('Player is joined to prebattle', prb_control.getPrebattleType())
     return True
Beispiel #8
0
 def init(self, clientPrb = None, ctx = None):
     super(CompanyFunctional, self).init(clientPrb=clientPrb)
     isInvitesOpen = False
     if ctx is not None:
         isInvitesOpen = ctx.getRequestType() is REQUEST_TYPE.CREATE
     playerInfo = self.getPlayerInfo()
     if self.getTeamState(team=1).isInQueue() and playerInfo.isReady() and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1:
         events_dispatcher.loadBattleQueue()
     else:
         events_dispatcher.loadHangar()
     events_dispatcher.loadCompany(isInvitesOpen=isInvitesOpen)
     g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED, self.__handleCarouselInited, scope=EVENT_BUS_SCOPE.LOBBY)
     return
Beispiel #9
0
    def fini(self, clientPrb = None, woEvents = False):
        super(TrainingFunctional, self).fini(clientPrb=clientPrb, woEvents=woEvents)
        remove = g_eventBus.removeListener
        for event in self.__loadEvents:
            remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        if not woEvents:
            if self._guiExit == GUI_EXIT.TRAINING_LIST:
                events_dispatcher.loadTrainingList()
            elif self._guiExit == GUI_EXIT.HANGAR:
                events_dispatcher.loadHangar()
            else:
                events_dispatcher.exitFromTrainingRoom()
        events_dispatcher.requestToDestroyPrbChannel(PREBATTLE_TYPE.TRAINING)
Beispiel #10
0
 def doAction(self, action, dispatcher=None):
     if action.actionName == PREBATTLE_ACTION_NAME.LEAVE_TRAINING_LIST:
         events_dispatcher.loadHangar()
     elif prb_control.getClientPrebattle() is None:
         self.__loadTrainingList()
     elif prb_control.isTraining():
         if dispatcher is not None:
             self.__loadTrainingRoom(dispatcher)
         else:
             LOG_ERROR('Dispatcher not found')
     else:
         LOG_ERROR('Player is joined to prebattle',
                   prb_control.getPrebattleType())
     return True
Beispiel #11
0
    def fini(self, clientPrb=None, woEvents=False):
        super(TrainingFunctional, self).fini(clientPrb=clientPrb,
                                             woEvents=woEvents)
        remove = g_eventBus.removeListener
        for event in self.__loadEvents:
            remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        if not woEvents:
            if self._guiExit == GUI_EXIT.TRAINING_LIST:
                events_dispatcher.loadTrainingList()
            elif self._guiExit == GUI_EXIT.HANGAR:
                events_dispatcher.loadHangar()
            else:
                events_dispatcher.exitFromTrainingRoom()
        events_dispatcher.requestToDestroyPrbChannel(PREBATTLE_TYPE.TRAINING)
Beispiel #12
0
 def init(self, clientPrb=None, ctx=None):
     super(SquadFunctional, self).init(clientPrb=clientPrb)
     isInvitesOpen = False
     if ctx is not None:
         isInvitesOpen = ctx.getRequestType() is REQUEST_TYPE.CREATE
     if self.getPlayerInfo().isReady() and self.getTeamState(
             team=1).isInQueue():
         events_dispatcher.loadBattleQueue()
     else:
         events_dispatcher.loadHangar()
     events_dispatcher.loadSquad(isInvitesOpen=isInvitesOpen)
     g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED,
                            self.__handleCarouselInited,
                            scope=EVENT_BUS_SCOPE.LOBBY)
     return
Beispiel #13
0
 def init(self, clientPrb=None, ctx=None):
     super(CompanyFunctional, self).init(clientPrb=clientPrb)
     isInvitesOpen = False
     if ctx is not None:
         isInvitesOpen = ctx.getRequestType() is REQUEST_TYPE.CREATE
     playerInfo = self.getPlayerInfo()
     if self.getTeamState(team=1).isInQueue() and playerInfo.isReady(
     ) and playerInfo.roster == PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1:
         events_dispatcher.loadBattleQueue()
     else:
         events_dispatcher.loadHangar()
     events_dispatcher.loadCompany(isInvitesOpen=isInvitesOpen)
     g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED,
                            self.__handleCarouselInited,
                            scope=EVENT_BUS_SCOPE.LOBBY)
     return
Beispiel #14
0
 def onChanged(self):
     events_dispatcher.loadHangar()
Beispiel #15
0
 def __onPlayerReady(self, result):
     if result:
         events_dispatcher.loadTrainingRoom()
     else:
         events_dispatcher.loadHangar()
 def init(self, clientPrb = None, ctx = None):
     super(BattleSessionFunctional, self).init(clientPrb=clientPrb)
     events_dispatcher.loadHangar()
     events_dispatcher.loadBattleSessionWindow(self.getPrbType())
     g_eventBus.addListener(ChannelCarouselEvent.CAROUSEL_INITED, self.__handleCarouselInited, scope=EVENT_BUS_SCOPE.LOBBY)
Beispiel #17
0
 def onChanged(self):
     events_dispatcher.loadHangar()
Beispiel #18
0
 def __onPlayerReady(self, result):
     if result:
         events_dispatcher.loadTrainingRoom()
     else:
         events_dispatcher.loadHangar()