Exemplo n.º 1
0
 def executeInit(self, ctx):
     prbType = self._entity.getEntityType()
     flags = self._entity.getFlags()
     g_eventDispatcher.loadFort(prbType)
     if flags.isInIdle():
         g_eventDispatcher.setUnitProgressInCarousel(prbType, True)
     return FUNCTIONAL_FLAG.LOAD_WINDOW
Exemplo n.º 2
0
 def pe_onEnqueuedUnitAssembler(self):
     self.__isInSearch = True
     self.__startSearchTime = BigWorld.time()
     g_eventDispatcher.setUnitProgressInCarousel(self.__functional.getEntityType(), True)
     for listener in self.__functional.getListenersIterator():
         listener.onUnitAutoSearchStarted(0)
     else:
         g_eventDispatcher.showUnitWindow(self.__functional.getEntityType())
Exemplo n.º 3
0
 def unitBrowser_onSearchSuccessReceived(self, unitMgrID, acceptDeadlineUTC):
     self.__hasResult = True
     acceptDelta = self.getAcceptDelta(acceptDeadlineUTC)
     LOG_DEBUG('onUnitAutoSearchSuccess', acceptDelta, acceptDeadlineUTC)
     g_eventDispatcher.setUnitProgressInCarousel(self.__functional.getEntityType(), False)
     for listener in self.__functional.getListenersIterator():
         listener.onUnitAutoSearchSuccess(acceptDelta)
     else:
         g_eventDispatcher.showUnitWindow(self.__functional.getEntityType())
Exemplo n.º 4
0
 def pe_onEnqueuedUnitAssembler(self):
     self.__isInSearch = True
     self.__startSearchTime = BigWorld.time()
     g_eventDispatcher.setUnitProgressInCarousel(
         self.__functional.getEntityType(), True)
     for listener in self.__functional.getListenersIterator():
         listener.onUnitAutoSearchStarted(0)
     else:
         g_eventDispatcher.showUnitWindow(self.__functional.getEntityType())
Exemplo n.º 5
0
 def executeInit(self, ctx):
     prbType = self._functional.getEntityType()
     pInfo = self._functional.getPlayerInfo()
     flags = self._functional.getFlags()
     if flags.isInPreArena() and pInfo.isInSlot:
         g_eventDispatcher.loadPreArenaUnit(prbType)
         return FUNCTIONAL_FLAG.LOAD_PAGE
     g_eventDispatcher.loadUnit(prbType)
     if flags.isInIdle():
         g_eventDispatcher.setUnitProgressInCarousel(prbType, True)
     return FUNCTIONAL_FLAG.LOAD_WINDOW
Exemplo n.º 6
0
 def __exitFromQueue(self):
     self.__isInSearch = False
     self.__lastErrorCode = UNIT_ERROR.OK
     self.__hasResult = False
     self.__startSearchTime = 0
     prbType = self.__functional.getEntityType()
     g_eventDispatcher.setUnitProgressInCarousel(prbType, False)
     for listener in self.__functional.getListenersIterator():
         listener.onUnitAutoSearchFinished()
     else:
         g_eventDispatcher.showUnitWindow(prbType)
Exemplo n.º 7
0
 def initEvents(self, listener):
     if self.__hasResult:
         browser = prb_getters.getClientUnitBrowser()
         if browser:
             acceptDelta = self.getAcceptDelta(browser._acceptDeadlineUTC)
             if acceptDelta > 0:
                 LOG_DEBUG('onUnitAutoSearchSuccess', acceptDelta)
                 listener.onUnitAutoSearchSuccess(acceptDelta)
     elif self.__isInSearch:
         g_eventDispatcher.setUnitProgressInCarousel(self.__functional.getEntityType(), True)
         listener.onUnitAutoSearchStarted(self.getTimeLeftInSearch())
Exemplo n.º 8
0
 def __exitFromQueue(self):
     self.__isInSearch = False
     self.__lastErrorCode = UNIT_ERROR.OK
     self.__hasResult = False
     self.__startSearchTime = 0
     prbType = self.__functional.getEntityType()
     g_eventDispatcher.setUnitProgressInCarousel(prbType, False)
     for listener in self.__functional.getListenersIterator():
         listener.onUnitAutoSearchFinished()
     else:
         g_eventDispatcher.showUnitWindow(prbType)
Exemplo n.º 9
0
 def unitBrowser_onSearchSuccessReceived(self, unitMgrID,
                                         acceptDeadlineUTC):
     self.__hasResult = True
     acceptDelta = self.getAcceptDelta(acceptDeadlineUTC)
     LOG_DEBUG('onUnitAutoSearchSuccess', acceptDelta, acceptDeadlineUTC)
     g_eventDispatcher.setUnitProgressInCarousel(
         self.__functional.getEntityType(), False)
     for listener in self.__functional.getListenersIterator():
         listener.onUnitAutoSearchSuccess(acceptDelta)
     else:
         g_eventDispatcher.showUnitWindow(self.__functional.getEntityType())
Exemplo n.º 10
0
 def executeInit(self, ctx):
     prbType = self._functional.getEntityType()
     pInfo = self._functional.getPlayerInfo()
     flags = self._functional.getFlags()
     if flags.isInPreArena() and pInfo.isInSlot:
         g_eventDispatcher.loadPreArenaUnit(prbType)
         return FUNCTIONAL_FLAG.LOAD_PAGE
     g_eventDispatcher.loadUnit(prbType)
     if flags.isInIdle():
         g_eventDispatcher.setUnitProgressInCarousel(prbType, True)
     return FUNCTIONAL_FLAG.LOAD_WINDOW
Exemplo n.º 11
0
 def initEvents(self, listener):
     if self.__hasResult:
         browser = prb_getters.getClientUnitBrowser()
         if browser:
             acceptDelta = self.getAcceptDelta(browser._acceptDeadlineUTC)
             if acceptDelta > 0:
                 LOG_DEBUG('onUnitAutoSearchSuccess', acceptDelta)
                 listener.onUnitAutoSearchSuccess(acceptDelta)
     elif self.__isInSearch:
         g_eventDispatcher.setUnitProgressInCarousel(
             self.__functional.getEntityType(), True)
         listener.onUnitAutoSearchStarted(self.getTimeLeftInSearch())
Exemplo n.º 12
0
 def __exitFromQueue(self):
     """
     Routine clears all information that is related to in search state
     """
     self.__isInSearch = False
     self.__lastErrorCode = UNIT_ERROR.OK
     self.__hasResult = False
     self.__startSearchTime = 0
     prbType = self.__entity.getEntityType()
     g_eventDispatcher.setUnitProgressInCarousel(prbType, False)
     for listener in self.__entity.getListenersIterator():
         listener.onUnitAutoSearchFinished()
     else:
         g_eventDispatcher.showUnitWindow(prbType)
Exemplo n.º 13
0
    def unitBrowser_onSearchSuccessReceived(self, unitMgrID, acceptDeadlineUTC):
        """
        Listener for auto search succeed event
        Args:
            unitMgrID: unit manager ID
            acceptDeadlineUTC: time when approval will expire
        """
        self.__hasResult = True
        acceptDelta = self.getAcceptDelta(acceptDeadlineUTC)
        LOG_DEBUG('onUnitAutoSearchSuccess', acceptDelta, acceptDeadlineUTC)
        g_eventDispatcher.setUnitProgressInCarousel(self.__entity.getEntityType(), False)
        for listener in self.__entity.getListenersIterator():
            listener.onUnitAutoSearchSuccess(acceptDelta)
        else:
            g_eventDispatcher.showUnitWindow(self.__entity.getEntityType())

        g_eventDispatcher.updateUI()