Add websocket event stream for sim updates.

As a proof of concept this only covers the flight positions.
This commit is contained in:
Dan Albert
2022-02-16 01:28:10 -08:00
parent 350f08be2f
commit 21f7912458
14 changed files with 150 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ from game.data.weapons import Pylon, Weapon, WeaponGroup
from game.db import FACTIONS
from game.dcs.aircrafttype import AircraftType
from game.profiling import logged_duration
from game.server import GameContext, Server
from game.server import EventStream, GameContext, Server
from game.settings import Settings
from game.theater.start_generator import GameGenerator, GeneratorSettings, ModSettings
from qt_ui import (
@@ -137,6 +137,7 @@ def run_ui(game: Optional[Game]) -> None:
# Apply CSS (need works)
GameUpdateSignal()
GameUpdateSignal.get_instance().game_loaded.connect(GameContext.set)
GameUpdateSignal.get_instance().game_loaded.connect(EventStream.drain)
# Start window
window = QLiberationWindow(game)