0.6.1: Emberwild is now Cinderwild (the old name's taken on Steam). Saves, identity and settings are copied across from the Emberwild folder on first start; the site moves to cinderwild.psbailey.uk; same protocol (18), so 0.6.0 and 0.6.1 play together

This commit is contained in:
Paul Bailey
2026-11-07 16:14:11 +00:00
parent 04b9d17826
commit c2c86b5f78
36 changed files with 262 additions and 173 deletions

View File

@@ -9,7 +9,7 @@ if [ ! -f .godot/global_script_class_cache.cfg ]; then
echo "Importing the project first (fresh copy)..."
godot --headless --path . --import >/dev/null 2>&1
fi
for t in test_survival_core test_survival_stats test_save_load test_weather_building test_creatures_combat test_wolves test_alpha test_bear test_thieves test_barrow test_boss test_den_sites test_fishing_diet test_food test_hazards test_iron test_stone test_net_lobby test_net_world test_net_shared test_net_life test_net_boss test_net_rules test_net_lands test_host test_tutorial test_tutorial_full test_hints test_updates test_audio test_items_more test_worldlets test_worldlet_pick test_water_bodies test_cove test_wreck test_shore test_boat test_bug_report test_tunnel test_map test_terrain_edges test_boundary; do
for t in test_boot test_survival_core test_survival_stats test_save_load test_weather_building test_creatures_combat test_wolves test_alpha test_bear test_thieves test_barrow test_boss test_den_sites test_fishing_diet test_food test_hazards test_iron test_stone test_net_lobby test_net_world test_net_shared test_net_life test_net_boss test_net_rules test_net_lands test_host test_tutorial test_tutorial_full test_hints test_updates test_audio test_items_more test_worldlets test_worldlet_pick test_water_bodies test_cove test_wreck test_shore test_boat test_bug_report test_tunnel test_map test_terrain_edges test_boundary; do
extra=""
[ "$t" = "test_boundary" ] && extra="--fixed-fps 30"
# A suite that waits on a world that failed to load would hang forever,

71
tests/test_boot.gd Normal file
View File

@@ -0,0 +1,71 @@
extends SceneTree
## The rename (Emberwild -> Cinderwild, 0.6.1): the first start copies your
## saves, identity and settings across from the old user-data folder, once,
## without overwriting anything already there, and only from the newest old
## name (so a world you deleted under Emberwild doesn't come back from the
## Valheimlike folder).
## Run: godot --headless --path . --script res://tests/test_boot.gd
var _fails := 0
func check(cond: bool, what: String) -> void:
print((" ok " if cond else " FAIL ") + what)
if not cond:
_fails += 1
func _write(path: String, text: String) -> void:
DirAccess.make_dir_recursive_absolute(path.get_base_dir())
var f := FileAccess.open(path, FileAccess.WRITE)
f.store_string(text)
f.close()
func _read(path: String) -> String:
return FileAccess.get_file_as_string(path) if FileAccess.file_exists(path) else ""
func _rm(dir: String) -> void:
if not DirAccess.dir_exists_absolute(dir):
return
var da := DirAccess.open(dir)
for f in da.get_files():
DirAccess.remove_absolute(dir.path_join(f))
for d in da.get_directories():
_rm(dir.path_join(d))
DirAccess.remove_absolute(dir)
func _initialize() -> void:
var B: Node = root.get_node("Boot")
var base := OS.get_user_data_dir().path_join("test_boot")
_rm(base)
var ember := base.path_join("Emberwild")
var valheim := base.path_join("Valheimlike")
var cinder := base.path_join("Cinderwild")
_write(ember.path_join("worlds/home/state.json"), "ember home")
_write(ember.path_join("identity.json"), "me")
_write(ember.path_join("logs/godot.log"), "old log")
_write(ember.path_join("migrated_from_valheimlike.txt"), "old marker")
_write(valheim.path_join("worlds/deleted/state.json"), "gone")
_write(cinder.path_join("audio.json"), "new settings")
_write(ember.path_join("audio.json"), "old settings")
print("the first start")
var n: int = 0
for old_name in B.OLD_NAMES:
var old_dir := base.path_join(old_name)
if DirAccess.dir_exists_absolute(old_dir):
n = B.migrate_from(old_dir, cinder, old_name)
break
check(n == 2, "copies the old folder's files (%d)" % n)
check(_read(cinder.path_join("worlds/home/state.json")) == "ember home" and _read(cinder.path_join("identity.json")) == "me",
"your worlds and identity come across")
check(_read(cinder.path_join("audio.json")) == "new settings", "nothing already there is overwritten")
check(not FileAccess.file_exists(cinder.path_join("logs/godot.log")), "logs stay behind")
check(not FileAccess.file_exists(cinder.path_join("worlds/deleted/state.json")), "the older Valheimlike folder isn't raked over")
check(FileAccess.file_exists(ember.path_join("identity.json")), "the old folder's left as it was")
check(FileAccess.file_exists(cinder.path_join("migrated_from_emberwild.txt")) and not FileAccess.file_exists(cinder.path_join("migrated_from_valheimlike.txt")),
"a marker says it's done")
print("the next start")
_write(ember.path_join("worlds/later/state.json"), "later")
check(B.migrate_from(ember, cinder, "Emberwild") == 0 and not FileAccess.file_exists(cinder.path_join("worlds/later/state.json")), "it only happens once")
_rm(base)
print("RESULT: %s (%d failures)" % ["PASS" if _fails == 0 else "FAIL", _fails])
quit(1 if _fails > 0 else 0)

1
tests/test_boot.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://bnsn0icdtxs16

View File

@@ -1,6 +1,6 @@
extends SceneTree
## 0.6.0, the playtest: Report a bug. The pause menu has a "Report a bug"
## page; its link is a new issue on the Emberwild repo, filled in with
## page; its link is a new issue on the Cinderwild repo, filled in with
## questions to answer and the details (version, computer, mode, land, time,
## where you are), short enough for a browser; the log's path is shown.
## Run: godot --headless --path . --script res://tests/test_bug_report.gd
@@ -43,11 +43,11 @@ func _body() -> void:
print("the link")
var url: String = BugReport.issue_url(w)
check(url.begins_with("https://git.psbailey.uk/Admin/Emberwild/issues/new?title=Bug%3A%20&body="), "a new issue on the Emberwild repo")
check(url.begins_with("https://git.psbailey.uk/Admin/Emberwild/issues/new?title=Bug%3A%20&body="), "a new issue on the Cinderwild repo")
check(url.length() < 4000, "short enough for any browser (%d characters)" % url.length())
var body := url.get_slice("&body=", 1).uri_decode()
var ver: String = String(ProjectSettings.get_setting("application/config/version"))
for want in ["**What happened?**", "**How can we make it happen again?**", "- Version: Emberwild %s" % ver,
for want in ["**What happened?**", "**How can we make it happen again?**", "- Version: Cinderwild %s" % ver,
"- Computer: ", "- Mode: single-player", "- Land: Cove", "- Time: day ", "- Where: ", "- Seed: 1337", "godot.log"]:
check(body.contains(want), "it says %s" % want)
check(BugReport.log_path().ends_with("logs/godot.log") and BugReport.log_path().begins_with("/"), "the log's full path (%s)" % BugReport.log_path())

View File

@@ -53,11 +53,11 @@ func _run() -> void:
Net.arrived.connect(func(l): _arrived = l)
for d in [SRV, BOBS]:
_rm_tree(d)
# (EMBERWILD_SERVER_BIN=<an exported game>: the hub, and the land servers
# (CINDERWILD_SERVER_BIN=<an exported game>: the hub, and the land servers
# 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"))
OS.get_environment("CINDERWILD_SERVER_BIN"))
await _sleep(4.0)
await _body()
if world != null and is_instance_valid(world):

View File

@@ -58,7 +58,7 @@ func _body() -> void:
var plat: String = C.platform_key()
print("a version.json feed")
pages[U.feed] = JSON.stringify({"version": "9.1.0", "protocol": 99, "notes": "The Cove.", "page": "https://example.test/r/9.1.0",
"downloads": {plat: {"file": "Emberwild-9.1.0-%s.zip" % plat, "url": "https://example.test/dl/%s.zip" % plat, "sha256": "ab"}}})
"downloads": {plat: {"file": "Cinderwild-9.1.0-%s.zip" % plat, "url": "https://example.test/dl/%s.zip" % plat, "sha256": "ab"}}})
check(await _check_now() == "available", "9.1.0 is out: available")
check(U.latest_version() == "9.1.0" and U.latest_protocol() == 99, "its version and protocol")
check(U.download_url() == "https://example.test/dl/%s.zip" % plat and U.download().sha256 == "ab", "this platform's download (%s), with its checksum" % plat)
@@ -67,9 +67,9 @@ func _body() -> void:
U.feed = "https://example.test/api/releases/latest"
pages[U.feed] = JSON.stringify({"tag_name": "v9.2.0", "html_url": "https://example.test/releases/v9.2.0", "assets": [
{"name": "version.json", "browser_download_url": "https://example.test/a/version.json"},
{"name": "Emberwild-9.2.0-%s.zip" % plat, "browser_download_url": "https://example.test/a/game-%s.zip" % plat}]})
{"name": "Cinderwild-9.2.0-%s.zip" % plat, "browser_download_url": "https://example.test/a/game-%s.zip" % plat}]})
pages["https://example.test/a/version.json"] = JSON.stringify({"version": "9.2.0", "protocol": 99,
"downloads": {plat: {"file": "Emberwild-9.2.0-%s.zip" % plat, "sha256": "cd"}}, "windows_only_key": true})
"downloads": {plat: {"file": "Cinderwild-9.2.0-%s.zip" % plat, "sha256": "cd"}}, "windows_only_key": true})
check(await _check_now() == "available" and U.latest_version() == "9.2.0", "the release's version.json is read: 9.2.0")
check(U.download_url() == "https://example.test/a/game-%s.zip" % plat, "the download is the release asset with that file name")
check(U.page == "https://example.test/releases/v9.2.0", "and the release page is kept")
@@ -97,7 +97,7 @@ func _body() -> void:
print("the title screen")
var TS: Script = load("res://scripts/ui/title_screen.gd")
var msg := "Different game version: this server runs Emberwild 9.3.0 (protocol 99), you have protocol 12. Update the game to join."
var msg := "Different game version: this server runs Cinderwild 9.3.0 (protocol 99), you have protocol 12. Update the game to join."
check(TS.version_advice(msg).contains("9.3.0 is out"), "refused for an old version: it says the new one is out")
check(TS.version_advice("Server is full").is_empty(), "(other refusals: nothing added)")
pages[U.feed] = JSON.stringify({"version": "9.4.0", "notes": "Sea fishing."})