Перейти к содержанию

Sequence — Switch Game

FR: FR-005, FR-004

sequenceDiagram
    participant Host as Host
    participant Session as session-service
    participant Game as game-runtime
    participant NATS as NATS
    participant Bot as telegram-bot
    participant Web as web-app

    Host->>Session: POST /sessions/{id}/games {plugin_id}
    Session->>Game: Create GameInstance
    Game->>Game: plugin.initial_state()
    Game-->>Session: game_id
    Session->>Session: status = InGame
    Game->>NATS: game.started
    NATS->>Bot: event
    NATS->>Web: via realtime WS
    Bot->>Host: New game UI

Исходник: seq-switch-game.mmd