This module manages the Real-Time Event Stream. It is initialized during the Strapi Bootstrap phase.
- Authentication: Validates JWT tokens on connection Handshake.
- Room Joining:
socket.join('room_<id>'). - Broadcasting:
GAME_UPDATE: Entity movements.NARRATIVE_STREAM: LLM tokens.ERROR: Toasts and alerts.
The entry point for the "Game Loop" initialization.
Since Strapi is stateless by default, we use lifecycle/bootstrap.ts (often called from src/index.ts) to:
- Start the
VoxelWorkerthreads. - Resurrect any suspended
GameLoops. - Hydrate the
Rediscache (if active).