示例#1
0
 def send_quick_chat_from_agent(self, team_only, quick_chat):
     """
     Passes the agents quick chats to the other bots.
     This does perform limiting.
     You are limited to 5 quick chats in a 2 second period starting from the first chat.
     This means you can spread your chats out to be even within that 2 second period.
     You could spam them in the first little bit but then will be throttled.
     """
     time_since_last_chat = time.time() - self.last_chat_time
     if not self.reset_chat_time and time_since_last_chat >= MAX_CHAT_RATE:
         self.reset_chat_time = True
     if self.reset_chat_time:
         self.last_chat_time = time.time()
         self.chat_counter = 0
         self.reset_chat_time = False
     if self.chat_counter < MAX_CHAT_COUNT:
         send_quick_chat_flat(self.game_interface, self.index, self.team, team_only, quick_chat)
         #send_quick_chat(self.quick_chat_queue_holder, self.index, self.team, team_only, quick_chat)
         self.chat_counter += 1
     else:
         self.logger.debug('quick chat disabled for %s', MAX_CHAT_RATE - time_since_last_chat)
示例#2
0
    def send_quick_chat_from_agent(self, team_only, quick_chat):
        """
        Passes the agents quick chats to the game, and also to other python bots.
        This does perform limiting.
        You are limited to 5 quick chats in a 2 second period starting from the first chat.
        This means you can spread your chats out to be even within that 2 second period.
        You could spam them in the first little bit but then will be throttled.
        """

        # Send the quick chat to the game
        rlbot_status = send_quick_chat_flat(self.game_interface, self.index,
                                            self.team, team_only, quick_chat)

        if rlbot_status == RLBotCoreStatus.QuickChatRateExceeded:
            self.logger.debug('quick chat disabled')