mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
fix(server): use headless-safe arena simulation
This commit is contained in:
@@ -435,7 +435,11 @@ func _start_server() -> void:
|
||||
var arena_path := server_arena_override if not server_arena_override.is_empty() else ArenaRegistry.random_path()
|
||||
server_arena_override = ""
|
||||
_arena_path = arena_path
|
||||
arena = (load(arena_path) as PackedScene).instantiate()
|
||||
# The authoritative simulation needs the shared goals, boundary, and spawn
|
||||
# markers, not a renderable arena variant. Some imported decoration scenes
|
||||
# cannot be instantiated by a dedicated export; clients still receive
|
||||
# arena_path below and instantiate that variant for presentation.
|
||||
arena = (load(ScenePaths.SERVER_ARENA) as PackedScene).instantiate()
|
||||
add_child(arena)
|
||||
for goal in arena.get_goals():
|
||||
goal.goal_scored.connect(_handle_goal_scored)
|
||||
|
||||
@@ -9,3 +9,7 @@ const LOBBY := "res://scenes/lobby.tscn"
|
||||
# previously only ever reached by test harnesses hardcoding the string.
|
||||
const NETWORKED_MATCH := "res://scenes/networked_match.tscn"
|
||||
const SERVER_BOOT := "res://scenes/server_boot.tscn"
|
||||
# Arena variants add presentation-only scenery. The dedicated server uses the
|
||||
# common physical layout instead, while MatchSim still tells clients which
|
||||
# variant to render.
|
||||
const SERVER_ARENA := "res://scenes/arena_base.tscn"
|
||||
|
||||
Reference in New Issue
Block a user