diff --git a/main.py b/main.py index b774d6e..a2ca385 100644 --- a/main.py +++ b/main.py @@ -361,7 +361,9 @@ def main_loop(screen): if '------- Game Initialization -------' in message or 'Game Initialization' in message: logger.info('Game initialization detected - refreshing server info') - ui.print_message("^6New Game - Refreshing Server Info^7\n") + + timestamp = time.strftime('%H:%M:%S') + ui.print_message(f"^3[^7{timestamp}^3] ^0^3Game initialized - Refreshing server info^9^7\n") rcon.send_command(b'qlx_serverBrandName') rcon.send_command(b'g_factoryTitle') diff --git a/parser.py b/parser.py index ce54669..1b02776 100644 --- a/parser.py +++ b/parser.py @@ -51,6 +51,9 @@ class EventParser: event_type = event['TYPE'] data = event['DATA'] + + if 'WARMUP' in data: + self.game_state.server_info.warmup = data['WARMUP'] # Route to appropriate handler handler_map = { diff --git a/state.py b/state.py index b74c777..80e2158 100644 --- a/state.py +++ b/state.py @@ -28,6 +28,7 @@ class ServerInfo: self.blue_score = 0 self.players = [] self.last_update = 0 + self.warmup = False def is_team_mode(self): """Check if current gametype is a team mode""" diff --git a/ui.py b/ui.py index e82e4e7..b8deae9 100644 --- a/ui.py +++ b/ui.py @@ -219,7 +219,8 @@ class UIManager: teams = game_state.player_tracker.get_players_by_team() if server_info.gametype in TEAM_MODES: - print_colored(self.info_window, f"^0^1(RED) ^4(BLUE) ^3(SPEC)^9\n", 0) + warmup_display = "^3Warmup: ^2YES^9" if server_info.warmup else "^3Warmup: ^1NO^9" + print_colored(self.info_window, f"^0^1(RED) ^4(BLUE) ^3(SPEC) {warmup_display}\n", 0) red_players = teams['RED'][:4] blue_players = teams['BLUE'][:4] @@ -243,7 +244,8 @@ class UIManager: line = f"^0{red}^9{' ' * red_pad}^0{blue}^9{' ' * blue_pad}^0{spec}^9\n" print_colored(self.info_window, line, 0) else: - print_colored(self.info_window, f"^0^3(FREE)\n", 0) + warmup_display = "^3Warmup: ^2YES^9" if server_info.warmup else "^3Warmup: ^1NO^9" + print_colored(self.info_window, f"^0^3(FREE) {warmup_display}\n", 0) free_players = teams['FREE'][:4] for player in free_players: print_colored(self.info_window, f"^0{player}^9\n", 0)