Ejemplo n.º 1
0
 def __checkAvailability(self):
     if not g_eventsCache.getHistoricalBattles():
         LOG_DEBUG('No historical battles available.')
         self.leave(
             pre_queue_ctx.LeavePreQueueCtx(waitingID='prebattle/leave'))
         return
     historicalBattle = g_eventsCache.getHistoricalBattles().get(
         self._settings[PREQUEUE_SETTING_NAME.BATTLE_ID])
     if historicalBattle is None:
         LOG_DEBUG(
             'Currently selected historical battle is no longer available.')
         self.leave(
             pre_queue_ctx.LeavePreQueueCtx(waitingID='prebattle/leave'))
     else:
         g_currentVehicle.setHistoricalBattle(historicalBattle)
Ejemplo n.º 2
0
 def triggerEffect(self):
     descriptor = getBattleDescriptor()
     if descriptor is not None and descriptor.areAllBonusesReceived(self._bonuses.getCompleted()):
         self._cache.setPlayerXPLevel(PLAYER_XP_LEVEL.NORMAL)
     dispatcher = g_prbLoader.getDispatcher()
     if dispatcher is not None:
         dispatcher.doLeaveAction(pre_queue_ctx.LeavePreQueueCtx(flags=FUNCTIONAL_FLAG.BATTLE_TUTORIAL))
     else:
         LOG_WARNING('Prebattle dispatcher is not defined')
     self._cache.setAfterBattle(False).write()
     self._tutorial.refuse()
     return
Ejemplo n.º 3
0
 def doAction(self, action=None, dispatcher=None):
     result = False
     if not self.isInQueue():
         histBattleID = self.getSetting(PREQUEUE_SETTING_NAME.BATTLE_ID)
         selectedVehicleID = self.getSetting(
             PREQUEUE_SETTING_NAME.SELECTED_VEHICLE_ID)
         _, isCreditsAmmo = self.getSelectedPrice(histBattleID,
                                                  selectedVehicleID)
         self.join(
             pre_queue_ctx.JoinHistoricalQueueCtx(
                 histBattleID, isCreditsAmmo, waitingID='prebattle/join'))
     else:
         self.leave(
             pre_queue_ctx.LeavePreQueueCtx(waitingID='prebattle/leave'))
     return result
Ejemplo n.º 4
0
 def requestToLeave(self):
     yield self.prbDispatcher.leave(
         pre_queue_ctx.LeavePreQueueCtx(waitingID='prebattle/leave'))
Ejemplo n.º 5
0
 def _leavePreQueue():
     self.leave(pre_queue_ctx.LeavePreQueueCtx(waitingID='prebattle/leave'))
Ejemplo n.º 6
0
 def doLeaveAction(self, dispatcher, ctx = None, showConfirmation = True):
     if ctx is None:
         ctx = pre_queue_ctx.LeavePreQueueCtx(waitingID='prebattle/leave')
     if dispatcher._setRequestCtx(ctx):
         self.leave(ctx)