Esempio n. 1
0
 def onEnqueueError(self, errorCode, *args):
     if self._requestCtx.getRequestType() == REQUEST_TYPE.QUEUE:
         self._requestCtx.stopProcessing(True)
     self._invokeListeners('onEnqueueError', self.getQueueType(), *args)
     self._exitFromQueueUI()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 2
0
 def create(self, ctx, callback=None):
     if not isinstance(ctx, TrainingSettingsCtx):
         LOG_ERROR('Invalid context to create training', ctx)
         if callback:
             callback(False)
     elif info.isRequestInCoolDown(REQUEST_TYPE.CREATE):
         SystemMessages.pushMessage(messages.getJoinFailureMessage(
             JOIN_FAILURE.COOLDOWN),
                                    type=SystemMessages.SM_TYPE.Error)
         if callback:
             callback(False)
     elif prb_control.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_createTraining(ctx.getArenaTypeID(),
                                              ctx.getRoundLen(),
                                              ctx.isOpened(),
                                              ctx.getComment())
         info.setRequestCoolDown(
             REQUEST_TYPE.CREATE,
             coolDown=REQUEST_COOLDOWN.PREBATTLE_CREATION)
     else:
         LOG_ERROR(
             'First, player has to confirm exit from the current prebattle',
             prb_control.getPrebattleType())
         if callback:
             callback(False)
     return
Esempio n. 3
0
def validatePrbCreationCooldown():
    if _rqc.isRequestInCoolDown(REQUEST_SCOPE.PRB_CONTROL,
                                REQUEST_TYPE.CREATE):
        SystemMessages.pushMessage(messages.getJoinFailureMessage(
            JOIN_FAILURE.COOLDOWN),
                                   type=SystemMessages.SM_TYPE.Error)
        return True
    return False
Esempio n. 4
0
 def onEnqueueError(self, errorCode, *args):
     """
     Routine must be invoked when player receives enqueue error.
     """
     self._requestCtx.stopProcessing(True)
     self._invokeListeners('onEnqueueError', self._queueType, *args)
     self._exitFromQueueUI()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 5
0
 def pe_onArenaJoinFailure(self, errorCode, errorStr):
     """
     Player event listener for arena join failure. Pushes system message.
     Args:
         errorCode: join error code
         errorStr: join error message
     """
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 6
0
 def pe_onPrebattleJoinFailure(self, errorCode):
     """
     Player event listener for prebattle join filure. Pushes system message and
     resets current entity to default.
     Args:
         errorCode: join error code
     """
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
     self.__setDefault()
     g_eventDispatcher.loadHangar()
Esempio n. 7
0
def validatePrbCreationCooldown():
    """
    Validates prebattle entity creation is in cooldown
    Returns:
        is creation in cooldown
    """
    if _rqc.isRequestInCoolDown(REQUEST_SCOPE.PRB_CONTROL,
                                REQUEST_TYPE.CREATE):
        SystemMessages.pushMessage(messages.getJoinFailureMessage(
            JOIN_FAILURE.COOLDOWN),
                                   type=SystemMessages.SM_TYPE.Error)
        return True
    return False
Esempio n. 8
0
 def create(self, ctx, callback = None):
     if not isinstance(ctx, context.SquadSettingsCtx):
         LOG_ERROR('Invalid context to create squad', ctx)
         if callback:
             callback(False)
     elif info.isRequestInCoolDown(REQUEST_TYPE.CREATE):
         SystemMessages.pushMessage(messages.getJoinFailureMessage(JOIN_FAILURE.COOLDOWN), type=SystemMessages.SM_TYPE.Error)
         if callback:
             callback(False)
     elif prb_control.getClientPrebattle() is None or ctx.isForced():
         ctx.startProcessing(callback=callback)
         BigWorld.player().prb_createSquad()
         info.setRequestCoolDown(REQUEST_TYPE.CREATE, coolDown=REQUEST_COOLDOWN.PREBATTLE_CREATION)
     else:
         LOG_ERROR('First, player has to confirm exit from the current prebattle', prb_control.getPrebattleType())
         if callback:
             callback(False)
     return
Esempio n. 9
0
 def pe_onPrebattleJoinFailure(self, errorCode):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
     self.__requestCtx.stopProcessing(result=False)
     events_dispatcher.updateUI()
Esempio n. 10
0
 def pe_onArenaJoinFailure(self, errorCode):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 11
0
 def pe_onEnqueueRandomFailure(self, errorCode, _):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 12
0
 def onEnqueueError(self, errorCode, _):
     super(HistoricalQueueFunctional, self).onEnqueueError(errorCode, _)
     self.__requestCtx.stopProcessing(False)
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 13
0
 def onEnqueueError(self, errorCode, *args):
     self._invokeListeners('onEnqueueError', self._queueType, *args)
     self._exitFromQueueUI()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 14
0
 def onEnqueueError(self, errorCode, _):
     super(RandomQueueFunctional, self).onEnqueueError(errorCode, _)
     self.__requestCtx.stopProcessing(False)
     g_prbCtrlEvents.onPreQueueFunctionalDestroyed()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 15
0
 def pe_onArenaJoinFailure(self, errorCode, _):
     self.__collection.reset()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 16
0
 def onEnqueueError(self, errorCode, _):
     super(HistoricalQueueFunctional, self).onEnqueueError(errorCode, _)
     self.__requestCtx.stopProcessing(False)
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 17
0
 def pe_onArenaJoinFailure(self, errorCode, _):
     self.__collection.reset()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 18
0
 def pe_onPrebattleJoinFailure(self, errorCode):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
     self.__setDefault()
     g_eventDispatcher.loadHangar()
Esempio n. 19
0
 def pe_onArenaJoinFailure(self, errorCode, errorStr):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
Esempio n. 20
0
def validatePrbCreationCooldown():
    result = False
    if _rqc.isRequestInCoolDown(REQUEST_SCOPE.PRB_CONTROL, REQUEST_TYPE.CREATE):
        result = True
        SystemMessages.pushMessage(messages.getJoinFailureMessage(JOIN_FAILURE.COOLDOWN), type=SystemMessages.SM_TYPE.Error)
    return result
Esempio n. 21
0
 def onEnqueueError(self, errorCode, *args):
     self._invokeListeners('onEnqueueError', self._queueType, *args)
     self._exitFromQueueUI()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 22
0
 def pe_onPrebattleJoinFailure(self, errorCode):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)
     self.__requestCtx.stopProcessing(result=False)
     self.__requestCtx.clearFlags()
     g_eventDispatcher.updateUI()
Esempio n. 23
0
 def onEnqueueError(self, errorCode, _):
     super(EventBattlesQueueFunctional, self).onEnqueueError(errorCode, _)
     self.__requestCtx.stopProcessing(False)
     g_prbCtrlEvents.onPreQueueFunctionalDestroyed()
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
Esempio n. 24
0
 def onTimeout():
     pushMessage(messages.getJoinFailureMessage(JOIN_FAILURE.TIME_OUT), type=SM_TYPE.Error)
     dispatcher.restorePrevious()
Esempio n. 25
0
 def pe_onEnqueueRandomFailure(self, errorCode, _):
     SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode),
                                type=SystemMessages.SM_TYPE.Error)