mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add websocket event stream for sim updates.
As a proof of concept this only covers the flight positions.
This commit is contained in:
@@ -72,6 +72,11 @@ class GameLoop:
|
||||
self.completed = True
|
||||
|
||||
def send_update(self, rate_limit: bool) -> None:
|
||||
# We don't skip empty events because we still want the tick in the Qt part of
|
||||
# the UI, which will update things like the current simulation time. The time
|
||||
# probably be an "event" of its own. For now the websocket endpoint will filter
|
||||
# out empty events to avoid the map handling unnecessary events, but we still
|
||||
# pass the events through to Qt.
|
||||
now = datetime.now()
|
||||
time_since_update = now - self.last_update_time
|
||||
if not rate_limit or time_since_update >= timedelta(seconds=1 / 60):
|
||||
|
||||
Reference in New Issue
Block a user