|
|
|
@@ -53,8 +53,11 @@ func _run() -> void:
|
|
|
|
Net.arrived.connect(func(l): _arrived = l)
|
|
|
|
Net.arrived.connect(func(l): _arrived = l)
|
|
|
|
for d in [SRV, BOBS]:
|
|
|
|
for d in [SRV, BOBS]:
|
|
|
|
_rm_tree(d)
|
|
|
|
_rm_tree(d)
|
|
|
|
_spawn(["--server", "--port", str(PORT), "--config", SRV + "/server.json",
|
|
|
|
# (EMBERWILD_SERVER_BIN=<an exported game>: the hub, and the land servers
|
|
|
|
"--server-name", "Lands Test", "--seed", str(SEED), "--debug-cheats", "--no-creatures"])
|
|
|
|
# it starts, are that build: checks a release does it too.)
|
|
|
|
|
|
|
|
_spawn(["--server", "--port", str(PORT), "--config", ProjectSettings.globalize_path(SRV + "/server.json"),
|
|
|
|
|
|
|
|
"--server-name", "Lands Test", "--seed", str(SEED), "--debug-cheats", "--no-creatures"], "",
|
|
|
|
|
|
|
|
OS.get_environment("EMBERWILD_SERVER_BIN"))
|
|
|
|
await _sleep(4.0)
|
|
|
|
await _sleep(4.0)
|
|
|
|
await _body()
|
|
|
|
await _body()
|
|
|
|
if world != null and is_instance_valid(world):
|
|
|
|
if world != null and is_instance_valid(world):
|
|
|
|
@@ -370,15 +373,17 @@ func _bob_result(n: int, limit: float) -> Dictionary:
|
|
|
|
var d: Variant = JSON.parse_string(FileAccess.get_file_as_string(path)) if FileAccess.file_exists(path) else null
|
|
|
|
var d: Variant = JSON.parse_string(FileAccess.get_file_as_string(path)) if FileAccess.file_exists(path) else null
|
|
|
|
return d if d is Dictionary else {"error": "Bob gave no answer to command %d" % n}
|
|
|
|
return d if d is Dictionary else {"error": "Bob gave no answer to command %d" % n}
|
|
|
|
|
|
|
|
|
|
|
|
func _spawn(user_args: Array, script: String = "") -> int:
|
|
|
|
func _spawn(user_args: Array, script: String = "", bin: String = "") -> int:
|
|
|
|
var args := PackedStringArray(["--headless", "--path", ProjectSettings.globalize_path("res://")])
|
|
|
|
var args := PackedStringArray(["--headless"])
|
|
|
|
|
|
|
|
if bin.is_empty():
|
|
|
|
|
|
|
|
args.append_array(["--path", ProjectSettings.globalize_path("res://")])
|
|
|
|
if not script.is_empty():
|
|
|
|
if not script.is_empty():
|
|
|
|
args.append_array(["--script", script])
|
|
|
|
args.append_array(["--script", script])
|
|
|
|
args.append("--")
|
|
|
|
args.append("--")
|
|
|
|
for x in user_args:
|
|
|
|
for x in user_args:
|
|
|
|
args.append(str(x))
|
|
|
|
args.append(str(x))
|
|
|
|
args.append_array(["--exit-with", str(OS.get_process_id())])
|
|
|
|
args.append_array(["--exit-with", str(OS.get_process_id())])
|
|
|
|
var pid := OS.create_process(OS.get_executable_path(), args)
|
|
|
|
var pid := OS.create_process(OS.get_executable_path() if bin.is_empty() else bin, args)
|
|
|
|
_pids.append(pid)
|
|
|
|
_pids.append(pid)
|
|
|
|
return pid
|
|
|
|
return pid
|
|
|
|
|
|
|
|
|
|
|
|
|