Show the real front line bounds on the map.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1067.
This commit is contained in:
Dan Albert
2023-08-10 20:45:28 -07:00
committed by Raffson
parent 03d8448def
commit 5ca344e87b
4 changed files with 24 additions and 18 deletions

View File

@@ -11,8 +11,7 @@ from game.server.flights.models import FlightJs
from game.server.frontlines.models import FrontLineJs
from game.server.iadsnetwork.models import IadsConnectionJs
from game.server.leaflet import LeafletPoint
from game.server.mapzones.models import ThreatZonesJs
from game.server.mapzones.models import UnculledZoneJs
from game.server.mapzones.models import ThreatZonesJs, UnculledZoneJs
from game.server.navmesh.models import NavMeshJs
from game.server.supplyroutes.models import SupplyRouteJs
from game.server.tgos.models import TgoJs
@@ -59,6 +58,7 @@ class GameUpdateEventsJs(BaseModel):
updated_unculled_zones = []
updated_iads = []
updated_supply_routes = []
updated_front_lines = []
if game is not None:
new_combats = [
FrozenCombatJs.for_combat(c, game.theater) for c in events.new_combats
@@ -82,6 +82,10 @@ class GameUpdateEventsJs(BaseModel):
updated_supply_routes = SupplyRouteJs.all_in_game(game)
for route in updated_supply_routes:
route.points = []
updated_front_lines = [
FrontLineJs.for_front_line(game.theater, f)
for f in events.updated_front_lines
]
return GameUpdateEventsJs(
updated_flight_positions={
@@ -103,9 +107,7 @@ class GameUpdateEventsJs(BaseModel):
deleted_flights=events.deleted_flights,
selected_flight=events.selected_flight,
deselected_flight=events.deselected_flight,
updated_front_lines=[
FrontLineJs.for_front_line(f) for f in events.updated_front_lines
],
updated_front_lines=updated_front_lines,
deleted_front_lines=events.deleted_front_lines,
updated_tgos=[TgoJs.for_tgo(tgo) for tgo in events.updated_tgos],
updated_control_points=[