From 7a3fefaafd39e8a9c2891f04e73d3c00356b2bff Mon Sep 17 00:00:00 2001
From: "Fabien F." <8136686+lostmind84@users.noreply.github.com>
Date: Wed, 7 Oct 2026 13:56:00 +0200
Subject: [PATCH 01/15] feat: validate a release and export its baseline on
Linux
The signed base package holds the MySQL data directory of a Windows repack. On a
Linux computer extract-schema-base now turns it into a Docker server folder whose
database container opens that directory (mysqlData in docker.json), so the release
SQL, the schema contract and export-baseline run with the Docker installation code.
Windows is unchanged: it still bootstraps the repack's own database program.
---
crates/coa-core/src/docker/fixture.rs | 69 +++++++++++++++++++++++++
crates/coa-core/src/docker/install.rs | 2 +-
crates/coa-core/src/docker/lifecycle.rs | 39 ++++++++++++--
crates/coa-core/src/docker/mod.rs | 11 ++--
crates/coa-core/src/release_schema.rs | 7 ++-
docs/ARCHITECTURE.md | 9 ++++
6 files changed, 129 insertions(+), 8 deletions(-)
create mode 100644 crates/coa-core/src/docker/fixture.rs
diff --git a/crates/coa-core/src/docker/fixture.rs b/crates/coa-core/src/docker/fixture.rs
new file mode 100644
index 0000000..2456859
--- /dev/null
+++ b/crates/coa-core/src/docker/fixture.rs
@@ -0,0 +1,69 @@
+//! The disposable database a release is validated against, on a Linux computer.
+//!
+//! A release is checked by applying its database changes to the database of the signed base package. The base carries the
+//! MySQL data directory of a Windows repack, and a MySQL 8.4 server in Docker opens it as it is (with the repack's table
+//! name setting). So the fixture is a Docker server folder whose database container uses that directory in place of a
+//! volume; everything else (start, SQL, schema capture, dumps) is the code of a Docker installation.
+
+use std::fs;
+use std::path::Path;
+
+use super::{Config, Docker, MARKER, MYSQL_IMAGE};
+use crate::driver::{self, Verb};
+use crate::error::{Error, Result};
+use crate::{fsx, install, package};
+
+/// Turn an extracted base package (`mysql/data`, `Settings/`) into a Docker server folder and start its database.
+pub fn prepare(root: &Path) -> Result<()> {
+ prepare_with(&super::SystemDocker, root)
+}
+
+pub(crate) fn prepare_with(d: &dyn Docker, root: &Path) -> Result<()> {
+ let boot = root.join(package::BOOTSTRAP_CREDENTIALS);
+ if !boot.is_file() {
+ return Err(Error::Invalid("The package has no database bootstrap information.".into()));
+ }
+ let secrets: serde_json::Value = fsx::read_json(&boot)?;
+ let root_pw = secrets["rootPassword"].as_str().filter(|p| p.chars().all(|c| c.is_ascii_hexdigit()) && !p.is_empty())
+ .ok_or_else(|| Error::Invalid("The database bootstrap information is not usable.".into()))?.to_string();
+ fs::copy(&boot, root.join("Settings/database.json"))?;
+ let data = fs::canonicalize(root.join("mysql/data"))
+ .map_err(|_| Error::Invalid("The package has no database data directory.".into()))?;
+ let cfg = Config {
+ project: format!("schema-{}", install::random_hex(8)),
+ bind_address: "127.0.0.1".into(),
+ mysql_image: MYSQL_IMAGE.into(),
+ data_dir: None,
+ mysql_data: Some(data.to_string_lossy().into_owned()),
+ };
+ fsx::atomic_write_json(&root.join(MARKER), &cfg)?;
+
+ let started = driver::run(root, Verb::StartMysql)?;
+ if !started.ok {
+ return Err(Error::Invalid(started.human.map(|h| h.message.to_string()).unwrap_or_else(|| "The database could not be started.".into())));
+ }
+ // The repack's administrator account only exists for connections from the server itself (the socket); the Manager
+ // connects over TCP. The fixture is thrown away, so the account is simply added.
+ let sql = format!("CREATE USER IF NOT EXISTS 'root'@'127.0.0.1' IDENTIFIED BY '{root_pw}'; GRANT ALL ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION;");
+ let mut call = super::Call::new(&["exec", "-i", "-e", "MYSQL_PWD", &cfg.names().db, "mysql", "--user=root"], std::time::Duration::from_secs(60));
+ call.env = vec![("MYSQL_PWD".into(), root_pw)];
+ call.stdin = Some(sql.as_bytes());
+ let o = d.run(&call)?;
+ if !o.ok() {
+ return Err(Error::Invalid(format!("The fixture database could not be opened to the Manager: {}", o.text())));
+ }
+ Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn a_package_without_bootstrap_information_is_refused_before_anything_starts() {
+ let dir = tempfile::tempdir().unwrap();
+ let err = prepare(dir.path()).unwrap_err();
+ assert!(err.to_string().contains("bootstrap"), "{err}");
+ assert!(!dir.path().join(MARKER).exists());
+ }
+}
diff --git a/crates/coa-core/src/docker/install.rs b/crates/coa-core/src/docker/install.rs
index 8e883a0..e427c18 100644
--- a/crates/coa-core/src/docker/install.rs
+++ b/crates/coa-core/src/docker/install.rs
@@ -146,7 +146,7 @@ fn write_settings(root: &Path, data_dir: &Path) -> Result {
let (auth, world, ra) = (pick_port(DEFAULT_PORTS.0)?, pick_port(DEFAULT_PORTS.1)?, pick_port(DEFAULT_PORTS.2)?);
let (root_password, app_password) = (random_hex(48), random_hex(48));
fs::create_dir_all(root.join("Settings"))?;
- let docker = Config { project, bind_address: "127.0.0.1".into(), mysql_image: super::MYSQL_IMAGE.into(), data_dir: Some(data_dir.to_string_lossy().into_owned()) };
+ let docker = Config { project, bind_address: "127.0.0.1".into(), mysql_image: super::MYSQL_IMAGE.into(), data_dir: Some(data_dir.to_string_lossy().into_owned()), mysql_data: None };
fsx::atomic_write_json(&root.join(MARKER), &docker)?;
// Same file and keys as a repack, so the console, the ports and the settings screens work unchanged. The database is
// not published on the host; its port is only there to fill the key.
diff --git a/crates/coa-core/src/docker/lifecycle.rs b/crates/coa-core/src/docker/lifecycle.rs
index bbf813a..52035dc 100644
--- a/crates/coa-core/src/docker/lifecycle.rs
+++ b/crates/coa-core/src/docker/lifecycle.rs
@@ -210,7 +210,7 @@ fn start(d: &dyn Docker, root: &Path, cfg: &Config, with_game: bool, log: &mut L
if !state.get(&n.db).is_some_and(Container::running) {
remove(d, &n.db);
let mut call = Call::new(&[], Duration::from_secs(120));
- call.args = db_args(cfg, &n);
+ call.args = db_args(cfg, &n, owner_of(root).as_deref());
call.env = vec![("MYSQL_ROOT_PASSWORD".into(), secrets.root.clone())];
let o = d.run(&call).or_else(|e| fail(ErrorCode::DockerUnavailable, e.to_string()))?;
if !o.ok() {
@@ -333,12 +333,22 @@ fn connect_ip(cfg: &Config) -> IpAddr {
// ------------------------------------------------------------------------------------------------- argument lists
-fn db_args(cfg: &Config, n: &Names) -> Vec {
+fn db_args(cfg: &Config, n: &Names, owner: Option<&str>) -> Vec {
let mut a: Vec = ["run", "--detach", "--name"].iter().map(|s| s.to_string()).collect();
a.push(n.db.clone());
a.extend(["--network".into(), n.network.clone(), "--network-alias".into(), "db".into()]);
a.extend(["--label".into(), format!("coa.project={}", cfg.project)]);
- a.extend(["--volume".into(), format!("{}:/var/lib/mysql", n.volume)]);
+ match &cfg.mysql_data {
+ Some(dir) => {
+ // A data directory from a Windows repack: it is written by the person who owns the folder, and its table names
+ // were folded to lower case (the repack's setting), which the server must be told because a Linux one does not.
+ a.extend(["--volume".into(), format!("{dir}:/var/lib/mysql")]);
+ if let Some(o) = owner {
+ a.extend(["--user".into(), o.into()]);
+ }
+ }
+ None => a.extend(["--volume".into(), format!("{}:/var/lib/mysql", n.volume)]),
+ }
// The password comes from the environment of the docker client, not from this command line.
a.extend(["--env".into(), "MYSQL_ROOT_PASSWORD".into()]);
// "mysqladmin ping" succeeds as soon as the server answers, with or without a login. It must go over TCP, like
@@ -349,6 +359,9 @@ fn db_args(cfg: &Config, n: &Names) -> Vec {
a.extend(["--health-interval".into(), "5s".into(), "--health-timeout".into(), "5s".into(), "--health-retries".into(), "40".into()]);
a.extend(["--stop-timeout".into(), "60".into()]);
a.push(cfg.mysql_image.clone());
+ if cfg.mysql_data.is_some() {
+ a.push("--lower-case-table-names=1".into());
+ }
a
}
@@ -698,6 +711,26 @@ mod tests {
assert!(runs[1].args.windows(2).any(|w| w == ["--env", "AC_WORLD_DATABASE_INFO"]), "name only, the value is in the environment");
}
+ #[test]
+ fn a_release_fixture_runs_its_database_on_the_package_data_directory_not_on_a_volume() {
+ let (_d, root) = server("t1");
+ fs::write(root.join("Settings/docker.json"), r#"{"project":"t1","mysqlData":"/work/fixture/mysql/data"}"#).unwrap();
+ let sim = Sim::new();
+ assert!(run_with(&sim, &root, Verb::StartMysql).unwrap().ok);
+ let db = &sim.calls_of("run")[0].args;
+ assert!(db.windows(2).any(|w| w == ["--volume", "/work/fixture/mysql/data:/var/lib/mysql"]), "{db:?}");
+ assert!(!db.iter().any(|a| a.starts_with("coa-t1-db:")), "no named volume: {db:?}");
+ assert!(db.iter().any(|a| a == "--user"), "the folder is written by its owner");
+ assert_eq!(db.last().map(String::as_str), Some("--lower-case-table-names=1"), "a server option, so after the image name");
+ // An installation never gets any of it.
+ let (_d2, root2) = server("t2");
+ let sim2 = Sim::new();
+ assert!(run_with(&sim2, &root2, Verb::StartMysql).unwrap().ok);
+ let plain = &sim2.calls_of("run")[0].args;
+ assert!(plain.windows(2).any(|w| w == ["--volume", "coa-t2-db:/var/lib/mysql"]), "{plain:?}");
+ assert!(!plain.iter().any(|a| a == "--lower-case-table-names=1" || a == "--user"));
+ }
+
#[test]
fn the_database_is_only_healthy_once_it_takes_tcp_connections() {
let (_d, root) = server("t1");
diff --git a/crates/coa-core/src/docker/mod.rs b/crates/coa-core/src/docker/mod.rs
index 04cc121..fae61d9 100644
--- a/crates/coa-core/src/docker/mod.rs
+++ b/crates/coa-core/src/docker/mod.rs
@@ -15,6 +15,7 @@
//! ```
mod cli;
+pub mod fixture;
pub mod install;
mod lifecycle;
@@ -63,6 +64,10 @@ pub struct Config {
/// mounted read-only, so one copy can serve several servers.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub data_dir: Option,
+ /// A MySQL data directory the database container uses in place of its volume. Only for the disposable fixture that
+ /// validates a release (the data directory of the signed base package); an installation never sets it.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub mysql_data: Option,
}
pub(crate) struct Names {
@@ -96,10 +101,10 @@ impl Config {
if self.bind_address.parse::().is_err() {
return Err(Error::Invalid(format!("{} is not an IP address.", self.bind_address)));
}
- if let Some(d) = &self.data_dir {
- // The folder goes into a `--volume host:container:ro` option, where a colon would be read as a separator.
+ for d in [&self.data_dir, &self.mysql_data].into_iter().flatten() {
+ // The folder goes into a `--volume host:container` option, where a colon would be read as a separator.
if !Path::new(d).is_absolute() || d.contains(':') {
- return Err(Error::Invalid("The game data folder must be a full path without a colon.".into()));
+ return Err(Error::Invalid("A Docker folder must be a full path without a colon.".into()));
}
}
let image_ok = !self.mysql_image.is_empty() && self.mysql_image.chars().all(|c| c.is_ascii_alphanumeric() || "._/:@-".contains(c));
diff --git a/crates/coa-core/src/release_schema.rs b/crates/coa-core/src/release_schema.rs
index d4c161e..16d274c 100644
--- a/crates/coa-core/src/release_schema.rs
+++ b/crates/coa-core/src/release_schema.rs
@@ -38,7 +38,12 @@ pub fn extract_base(source: &Path, fixture: &Path, trusted_key: &str) -> Result<
["mysql/", "settings/", "runtime/", "scripts/", "core/", "bugreport/"].iter().any(|prefix| path.starts_with(prefix))
}, &|_, _| {})?;
fsx::atomic_write(&fixture.join(MARKER), b"disposable release-schema fixture")?;
- install::bootstrap_database(fixture)
+ // A Linux computer has no Windows database program: the fixture is a Docker server over the package's data directory.
+ if cfg!(windows) {
+ install::bootstrap_database(fixture)
+ } else {
+ crate::docker::fixture::prepare(fixture)
+ }
}
pub fn capture_release(fixture: &Path, tree: &Path, sql: &[SqlFile]) -> Result<()> {
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 80a4ff9..97c48b5 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -392,6 +392,15 @@ hand over to `coa_core::docker`; nothing else needed to change for start, stop,
so replaying the SQL files from the base scripts fails, in any order. `coa-release export-baseline --server DIR --out DIR`
produces the dumps from a prepared server (repack or Docker). The game data stays where the person has it
(`dataDir` in `docker.json`, mounted read-only). A failure removes the containers, the volume and the staging folder.
+* **Validating a release on Linux** (`docker/fixture.rs`, used by `coa-release extract-schema-base` and `schema-contract` where
+ there is no Windows database program): the signed base package carries the MySQL data directory of a Windows repack, and a
+ MySQL 8.4 container opens it as it is (`--lower-case-table-names=1`, the repack's setting). The fixture is a Docker server
+ folder (`docker.json` with `mysqlData`: the database container uses that directory in place of a volume; an installation
+ never sets it), plus a `root` account for TCP, which the repack only has for its socket. The release SQL is then applied and the
+ schema contract captured by the same code as on Windows, and `export-baseline` dumps the result: that is how a Linux build
+ produces `Database/baseline` without anyone's live database. The migration checksums recorded in the base are those of
+ files checked out on Windows (CRLF line endings, `core.autocrlf`): the SQL of the core, the modules and SQUID must be
+ checked out the same way for the checksums to match, or every applied migration looks edited.
* **Not done yet**: wiring the installer into the screens, downloading the game data, updates, port conflict detection,
the firewall and exposure checks, the Wildcard realm profiles, and the client under Wine/Proton.
From 3f98ba3add60d82c0fdcf37c936d12c58aed6a1c Mon Sep 17 00:00:00 2001
From: "Fabien F." <8136686+lostmind84@users.noreply.github.com>
Date: Wed, 7 Oct 2026 21:01:43 +0200
Subject: [PATCH 02/15] test: the release fixture database arguments are a
Linux case
---
crates/coa-core/src/docker/lifecycle.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/crates/coa-core/src/docker/lifecycle.rs b/crates/coa-core/src/docker/lifecycle.rs
index 52035dc..a4d6025 100644
--- a/crates/coa-core/src/docker/lifecycle.rs
+++ b/crates/coa-core/src/docker/lifecycle.rs
@@ -711,6 +711,8 @@ mod tests {
assert!(runs[1].args.windows(2).any(|w| w == ["--env", "AC_WORLD_DATABASE_INFO"]), "name only, the value is in the environment");
}
+ // Unix only: the folder is a Linux path (a Windows path has a colon, which a Docker folder may not).
+ #[cfg(unix)]
#[test]
fn a_release_fixture_runs_its_database_on_the_package_data_directory_not_on_a_volume() {
let (_d, root) = server("t1");
From c6e8a3450924e693620694fd1778fb4ba1856366 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?=
Date: Thu, 8 Oct 2026 06:56:03 +0500
Subject: [PATCH 03/15] Make the update check survive damaged launcher state
and an unavailable database
A crash during a launcher write can leave .state/*.json zero-filled, which made
every launcher start (and so the update check) fail with "Something went wrong".
Zero-filled state files are now discarded before each launcher verb, the check
degrades to a warning when the database cannot be inspected, and database start
failures carry the launcher's own output.
Co-Authored-By: Claude Sonnet 5.5
---
...008-update-check-survives-damaged-state.md | 7 +++
crates/coa-core/src/backup.rs | 3 +-
crates/coa-core/src/driver.rs | 43 +++++++++++++++++++
crates/coa-core/src/update.rs | 15 ++++++-
src/i18n/locales/de.ts | 1 +
src/i18n/locales/en.ts | 1 +
src/i18n/locales/es.ts | 1 +
src/i18n/locales/fr.ts | 1 +
src/i18n/locales/ru.ts | 1 +
src/i18n/locales/zh.ts | 1 +
src/lib/api.ts | 2 +
src/lib/serverUpdateStatus.ts | 2 +-
src/screens/SettingsHome.tsx | 6 ++-
13 files changed, 80 insertions(+), 4 deletions(-)
create mode 100644 changelog.d/20261008-update-check-survives-damaged-state.md
diff --git a/changelog.d/20261008-update-check-survives-damaged-state.md b/changelog.d/20261008-update-check-survives-damaged-state.md
new file mode 100644
index 0000000..b01e708
--- /dev/null
+++ b/changelog.d/20261008-update-check-survives-damaged-state.md
@@ -0,0 +1,7 @@
+---
+area: manager
+type: fixed
+audience: admins
+title: Checking for updates no longer fails with "Something went wrong" after an interrupted start
+---
+A crash or power loss could leave a damaged status file that made every database start fail. The Manager now removes such files itself, still compares the files when the database is unavailable, and shows the real reason.
diff --git a/crates/coa-core/src/backup.rs b/crates/coa-core/src/backup.rs
index 8e21adb..c3094ea 100644
--- a/crates/coa-core/src/backup.rs
+++ b/crates/coa-core/src/backup.rs
@@ -163,7 +163,8 @@ pub fn with_database(root: &Path, f: impl FnOnce(&Db) -> Result) -> Result
if !mysql_was_up {
let out = driver::run(root, Verb::StartMysql)?;
if !out.ok {
- return Err(Error::Invalid(out.human.map(|h| h.title.to_string()).unwrap_or_else(|| "The database could not be started.".into())));
+ // Keep the launcher's own last lines: the title alone ("Something went wrong") hides the cause.
+ return Err(Error::Invalid(format!("The database could not be started. {}", driver::startup_failure(root, &out))));
}
}
let result = f(&db);
diff --git a/crates/coa-core/src/driver.rs b/crates/coa-core/src/driver.rs
index b3c8a1e..930ed7b 100644
--- a/crates/coa-core/src/driver.rs
+++ b/crates/coa-core/src/driver.rs
@@ -136,6 +136,7 @@ fn run_inner(root: &Path, verb: Verb, validating_update: bool) -> Result Result = redacted.lines().rev().take(12).collect();
+ tracing::warn!(?verb, exit_code, output = %tail.into_iter().rev().collect::>().join("\n"), "driver: launcher verb failed");
+ }
if ok && verb == Verb::StartAll { crate::multiworld::start(&root)?; }
Ok(DriverOutcome { ok, exit_code, code, human: code.map(ErrorCode::human), output })
}
+/// The launcher keeps one JSON record per service in `.state`. A crash or power loss while it writes one can leave
+/// a file of the right length that holds only zero bytes (NTFS keeps the length but not the data), and the launcher
+/// then dies on every start with an unreadable record. Such a file carries no information, so remove it: the
+/// launcher treats a missing record as "not running". Only empty or all-zero `*.json` files are touched.
+pub(crate) fn discard_damaged_launcher_state(root: &Path) -> Vec {
+ let mut removed = Vec::new();
+ let Ok(entries) = std::fs::read_dir(root.join(".state")) else { return removed; };
+ for entry in entries.flatten() {
+ let path = entry.path();
+ if path.extension().is_none_or(|e| !e.eq_ignore_ascii_case("json")) || !path.is_file() { continue; }
+ let Ok(bytes) = std::fs::read(&path) else { continue; };
+ if bytes.iter().all(|b| *b == 0) && std::fs::remove_file(&path).is_ok() {
+ tracing::warn!(file = %path.display(), bytes = bytes.len(), "driver: removed a launcher state file damaged by an interrupted write");
+ removed.push(path);
+ }
+ }
+ removed
+}
+
const LAUNCH_SCRIPT: &str = "import runpy,sys;from pathlib import Path;script=sys.argv[1];sys.path.insert(0,str(Path(script).resolve().parent));sys.argv=sys.argv[1:];runpy.run_path(script,run_name='__main__')";
pub(crate) fn patch_launcher_imports(text: &str) -> Result {
@@ -251,6 +276,24 @@ mod tests {
assert_eq!(Verb::StartWorld.timeout(folder.path()), Duration::from_secs(420));
}
+ #[test]
+ fn zero_filled_launcher_state_is_discarded_and_valid_state_is_kept() {
+ let folder = tempfile::tempdir().unwrap();
+ let state = folder.path().join(".state");
+ std::fs::create_dir_all(&state).unwrap();
+ std::fs::write(state.join("mysql.json"), vec![0u8; 116]).unwrap();
+ std::fs::write(state.join("configuration.json"), Vec::::new()).unwrap();
+ std::fs::write(state.join("world.json"), "{\"pid\": 4}\n").unwrap();
+ std::fs::write(state.join("stop-relay"), Vec::::new()).unwrap();
+ std::fs::write(state.join("auth.json"), "{\"pid\": 0}").unwrap();
+ let mut removed: Vec<_> = discard_damaged_launcher_state(folder.path()).iter().map(|p| p.file_name().unwrap().to_string_lossy().into_owned()).collect();
+ removed.sort();
+ assert_eq!(removed, ["configuration.json", "mysql.json"]);
+ assert!(state.join("world.json").exists() && state.join("auth.json").exists() && state.join("stop-relay").exists());
+ assert!(discard_damaged_launcher_state(folder.path()).is_empty());
+ assert!(discard_damaged_launcher_state(&folder.path().join("missing")).is_empty());
+ }
+
#[test]
fn translates_known_launcher_messages() {
assert_eq!(translate("RuntimeError: Port 8085 is already used. Stop the other server"), ErrorCode::PortInUse);
diff --git a/crates/coa-core/src/update.rs b/crates/coa-core/src/update.rs
index a048010..7ff06ea 100644
--- a/crates/coa-core/src/update.rs
+++ b/crates/coa-core/src/update.rs
@@ -259,6 +259,10 @@ pub struct Preview {
pub migrations: usize,
pub pending_migrations: usize,
pub download_bytes: u64,
+ /// Why the database could not be inspected. The check still answers about the files; applying the update starts
+ /// the database itself and reports its own failure.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub database_check_error: Option,
}
/// Describe the update; a managed launcher may need a one-time authenticated payload check.
@@ -277,7 +281,15 @@ pub fn preview(root: &Path, meta: &InstallMeta, source: &Source, trusted_key: &s
item.reason = Some("already up to date with Manager integration".into());
}
}
- let pending_migrations = (RepackEnv { root, meta_dir: &meta_dir }).pending_migrations(&m)?;
+ // Counting pending SQL needs the database. If it cannot be started the files can still be compared, so report
+ // that instead of failing the whole check.
+ let (pending_migrations, database_check_error) = match (RepackEnv { root, meta_dir: &meta_dir }).pending_migrations(&m) {
+ Ok(count) => (count, None),
+ Err(error) => {
+ tracing::warn!(%error, "update check: the database could not be inspected");
+ (m.migrations.len(), Some(error.to_string()))
+ }
+ };
Ok(Preview {
from_version: meta.core.version.clone(),
to_version: m.version.clone(),
@@ -286,6 +298,7 @@ pub fn preview(root: &Path, meta: &InstallMeta, source: &Source, trusted_key: &s
migrations: m.migrations.len(),
pending_migrations,
download_bytes: m.archive.as_ref().map(|a| a.parts.iter().map(|p| p.size).sum()).unwrap_or(0),
+ database_check_error,
})
}
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index c13b43a..7fc74bd 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -827,6 +827,7 @@ const de: Partial> = {
"set.searchAll": "Alle Einstellungen nach Name oder Beschreibung durchsuchen…",
"set.search": "Einstellungen durchsuchen…",
"upd.current": "Du bist auf dem neuesten Stand (Version {v}).",
+ "upd.dbUnchecked": "Die Datenbank konnte nicht geprüft werden, daher sind offene Datenbankänderungen unbekannt: {why}",
"client.job.checking": "Client wird geprüft…",
"client.job.updating": "Client wird aktualisiert",
"fr.lan.address": "Netzwerkadresse",
diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts
index 03db274..af81ef5 100644
--- a/src/i18n/locales/en.ts
+++ b/src/i18n/locales/en.ts
@@ -848,6 +848,7 @@ const en = {
"set.searchAll": "Search all settings by name or description…",
"set.search": "Search settings…",
"upd.current": "You are up to date (version {v}).",
+ "upd.dbUnchecked": "The database could not be checked, so pending database changes are unknown: {why}",
"client.job.checking": "Checking the client…",
"client.job.updating": "Updating the client",
"fr.lan.address": "Network address",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index 3bd4e70..4336f40 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -827,6 +827,7 @@ const es: Partial> = {
"set.searchAll": "Buscar en todos los ajustes por nombre o descripción…",
"set.search": "Buscar ajustes…",
"upd.current": "Estás al día (versión {v}).",
+ "upd.dbUnchecked": "No se pudo comprobar la base de datos, así que se desconocen los cambios pendientes: {why}",
"client.job.checking": "Comprobando el cliente…",
"client.job.updating": "Actualizando el cliente",
"fr.lan.address": "Dirección de red",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index beb10a4..83b52a2 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -827,6 +827,7 @@ const fr: Partial> = {
"set.searchAll": "Rechercher dans tous les réglages par nom ou description…",
"set.search": "Rechercher un réglage…",
"upd.current": "Vous êtes à jour (version {v}).",
+ "upd.dbUnchecked": "La base de données n'a pas pu être vérifiée ; les modifications en attente sont donc inconnues : {why}",
"client.job.checking": "Vérification du client…",
"client.job.updating": "Mise à jour du client",
"fr.lan.address": "Adresse réseau",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 7d24c29..a6ae392 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -846,6 +846,7 @@ const ru: Partial> = {
"set.searchAll": "Поиск по всем настройкам: название или описание…",
"set.search": "Поиск по настройкам…",
"upd.current": "У вас последняя версия ({v}).",
+ "upd.dbUnchecked": "Не удалось проверить базу данных, поэтому неизвестно, нужны ли ей изменения: {why}",
"client.job.checking": "Проверка клиента…",
"client.job.updating": "Обновление клиента",
"fr.lan.address": "Сетевой адрес",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index fe83254..9b21111 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -827,6 +827,7 @@ const zh = {
"set.searchAll": "按名称或描述搜索全部设置…",
"set.search": "搜索设置…",
"upd.current": "当前已是最新版本 ({v})。",
+ "upd.dbUnchecked": "无法检查数据库,因此不清楚是否有待应用的数据库更改:{why}",
"client.job.checking": "正在检查游戏客户端…",
"client.job.updating": "正在更新游戏客户端",
"err.docker_unavailable.title": "Docker 不可用",
diff --git a/src/lib/api.ts b/src/lib/api.ts
index 19f0539..5d2ddb4 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -285,6 +285,8 @@ export interface UpdatePreview {
migrations: number;
pending_migrations?: number;
download_bytes: number;
+ /** Set when the database could not be inspected; the file comparison is still valid. */
+ database_check_error?: string;
}
export interface UpdateTxn {
diff --git a/src/lib/serverUpdateStatus.ts b/src/lib/serverUpdateStatus.ts
index be84a75..dd5a76d 100644
--- a/src/lib/serverUpdateStatus.ts
+++ b/src/lib/serverUpdateStatus.ts
@@ -3,5 +3,5 @@ import type { UpdatePreview } from "./api";
export function isUpdateCurrent(preview: UpdatePreview): boolean {
return preview.from_version === preview.to_version
&& preview.items.every((item) => item.action === "skip")
- && (preview.pending_migrations ?? (preview.migrations === 0 ? 0 : undefined)) === 0;
+ && (preview.database_check_error !== undefined || (preview.pending_migrations ?? (preview.migrations === 0 ? 0 : undefined)) === 0);
}
diff --git a/src/screens/SettingsHome.tsx b/src/screens/SettingsHome.tsx
index 1f5574f..60ab99a 100644
--- a/src/screens/SettingsHome.tsx
+++ b/src/screens/SettingsHome.tsx
@@ -202,6 +202,10 @@ export function SettingsHome({ serverId }: { serverId: string }) {
From 072a657649f80d3b0202344b960817fd73106681 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?=
Date: Thu, 8 Oct 2026 07:01:20 +0500
Subject: [PATCH 04/15] Remove-server card, Accounts tab, quiet background
update check, safer install cleanup
- Settings: a card removes a stopped server from the Manager (no files deleted).
- The Players tab is now Accounts in all languages.
- The five-minute background check no longer starts and stops MySQL on a stopped
server; only an explicit check may start it.
- A failed install keeps its marker until the folder is complete, cleans up after a
failure that happens after the move, and reports the launcher's output; install and
update errors have a Copy button.
Co-Authored-By: Claude Sonnet 5.5
---
crates/coa-core/src/backup.rs | 8 +++++++
crates/coa-core/src/install.rs | 34 ++++++++++++++++++++--------
crates/coa-core/src/update.rs | 38 ++++++++++++++++++++++++++-----
src-tauri/src/lib.rs | 6 +++--
src/i18n/locales/de.ts | 11 ++++++---
src/i18n/locales/en.ts | 11 ++++++---
src/i18n/locales/es.ts | 11 ++++++---
src/i18n/locales/fr.ts | 11 ++++++---
src/i18n/locales/ru.ts | 11 ++++++---
src/i18n/locales/zh.ts | 11 ++++++---
src/lib/api.ts | 5 +++-
src/lib/serverUpdate.ts | 8 +++----
src/lib/serverUpdateStatus.ts | 2 +-
src/screens/InstallServer.tsx | 11 ++++++---
src/screens/RemoveServerCard.tsx | 39 ++++++++++++++++++++++++++++++++
src/screens/SettingsHome.tsx | 16 +++++++++----
src/screens/Shell.tsx | 2 +-
17 files changed, 185 insertions(+), 50 deletions(-)
create mode 100644 src/screens/RemoveServerCard.tsx
diff --git a/crates/coa-core/src/backup.rs b/crates/coa-core/src/backup.rs
index c3094ea..41be4b6 100644
--- a/crates/coa-core/src/backup.rs
+++ b/crates/coa-core/src/backup.rs
@@ -177,6 +177,14 @@ pub fn with_database(root: &Path, f: impl FnOnce(&Db) -> Result) -> Result
result
}
+/// Run `f` only if the database is already up; `None` (and nothing started) otherwise.
+pub fn with_running_database(root: &Path, f: impl FnOnce(&Db) -> Result) -> Result
)}
+
+
);
}
diff --git a/src/screens/Shell.tsx b/src/screens/Shell.tsx
index aa4a804..4a6b134 100644
--- a/src/screens/Shell.tsx
+++ b/src/screens/Shell.tsx
@@ -139,7 +139,7 @@ export function Shell(props: {
) : page === "friends" ? (
) : page === "settings" ? (
-
+ props.onForget(server.id)} />
) : page === "players" ? (
) : page === "backups" ? (
From f920ff8a59909ff7771ddc0db90dc95100ab6268 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?=
Date: Thu, 8 Oct 2026 07:04:25 +0500
Subject: [PATCH 05/15] Fix the stray window scrollbar, the Overview button
overflow and show one card per realm
- The main area and the console log are now positioning contexts, so screen-reader-only
text inside them can no longer extend the whole window (the second scrollbar in the update
dialog and the window scroll on the Console database tab).
- The client button group on the server card wraps instead of leaving the card.
- With both worlds starting together, each realm gets its own card.
Co-Authored-By: Claude Sonnet 5.5
---
src/screens/ConsolePage.tsx | 2 +-
src/screens/Overview.tsx | 40 ++++++++++++++++++++++++++++++++++---
src/screens/Shell.tsx | 2 +-
3 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/src/screens/ConsolePage.tsx b/src/screens/ConsolePage.tsx
index dfcef3d..945930d 100644
--- a/src/screens/ConsolePage.tsx
+++ b/src/screens/ConsolePage.tsx
@@ -103,7 +103,7 @@ export function ConsolePage({ serverId }: { serverId: string }) {
-
+
{missing ?
{missing}
: lines.length === 0 ?
{t("con.empty")}
: lines.map((l, i) => (
{l.level !== "info" && {l.level}: }
diff --git a/src/screens/Overview.tsx b/src/screens/Overview.tsx
index a288bb7..ee3ebac 100644
--- a/src/screens/Overview.tsx
+++ b/src/screens/Overview.tsx
@@ -68,6 +68,19 @@ export function Overview({ server, companions = true, onForget, onOpenUpdates, o
const t = useT();
const human = useHuman();
const [status, setStatus] = useState(null);
+ // With both worlds started together, each realm gets its own card; the first realm owns the database and auth.
+ const [realms, setRealms] = useState<{ first: string; second: string } | null>(null);
+ const bothWorlds = !!status?.observed.secondary_world;
+ useEffect(() => {
+ if (!bothWorlds) { setRealms(null); return; }
+ let alive = true;
+ void api.realmProfiles(server.id).then((r) => {
+ if (!alive) return;
+ const name = (m: "coa" | "wildcard") => (m === "coa" ? "Conquest of Azeroth" : "Wildcard");
+ setRealms({ first: name(r.active), second: name(r.active === "coa" ? "wildcard" : "coa") });
+ }).catch(() => { if (alive) setRealms(null); });
+ return () => { alive = false; };
+ }, [bothWorlds, server.id]);
const [action, setAction] = useState(null);
const [realmBusy, setRealmBusy] = useState(false);
const [failure, setFailure] = useState(null);
@@ -220,7 +233,7 @@ export function Overview({ server, companions = true, onForget, onOpenUpdates, o
{ onRealmChanged(); void poll(); }} />
-
}
{error && (
From 017b977bfa09a9a859c6f2ea6fd05a2818125744 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?=
Date: Thu, 8 Oct 2026 07:09:33 +0500
Subject: [PATCH 07/15] Same version is never an update; Repair lists the files
that differ
An update is decided by version: files the owner edited at the same version no longer
open a keep/replace decision. Repair shows which files differ or are missing.
Co-Authored-By: Claude Sonnet 5.5
---
crates/coa-core/src/update.rs | 12 ++++++++++++
src/i18n/locales/en.ts | 2 ++
src/i18n/locales/ru.ts | 2 ++
src/screens/RepairCard.tsx | 8 +++++++-
4 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/crates/coa-core/src/update.rs b/crates/coa-core/src/update.rs
index 9c7b7bf..96c3ba9 100644
--- a/crates/coa-core/src/update.rs
+++ b/crates/coa-core/src/update.rs
@@ -197,8 +197,15 @@ pub struct PlanItem {
/// What an update would do to this installation. Read-only.
pub fn plan(root: &Path, meta: &InstallMeta, manifest: &Manifest, resolutions: &BTreeMap, staged: Option<&Path>) -> Result> {
let mut out = Vec::new();
+ // An update is decided by version. The same version has the same files, so a file the owner edited (or removed)
+ // is not an update: Repair lists such files and restores them on request.
+ let same_version = meta.core.version.as_deref().is_some_and(|installed| installed == manifest.version);
for f in manifest.files.iter().filter(|f| !f.path.starts_with(STAGED_PREFIX)) {
let target = fsx::ensure_within(root, &fsx::safe_join(root, &f.path)?)?;
+ if same_version {
+ out.push(PlanItem { path: f.path.clone(), action: Action::Skip, reason: Some("same version; Repair restores changed files".into()) });
+ continue;
+ }
let cur = sha_if_exists(&target);
let recorded = meta.original_hashes.get(&f.path);
let (action, reason) = match (f.policy, &cur) {
@@ -1170,6 +1177,11 @@ mod tests {
changed.files.iter_mut().find(|file| file.path == "Scripts/manage.py").unwrap().sha256 = fsx::sha256_bytes(b"new launcher");
assert!(launcher_already_integrated(&w.root, &w.meta, &meta, &changed, &Source::Dir(w.pkg.clone())).is_err());
write(&w.root, "Scripts/manage.py", format!("{integrated}\n# user edit\n").as_bytes());
+ // Same version: the owner's edit is not an update (Repair lists and restores it).
+ let p = preview(&w.root, &meta, &Source::Dir(w.pkg.clone()), &w.key, &BTreeMap::new()).unwrap();
+ assert!(p.items.iter().all(|item| item.action == Action::Skip) && p.conflicts.is_empty());
+ // An older installed build with the same edit does need a decision.
+ meta.core.version = Some("1.0.0".into());
let p = preview(&w.root, &meta, &Source::Dir(w.pkg.clone()), &w.key, &BTreeMap::new()).unwrap();
assert_eq!(p.items.iter().find(|item| item.path == "Scripts/manage.py").unwrap().action, Action::Conflict);
meta.original_hashes.insert("Scripts/manage.py".into(), fsx::sha256_file(&w.root.join("Scripts/manage.py")).unwrap());
diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts
index 16677cd..12f3538 100644
--- a/src/i18n/locales/en.ts
+++ b/src/i18n/locales/en.ts
@@ -32,6 +32,8 @@ const en = {
"repair.result": "Restored files: {files}. Applied database updates: {sql}.",
"repair.backup": "Backup: {id}",
"repair.fileCount": "Files that differ or are missing: {n}",
+ "repair.fileMissing": "missing",
+ "repair.fileChanged": "changed",
"repair.dbCount": "Schema/start-data problems: {columns}. Pending or failed SQL updates: {sql}.",
"repair.limited": "This older package has no full schema contract. Only character-save columns and starting data are checked.",
"repair.unresolved": "Database problems remain. Repair does not replay already applied SQL or invent column changes. Export diagnostics with the listed problems for a corrective server update.",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 319f4b0..0880437 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -34,6 +34,8 @@ const ru: Partial> = {
"repair.result": "Восстановлено файлов: {files}. Применено обновлений БД: {sql}.",
"repair.backup": "Резервная копия: {id}",
"repair.fileCount": "Изменённых или отсутствующих файлов: {n}",
+ "repair.fileMissing": "нет файла",
+ "repair.fileChanged": "изменён",
"repair.dbCount": "Проблем структуры БД/стартовых данных: {columns}. Ожидающих или неудачных SQL: {sql}.",
"repair.limited": "В старом пакете нет полного описания схемы. Проверяются только колонки сохранения персонажей и стартовые данные.",
"repair.unresolved": "Проблемы БД остались. Repair не повторяет уже применённые SQL и не добавляет колонки наугад. Экспортируйте диагностику с этим списком для исправляющего обновления сервера.",
diff --git a/src/screens/RepairCard.tsx b/src/screens/RepairCard.tsx
index 3368c44..9d3f23d 100644
--- a/src/screens/RepairCard.tsx
+++ b/src/screens/RepairCard.tsx
@@ -10,7 +10,7 @@ export function RepairCard({ serverId }: { serverId: string }) {
const job = useRepair(serverId);
const [checking, setChecking] = useState(false);
const [database, setDatabase] = useState(null);
- const [files, setFiles] = useState<{ path: string; kind: string }[] | null>(null);
+ const [files, setFiles] = useState<{ path: string; kind: "missing" | "changed" | string }[] | null>(null);
const [error, setError] = useState(null);
async function check() {
clearRepairResult(serverId);
@@ -36,6 +36,12 @@ export function RepairCard({ serverId }: { serverId: string }) {
{job.result.error &&
From 0a050a40a27269a4cc1d1bf5ccd4472452b35e85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?=
Date: Thu, 8 Oct 2026 07:11:08 +0500
Subject: [PATCH 08/15] Add start-after-update options and clarify the
always-max-skills setting
Co-Authored-By: Claude Sonnet 5.5
---
.../20261008-start-after-update-options.md | 7 +++++
schemas/server.json | 2 +-
src/i18n/locales/de.ts | 2 ++
src/i18n/locales/en.ts | 2 ++
src/i18n/locales/es.ts | 2 ++
src/i18n/locales/fr.ts | 2 ++
src/i18n/locales/ru.ts | 2 ++
src/i18n/locales/zh.ts | 2 ++
src/i18n/schema/de.json | 2 +-
src/i18n/schema/es.json | 2 +-
src/i18n/schema/fr.json | 2 +-
src/i18n/schema/ru.json | 2 +-
src/i18n/schema/zh.json | 2 +-
src/lib/clientJob.ts | 2 ++
src/lib/serverUpdate.ts | 3 ++
src/lib/updatePrefs.ts | 28 +++++++++++++++++++
src/screens/ClientCard.tsx | 8 ++++++
src/screens/SettingsHome.tsx | 6 ++++
18 files changed, 72 insertions(+), 6 deletions(-)
create mode 100644 changelog.d/20261008-start-after-update-options.md
create mode 100644 src/lib/updatePrefs.ts
diff --git a/changelog.d/20261008-start-after-update-options.md b/changelog.d/20261008-start-after-update-options.md
new file mode 100644
index 0000000..10144fa
--- /dev/null
+++ b/changelog.d/20261008-start-after-update-options.md
@@ -0,0 +1,7 @@
+---
+area: manager
+type: added
+audience: admins
+title: Choose whether the server keeps running after an update and whether the game starts after a client update
+---
+Settings has a switch for stopping the server again once its update has finished, and the client card has one for starting the game after the client has been updated.
diff --git a/schemas/server.json b/schemas/server.json
index e0762de..b8bc720 100644
--- a/schemas/server.json
+++ b/schemas/server.json
@@ -770,7 +770,7 @@
"type": "bool",
"category": "gameplay",
"title": "Skills always at maximum for level",
- "description": "Weapon and other skills are always at their maximum for the character's level, no training needed.",
+ "description": "Weapon and other skills are always at their maximum for the character's level, no training needed. The Wildcard realm always turns this on for itself.",
"default": false,
"advanced": false,
"restartRequired": "world",
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index fa81270..831611a 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -827,6 +827,8 @@ const de: Partial> = {
"set.searchAll": "Alle Einstellungen nach Name oder Beschreibung durchsuchen…",
"set.search": "Einstellungen durchsuchen…",
"upd.current": "Du bist auf dem neuesten Stand (Version {v}).",
+ "upd.startAfter": "Server nach dem Update starten (ausschalten, damit er nach dem Update wieder angehalten wird)",
+ "client.startAfter": "Spiel nach dem Client-Update starten",
"bk.folder": "Sicherungsordner",
"bk.folderDefault": "Standard",
"bk.folderNote": "Neue Sicherungen werden hier gespeichert, zum Beispiel auf einem anderen Laufwerk. Frühere Sicherungen bleiben, wo sie sind, und werden weiter aufgelistet. Der Ordner muss außerhalb des Serverordners liegen.",
diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts
index 12f3538..a7aa2d8 100644
--- a/src/i18n/locales/en.ts
+++ b/src/i18n/locales/en.ts
@@ -850,6 +850,8 @@ const en = {
"set.searchAll": "Search all settings by name or description…",
"set.search": "Search settings…",
"upd.current": "You are up to date (version {v}).",
+ "upd.startAfter": "Start the server after updating it (turn off to stop it again once the update is done)",
+ "client.startAfter": "Start the game after the client has been updated",
"bk.folder": "Backup folder",
"bk.folderDefault": "default",
"bk.folderNote": "New backups are saved here, for example on another drive. Backups made earlier stay where they are and are still listed. The folder must be outside the server folder.",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index 656a55f..af95035 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -827,6 +827,8 @@ const es: Partial> = {
"set.searchAll": "Buscar en todos los ajustes por nombre o descripción…",
"set.search": "Buscar ajustes…",
"upd.current": "Estás al día (versión {v}).",
+ "upd.startAfter": "Iniciar el servidor tras actualizarlo (desactívalo para detenerlo de nuevo al terminar)",
+ "client.startAfter": "Iniciar el juego tras actualizar el cliente",
"bk.folder": "Carpeta de copias de seguridad",
"bk.folderDefault": "predeterminada",
"bk.folderNote": "Las copias nuevas se guardan aquí, por ejemplo en otra unidad. Las anteriores se quedan donde están y siguen en la lista. La carpeta debe estar fuera de la carpeta del servidor.",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index 13e5d12..c3a7ab3 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -827,6 +827,8 @@ const fr: Partial> = {
"set.searchAll": "Rechercher dans tous les réglages par nom ou description…",
"set.search": "Rechercher un réglage…",
"upd.current": "Vous êtes à jour (version {v}).",
+ "upd.startAfter": "Démarrer le serveur après la mise à jour (désactivez pour qu’il soit arrêté à nouveau ensuite)",
+ "client.startAfter": "Lancer le jeu après la mise à jour du client",
"bk.folder": "Dossier des sauvegardes",
"bk.folderDefault": "par défaut",
"bk.folderNote": "Les nouvelles sauvegardes sont enregistrées ici, par exemple sur un autre disque. Les précédentes restent où elles sont et figurent toujours dans la liste. Le dossier doit se trouver hors du dossier du serveur.",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 0880437..a38477c 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -848,6 +848,8 @@ const ru: Partial> = {
"set.searchAll": "Поиск по всем настройкам: название или описание…",
"set.search": "Поиск по настройкам…",
"upd.current": "У вас последняя версия ({v}).",
+ "upd.startAfter": "Запускать сервер после обновления (выключите, чтобы он снова остановился после обновления)",
+ "client.startAfter": "Запускать игру после обновления клиента",
"bk.folder": "Папка резервных копий",
"bk.folderDefault": "по умолчанию",
"bk.folderNote": "Новые копии сохраняются сюда, например на другой диск. Прежние копии остаются на месте и по-прежнему в списке. Папка должна быть вне папки сервера.",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index 9dc3888..1b88128 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -827,6 +827,8 @@ const zh = {
"set.searchAll": "按名称或描述搜索全部设置…",
"set.search": "搜索设置…",
"upd.current": "当前已是最新版本 ({v})。",
+ "upd.startAfter": "更新后启动服务器(关闭则更新完成后再次停止)",
+ "client.startAfter": "更新客户端后启动游戏",
"bk.folder": "备份文件夹",
"bk.folderDefault": "默认",
"bk.folderNote": "新备份将保存在这里,例如另一个驱动器上。之前的备份保留在原处,仍会列出。该文件夹必须位于服务器文件夹之外。",
diff --git a/src/i18n/schema/de.json b/src/i18n/schema/de.json
index b32e60e..075054e 100644
--- a/src/i18n/schema/de.json
+++ b/src/i18n/schema/de.json
@@ -525,7 +525,7 @@
},
"AlwaysMaxSkillForLevel": {
"t": "Fertigkeiten immer auf Maximum der Stufe",
- "d": "Waffen- und andere Fertigkeiten sind immer auf dem Maximum der Charakterstufe, Training ist nicht nötig."
+ "d": "Waffen- und andere Fertigkeiten sind immer auf dem Maximum der Charakterstufe, Training ist nicht nötig. Der Wildcard-Realm schaltet dies für sich immer ein."
},
"ActivateWeather": {
"t": "Wetter",
diff --git a/src/i18n/schema/es.json b/src/i18n/schema/es.json
index dd2c1a4..11dab15 100644
--- a/src/i18n/schema/es.json
+++ b/src/i18n/schema/es.json
@@ -525,7 +525,7 @@
},
"AlwaysMaxSkillForLevel": {
"t": "Habilidades siempre al máximo del nivel",
- "d": "Las habilidades de armas y otras están siempre al máximo para el nivel del personaje, sin entrenar."
+ "d": "Las habilidades de armas y otras están siempre al máximo para el nivel del personaje, sin entrenar. El reino Wildcard lo activa siempre para sí mismo."
},
"ActivateWeather": {
"t": "Clima",
diff --git a/src/i18n/schema/fr.json b/src/i18n/schema/fr.json
index 85365d2..b399d7b 100644
--- a/src/i18n/schema/fr.json
+++ b/src/i18n/schema/fr.json
@@ -525,7 +525,7 @@
},
"AlwaysMaxSkillForLevel": {
"t": "Compétences toujours au maximum du niveau",
- "d": "Les compétences d'armes et autres sont toujours au maximum du niveau du personnage, sans entraînement."
+ "d": "Les compétences d'armes et autres sont toujours au maximum du niveau du personnage, sans entraînement. Le royaume Wildcard l’active toujours pour lui-même."
},
"ActivateWeather": {
"t": "Météo",
diff --git a/src/i18n/schema/ru.json b/src/i18n/schema/ru.json
index 15fe228..fbd248c 100644
--- a/src/i18n/schema/ru.json
+++ b/src/i18n/schema/ru.json
@@ -525,7 +525,7 @@
},
"AlwaysMaxSkillForLevel": {
"t": "Навыки всегда на максимуме для уровня",
- "d": "Навыки оружия и другие навыки всегда на максимуме для уровня персонажа, учиться не нужно."
+ "d": "Навыки оружия и другие навыки всегда на максимуме для уровня персонажа, учиться не нужно. Реалм Wildcard всегда включает это для себя."
},
"ActivateWeather": {
"t": "Погода",
diff --git a/src/i18n/schema/zh.json b/src/i18n/schema/zh.json
index 130548b..c38a478 100644
--- a/src/i18n/schema/zh.json
+++ b/src/i18n/schema/zh.json
@@ -525,7 +525,7 @@
},
"AlwaysMaxSkillForLevel": {
"t": "武器技能自动升满",
- "d": "武器及其他熟练度技能自动保持在当前角色等级上限,无需反复练习。"
+ "d": "武器及其他熟练度技能自动保持在当前角色等级上限,无需反复练习。 Wildcard 领域会始终为自己开启此项。"
},
"ActivateWeather": {
"t": "天气系统",
diff --git a/src/lib/clientJob.ts b/src/lib/clientJob.ts
index 9f961f2..3c8393e 100644
--- a/src/lib/clientJob.ts
+++ b/src/lib/clientJob.ts
@@ -1,3 +1,4 @@
+import { startAfterUpdate } from "./updatePrefs";
import { useSyncExternalStore } from "react";
import { listen } from "@tauri-apps/api/event";
import { api, asUiError, type ClientPlan, type ClientStep, type UiError } from "@/lib/api";
@@ -85,6 +86,7 @@ export async function syncClient(id: string, keepModified: boolean): Promise undefined);
void refresh(id);
setTimeout(() => {
if (get(id).phase === "done") set(id, { phase: "idle" });
diff --git a/src/lib/serverUpdate.ts b/src/lib/serverUpdate.ts
index eeab33e..295faf8 100644
--- a/src/lib/serverUpdate.ts
+++ b/src/lib/serverUpdate.ts
@@ -2,6 +2,7 @@ import { useSyncExternalStore } from "react";
import { listen } from "@tauri-apps/api/event";
import { api, asUiError, type UiError, type UpdatePreview, type UpdateTxn } from "@/lib/api";
import { isUpdateCurrent } from "./serverUpdateStatus";
+import { startAfterUpdate } from "./updatePrefs";
/**
* Server update status for the main screen and the navigation: checked when the app starts and every five minutes,
@@ -95,6 +96,8 @@ export async function applyServerUpdate(id: string, opts?: { choices: Record undefined);
return true;
} catch (e) {
const ui = asUiError(e);
diff --git a/src/lib/updatePrefs.ts b/src/lib/updatePrefs.ts
new file mode 100644
index 0000000..0b5950c
--- /dev/null
+++ b/src/lib/updatePrefs.ts
@@ -0,0 +1,28 @@
+import { useState } from "react";
+
+/**
+ * What to do when an update has finished: leave the server running (the default, as the update proves the new build
+ * starts) or stop it again, and whether to open the game after a client update (off by default).
+ */
+export type AfterUpdate = "server" | "client";
+
+const key = (kind: AfterUpdate, id: string) => `coa-start-after-${kind}-update:${id}`;
+const fallback = (kind: AfterUpdate) => kind === "server";
+
+export function startAfterUpdate(kind: AfterUpdate, id: string): boolean {
+ try {
+ const value = localStorage.getItem(key(kind, id));
+ return value === null ? fallback(kind) : value === "1";
+ } catch {
+ return fallback(kind);
+ }
+}
+
+export function setStartAfterUpdate(kind: AfterUpdate, id: string, on: boolean) {
+ try { localStorage.setItem(key(kind, id), on ? "1" : "0"); } catch { /* storage unavailable: the default applies */ }
+}
+
+export function useStartAfterUpdate(kind: AfterUpdate, id: string): [boolean, (on: boolean) => void] {
+ const [on, setOn] = useState(() => startAfterUpdate(kind, id));
+ return [on, (next) => { setStartAfterUpdate(kind, id, next); setOn(next); }];
+}
diff --git a/src/screens/ClientCard.tsx b/src/screens/ClientCard.tsx
index a2c2b7f..4103e6b 100644
--- a/src/screens/ClientCard.tsx
+++ b/src/screens/ClientCard.tsx
@@ -6,6 +6,7 @@ import { ClientDialog, type ClientDialogMode } from "@/screens/ClientDialog";
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import { useHuman, useT } from "@/i18n";
+import { useStartAfterUpdate } from "@/lib/updatePrefs";
export function ClientCard({ serverId, remote = false }: { serverId: string; remote?: boolean }) {
const t = useT();
@@ -16,6 +17,7 @@ export function ClientCard({ serverId, remote = false }: { serverId: string; rem
const [busy, setBusy] = useState(false);
const [status, setStatus] = useState(null);
const [dialog, setDialog] = useState(null);
+ const [playAfter, setPlayAfter] = useStartAfterUpdate("client", serverId);
const refresh = () => {
void api.clientStatus(serverId).then(setStatus).catch(() => setStatus(null));
@@ -86,6 +88,12 @@ export function ClientCard({ serverId, remote = false }: { serverId: string; rem