def __showChatCommand(self, command): if command not in self._chatCommandsMessage: return messageStringID = self._chatCommandsMessage[command] dTime = BigWorld.time() - self.__lastSendTime if dTime > WAIT_TIME_FOR_SEND_CHAT_MSG: if messageStringID == CommandTypes.INTENTIONS or messageStringID == CommandTypes.OFFENSE_DEFENSE: self.__requestTargets(messageStringID) else: self.__sendToServer(messageStringID) self.__lastSendTime = BigWorld.time() else: chat = GameEnvironment.getChat() lastTime = WAIT_TIME_FOR_SEND_CHAT_MSG - dTime chat.spamNotification(lastTime)
def __onGetDataFromServer(self, authorID, commandType, notificationID, targetID): if commandType == CommandTypes.OFFENSE_DEFENSE: waveID = self._waveInfoManager.getWaveByPlaneID(targetID) else: waveID = -1 self._sendToFlash(authorID, commandType, targetID, notificationID, waveID) locale = self._getLocal(commandType, notificationID, targetID) chat = GameEnvironment.getChat() if notificationID == -1: chat.chooseNotification(locale) self.__lastSendTime = BigWorld.time() - WAIT_TIME_FOR_SEND_CHAT_MSG else: chat.showFastCommandMessage(authorID, MESSAGE_TYPE.BATTLE_FAST_COMMAND_ALL, commandType, targetID, locale, False)