Uhmm

parent 216d3044
......@@ -490,6 +490,8 @@ class GamesThread(ThreadedComponent):
self._handle_match_start(message)
elif message.type == MessageType.GAME_STATUS:
self._handle_game_status_request(message)
elif message.type == MessageType.START_INTRO:
self._handle_start_intro(message)
except Exception as e:
logger.error(f"Failed to process message: {e}")
......@@ -506,6 +508,23 @@ class GamesThread(ThreadedComponent):
except Exception as e:
logger.error(f"Failed to handle game update: {e}")
def _handle_start_intro(self, message: Message):
"""Handle START_INTRO message - broadcast GAME_STARTED"""
try:
fixture_id = message.data.get("fixture_id")
logger.info(f"Received START_INTRO message for fixture {fixture_id} - broadcasting GAME_STARTED")
# Broadcast GAME_STARTED message to notify all components that game has started with this fixture
game_started_message = MessageBuilder.game_started(
sender=self.name,
fixture_id=fixture_id
)
self.message_bus.publish(game_started_message, broadcast=True)
logger.info(f"🎯 Broadcast GAME_STARTED message for fixture {fixture_id}")
except Exception as e:
logger.error(f"Failed to handle START_INTRO message: {e}")
def _find_last_fixture_with_pending_matches(self) -> Optional[str]:
"""Find the last fixture that has pending matches"""
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment