def __baseChatCommand(self, command, channelID = 0, int64Arg = 0, int16Arg = 0, stringArg1 = '', stringArg2 = '', ignoreCooldown = True, requestID = None): if requestID is None: requestID = self.acquireRequestID() if chat_shared.isOperationInCooldown(chat_shared.g_chatCooldownData, command): if not ignoreCooldown: raise ChatCommandInCooldown(command) self.base.chatCommandFromClient(requestID, command.index(), channelID, int64Arg, int16Arg, stringArg1, stringArg2)
def isOperationInCooldownEx(operationName): operation = CHAT_COMMANDS.lookup(operationName) result = False if operation is not None: result = isOperationInCooldown(chat_shared.g_chatCooldownData, operation, update=False) else: LOG_ERROR("Can't find operation = %s in chat_shared.CHAT_COMMANDS" % operationName) return result
def __baseChatCommand(self, command, channelID=0, int64Arg=0, int16Arg=0, stringArg1='', stringArg2='', ignoreCooldown=True, requestID=None): if requestID is None: requestID = self.acquireRequestID() if chat_shared.isOperationInCooldown(chat_shared.g_chatCooldownData, command): if not ignoreCooldown: raise ChatCommandInCooldown(command) self.base.chatCommandFromClient(requestID, command.index(), channelID, int64Arg, int16Arg, stringArg1, stringArg2) return
def __baseChannelChatCommand(self, channelID, command, int64Arg = 0, int16Arg = 0, stringArg1 = '', stringArg2 = '', ignoreCooldown = True): if 0 == channelID: LOG_ERROR('Can`t execute chat channel command for channelId: %s' % (channelID,)) elif chat_shared.isOperationInCooldown(chat_shared.g_chatCooldownData, command): if ignoreCooldown: return raise ChatCommandInCooldown(command) self.__baseChatCommand(command, channelID, int64Arg, int16Arg, stringArg1, stringArg2)
def __baseChannelChatCommand(self, channelID, command, int64Arg=0, int16Arg=0, stringArg1='', stringArg2='', ignoreCooldown=True): if channelID == 0: LOG_ERROR('Can`t execute chat channel command for channelId: %s' % (channelID,)) else: if chat_shared.isOperationInCooldown(chat_shared.g_chatCooldownData, command): if ignoreCooldown: return raise ChatCommandInCooldown(command) self.__baseChatCommand(command, channelID, int64Arg, int16Arg, stringArg1, stringArg2)
def isBroadcatInCooldown(): return isOperationInCooldown(chat_shared.g_chatCooldownData, CHAT_COMMANDS.broadcast, update=False)