19 lines
680 B
GDScript
19 lines
680 B
GDScript
## Entry — Smart entry point.
|
|
## Loads the server scene if running headless (dedicated server),
|
|
## or the client scene if running with a display (Windows client).
|
|
extends Node
|
|
|
|
func _ready() -> void:
|
|
var is_headless := DisplayServer.get_name() == "headless"
|
|
|
|
if is_headless:
|
|
# Dedicated server mode
|
|
var server_scene = preload("res://scenes/server/server_main.tscn")
|
|
add_child(server_scene.instantiate())
|
|
print("[Entry] Starting in SERVER mode (headless)")
|
|
else:
|
|
# Client mode (Windows, etc.)
|
|
var client_scene = preload("res://scenes/client/client_main.tscn")
|
|
add_child(client_scene.instantiate())
|
|
print("[Entry] Starting in CLIENT mode (display available)")
|