def doAction(self, actionID, args = None, response = False, skipCoolDown = False): success, reqID = False, 0 if self.__coolDown.isInProcess(actionID): if not skipCoolDown: g_messengerEvents.onErrorReceived(createCoolDownError(actionID)) else: if response: reqID = self.__idGen.next() if self.__isEnabled: success = self.__sendAction(actionID, reqID, args) else: success = self.__addActionToQueue(actionID, reqID, args) return (success, reqID)
def doAction(self, actionID, args = None, response = False, skipCoolDown = False): player = BigWorld.player() (success, reqID,) = (False, 0) if player: if self.__coolDown.isInProcess(actionID): if not skipCoolDown: g_messengerEvents.onServerErrorReceived(createCoolDownError(actionID)) elif response: reqID = self.__idGen.next() player.base.messenger_onActionByClient_chat2(actionID, reqID, args or messageArgs()) success = True else: LOG_ERROR('Player is not defined') return (success, reqID)
def doAction(self, actionID, args=None, response=False, skipCoolDown=False): success, reqID = False, 0 if self.__isCooldownInProcess(actionID, args): shouldShowCooldownError = not skipCoolDown and self.__shouldShowErrorMessage(actionID, args) if shouldShowCooldownError: g_messengerEvents.onErrorReceived(createCoolDownError(actionID, self.__getCooldownTime(actionID, args))) else: if response: reqID = self.__idGen.next() if self.__isEnabled: success = self.__sendAction(actionID, reqID, args) else: success = self.__addActionToQueue(actionID, reqID, args) return (success, reqID)