W1: choose a worldlet (New World and Host Game pages, kept once an island exists), worldlet shown in the Load list; Godot .uid files

This commit is contained in:
Paul Bailey
2026-11-06 16:10:32 +00:00
parent db4a659236
commit 68e6d814d9
96 changed files with 292 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ func _body() -> void:
var statuses: Array[String] = []
Net.host_status.connect(func(t, _f): statuses.append(t))
print("hosting")
Net.host("Alice's island", "", PORT, "rivals", 4242)
Net.host("Alice's island", "", PORT, "rivals", 4242, "valley")
check(Net.hosting, "Host Game starts a server (%s)" % ", ".join(statuses))
await _until(func(): return Net.state == "connected", 40.0)
check(Net.state == "connected", "and joins it (%s)" % " -> ".join(statuses))
@@ -56,6 +56,7 @@ func _body() -> void:
"with the name and the rules picked (friendly rivals: PvP on)")
check(bool(Net.players.get(Net.local_peer, {}).get("admin", false)), "and Alice is its admin")
check(int(Net.world_info.get("seed", 0)) == 4242, "a new island from the seed given (%d)" % int(Net.world_info.get("seed", 0)))
check(String(Net.world_info.get("worldlet", "")) == "valley", "in the worldlet picked (%s)" % Net.world_info.get("worldlet", "-"))
var addrs: Array[String] = Net.my_addresses()
check(not addrs.is_empty(), "the addresses friends can use: %s" % ", ".join(addrs))
var log_path := ProjectSettings.globalize_path(DIR + "/server.log")
@@ -105,10 +106,12 @@ func _body() -> void:
c.data.backups_kept = 3
c.save()
statuses.clear()
Net.host("Alice's island", "", PORT, "co-op", 999)
Net.host("Alice's island", "", PORT, "co-op", 999, "cove")
await _until(func(): return Net.state == "connected", 40.0)
check(Net.state == "connected", "Host Game again: joined (%s)" % " -> ".join(statuses))
check(int(Net.world_info.get("seed", 0)) == 4242, "the same island (seed %d, not the new one typed)" % int(Net.world_info.get("seed", 0)))
check(String(load("res://scripts/net/server_config.gd").open(DIR + "/server.json").data.worldlet) == "valley",
"and the same worldlet (the Valley, not the new one picked)")
check(not bool(Net.server_info.get("pvp", true)), "with the rules picked this time (co-op: PvP off)")
check(_backups().size() == 3, "start-up made a backup, and only backups_kept (3) are kept (%d)" % _backups().size())
_finished = true