1 Commits

2 changed files with 17 additions and 8 deletions

View File

@@ -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

View File

@@ -101,9 +101,13 @@
<section aria-labelledby="host-title"> <section aria-labelledby="host-title">
<h2 id="host-title">Playing with friends</h2> <h2 id="host-title">Playing with friends</h2>
<p>Choose <b>Host Game</b> on the title screen, and friends choose <b>Join Game</b> <p>Choose <b>Host Game</b> on the title screen, and friends choose <b>Join Game</b>
with your address (UDP port 24242). Everyone needs the same version. A spare with your address (UDP port 24242). Everyone needs the same version. On the same
computer can run a dedicated server from the same download: network, or over Tailscale, that's all. For friends over the internet, forward
<code>Emberwild --headless -- --server</code>.</p> <b>UDP 24242 and 24243</b> on your router: the Cove runs as its own server on the
next port, started when someone first goes there. A spare computer can run a
dedicated server from the same download:
<code>Emberwild --headless -- --server</code>.
<a href="guide.html#multiplayer">More in the guide</a>.</p>
</section> </section>
</main> </main>