From ee4352201921075f1d3f36b8792d763ada37b98b 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: Tue, 10 Nov 2026 06:58:16 +0500 Subject: [PATCH 01/29] launcher (Rust): settings, state records, control lock, prepare MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First part of moving Scripts/manage.py into coa-core (plan §17, PY-1). Same formats on disk as manage.py so both can run on one server: .state records, the byte-0 control lock msvcrt.locking takes, configuration.json. prepare renders byte-for-byte what manage.py renders (checked against the real script, COA_MANAGE_PY). State files are flushed to disk before they replace the old ones, and a damaged record counts as no process instead of failing every later start. Co-Authored-By: Claude Opus 5.5 --- crates/coa-core/src/launcher/mod.rs | 18 ++ crates/coa-core/src/launcher/render.rs | 267 +++++++++++++++++++++++ crates/coa-core/src/launcher/settings.rs | 111 ++++++++++ crates/coa-core/src/launcher/state.rs | 175 +++++++++++++++ crates/coa-core/src/lib.rs | 1 + 5 files changed, 572 insertions(+) create mode 100644 crates/coa-core/src/launcher/mod.rs create mode 100644 crates/coa-core/src/launcher/render.rs create mode 100644 crates/coa-core/src/launcher/settings.rs create mode 100644 crates/coa-core/src/launcher/state.rs diff --git a/crates/coa-core/src/launcher/mod.rs b/crates/coa-core/src/launcher/mod.rs new file mode 100644 index 0000000..c4bc0d4 --- /dev/null +++ b/crates/coa-core/src/launcher/mod.rs @@ -0,0 +1,18 @@ +//! The repack launcher in Rust: what `Scripts/manage.py` does, without Python. +//! +//! Formats on disk stay exactly those of `manage.py`, so the two can be used on the same server during the move +//! (an old `.bat` and a new Manager, or the other way round): +//! +//! * `.state/.json` process records `{pid, exe, created}` (see [`crate::process::ProcessIdentity`]); +//! * `.state/control.lock` one start/stop action at a time: byte 0 locked, as `msvcrt.locking` does; +//! * `.state/control-owner.json`, `.state/configuration.json`, `.state/debug-logs.json`; +//! * the rendered configs (`Core/configs/*.conf`, `mysql/my.ini`, `mysql/admin-client.ini`) byte for byte. +//! +//! State files are written with a flush to disk before they replace the old ones (`manage.py` did not, and a +//! power cut could leave a zero-filled record that stopped every later start). + +pub mod render; +pub mod settings; +pub mod state; + +pub use settings::Settings; diff --git a/crates/coa-core/src/launcher/render.rs b/crates/coa-core/src/launcher/render.rs new file mode 100644 index 0000000..ef14740 --- /dev/null +++ b/crates/coa-core/src/launcher/render.rs @@ -0,0 +1,267 @@ +//! `prepare`: the configuration files a repack runs with, rendered from `Settings/*.template` and +//! `Settings/repack.json` (`manage.py prepare()`), byte for byte the same. + +use std::path::{Path, PathBuf}; + +use crate::error::{Error, Result}; +use crate::launcher::{settings::Settings, state}; + +/// Services whose running process blocks moving the folder or changing ports. +const SERVICES: [&str; 5] = ["mysql", "auth", "world", "supervisor", "relay"]; + +/// The root as the servers see it: forward slashes, and the short (8.3) form when the real one has non-Latin +/// letters, which MySQL and the servers do not read reliably from their config files. +pub fn native_root(root: &Path) -> Result { + let mut value = root.to_string_lossy().into_owned(); + if !value.is_ascii() { + if let Some(short) = sys::short_path(root) { + value = short; + } + } + if !value.is_ascii() { + return Err(Error::Invalid( + "Extract the repack to a path with Latin letters, such as C:\\Games\\CoA-Repack.".into(), + )); + } + Ok(value.replace('\\', "/")) +} + +/// Text as Python's text mode reads it: strict UTF-8, Windows and old Mac line ends turned into "\n". +fn read_text(path: &Path) -> Result { + let bytes = std::fs::read(path)?; + let text = String::from_utf8(bytes).map_err(|_| Error::Invalid(format!("{} is not UTF-8 text.", path.display())))?; + Ok(text.replace("\r\n", "\n").replace('\r', "\n")) +} + +/// Text written as Python's text mode writes it on Windows: "\n" becomes "\r\n". +fn windows_text(text: &str) -> Vec { + if cfg!(windows) { + text.replace('\n', "\r\n").into_bytes() + } else { + text.as_bytes().to_vec() + } +} + +fn placeholders(line: &str) -> Vec { + let mut out = Vec::new(); + let bytes = line.as_bytes(); + let mut i = 0; + while i < bytes.len() { + if bytes[i] == b'@' { + let mut j = i + 1; + while j < bytes.len() && (bytes[j].is_ascii_alphabetic() || bytes[j] == b'_') { + j += 1; + } + if j < bytes.len() && j > i + 1 && bytes[j] == b'@' { + out.push(line[i..=j].to_string()); + i = j + 1; + continue; + } + } + i += 1; + } + out +} + +fn credentials(root: &Path) -> Result<(String, String)> { + let v: serde_json::Value = crate::fsx::read_json(&root.join("Settings/database.json"))?; + let good = |k: &str| { + v.get(k) + .and_then(|x| x.as_str()) + .filter(|s| s.len() == 48 && s.bytes().all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b))) + .map(str::to_string) + }; + match (good("rootPassword"), good("appPassword")) { + (Some(r), Some(a)) => Ok((r, a)), + _ => Err(Error::Invalid("Invalid packaged database configuration.".into())), + } +} + +/// Render every file the repack's services read. Refuses while a service runs and the folder or the ports +/// changed since the last render. +pub fn prepare(root: &Path, config: &Settings) -> Result> { + let base = native_root(root)?; + let signature = serde_json::json!({ + "root": root.to_string_lossy(), + "ports": serde_json::Value::Object(config.port_map()), + }); + let previous = state::dir(root).join("configuration.json"); + if previous.exists() { + let recorded: Option = crate::fsx::read_json(&previous).ok(); + if recorded.as_ref() != Some(&signature) && SERVICES.iter().any(|s| state::running(root, s).is_some()) { + return Err(Error::Invalid("Stop this repack before moving its folder or changing its ports.".into())); + } + } + let (root_password, app_password) = credentials(root)?; + for folder in ["Core/configs/modules", "Core/Logs", "BugReport/reports", "BugReport/Logs", "mysql/logs", ".state"] { + std::fs::create_dir_all(root.join(folder))?; + } + let mysql_port = config.mysql_port; + let mut values: Vec<(&str, String)> = vec![ + ("DATA", format!("{base}/Data")), + ("LOGS", format!("{base}/Core/Logs")), + ("ASCENSION_DBC", format!("{base}/Data/dbc/Ascension")), + ("MYSQL_EXE", format!("{base}/mysql/bin/mysql.exe")), + ("AUTH_PORT", config.auth_port.to_string()), + ("WORLD_PORT", config.world_port.to_string()), + ("RA_PORT", config.ra_port.to_string()), + ]; + for (key, db) in [("LoginDatabaseInfo", "acore_auth"), ("WorldDatabaseInfo", "acore_world"), ("CharacterDatabaseInfo", "acore_characters")] { + values.push((key, format!("127.0.0.1;{mysql_port};acore;{app_password};{db}"))); + } + let mut written = Vec::new(); + for (name, target) in [ + ("authserver.conf", "Core/configs/authserver.conf"), + ("worldserver.conf", "Core/configs/worldserver.conf"), + ("mod_ascension_compat.conf", "Core/configs/modules/mod_ascension_compat.conf"), + ] { + let mut text = read_text(&root.join("Settings").join(format!("{name}.template")))?; + for (key, value) in &values { + text = text.replace(&format!("@{key}@"), value); + } + let mut unresolved: Vec = text + .split('\n') + .filter(|l| !l.trim().is_empty() && !l.trim_start().starts_with('#')) + .flat_map(placeholders) + .collect(); + unresolved.sort(); + unresolved.dedup(); + if !unresolved.is_empty() { + return Err(Error::Invalid(format!( + "An unresolved placeholder remains in Settings/{name}.template: {}", + unresolved.join(", ") + ))); + } + // these three keep "\n" (Python wrote them with newline="\n") + std::fs::write(root.join(target), text.as_bytes())?; + written.push(root.join(target)); + } + let files: [(&str, String); 3] = [ + ( + "Core/configs/modules/coa_bugreport.conf", + format!( + "# Managed by the repack launcher. Enabled whenever worldserver starts.\nCoABugReport.Enable = 1\nCoABugReport.SpoolDirectory = \"{base}/BugReport/reports\"\nCoABugReport.CooldownSeconds = 120\n" + ), + ), + ( + "mysql/my.ini", + format!( + "[mysqld]\nbasedir=\"{base}/mysql\"\ndatadir=\"{base}/mysql/data\"\nport={mysql_port}\nbind-address=127.0.0.1\nmysqlx=0\ncharacter-set-server=utf8mb4\ncollation-server=utf8mb4_unicode_ci\nmax_allowed_packet=128M\ninnodb_buffer_pool_size=256M\nskip-log-bin\nlog-error=\"{base}/mysql/logs/mysql-error.log\"\npid-file=\"{base}/mysql/mysql.pid\"\n" + ), + ), + ( + "mysql/admin-client.ini", + format!( + "[client]\nuser=root\npassword={root_password}\nhost=127.0.0.1\nport={mysql_port}\nprotocol=tcp\ndefault-character-set=utf8mb4\n" + ), + ), + ]; + for (rel, text) in files { + std::fs::write(root.join(rel), windows_text(&text))?; + written.push(root.join(rel)); + } + state::write_json(&previous, &signature)?; + Ok(written) +} + +#[cfg(windows)] +mod sys { + use std::os::windows::ffi::OsStrExt; + use std::path::Path; + use windows_sys::Win32::Storage::FileSystem::GetShortPathNameW; + + pub fn short_path(path: &Path) -> Option { + let wide: Vec = path.as_os_str().encode_wide().chain(Some(0)).collect(); + let mut buf = vec![0u16; 32768]; + let n = unsafe { GetShortPathNameW(wide.as_ptr(), buf.as_mut_ptr(), buf.len() as u32) }; + (n > 0 && (n as usize) < buf.len()).then(|| String::from_utf16_lossy(&buf[..n as usize])) + } +} + +#[cfg(not(windows))] +mod sys { + pub fn short_path(_: &std::path::Path) -> Option { + None + } +} + +#[cfg(test)] +mod tests { + use super::*; + + pub(crate) fn fixture(root: &Path) { + let w = |rel: &str, text: &[u8]| { + let p = root.join(rel); + std::fs::create_dir_all(p.parent().unwrap()).unwrap(); + std::fs::write(p, text).unwrap(); + }; + w("Settings/repack.json", br#"{"authPort": 3724, "mysqlPort": 3307, "raPassword": "e0c39beaa5c14128", "raPort": 3443, "raUsername": "COAMANAGER", "worldPort": 8085}"#); + w("Settings/database.json", format!(r#"{{"rootPassword": "{}", "appPassword": "{}"}}"#, "a".repeat(48), "0123456789abcdef".repeat(3)).as_bytes()); + w("Settings/authserver.conf.template", b"[authserver]\r\nLoginDatabaseInfo = \"@LoginDatabaseInfo@\"\r\nRealmServerPort = @AUTH_PORT@\r\nLogsDir = \"@LOGS@\"\r\n# @NOT_A_VALUE@ in a comment is fine\r\n"); + w("Settings/worldserver.conf.template", "[worldserver]\nDataDir = \"@DATA@\"\nWorldServerPort = @WORLD_PORT@\nRa.Port = @RA_PORT@\nWorldDatabaseInfo = \"@WorldDatabaseInfo@\"\nCharacterDatabaseInfo = \"@CharacterDatabaseInfo@\"\nMySQLExecutable = \"@MYSQL_EXE@\"\nMotd = \"Ünïcode stays\"\n".as_bytes()); + w("Settings/mod_ascension_compat.conf.template", b"Ascension.DbcDir = \"@ASCENSION_DBC@\"\rOld.Mac = 1\r"); + } + + #[test] + fn placeholders_left_outside_comments_are_refused() { + let d = tempfile::tempdir().unwrap(); + fixture(d.path()); + std::fs::write(d.path().join("Settings/worldserver.conf.template"), "A = @UNKNOWN@\n").unwrap(); + let cfg = Settings::load(d.path(), 0).unwrap(); + let err = prepare(d.path(), &cfg).unwrap_err().to_string(); + assert!(err.contains("worldserver.conf.template: @UNKNOWN@"), "{err}"); + } + + #[test] + fn a_bad_password_file_is_refused() { + let d = tempfile::tempdir().unwrap(); + fixture(d.path()); + std::fs::write(d.path().join("Settings/database.json"), r#"{"rootPassword":"short","appPassword":"x"}"#).unwrap(); + let cfg = Settings::load(d.path(), 0).unwrap(); + assert!(prepare(d.path(), &cfg).unwrap_err().to_string().contains("Invalid packaged database configuration")); + } + + /// Byte-for-byte the same files as the Python launcher. COA_MANAGE_PY = a manage.py to compare with (taken from + /// coa-server-build); skipped without it. + #[test] + fn renders_exactly_what_manage_py_renders() { + let Ok(manage) = std::env::var("COA_MANAGE_PY") else { return }; + let python = std::env::var("COA_PYTHON").unwrap_or_else(|_| "python".into()); + let rust = tempfile::tempdir().unwrap(); + let py = tempfile::tempdir().unwrap(); + for d in [rust.path(), py.path()] { + fixture(d); + } + std::fs::create_dir_all(py.path().join("Scripts")).unwrap(); + std::fs::copy(&manage, py.path().join("Scripts/manage.py")).unwrap(); + // manage.py imports squid_playerbots lazily; prepare does not need it. + let out = std::process::Command::new(&python) + .args(["-I", "-B"]) + .arg(py.path().join("Scripts/manage.py")) + .arg("prepare") + .output() + .unwrap(); + assert!(out.status.success(), "{}{}", String::from_utf8_lossy(&out.stdout), String::from_utf8_lossy(&out.stderr)); + let cfg = Settings::load(rust.path(), 0).unwrap(); + let written = prepare(rust.path(), &cfg).unwrap(); + let root_text = |p: &Path, base: &Path| { + let n = native_root(base).unwrap(); + String::from_utf8(std::fs::read(p).unwrap()).unwrap().replace(&n, "") + }; + for file in &written { + let rel = file.strip_prefix(rust.path()).unwrap(); + assert_eq!( + root_text(file, rust.path()), + root_text(&py.path().join(rel), py.path()), + "{} differs", + rel.display() + ); + } + let sig = |base: &Path| -> serde_json::Value { + let mut v: serde_json::Value = crate::fsx::read_json(&base.join(".state/configuration.json")).unwrap(); + v["root"] = serde_json::Value::Null; + v + }; + assert_eq!(sig(rust.path()), sig(py.path())); + } +} diff --git a/crates/coa-core/src/launcher/settings.rs b/crates/coa-core/src/launcher/settings.rs new file mode 100644 index 0000000..31dfe44 --- /dev/null +++ b/crates/coa-core/src/launcher/settings.rs @@ -0,0 +1,111 @@ +//! `Settings/repack.json`: ports and the console login of one repack (`manage.py settings()`). + +use std::path::Path; + +use crate::error::{Error, Result}; + +pub const PORT_KEYS: [&str; 4] = ["mysqlPort", "authPort", "worldPort", "raPort"]; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Settings { + pub mysql_port: u16, + pub auth_port: u16, + pub world_port: u16, + pub ra_port: u16, + pub ra_username: String, + pub ra_password: String, + /// The whole document, for keys this code does not know (kept when it is written back). + pub raw: serde_json::Map, +} + +impl Settings { + /// Read `Settings/repack.json`, with every port moved by `offset` (a second world of the same server runs on + /// shifted ports). The same checks as `manage.py`: integer ports in 1025..65535 after the offset, all + /// different. + pub fn load(root: &Path, offset: i32) -> Result { + let bytes = std::fs::read(root.join("Settings/repack.json"))?; + let text = String::from_utf8_lossy(&bytes); + let text = text.strip_prefix('\u{feff}').unwrap_or(&text); + let raw: serde_json::Map = + serde_json::from_str(text).map_err(|e| Error::Invalid(format!("Settings/repack.json: {e}")))?; + let mut ports = [0u16; 4]; + for (i, key) in PORT_KEYS.iter().enumerate() { + // Python's `type(value) is not int` refuses booleans and floats alike. + let value = raw.get(*key).and_then(|v| v.as_i64()).filter(|_| raw[*key].is_i64() || raw[*key].is_u64()); + let shifted = value.map(|v| v + i64::from(offset)); + match shifted { + Some(p) if p > 1024 && p < 65536 => ports[i] = p as u16, + _ => return Err(Error::Invalid("Invalid port in Settings/repack.json".into())), + } + } + let mut unique = ports.to_vec(); + unique.sort_unstable(); + unique.dedup(); + if unique.len() != 4 { + return Err(Error::Invalid("Each service needs a different port.".into())); + } + let text_of = |k: &str| raw.get(k).and_then(|v| v.as_str()).unwrap_or_default().to_string(); + Ok(Settings { + mysql_port: ports[0], + auth_port: ports[1], + world_port: ports[2], + ra_port: ports[3], + ra_username: text_of("raUsername"), + ra_password: text_of("raPassword"), + raw, + }) + } + + /// `{"mysqlPort": .., "authPort": .., "worldPort": .., "raPort": ..}` as `manage.py` records it in + /// `.state/configuration.json` (the keys of repack.json ending in "Port", in the file's order). + pub fn port_map(&self) -> serde_json::Map { + let shifted = [self.mysql_port, self.auth_port, self.world_port, self.ra_port]; + let mut out = serde_json::Map::new(); + for key in self.raw.keys().filter(|k| k.ends_with("Port")) { + let value = PORT_KEYS + .iter() + .position(|p| p == key) + .map(|i| serde_json::Value::from(shifted[i])) + .unwrap_or_else(|| self.raw[key].clone()); + out.insert(key.clone(), value); + } + out + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn write(dir: &Path, text: &str) { + std::fs::create_dir_all(dir.join("Settings")).unwrap(); + std::fs::write(dir.join("Settings/repack.json"), text).unwrap(); + } + + #[test] + fn ports_are_checked_like_the_python_launcher() { + let d = tempfile::tempdir().unwrap(); + write(d.path(), r#"{"mysqlPort":3307,"authPort":3724,"worldPort":8085,"raPort":3443,"raUsername":"U","raPassword":"P"}"#); + let s = Settings::load(d.path(), 0).unwrap(); + assert_eq!((s.mysql_port, s.auth_port, s.world_port, s.ra_port), (3307, 3724, 8085, 3443)); + assert_eq!(s.ra_username, "U"); + let shifted = Settings::load(d.path(), 10).unwrap(); + assert_eq!(shifted.world_port, 8095); + assert_eq!(shifted.port_map()["worldPort"], serde_json::json!(8095)); + + for bad in [ + r#"{"mysqlPort":1024,"authPort":3724,"worldPort":8085,"raPort":3443}"#, + r#"{"mysqlPort":"3307","authPort":3724,"worldPort":8085,"raPort":3443}"#, + r#"{"mysqlPort":3307.0,"authPort":3724,"worldPort":8085,"raPort":3443}"#, + r#"{"mysqlPort":true,"authPort":3724,"worldPort":8085,"raPort":3443}"#, + r#"{"mysqlPort":3307,"authPort":3307,"worldPort":8085,"raPort":3443}"#, + r#"{"authPort":3724,"worldPort":8085,"raPort":3443}"#, + ] { + write(d.path(), bad); + assert!(Settings::load(d.path(), 0).is_err(), "{bad}"); + } + write(d.path(), "\u{feff}{\"mysqlPort\":3307,\"authPort\":3724,\"worldPort\":8085,\"raPort\":65535}"); + assert!(Settings::load(d.path(), 1).is_err(), "65536 after the offset"); + assert!(Settings::load(d.path(), 0).is_ok(), "a byte order mark is accepted"); + } +} diff --git a/crates/coa-core/src/launcher/state.rs b/crates/coa-core/src/launcher/state.rs new file mode 100644 index 0000000..4ff3836 --- /dev/null +++ b/crates/coa-core/src/launcher/state.rs @@ -0,0 +1,175 @@ +//! `.state/`: which processes belong to this repack, and the one-action-at-a-time lock. + +use std::fs::{File, OpenOptions}; +use std::io::{Seek, SeekFrom, Write}; +use std::path::{Path, PathBuf}; +use std::time::{Duration, Instant}; + +use crate::error::{Error, Result}; +use crate::fsx; +use crate::process::{self, ProcessIdentity}; + +pub fn dir(root: &Path) -> PathBuf { + root.join(".state") +} + +/// Written like `manage.py atomic_json`: two-space JSON and a newline, now flushed to disk before it replaces +/// the old file. +pub fn write_json(path: &Path, value: &impl serde::Serialize) -> Result<()> { + let mut text = serde_json::to_string_pretty(value)?; + text.push('\n'); + fsx::atomic_write(path, text.as_bytes()) +} + +/// The recorded process of `name` when it is still that process (same executable and start time). A missing, +/// empty or damaged record is no process: `manage.py` failed on those, and every later start with it. +pub fn running(root: &Path, name: &str) -> Option { + let record = process::read_state_record(root, name)?; + process::is_alive(&record).then_some(record) +} + +/// Record the process `pid` as `name`. Fails when it has already exited. +pub fn record(root: &Path, name: &str, pid: u32) -> Result { + let identity = process::identity(pid) + .ok_or_else(|| Error::Invalid(format!("{name} exited during startup; check its log.")))?; + write_json(&dir(root).join(format!("{name}.json")), &identity)?; + Ok(identity) +} + +/// Held while one start/stop action runs. Byte 0 of `.state/control.lock` is locked, exactly the region +/// `msvcrt.locking(fd, LK_NBLCK, 1)` locks in `manage.py`, so a Python launcher and this one exclude each other. +pub struct ControlLock { + file: File, + owner: PathBuf, +} + +impl ControlLock { + /// Wait up to `wait` for the lock. `action` is recorded for whoever waits next ("start-all", ...). + pub fn acquire(root: &Path, action: &str, wait: Duration, progress: &dyn Fn(&str)) -> Result { + let state = dir(root); + std::fs::create_dir_all(&state)?; + let mut file = OpenOptions::new().read(true).append(true).create(true).open(state.join("control.lock"))?; + if file.seek(SeekFrom::End(0))? == 0 { + file.write_all(b"0")?; + file.flush()?; + } + let owner = state.join("control-owner.json"); + let deadline = Instant::now() + wait; + let mut announced = false; + loop { + if sys::try_lock(&file)? { + break; + } + let detail = match fsx::read_json::(&owner) { + Ok(v) if v.get("pid").is_some() && v.get("action").is_some() => { + format!(" PID {}, action {}.", v["pid"], v["action"].as_str().unwrap_or("")) + } + _ => " Owner information is unavailable.".into(), + }; + if Instant::now() >= deadline { + return Err(Error::Invalid(format!("Another start/stop action is in progress.{detail}"))); + } + if !announced { + progress(&format!("Waiting for the current server action.{detail}")); + announced = true; + } + std::thread::sleep(Duration::from_millis(250)); + } + let started = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map(|d| d.as_secs_f64()) + .unwrap_or(0.0); + let lock = ControlLock { file, owner }; + write_json( + &lock.owner, + &serde_json::json!({ "pid": std::process::id(), "action": action, "started": started }), + )?; + Ok(lock) + } +} + +impl Drop for ControlLock { + fn drop(&mut self) { + let _ = std::fs::remove_file(&self.owner); + sys::unlock(&self.file); + } +} + +#[cfg(windows)] +mod sys { + use std::fs::File; + use std::os::windows::io::AsRawHandle; + use windows_sys::Win32::Storage::FileSystem::{LockFile, UnlockFile}; + + /// `LockFile` on byte 0, length 1: the call `msvcrt.locking` makes. Non-blocking. + pub fn try_lock(file: &File) -> std::io::Result { + let ok = unsafe { LockFile(file.as_raw_handle() as _, 0, 0, 1, 0) }; + if ok != 0 { + return Ok(true); + } + let err = std::io::Error::last_os_error(); + // ERROR_LOCK_VIOLATION (33): someone else holds it. + if err.raw_os_error() == Some(33) { + Ok(false) + } else { + Err(err) + } + } + + pub fn unlock(file: &File) { + unsafe { + UnlockFile(file.as_raw_handle() as _, 0, 0, 1, 0); + } + } +} + +#[cfg(not(windows))] +mod sys { + use std::fs::File; + pub fn try_lock(_: &File) -> std::io::Result { + Ok(true) + } + pub fn unlock(_: &File) {} +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_damaged_record_is_no_process() { + let d = tempfile::tempdir().unwrap(); + std::fs::create_dir_all(dir(d.path())).unwrap(); + std::fs::write(dir(d.path()).join("mysql.json"), [0u8; 116]).unwrap(); + assert!(running(d.path(), "mysql").is_none()); + std::fs::write(dir(d.path()).join("auth.json"), b"").unwrap(); + assert!(running(d.path(), "auth").is_none()); + } + + #[test] + fn this_process_is_recorded_and_found_running() { + let d = tempfile::tempdir().unwrap(); + let me = record(d.path(), "probe", std::process::id()).unwrap(); + assert_eq!(running(d.path(), "probe"), Some(me)); + let text = std::fs::read_to_string(dir(d.path()).join("probe.json")).unwrap(); + assert!(text.starts_with("{\n \"pid\": ") && text.ends_with("}\n"), "{text}"); + } + + #[test] + fn one_action_at_a_time() { + let d = tempfile::tempdir().unwrap(); + let first = ControlLock::acquire(d.path(), "start-all", Duration::from_secs(1), &|_| {}).unwrap(); + let owner: serde_json::Value = fsx::read_json(&dir(d.path()).join("control-owner.json")).unwrap(); + assert_eq!(owner["action"], "start-all"); + let said = std::sync::Mutex::new(Vec::new()); + let second = ControlLock::acquire(d.path(), "stop-all", Duration::from_millis(600), &|m| said.lock().unwrap().push(m.to_string())); + if cfg!(windows) { + let err = second.err().expect("the second action waits and gives up").to_string(); + assert!(err.contains("Another start/stop action is in progress") && err.contains("start-all"), "{err}"); + assert_eq!(said.lock().unwrap().len(), 1); + } + drop(first); + assert!(!dir(d.path()).join("control-owner.json").exists()); + ControlLock::acquire(d.path(), "stop-all", Duration::from_secs(1), &|_| {}).unwrap(); + } +} diff --git a/crates/coa-core/src/lib.rs b/crates/coa-core/src/lib.rs index 8918c16..67387b1 100644 --- a/crates/coa-core/src/lib.rs +++ b/crates/coa-core/src/lib.rs @@ -36,6 +36,7 @@ pub mod glue_config; pub mod health; pub mod install; pub mod layout; +pub mod launcher; pub mod logging; pub mod server_logging; pub mod manifest; From ee36692db73ec2a693648256d6fff7486abc2f0c 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: Tue, 10 Nov 2026 07:29:55 +0500 Subject: [PATCH 02/29] launcher (Rust): services, world supervisor, SQUID provisioning, coa-launcher.exe - services: exclusive-bind port check, readiness by listener row or the server side of a loopback connection, MySQL client, start MySQL/auth, stop-all (world through its console, database last), status. - world: start-world through a supervisor process (coa-launcher watch-world) that keeps the bug-report relay (still BugReport/relay.py via the repack's Python) alive; detailed logging. - squid: squid_playerbots.py in Rust with the same journals (coa_squid_migrations, coa_squid_pending, coa_bots_installed). - coa-launcher.exe: the manage.py commands and error texts (the Manager reads them). - Services no longer inherit the launcher's stdin/stdout/stderr: a server holding the output pipe kept whoever read the launcher's output waiting. E2E (examples/launcher_e2e, disposable stable repack on free ports): coa-launcher start-all -> manage.py sees and stops it; manage.py start-all -> coa-launcher sees and stops it; a second Rust-only cycle leaves nothing running. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 10 + Cargo.toml | 2 +- crates/coa-core/Cargo.toml | 3 +- crates/coa-core/examples/launcher_e2e.rs | 114 +++++ crates/coa-core/src/launcher/mod.rs | 3 + crates/coa-core/src/launcher/services.rs | 523 +++++++++++++++++++++++ crates/coa-core/src/launcher/squid.rs | 398 +++++++++++++++++ crates/coa-core/src/launcher/world.rs | 243 +++++++++++ crates/coa-core/src/ra.rs | 9 + crates/coa-launcher/Cargo.toml | 15 + crates/coa-launcher/src/main.rs | 238 +++++++++++ 11 files changed, 1556 insertions(+), 2 deletions(-) create mode 100644 crates/coa-core/examples/launcher_e2e.rs create mode 100644 crates/coa-core/src/launcher/services.rs create mode 100644 crates/coa-core/src/launcher/squid.rs create mode 100644 crates/coa-core/src/launcher/world.rs create mode 100644 crates/coa-launcher/Cargo.toml create mode 100644 crates/coa-launcher/src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 9d82548..42742ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -606,6 +606,7 @@ dependencies = [ "serde_json", "sha1", "sha2", + "socket2", "tar", "tempfile", "thiserror 2.0.21", @@ -618,6 +619,15 @@ dependencies = [ "zstd", ] +[[package]] +name = "coa-launcher" +version = "0.9.10" +dependencies = [ + "coa-core", + "serde_json", + "windows-sys 0.60.2", +] + [[package]] name = "coa-registry-proto" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index be96eef..d7446ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["crates/coa-core", "crates/coa-release", "crates/coa-registry-proto", "crates/coa-control-proto", "src-tauri"] +members = ["crates/coa-core", "crates/coa-launcher", "crates/coa-release", "crates/coa-registry-proto", "crates/coa-control-proto", "src-tauri"] exclude = ["services/coa-registry", "services/coa-registry-e2e", "services/coa-coordinator", "services/coa-relay"] [workspace.package] diff --git a/crates/coa-core/Cargo.toml b/crates/coa-core/Cargo.toml index 6f12f60..efae212 100644 --- a/crates/coa-core/Cargo.toml +++ b/crates/coa-core/Cargo.toml @@ -5,6 +5,7 @@ edition.workspace = true license.workspace = true [dependencies] +socket2 = "0.6" serde = { version = "1", features = ["derive"] } serde_json = "1" sha2 = "0.10" @@ -37,7 +38,7 @@ rand_core = { version = "0.6", features = ["getrandom"] } ed25519-dalek = { version = "2", features = ["rand_core"] } [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.60", features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Threading", "Win32_System_SystemInformation", "Win32_System_Diagnostics_ToolHelp", "Win32_NetworkManagement_IpHelper", "Win32_Networking_WinSock", "Win32_Security_Cryptography", "Win32_UI_Shell", "Win32_System_Registry", "Win32_UI_WindowsAndMessaging"] } +windows-sys = { version = "0.60", features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Threading", "Win32_System_Console", "Win32_System_SystemInformation", "Win32_System_Diagnostics_ToolHelp", "Win32_NetworkManagement_IpHelper", "Win32_Networking_WinSock", "Win32_Security_Cryptography", "Win32_UI_Shell", "Win32_System_Registry", "Win32_UI_WindowsAndMessaging"] } [features] testkit = [] diff --git a/crates/coa-core/examples/launcher_e2e.rs b/crates/coa-core/examples/launcher_e2e.rs new file mode 100644 index 0000000..81692f9 --- /dev/null +++ b/crates/coa-core/examples/launcher_e2e.rs @@ -0,0 +1,114 @@ +//! The Rust launcher on a DISPOSABLE repack, side by side with Scripts/manage.py: +//! +//! 1. install the stable server into a new folder on unused ports; +//! 2. coa-launcher start-all, then manage.py status-json must see every service; +//! 3. manage.py stop-all stops what coa-launcher started; +//! 4. manage.py start-all, coa-launcher status-json sees it, coa-launcher stop-all stops it; +//! 5. both stop-alls leave nothing of the repack running. +//! +//! usage: launcher_e2e +use std::path::Path; +use std::process::Command; + +use coa_core::install::{install_base, Params}; +use coa_core::registry::Registry; + +fn free_port() -> u16 { + std::net::TcpListener::bind("127.0.0.1:0").unwrap().local_addr().unwrap().port() +} + +fn run(exe: &Path, args: &[&str]) -> (bool, String) { + let out = Command::new(exe).args(args).output().unwrap(); + let text = String::from_utf8_lossy(&out.stdout).into_owned() + &String::from_utf8_lossy(&out.stderr); + (out.status.success(), text) +} + +fn launcher(root: &Path, exe: &Path, action: &str) -> (bool, String) { + let r = root.to_string_lossy().into_owned(); + let t = std::time::Instant::now(); + let out = run(exe, &["--root", &r, action]); + println!("[coa-launcher {action}] ok={} in {:?}\n{}", out.0, t.elapsed(), indent(&out.1)); + out +} + +fn manage(root: &Path, action: &str) -> (bool, String) { + let python = root.join("Runtime/python/python.exe"); + let script = root.join("Scripts/manage.py").to_string_lossy().into_owned(); + let t = std::time::Instant::now(); + let out = run(&python, &["-B", &script, action]); + println!("[manage.py {action}] ok={} in {:?}\n{}", out.0, t.elapsed(), indent(&out.1)); + out +} + +fn indent(s: &str) -> String { + s.lines().map(|l| format!(" {l}")).collect::>().join("\n") +} + +fn status(out: &str) -> serde_json::Value { + let line = out.lines().rev().find(|l| l.trim_start().starts_with('{')).expect("a JSON status line"); + serde_json::from_str(line).unwrap() +} + +fn all(v: &serde_json::Value, running: bool) -> bool { + ["mysql", "auth", "world", "relay"].iter().all(|k| v[*k] == running) +} + +fn main() { + let a: Vec = std::env::args().skip(1).collect(); + let root = Path::new(&a[0]); + let exe = Path::new(&a[1]); + assert!(a[0].ends_with("-fixture"), "a folder ending in -fixture is required"); + if root.join("Core/worldserver.exe").is_file() { + println!("reusing the installed fixture"); + } else { + install(root); + } + test(root, exe); +} + +fn install(root: &Path) { + assert!(!root.exists(), "a new folder is required"); + let reg_dir = std::env::temp_dir().join("coa-launcher-e2e-registry"); + let _ = std::fs::remove_dir_all(®_dir); + let reg = Registry::at(reg_dir.join("installs.json")); + // what the Manager installs: the stable release's installation image + let image = coa_core::install::Source::Installation(Box::new(coa_core::channels::resolve("stable").expect("stable channel"))); + let installed = install_base( + &Params { source: image, dest: root.into(), trusted_key: coa_core::signing::EMBEDDED_PUBLIC_KEY, registry: ®, cancel: Default::default() }, + &|s| eprintln!(" {:>3}% {}", s.percent, s.step), + ) + .expect("install"); + println!("installed {}", installed.version); + let repack = root.join("Settings/repack.json"); + let mut cfg: serde_json::Value = serde_json::from_slice(&std::fs::read(&repack).unwrap()).unwrap(); + for k in ["mysqlPort", "authPort", "worldPort", "raPort"] { + cfg[k] = free_port().into(); + } + std::fs::write(&repack, serde_json::to_vec_pretty(&cfg).unwrap()).unwrap(); +} + +fn test(root: &Path, exe: &Path) { + // 2. Rust starts, Python sees it + assert!(launcher(root, exe, "start-all").0, "coa-launcher start-all"); + let seen = status(&manage(root, "status-json").1); + assert!(all(&seen, true), "manage.py must see the services coa-launcher started: {seen}"); + // 3. Python stops what Rust started + assert!(manage(root, "stop-all").0, "manage.py stop-all"); + assert!(all(&status(&launcher(root, exe, "status-json").1), false)); + + // 4. Python starts, Rust sees and stops it + assert!(manage(root, "start-all").0, "manage.py start-all"); + let seen = status(&launcher(root, exe, "status-json").1); + assert!(all(&seen, true), "coa-launcher must see the services manage.py started: {seen}"); + assert!(launcher(root, exe, "stop-all").0, "coa-launcher stop-all"); + assert!(all(&status(&manage(root, "status-json").1), false)); + + // 5. Rust alone, a second time (start on a server it stopped) + assert!(launcher(root, exe, "start-all").0); + assert!(launcher(root, exe, "stop-all").0); + let left = coa_core::process::find_by_exe(&root.join("mysql/bin/mysqld.exe")).len() + + coa_core::process::find_by_exe(&root.join("Core/worldserver.exe")).len() + + coa_core::process::find_by_exe(&root.join("Core/authserver.exe")).len(); + assert_eq!(left, 0, "nothing of the repack may be left running"); + println!("LAUNCHER E2E PASS"); +} diff --git a/crates/coa-core/src/launcher/mod.rs b/crates/coa-core/src/launcher/mod.rs index c4bc0d4..b1d79d1 100644 --- a/crates/coa-core/src/launcher/mod.rs +++ b/crates/coa-core/src/launcher/mod.rs @@ -12,7 +12,10 @@ //! power cut could leave a zero-filled record that stopped every later start). pub mod render; +pub mod services; pub mod settings; +pub mod squid; pub mod state; +pub mod world; pub use settings::Settings; diff --git a/crates/coa-core/src/launcher/services.rs b/crates/coa-core/src/launcher/services.rs new file mode 100644 index 0000000..82160a1 --- /dev/null +++ b/crates/coa-core/src/launcher/services.rs @@ -0,0 +1,523 @@ +//! Starting, checking and stopping the services of one repack: MySQL, authserver, worldserver +//! (`manage.py start_mysql`, `start_auth`, `stop_all` and their helpers), with the same rules. + +use std::fs::OpenOptions; +use std::net::{SocketAddr, TcpStream}; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; +use std::time::{Duration, Instant}; + +use crate::error::{Error, Result}; +use crate::launcher::{settings::Settings, state}; +use crate::process::ProcessIdentity; + +pub type Progress<'a> = &'a dyn Fn(&str); + +const CREATE_NO_WINDOW: u32 = 0x0800_0000; +const CREATE_NEW_PROCESS_GROUP: u32 = 0x0000_0200; + +fn hidden(cmd: &mut Command) -> &mut Command { + #[cfg(windows)] + { + use std::os::windows::process::CommandExt; + cmd.creation_flags(CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP); + } + cmd +} + +/// Keep this process's own stdin/stdout/stderr out of the services it starts. Windows children inherit every +/// inheritable handle, and a server holding the launcher's output pipe keeps whoever reads that output (the +/// Manager, a test) waiting until the server exits. Python's subprocess passes only the handles it is given; this +/// gives the same result. +pub(crate) fn keep_std_handles_private() { + #[cfg(windows)] + unsafe { + use windows_sys::Win32::Foundation::{SetHandleInformation, HANDLE_FLAG_INHERIT}; + use windows_sys::Win32::System::Console::{GetStdHandle, STD_ERROR_HANDLE, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE}; + for which in [STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE] { + let h = GetStdHandle(which); + if !h.is_null() && h as isize != -1 { + SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0); + } + } + } +} + +/// Start `exe` with its output appended to `log`, and record it as `name`. +pub fn spawn(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { + keep_std_handles_private(); + if let Some(dir) = log.parent() { + std::fs::create_dir_all(dir)?; + } + let out = OpenOptions::new().create(true).append(true).open(log)?; + let err = out.try_clone()?; + let child = hidden(Command::new(exe).args(args).current_dir(cwd)) + .stdin(Stdio::null()) + .stdout(out) + .stderr(err) + .spawn()?; + state::record(root, name, child.id()) +} + +// --------------------------------------------------------------------------------------------------------------- +// Ports +// --------------------------------------------------------------------------------------------------------------- + +/// Wait (up to 30 s) until `port` can be bound by a new server. A port with a listening owner is refused at +/// once; a port Windows still holds for a stopped process (a PID-zero row) is waited for. The test bind is +/// exclusive (`SO_EXCLUSIVEADDRUSE`), never a shared one. +pub fn ensure_free(port: u16, progress: Progress) -> Result<()> { + let deadline = Instant::now() + Duration::from_secs(30); + let mut announced = false; + loop { + let mut owners: Vec = sys::tcp_rows_v4() + .into_iter() + .filter(|r| r.state == sys::LISTEN && r.local_port == port) + .map(|r| r.pid) + .collect(); + owners.sort_unstable(); + owners.dedup(); + if owners.iter().any(|p| *p != 0) { + let list: Vec = owners.iter().map(u32::to_string).collect(); + return Err(Error::Invalid(format!( + "Port {port} is already used (PID {}). Stop the other server or change Settings/repack.json.", + list.join(", ") + ))); + } + match sys::exclusive_bind(port) { + Ok(()) => return Ok(()), + Err(code) if code == 10013 || code == 10048 => { + if Instant::now() >= deadline { + return Err(Error::Invalid(format!( + "Port {port} remains unavailable after 30 seconds (Windows bind error {code}). No process was stopped. Retry after the previous database shutdown has finished, or check the Windows port reservation." + ))); + } + if !announced { + progress(&format!("Waiting for Windows to release port {port}...")); + announced = true; + } + std::thread::sleep(Duration::from_millis(250)); + } + Err(code) => return Err(Error::Invalid(format!("Port {port} cannot be checked (Windows error {code})."))), + } + } +} + +/// Is the recorded process of `name` serving `port`? Its listener row is the evidence; when a system does not +/// show the owner of a listener, the server side of a fresh loopback connection is (never for MySQL, whose +/// listener has always been visible and which should not get stray connections). +pub fn ready(root: &Path, name: &str, port: u16) -> bool { + let Some(record) = state::running(root, name) else { return false }; + let listening = sys::tcp_rows_v4().iter().any(|r| r.state == sys::LISTEN && r.local_port == port && r.pid == record.pid); + if listening { + return crate::process::is_alive(&record); + } + if name == "mysql" { + return false; + } + accepted_by(port, record.pid) && crate::process::is_alive(&record) +} + +/// Connect to 127.0.0.1:`port` and check that exactly one established server-side row, owned by `pid`, answers +/// that connection. +fn accepted_by(port: u16, pid: u32) -> bool { + let addr: SocketAddr = ([127, 0, 0, 1], port).into(); + let Ok(client) = TcpStream::connect_timeout(&addr, Duration::from_millis(500)) else { return false }; + let Ok(mine) = client.local_addr().map(|a| a.port()) else { return false }; + let me = std::process::id(); + let rows: Vec = sys::tcp_rows_v4() + .into_iter() + .chain(sys::tcp_rows_v6()) + .filter(|r| r.remote_port == mine && r.remote_loopback && !(r.local_port == mine && r.pid == me)) + .collect(); + rows.len() == 1 && rows[0].state == sys::ESTABLISHED && rows[0].pid == pid +} + +pub fn wait_ready(root: &Path, name: &str, port: u16, seconds: u64) -> Result<()> { + let until = Instant::now() + Duration::from_secs(seconds); + while Instant::now() < until { + if ready(root, name, port) { + return Ok(()); + } + if state::running(root, name).is_none() { + return Err(Error::Invalid(format!("{name} stopped during startup. Check its log."))); + } + std::thread::sleep(Duration::from_millis(500)); + } + Err(Error::Invalid(format!( + "{name} is still starting: its expected TCP listener on port {port} was not found; check its log." + ))) +} + +// --------------------------------------------------------------------------------------------------------------- +// MySQL client +// --------------------------------------------------------------------------------------------------------------- + +/// Run SQL (or a `mysqladmin` command) with the repack's own client and administrator login. +pub fn mysql(root: &Path, sql: Option<&str>, admin: Option<&str>) -> Result { + let exe = root.join(if admin.is_some() { "mysql/bin/mysqladmin.exe" } else { "mysql/bin/mysql.exe" }); + let defaults = format!("--defaults-file={}", root.join("mysql/admin-client.ini").display()); + let mut cmd = Command::new(exe); + hidden(&mut cmd).arg(defaults); + match admin { + Some(a) => cmd.arg(a), + None => cmd.args(["--batch", "--skip-column-names"]), + }; + let payload = sql.map(|s| s.as_bytes().to_vec()); + let timeout = if payload.as_ref().is_some_and(|p| p.len() > 1024 * 1024) { 900 } else { 90 }; + cmd.stdin(if payload.is_some() { Stdio::piped() } else { Stdio::null() }).stdout(Stdio::piped()).stderr(Stdio::piped()); + let mut child = cmd.spawn()?; + if let (Some(data), Some(mut stdin)) = (payload, child.stdin.take()) { + std::thread::spawn(move || { + use std::io::Write; + let _ = stdin.write_all(&data); + }); + } + let started = Instant::now(); + let failed = || Error::Invalid("The repack database command failed; check mysql/logs/mysql-error.log.".into()); + loop { + if let Some(status) = child.try_wait()? { + let out = child.wait_with_output()?; + if !status.success() { + return Err(failed()); + } + return Ok(String::from_utf8_lossy(&out.stdout).trim().to_string()); + } + if started.elapsed() > Duration::from_secs(timeout) { + let _ = child.kill(); + let _ = child.wait(); + return Err(failed()); + } + std::thread::sleep(Duration::from_millis(50)); + } +} + +// --------------------------------------------------------------------------------------------------------------- +// Start and stop +// --------------------------------------------------------------------------------------------------------------- + +pub fn start_mysql(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { + if state::running(root, "mysql").is_some() { + wait_ready(root, "mysql", cfg.mysql_port, 300)?; + mysql(root, None, Some("ping"))?; + progress("MySQL is already running."); + return Ok(()); + } + ensure_free(cfg.mysql_port, progress)?; + if !root.join("mysql/data/mysql").is_dir() { + return Err(Error::Invalid("The packaged database is missing. Extract the complete repack.".into())); + } + progress("Starting MySQL..."); + let ini = format!("--defaults-file={}", root.join("mysql/my.ini").display()); + spawn(root, "mysql", &root.join("mysql/bin/mysqld.exe"), &[&ini, "--no-monitor"], &root.join("mysql"), &root.join("mysql/logs/startup.log"))?; + wait_ready(root, "mysql", cfg.mysql_port, 300)?; + mysql(root, None, Some("ping"))?; + mysql( + root, + Some(&format!( + "UPDATE acore_auth.realmlist SET name='AzerothCore',address='127.0.0.1',localAddress='127.0.0.1',port={} WHERE id=1;", + cfg.world_port + )), + None, + )?; + Ok(()) +} + +pub fn start_auth(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { + start_mysql(root, cfg, progress)?; + if state::running(root, "auth").is_some() { + wait_ready(root, "auth", cfg.auth_port, 60)?; + progress("Authserver is already running."); + return Ok(()); + } + ensure_free(cfg.auth_port, progress)?; + // An interrupted world startup can leave flag 3, which authserver excludes. + mysql(root, Some("UPDATE acore_auth.realmlist SET flag=0 WHERE id=1;"), None)?; + progress("Starting authserver..."); + spawn(root, "auth", &root.join("Core/authserver.exe"), &["-c", "configs/authserver.conf"], &root.join("Core"), &root.join("Core/Logs/auth-console.log"))?; + wait_ready(root, "auth", cfg.auth_port, 60) +} + +/// Stop the recorded process, only if it is still that process. +pub fn terminate(record: &ProcessIdentity) -> Result<()> { + if !crate::process::is_alive(record) { + return Ok(()); + } + sys::terminate(record) +} + +pub fn wait_stopped(record: &ProcessIdentity, seconds: u64) -> bool { + let until = Instant::now() + Duration::from_secs(seconds); + while crate::process::is_alive(record) && Instant::now() < until { + std::thread::sleep(Duration::from_millis(250)); + } + !crate::process::is_alive(record) +} + +/// Stop everything of this repack, world first (gracefully through its console), its database last. +pub fn stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { + if let Some(world) = state::running(root, "world") { + let asked = ready(root, "world", cfg.ra_port) + .then(|| crate::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password)) + .and_then(|r| r.ok()) + .map(|ra| ra.send_without_answer("server shutdown 1s 0")); + match asked { + Some(Ok(())) => progress("Graceful world shutdown requested."), + _ => { + progress("World console unavailable; stopping this repack's recorded world process."); + terminate(&world)?; + } + } + if !wait_stopped(&world, 90) { + return Err(Error::Invalid("Worldserver is still stopping; its database has been left running.".into())); + } + } + if let Some(supervisor) = state::running(root, "supervisor") { + if !wait_stopped(&supervisor, 45) { + return Err(Error::Invalid("The report relay is still finishing a request. Try Stop All again shortly.".into())); + } + } + if let Some(relay) = state::running(root, "relay") { + std::fs::write(state::dir(root).join("stop-relay"), b"")?; + if !wait_stopped(&relay, 40) { + return Err(Error::Invalid("The report relay did not finish; it was left running for recovery.".into())); + } + } + if let Some(auth) = state::running(root, "auth") { + terminate(&auth)?; + if !wait_stopped(&auth, 10) { + return Err(Error::Invalid("Authserver did not stop.".into())); + } + } + if let Some(database) = state::running(root, "mysql") { + let shutdown = mysql(root, None, Some("shutdown")); + if !wait_stopped(&database, 60) { + shutdown?; + return Err(Error::Invalid("MySQL is still stopping; wait before copying the repack.".into())); + } + } + progress("All services from this repack are stopped. It is safe to move or copy this folder."); + Ok(()) +} + +/// Which services run (`manage.py status-json`). +pub fn status(root: &Path) -> serde_json::Value { + let mut out = serde_json::Map::new(); + for name in ["mysql", "auth", "world", "relay"] { + out.insert(name.into(), state::running(root, name).is_some().into()); + } + let debug: bool = crate::fsx::read_json::(&state::dir(root).join("debug-logs.json")) + .ok() + .and_then(|v| v.get("enabled").and_then(|e| e.as_bool())) + .unwrap_or(false); + out.insert("debugLogs".into(), debug.into()); + serde_json::Value::Object(out) +} + +pub fn log_path(root: &Path, name: &str) -> PathBuf { + match name { + "mysql" => root.join("mysql/logs/startup.log"), + "auth" => root.join("Core/Logs/auth-console.log"), + "world" => root.join("Core/Logs/world-console.log"), + "supervisor" => root.join("Core/Logs/supervisor.log"), + _ => root.join("BugReport/Logs/relay.log"), + } +} + +// --------------------------------------------------------------------------------------------------------------- +// Windows +// --------------------------------------------------------------------------------------------------------------- + +#[cfg(windows)] +mod sys { + use crate::error::{Error, Result}; + use crate::process::ProcessIdentity; + use windows_sys::Win32::Foundation::CloseHandle; + use windows_sys::Win32::NetworkManagement::IpHelper::GetExtendedTcpTable; + use windows_sys::Win32::Networking::WinSock::{setsockopt, SOL_SOCKET, SO_EXCLUSIVEADDRUSE}; + use windows_sys::Win32::System::Threading::{OpenProcess, TerminateProcess, PROCESS_QUERY_LIMITED_INFORMATION, PROCESS_TERMINATE}; + + pub const LISTEN: u32 = 2; + pub const ESTABLISHED: u32 = 5; + + pub struct TcpRow { + pub state: u32, + pub local_port: u16, + pub remote_port: u16, + pub remote_loopback: bool, + pub pid: u32, + } + + fn table(af: u32) -> Vec { + const TCP_TABLE_OWNER_PID_ALL: i32 = 5; + let mut size = 0u32; + let mut buf: Vec = Vec::new(); + for _ in 0..4 { + let code = unsafe { + GetExtendedTcpTable( + if buf.is_empty() { std::ptr::null_mut() } else { buf.as_mut_ptr().cast() }, + &mut size, + 0, + af, + TCP_TABLE_OWNER_PID_ALL, + 0, + ) + }; + match code { + 0 if !buf.is_empty() => return buf, + 0 | 122 => buf = vec![0u8; size as usize + 4096], + _ => return Vec::new(), + } + } + Vec::new() + } + + fn u32_at(b: &[u8], o: usize) -> u32 { + u32::from_le_bytes(b[o..o + 4].try_into().unwrap()) + } + + pub fn tcp_rows_v4() -> Vec { + let b = table(2); + let mut out = Vec::new(); + if b.len() < 4 { + return out; + } + for i in 0..u32_at(&b, 0) as usize { + let o = 4 + 24 * i; + if o + 24 > b.len() { + break; + } + let remote = u32_at(&b, o + 12).to_le_bytes(); + out.push(TcpRow { + state: u32_at(&b, o), + local_port: u16::from_be((u32_at(&b, o + 8) & 0xFFFF) as u16), + remote_port: u16::from_be((u32_at(&b, o + 16) & 0xFFFF) as u16), + remote_loopback: remote == [127, 0, 0, 1], + pid: u32_at(&b, o + 20), + }); + } + out + } + + pub fn tcp_rows_v6() -> Vec { + let b = table(23); + let mut out = Vec::new(); + if b.len() < 4 { + return out; + } + // MIB_TCP6ROW_OWNER_PID: local addr 16, scope 4, local port 4, remote addr 16, scope 4, remote port 4, state 4, pid 4 + for i in 0..u32_at(&b, 0) as usize { + let o = 4 + 56 * i; + if o + 56 > b.len() { + break; + } + let remote = &b[o + 24..o + 40]; + let mapped_loopback = remote[..10].iter().all(|x| *x == 0) && remote[10] == 0xff && remote[11] == 0xff && remote[12..] == [127, 0, 0, 1]; + out.push(TcpRow { + state: u32_at(&b, o + 48), + local_port: u16::from_be((u32_at(&b, o + 20) & 0xFFFF) as u16), + remote_port: u16::from_be((u32_at(&b, o + 44) & 0xFFFF) as u16), + remote_loopback: mapped_loopback, + pid: u32_at(&b, o + 52), + }); + } + out + } + + /// Bind 0.0.0.0:port exclusively and release it. Err carries the Windows socket error. + pub fn exclusive_bind(port: u16) -> std::result::Result<(), i32> { + use socket2::{Domain, Socket, Type}; + use std::os::windows::io::AsRawSocket; + let socket = Socket::new(Domain::IPV4, Type::STREAM, None).map_err(|e| e.raw_os_error().unwrap_or(-1))?; + let one: i32 = 1; + let set = unsafe { + setsockopt(socket.as_raw_socket() as _, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (&one as *const i32).cast(), 4) + }; + if set != 0 { + return Err(std::io::Error::last_os_error().raw_os_error().unwrap_or(-1)); + } + let addr: std::net::SocketAddr = ([0, 0, 0, 0], port).into(); + socket.bind(&addr.into()).map_err(|e| e.raw_os_error().unwrap_or(-1)) + } + + pub fn terminate(record: &ProcessIdentity) -> Result<()> { + unsafe { + let h = OpenProcess(PROCESS_TERMINATE | PROCESS_QUERY_LIMITED_INFORMATION, 0, record.pid); + if h.is_null() { + return Err(Error::Invalid("Unable to stop the repack process.".into())); + } + let same = crate::process::is_alive(record); + let ok = same && TerminateProcess(h, 0) != 0; + CloseHandle(h); + if !ok { + return Err(Error::Invalid("The process changed while stopping it.".into())); + } + } + Ok(()) + } +} + +#[cfg(not(windows))] +mod sys { + use crate::error::{Error, Result}; + use crate::process::ProcessIdentity; + pub const LISTEN: u32 = 2; + pub const ESTABLISHED: u32 = 5; + pub struct TcpRow { + pub state: u32, + pub local_port: u16, + pub remote_port: u16, + pub remote_loopback: bool, + pub pid: u32, + } + pub fn tcp_rows_v4() -> Vec { + Vec::new() + } + pub fn tcp_rows_v6() -> Vec { + Vec::new() + } + pub fn exclusive_bind(_: u16) -> std::result::Result<(), i32> { + Ok(()) + } + pub fn terminate(_: &ProcessIdentity) -> Result<()> { + Err(Error::Invalid("not supported".into())) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_port_with_a_listener_is_refused_and_a_free_one_passes() { + let held = std::net::TcpListener::bind("0.0.0.0:0").unwrap(); + let port = held.local_addr().unwrap().port(); + let err = ensure_free(port, &|_| {}).unwrap_err().to_string(); + assert!(err.contains(&format!("Port {port} is already used (PID {}", std::process::id())), "{err}"); + drop(held); + ensure_free(port, &|_| {}).unwrap(); + } + + #[test] + fn a_service_is_ready_only_on_its_own_port() { + let d = tempfile::tempdir().unwrap(); + let held = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); + let port = held.local_addr().unwrap().port(); + assert!(!ready(d.path(), "auth", port), "no record yet"); + state::record(d.path(), "auth", std::process::id()).unwrap(); + assert!(ready(d.path(), "auth", port)); + let other = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); + drop(other); + assert!(!ready(d.path(), "auth", port + 1) || port + 1 == 0); + } + + #[test] + fn status_reads_the_records() { + let d = tempfile::tempdir().unwrap(); + state::record(d.path(), "mysql", std::process::id()).unwrap(); + let s = status(d.path()); + assert_eq!(s["mysql"], true); + assert_eq!(s["world"], false); + assert_eq!(s["debugLogs"], false); + } +} diff --git a/crates/coa-core/src/launcher/squid.rs b/crates/coa-core/src/launcher/squid.rs new file mode 100644 index 0000000..1ac0409 --- /dev/null +++ b/crates/coa-core/src/launcher/squid.rs @@ -0,0 +1,398 @@ +//! SQUID Playerbots on a repack (`Scripts/squid_playerbots.py`): the bot modules must not both run, how long a +//! SQUID world may take to start, and its database, provisioned before the world starts. +//! +//! The SQL journals are the ones the Python script keeps, unchanged: `coa_squid_migrations(path, sha256)` and +//! `coa_squid_pending(path, sha256)` in every target schema, and the SQUID installer's `coa_bots_installed`. + +use std::collections::{BTreeMap, BTreeSet}; +use std::path::{Path, PathBuf}; + +use sha1::Digest as _; + +use crate::error::{Error, Result}; + +/// `key = value` lines of a module config (comments and quotes dropped), as `options()` reads them. +pub fn options(path: &Path) -> BTreeMap { + let mut out = BTreeMap::new(); + let Ok(bytes) = std::fs::read(path) else { return out }; + let text = String::from_utf8_lossy(&bytes); + let text = text.strip_prefix('\u{feff}').unwrap_or(&text); + for line in text.lines() { + let line = line.trim_start(); + let Some((key, rest)) = line.split_once('=') else { continue }; + let key = key.trim_end(); + if key.is_empty() || key.starts_with('#') || key.contains(char::is_whitespace) { + continue; + } + let value = rest.split('#').next().unwrap_or("").trim(); + out.insert(key.to_string(), value.trim_matches('"').to_string()); + } + out +} + +/// A secondary world shares the primary's package files. +pub fn package_root(root: &Path) -> PathBuf { + let secondary = root.file_name().is_some_and(|n| n == "secondary") + && root.parent().and_then(|p| p.file_name()).is_some_and(|n| n == ".realms"); + if secondary { + root.parent().and_then(Path::parent).map(Path::to_path_buf).unwrap_or_else(|| root.to_path_buf()) + } else { + root.to_path_buf() + } +} + +pub fn module_options(root: &Path, name: &str) -> (PathBuf, BTreeMap) { + let folder = root.join("Core/configs/modules"); + let active = folder.join(name); + let mut path = if active.exists() { active } else { folder.join(format!("{name}.dist")) }; + if !path.exists() && name == "playerbots.conf" { + path = package_root(root).join("Core/configs/modules/playerbots.conf.dist"); + } + let values = options(&path); + (path, values) +} + +/// Invalid booleans count as the modules' compiled default: enabled. +pub fn enabled(values: &BTreeMap, key: &str) -> bool { + !matches!(values.get(key).map(|v| v.to_ascii_lowercase()).as_deref(), Some("0" | "false" | "no" | "off")) +} + +pub fn validate_bots(root: &Path) -> Result<()> { + let (a, av) = module_options(root, "mod_coa_playerbots.conf"); + let (b, bv) = module_options(root, "playerbots.conf"); + if a.exists() && b.exists() && enabled(&av, "CoaBots.Enable") && enabled(&bv, "AiPlayerbot.Enabled") { + return Err(Error::Invalid( + "CoA Companions and SQUID Playerbots cannot both be enabled. Disable one bot module in Modules or its config.".into(), + )); + } + Ok(()) +} + +/// Seconds a world may take to open its port: SQUID loads its bots first. +pub fn startup_timeout(root: &Path) -> u64 { + let (path, values) = module_options(root, "playerbots.conf"); + if path.exists() && enabled(&values, "AiPlayerbot.Enabled") { + 1500 + } else { + 180 + } +} + +/// Replace (or append) `key = value` lines; the file is written with "\n" line ends. +pub fn set_options(path: &Path, values: &[(&str, String)]) -> Result<()> { + let bytes = std::fs::read(path)?; + let text = String::from_utf8_lossy(&bytes); + let mut text = text.strip_prefix('\u{feff}').unwrap_or(&text).replace("\r\n", "\n"); + for (key, value) in values { + let line = format!("{key} = {value}"); + let mut found = false; + let lines: Vec = text + .split('\n') + .map(|l| { + let t = l.trim_start(); + let matches = t.strip_prefix(key).is_some_and(|rest| rest.trim_start().starts_with('=')); + if matches { + found = true; + line.clone() + } else { + l.to_string() + } + }) + .collect(); + text = lines.join("\n"); + if !found { + text.push('\n'); + text.push_str(&line); + text.push('\n'); + } + } + crate::fsx::atomic_write(path, text.as_bytes()) +} + +fn valid_relative(rel: &str) -> bool { + !rel.is_empty() && rel.bytes().all(|b| b.is_ascii_alphanumeric() || matches!(b, b'_' | b'.' | b'/' | b'-')) +} + +/// Table names a base file creates (`CREATE TABLE [IF NOT EXISTS] name`). +fn created_tables(sql: &str) -> BTreeSet { + let mut out = BTreeSet::new(); + let upper = sql.to_ascii_uppercase(); + let mut from = 0; + while let Some(i) = upper[from..].find("CREATE") { + let start = from + i + "CREATE".len(); + from = start; + let rest = &sql[start..]; + let mut words = rest.split_whitespace(); + if !words.next().is_some_and(|w| w.eq_ignore_ascii_case("TABLE")) { + continue; + } + let mut name = words.next().unwrap_or(""); + if name.eq_ignore_ascii_case("IF") { + let _ = words.next(); // NOT + let _ = words.next(); // EXISTS + name = words.next().unwrap_or(""); + } + let name: String = name.trim_start_matches('`').chars().take_while(|c| c.is_ascii_alphanumeric() || *c == '_').collect(); + if !name.is_empty() { + out.insert(name); + } + } + out +} + +fn sha256_hex(bytes: &[u8]) -> String { + crate::fsx::sha256_bytes(bytes) +} + +fn sha1_hex(bytes: &[u8]) -> String { + let mut h = sha1::Sha1::new(); + h.update(bytes); + h.finalize().iter().map(|b| format!("{b:02x}")).collect() +} + +fn rows(text: &str) -> Vec<(String, String)> { + text.lines().filter_map(|r| r.split_once('\t')).map(|(a, b)| (a.to_string(), b.to_string())).collect() +} + +/// Provision an enabled SQUID without replaying imported base tables (`prepare_playerbots`). `mysql(sql)` runs +/// SQL with the repack's administrator login and returns its output. +pub fn prepare_playerbots(root: &Path, mysql_port: u16, mysql: &dyn Fn(&str) -> Result, progress: &dyn Fn(&str)) -> Result<()> { + let (mut path, values) = module_options(root, "playerbots.conf"); + if !path.exists() || !enabled(&values, "AiPlayerbot.Enabled") { + return Ok(()); + } + validate_bots(root)?; + let sql_root = package_root(root).join("Extras/SquidPlayerbots/sql"); + if !sql_root.join("playerbots/base").is_dir() { + return Err(Error::Invalid("SQUID Playerbots database files are missing. Repair the server installation.".into())); + } + let world = options(&root.join("Core/configs/worldserver.conf")); + let mut schemas: Vec<(&str, String)> = Vec::new(); + for (kind, key) in [("characters", "CharacterDatabaseInfo"), ("world", "WorldDatabaseInfo")] { + let schema = world.get(key).and_then(|v| v.rsplit(';').next()).unwrap_or("").to_string(); + let ok = matches!(schema.as_str(), "acore_world" | "acore_characters" | "acore_world_wildcard" | "acore_characters_wildcard"); + if !ok { + return Err(Error::Invalid("Unsupported world/characters database for SQUID Playerbots.".into())); + } + schemas.push((kind, schema)); + } + schemas.push(("playerbots", "acore_playerbots".into())); + + let list = |schema: &str| -> Result> { + Ok(mysql(&format!("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='{schema}';"))? + .lines() + .map(str::to_string) + .collect()) + }; + let existing_playerbots = list("acore_playerbots")?; + let bookkeeping = ["updates", "updates_include", "version_db_playerbots", "coa_squid_migrations", "coa_bots_installed", "coa_squid_pending"]; + let data_tables: Vec<&String> = existing_playerbots.iter().filter(|t| !bookkeeping.contains(&t.as_str())).collect(); + let mut installer_history = BTreeSet::new(); + if existing_playerbots.contains("coa_bots_installed") { + for name in mysql("SELECT file FROM `acore_playerbots`.coa_bots_installed;")?.lines() { + let mut n = name.replace('\\', "/"); + while n.contains("//") { + n = n.replace("//", "/"); + } + let n = n.trim_matches('/').to_string(); + if n.to_ascii_lowercase().ends_with(".sql") { + installer_history.insert(n); + } + } + } + let mut tables: BTreeMap<&str, BTreeSet> = BTreeMap::new(); + let mut histories: BTreeMap<&str, BTreeMap> = BTreeMap::new(); + let mut ledgers: BTreeMap<&str, BTreeMap> = BTreeMap::new(); + for (kind, schema) in &schemas { + let t = if *kind == "playerbots" { existing_playerbots.clone() } else { list(schema)? }; + if t.contains("coa_squid_pending") { + let pending = mysql(&format!("SELECT path FROM `{schema}`.coa_squid_pending;"))?; + let pending = pending.trim(); + if !pending.is_empty() { + return Err(Error::Invalid(format!( + "A SQUID base import was interrupted. Restore the database backup or repair the incomplete import before continuing; no SQL was applied: {pending}" + ))); + } + } + let mut history = BTreeMap::new(); + if t.contains("updates") { + for (name, digest) in rows(&mysql(&format!("SELECT name,hash FROM `{schema}`.updates;"))?) { + history.insert(name, digest.to_ascii_lowercase()); + } + } + let mut ledger = BTreeMap::new(); + if t.contains("coa_squid_migrations") { + for (name, digest) in rows(&mysql(&format!("SELECT path,sha256 FROM `{schema}`.coa_squid_migrations;"))?) { + ledger.insert(name, digest); + } + } + tables.insert(kind, t); + histories.insert(kind, history); + ledgers.insert(kind, ledger); + } + if !data_tables.is_empty() && installer_history.is_empty() && histories["playerbots"].is_empty() && ledgers["playerbots"].is_empty() { + for table in data_tables { + let quoted = table.replace('`', "``"); + if mysql(&format!("SELECT EXISTS(SELECT 1 FROM `acore_playerbots`.`{quoted}` LIMIT 1);"))?.trim() == "1" { + return Err(Error::Invalid( + "Existing SQUID data has no recorded installation history. Repair the imported database history before continuing; no SQL was applied.".into(), + )); + } + } + } + mysql("CREATE DATABASE IF NOT EXISTS acore_playerbots CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;")?; + for host in ["localhost", "127.0.0.1"] { + mysql(&format!("GRANT ALL PRIVILEGES ON acore_playerbots.* TO 'acore'@'{host}';"))?; + } + let (_, password) = crate::db::credentials(root)?; + if password.len() != 48 || !password.bytes().all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b)) { + return Err(Error::Invalid("Invalid packaged database configuration.".into())); + } + if path.file_name().is_some_and(|n| n.to_string_lossy().ends_with(".dist")) { + let active = root.join("Core/configs/modules/playerbots.conf"); + std::fs::create_dir_all(active.parent().unwrap())?; + std::fs::write(&active, std::fs::read(&path)?)?; + path = active; + } + set_options( + &path, + &[ + ("PlayerbotsDatabaseInfo", format!("\"127.0.0.1;{mysql_port};acore;{password};acore_playerbots\"")), + ("Playerbots.Updates.EnableDatabases", "0".into()), + ], + )?; + for (kind, schema) in &schemas { + mysql(&format!("CREATE TABLE IF NOT EXISTS `{schema}`.coa_squid_migrations (path VARCHAR(240) PRIMARY KEY, sha256 CHAR(64) NOT NULL);"))?; + mysql(&format!("CREATE TABLE IF NOT EXISTS `{schema}`.coa_squid_pending (path VARCHAR(240) PRIMARY KEY, sha256 CHAR(64) NOT NULL);"))?; + let history = &histories[kind]; + let recorded = ledgers[kind].clone(); + for stage in ["base", "updates", "custom"] { + let mut sources: Vec = std::fs::read_dir(sql_root.join(kind).join(stage)) + .map(|rd| rd.flatten().map(|e| e.path()).filter(|p| p.extension().is_some_and(|e| e == "sql")).collect()) + .unwrap_or_default(); + sources.sort(); + for source in sources { + let relative = source.strip_prefix(&sql_root).unwrap_or(&source).to_string_lossy().replace('\\', "/"); + if !valid_relative(&relative) { + return Err(Error::Invalid("Invalid SQUID SQL filename.".into())); + } + let bytes = std::fs::read(&source)?; + let digest = sha256_hex(&bytes); + if let Some(previous) = recorded.get(&relative) { + if *previous != digest { + return Err(Error::Invalid(format!("A previously applied SQUID database migration changed: {relative}"))); + } + if stage != "base" { + continue; + } + } + let ledger_sql = if recorded.contains_key(&relative) { + String::new() + } else { + format!("INSERT INTO `{schema}`.coa_squid_migrations VALUES ('{relative}','{digest}');") + }; + let text = String::from_utf8_lossy(&bytes); + let text = text.strip_prefix('\u{feff}').unwrap_or(&text).to_string(); + if stage == "base" { + let definitions = created_tables(&text); + let present: BTreeSet = definitions.intersection(&tables[kind]).cloned().collect(); + if !present.is_empty() && present != definitions { + return Err(Error::Invalid(format!("SQUID base file has only some of its tables. Repair the incomplete database before continuing: {relative}"))); + } + if definitions.is_empty() { + return Err(Error::Invalid(format!("SQUID base file has no recognizable table definitions; repair is required: {relative}"))); + } + if present == definitions { + if !ledger_sql.is_empty() { + mysql(&ledger_sql)?; + } + continue; + } + mysql(&format!("INSERT INTO `{schema}`.coa_squid_pending VALUES ('{relative}','{digest}'); COMMIT;"))?; + let complete = format!("DELETE FROM `{schema}`.coa_squid_pending WHERE path='{relative}' AND sha256='{digest}'; COMMIT;"); + progress(&format!("Importing SQUID {relative} into {schema} ({} bytes); large imports may take several minutes...", bytes.len())); + mysql(&format!("USE `{schema}`;\n{text}\n{ledger_sql}\n{complete}")).map_err(|_| { + Error::Invalid(format!( + "SQUID import failed: {relative} in {schema}. The world server was not started. The incomplete import is recorded; restore a database backup or repair that import before retrying." + )) + })?; + progress(&format!("Imported SQUID {relative}.")); + if let Some(t) = tables.get_mut(kind) { + t.extend(definitions); + } + continue; + } + if installer_history.iter().any(|n| *n == relative || n.ends_with(&format!("/{relative}"))) { + mysql(&ledger_sql)?; + continue; + } + let file_name = source.file_name().unwrap_or_default().to_string_lossy().into_owned(); + if let Some(upstream) = history.get(&file_name) { + let lf = String::from_utf8_lossy(&bytes).replace("\r\n", "\n"); + let accepted = [sha1_hex(&bytes), sha1_hex(lf.as_bytes())]; + if !upstream.is_empty() && !accepted.contains(upstream) { + return Err(Error::Invalid(format!("SQUID update history does not match the shipped SQL: {relative}"))); + } + mysql(&ledger_sql)?; + continue; + } + mysql(&format!("USE `{schema}`;\n{text}\n{ledger_sql}"))?; + } + } + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn config_lines_are_read_like_the_python_script() { + let d = tempfile::tempdir().unwrap(); + let p = d.path().join("playerbots.conf"); + std::fs::write(&p, "\u{feff}# comment = 1\nAiPlayerbot.Enabled = 0 # off\n Key.Two=\"quoted\"\nnot a line\nEmpty =\n").unwrap(); + let o = options(&p); + assert_eq!(o.get("AiPlayerbot.Enabled").map(String::as_str), Some("0")); + assert_eq!(o.get("Key.Two").map(String::as_str), Some("quoted")); + assert_eq!(o.get("Empty").map(String::as_str), Some("")); + assert!(!o.contains_key("#")); + assert!(!enabled(&o, "AiPlayerbot.Enabled")); + assert!(enabled(&o, "Missing")); + } + + #[test] + fn both_bot_modules_on_is_refused_and_squid_gets_a_long_startup() { + let d = tempfile::tempdir().unwrap(); + let m = d.path().join("Core/configs/modules"); + std::fs::create_dir_all(&m).unwrap(); + std::fs::write(m.join("mod_coa_playerbots.conf"), "CoaBots.Enable = 1\n").unwrap(); + std::fs::write(m.join("playerbots.conf.dist"), "AiPlayerbot.Enabled = 1\n").unwrap(); + assert!(validate_bots(d.path()).is_err()); + assert_eq!(startup_timeout(d.path()), 1500); + std::fs::write(m.join("playerbots.conf"), "AiPlayerbot.Enabled = 0\n").unwrap(); + validate_bots(d.path()).unwrap(); + assert_eq!(startup_timeout(d.path()), 180); + } + + #[test] + fn options_are_replaced_or_appended() { + let d = tempfile::tempdir().unwrap(); + let p = d.path().join("playerbots.conf"); + std::fs::write(&p, "A = 1\r\n Playerbots.Updates.EnableDatabases = 1\r\n").unwrap(); + set_options(&p, &[("Playerbots.Updates.EnableDatabases", "0".into()), ("PlayerbotsDatabaseInfo", "\"x\"".into())]).unwrap(); + assert_eq!(std::fs::read_to_string(&p).unwrap(), "A = 1\nPlayerbots.Updates.EnableDatabases = 0\n\nPlayerbotsDatabaseInfo = \"x\"\n"); + } + + #[test] + fn base_tables_are_found() { + let t = created_tables("CREATE TABLE IF NOT EXISTS `ai_playerbot_names` (\n id int);\ncreate table playerbots_random_bots(x int);\n-- CREATE INDEX i ON t(x);"); + assert_eq!(t, ["ai_playerbot_names".to_string(), "playerbots_random_bots".to_string()].into_iter().collect()); + } + + #[test] + fn a_secondary_world_uses_the_primary_package() { + assert_eq!(package_root(Path::new("C:/S/.realms/secondary")), Path::new("C:/S")); + assert_eq!(package_root(Path::new("C:/S")), Path::new("C:/S")); + } +} diff --git a/crates/coa-core/src/launcher/world.rs b/crates/coa-core/src/launcher/world.rs new file mode 100644 index 0000000..52667db --- /dev/null +++ b/crates/coa-core/src/launcher/world.rs @@ -0,0 +1,243 @@ +//! The world server and the bug-report relay beside it (`manage.py start_world`, `watch_world`, `wait_relay`), +//! and the detailed-logging switch (`debug_logs`). +//! +//! A world is started through a supervisor process that outlives the caller: it starts `worldserver.exe`, keeps +//! the relay running while the world runs, and stops the relay when the world ends. The relay itself is still +//! the Python `BugReport/relay.py`, run through the repack's Python, until it is ported too. + +use std::path::Path; +use std::process::{Child, Command, Stdio}; +use std::time::{Duration, Instant}; + +use crate::error::{Error, Result}; +use crate::launcher::services::{self, ensure_free, mysql, spawn, start_mysql, wait_ready, Progress}; +use crate::launcher::{settings::Settings, squid, state}; + +fn stop_relay_flag(root: &Path) -> std::path::PathBuf { + state::dir(root).join("stop-relay") +} + +/// The relay is up and has finished starting (it records itself as `relay-ready` once it serves). +pub fn wait_relay(root: &Path) -> Result<()> { + let until = Instant::now() + Duration::from_secs(20); + while Instant::now() < until { + if let (Some(relay), Some(ready)) = (state::running(root, "relay"), state::running(root, "relay-ready")) { + if relay == ready { + return Ok(()); + } + } + std::thread::sleep(Duration::from_millis(250)); + } + Err(Error::Invalid("Bug-report relay is not ready; check BugReport/Logs/relay.log.".into())) +} + +/// Start the world (and its database). `supervisor` is the launcher executable that runs `watch-world`. +pub fn start_world(root: &Path, cfg: &Settings, offset: i32, supervisor: &Path, progress: Progress) -> Result<()> { + start_mysql(root, cfg, progress)?; + squid::validate_bots(root)?; + let seconds = squid::startup_timeout(root); + if state::running(root, "world").is_some() { + if state::running(root, "supervisor").is_none() { + return Err(Error::Invalid("Worldserver has no repack supervisor. Use Stop_All_Server.bat before restarting it.".into())); + } + wait_ready(root, "world", cfg.world_port, seconds)?; + wait_relay(root)?; + progress("Worldserver and bug-report relay are already running."); + return Ok(()); + } + ensure_free(cfg.world_port, progress)?; + ensure_free(cfg.ra_port, progress)?; + if state::running(root, "supervisor").is_some() || state::running(root, "relay").is_some() { + return Err(Error::Invalid("The previous world/relay shutdown is still finishing. Try again shortly.".into())); + } + squid::prepare_playerbots(root, cfg.mysql_port, &|sql| mysql(root, Some(sql), None), progress)?; + progress("Starting worldserver and its bug-report relay..."); + let _ = std::fs::remove_file(stop_relay_flag(root)); + let offset_text = offset.to_string(); + let root_text = root.to_string_lossy().into_owned(); + spawn( + root, + "supervisor", + supervisor, + &["--root", &root_text, "--port-offset", &offset_text, "watch-world"], + root, + &root.join("Core/Logs/supervisor.log"), + )?; + let until = Instant::now() + Duration::from_secs(20); + while state::running(root, "world").is_none() && Instant::now() < until { + if state::running(root, "supervisor").is_none() { + return Err(Error::Invalid("World startup failed; check Core/Logs/supervisor.log.".into())); + } + std::thread::sleep(Duration::from_millis(250)); + } + wait_ready(root, "world", cfg.world_port, seconds)?; + wait_ready(root, "world", cfg.ra_port, seconds)?; + wait_relay(root)?; + progress("Worldserver and automatic bug reporting are ready."); + Ok(()) +} + +fn hidden(cmd: &mut Command) -> &mut Command { + #[cfg(windows)] + { + use std::os::windows::process::CommandExt; + cmd.creation_flags(0x0800_0000 | 0x0000_0200); + } + cmd +} + +fn spawn_child(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { + services::keep_std_handles_private(); + if let Some(dir) = log.parent() { + std::fs::create_dir_all(dir)?; + } + let out = std::fs::OpenOptions::new().create(true).append(true).open(log)?; + let err = out.try_clone()?; + let child = hidden(Command::new(exe).args(args).current_dir(cwd)).stdin(Stdio::null()).stdout(out).stderr(err).spawn()?; + state::record(root, name, child.id())?; + Ok(child) +} + +/// The relay worker: the repack's Python running `Scripts/manage.py relay-worker` (BugReport/relay.py). +fn spawn_relay(root: &Path) -> Result { + let python = squid::package_root(root).join("Runtime/python/python.exe"); + let manage = root.join("Scripts/manage.py"); + if !python.is_file() || !manage.is_file() { + return Err(Error::Invalid("The bug-report relay needs the repack's Python and Scripts/manage.py.".into())); + } + let manage = manage.to_string_lossy().into_owned(); + spawn_child(root, "relay", &python, &["-B", &manage, "relay-worker"], root, &root.join("BugReport/Logs/relay.log")) +} + +/// The supervisor (`watch-world`): run the world, keep the relay alive while it runs, stop the relay after it. +pub fn watch_world(root: &Path, log: Progress) -> Result<()> { + squid::validate_bots(root)?; + let mut world = spawn_child(root, "world", &root.join("Core/worldserver.exe"), &["-c", "configs/worldserver.conf"], &root.join("Core"), &root.join("Core/Logs/world-console.log"))?; + let mut relay: Option = None; + while world.try_wait()?.is_none() { + let dead = match relay.as_mut() { + None => true, + Some(r) => r.try_wait()?.is_some(), + }; + if dead { + match spawn_relay(root) { + Ok(r) => relay = Some(r), + Err(e) => { + log(&format!("Report relay could not start ({e}); retrying.")); + std::thread::sleep(Duration::from_secs(5)); + continue; + } + } + } + std::thread::sleep(Duration::from_secs(2)); + } + std::fs::write(stop_relay_flag(root), b"")?; + if let Some(mut r) = relay { + let until = Instant::now() + Duration::from_secs(40); + while r.try_wait()?.is_none() && Instant::now() < until { + std::thread::sleep(Duration::from_millis(250)); + } + if r.try_wait()?.is_none() { + // An interrupted POST stays uncertain in the relay's journal; it is not resent. + if let Some(record) = state::running(root, "relay") { + services::terminate(&record)?; + } + } + } + Ok(()) +} + +// --------------------------------------------------------------------------------------------------------------- +// Detailed logging (Debug_Logs_On.bat / Debug_Logs_Off.bat) +// --------------------------------------------------------------------------------------------------------------- + +const DEBUG_TEMPLATES: [&str; 2] = ["worldserver.conf.template", "authserver.conf.template"]; + +/// One template line with every logger forced to Trace and the console/server appenders to the most detail. +fn debug_line(line: &str) -> String { + let body = line.strip_prefix('#').unwrap_or(line).trim_start(); + for appender in ["Appender.Console", "Appender.Server"] { + if let Some(rest) = body.strip_prefix(appender).and_then(|r| r.strip_prefix('=')) { + let parts: Vec<&str> = rest.splitn(4, ',').collect(); + if parts.len() == 4 && parts[..3].iter().all(|p| !p.is_empty() && p.bytes().all(|b| b.is_ascii_digit())) { + return format!("{appender}={},6,7,{}", parts[0], parts[3]); + } + } + } + if let Some(rest) = body.strip_prefix("Logger.") { + if let Some((name, value)) = rest.split_once('=') { + if !name.is_empty() && name.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'_' || b == b'.') { + if let Some((level, tail)) = value.split_once(',') { + if !level.is_empty() && level.bytes().all(|b| b.is_ascii_digit()) { + return format!("Logger.{name}=6,{tail}"); + } + } + } + } + } + let t = line.trim_end(); + if let Some(v) = t.strip_prefix("Log.Async.Enable") { + let v = v.trim_start(); + if let Some(n) = v.strip_prefix('=') { + let n = n.trim(); + if !n.is_empty() && n.bytes().all(|b| b.is_ascii_digit()) { + return "Log.Async.Enable = 1".into(); + } + } + } + line.to_string() +} + +/// Turn detailed logging on or off (the templates; services apply it at their next start). Returns the changed +/// templates. +pub fn debug_logs(root: &Path, enable: bool) -> Result> { + let mut changed = Vec::new(); + for name in DEBUG_TEMPLATES { + let path = root.join("Settings").join(name); + let original = root.join("Settings").join(format!("{name}.original")); + if !original.exists() { + std::fs::write(&original, std::fs::read(&path)?)?; + } + let new_bytes = if enable { + let text = String::from_utf8(std::fs::read(&original)?).map_err(|_| Error::Invalid(format!("{name} is not UTF-8.")))?; + let newline = if text.contains("\r\n") { "\r\n" } else { "\n" }; + let mut out = text.lines().map(debug_line).collect::>().join(newline); + if text.ends_with('\n') { + out.push_str(newline); + } + out.into_bytes() + } else { + std::fs::read(&original)? + }; + if std::fs::read(&path)? != new_bytes { + std::fs::write(&path, &new_bytes)?; + changed.push(name.to_string()); + } + } + state::write_json(&state::dir(root).join("debug-logs.json"), &serde_json::json!({ "enabled": enable }))?; + Ok(changed) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn detailed_logging_rewrites_loggers_and_restores_the_original() { + let d = tempfile::tempdir().unwrap(); + std::fs::create_dir_all(d.path().join("Settings")).unwrap(); + let world = "Appender.Console=1,3,0\r\nAppender.Server=2,2,0,Server.log,w\r\n#Logger.module=4,Console Server\r\nLogger.root=5,Console Server\r\nLog.Async.Enable = 0\r\nOther = 1\r\n"; + std::fs::write(d.path().join("Settings/worldserver.conf.template"), world).unwrap(); + std::fs::write(d.path().join("Settings/authserver.conf.template"), "Logger.root=2,Console\n").unwrap(); + let changed = debug_logs(d.path(), true).unwrap(); + assert_eq!(changed.len(), 2); + assert_eq!( + std::fs::read_to_string(d.path().join("Settings/worldserver.conf.template")).unwrap(), + "Appender.Console=1,3,0\r\nAppender.Server=2,6,7,Server.log,w\r\nLogger.module=6,Console Server\r\nLogger.root=6,Console Server\r\nLog.Async.Enable = 1\r\nOther = 1\r\n" + ); + assert_eq!(debug_logs(d.path(), true).unwrap().len(), 0, "already on"); + debug_logs(d.path(), false).unwrap(); + assert_eq!(std::fs::read_to_string(d.path().join("Settings/worldserver.conf.template")).unwrap(), world); + assert_eq!(services::status(d.path())["debugLogs"], false); + } +} diff --git a/crates/coa-core/src/ra.rs b/crates/coa-core/src/ra.rs index 2523c04..5764488 100644 --- a/crates/coa-core/src/ra.rs +++ b/crates/coa-core/src/ra.rs @@ -88,6 +88,15 @@ impl Ra { self.command(c) } + /// Send a command the server does not answer before it closes the console (`server shutdown`), and return at + /// once. + pub fn send_without_answer(mut self, cmd: &str) -> Result<()> { + let c = crate::console::check_command(cmd)?; + self.stream.write_all(format!("{c}\r\n").as_bytes())?; + self.stream.flush()?; + Ok(()) + } + fn command(&mut self, cmd: &str) -> Result { debug_assert!(!cmd.contains(['\r', '\n'])); self.stream.write_all(format!("{cmd}\r\n").as_bytes())?; diff --git a/crates/coa-launcher/Cargo.toml b/crates/coa-launcher/Cargo.toml new file mode 100644 index 0000000..b4263cf --- /dev/null +++ b/crates/coa-launcher/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "coa-launcher" +description = "The CoA repack launcher (Start_All_Server.bat and friends) without Python" +version.workspace = true +edition.workspace = true +license.workspace = true + +[[bin]] +name = "coa-launcher" +path = "src/main.rs" + +[dependencies] +coa-core = { path = "../coa-core" } +serde_json = "1" +windows-sys = { version = "0.60", features = ["Win32_Foundation", "Win32_System_Console"] } diff --git a/crates/coa-launcher/src/main.rs b/crates/coa-launcher/src/main.rs new file mode 100644 index 0000000..39d802d --- /dev/null +++ b/crates/coa-launcher/src/main.rs @@ -0,0 +1,238 @@ +//! `coa-launcher.exe`: the repack launcher, the same commands as `Scripts/manage.py`. +//! +//! It lives in `/Scripts/` next to manage.py (the server folder is its parent), or takes `--root `. +//! Errors are printed as `ERROR: ` on stderr with exit code 1, exactly like manage.py, because the +//! Manager reads them. + +use std::io::{BufRead, Write}; +use std::path::{Path, PathBuf}; +use std::time::Duration; + +use coa_core::launcher::{render, services, settings::Settings, state, world}; + +const ACTIONS: [&str; 17] = [ + "start-all", "start-mysql", "start-auth", "start-world", "stop-all", "status", "status-json", "create-account", + "create-account-once", "console", "ra-once", "prepare", "watch-world", "relay-worker", "debug-logs-on", + "debug-logs-off", "debug-logs-status", +]; + +fn say(text: &str) { + println!("{text}"); + let _ = std::io::stdout().flush(); +} + +fn usage() -> String { + format!("usage: coa-launcher [--root ] [--port-offset N] {{{}}}", ACTIONS.join(",")) +} + +struct Args { + root: PathBuf, + offset: i32, + action: String, +} + +fn parse() -> Result { + let mut root: Option = None; + let mut offset = 0; + let mut action = None; + let mut it = std::env::args().skip(1); + while let Some(a) = it.next() { + match a.as_str() { + "--root" => root = Some(PathBuf::from(it.next().ok_or_else(usage)?)), + "--port-offset" => offset = it.next().and_then(|v| v.parse().ok()).ok_or_else(usage)?, + _ if ACTIONS.contains(&a.as_str()) && action.is_none() => action = Some(a), + _ => return Err(usage()), + } + } + let root = match root { + Some(r) => r, + None => { + // /Scripts/coa-launcher.exe -> + let exe = std::env::current_exe().map_err(|e| e.to_string())?; + exe.parent().and_then(Path::parent).map(Path::to_path_buf).ok_or("cannot find the server folder")? + } + }; + Ok(Args { root, offset, action: action.ok_or_else(usage)? }) +} + +fn read_line(prompt: &str) -> std::io::Result { + print!("{prompt}"); + std::io::stdout().flush()?; + let mut line = String::new(); + std::io::stdin().lock().read_line(&mut line)?; + Ok(line.trim_end_matches(['\r', '\n']).to_string()) +} + +/// Read a line without showing it (passwords). +fn read_secret(prompt: &str) -> std::io::Result { + #[cfg(windows)] + unsafe { + use windows_sys::Win32::System::Console::{GetConsoleMode, GetStdHandle, SetConsoleMode, ENABLE_ECHO_INPUT, STD_INPUT_HANDLE}; + let h = GetStdHandle(STD_INPUT_HANDLE); + let mut mode = 0; + if GetConsoleMode(h, &mut mode) != 0 { + SetConsoleMode(h, mode & !ENABLE_ECHO_INPUT); + let line = read_line(prompt); + SetConsoleMode(h, mode); + println!(); + return line; + } + } + read_line(prompt) +} + +fn valid_login(text: &str) -> bool { + (1..=16).contains(&text.len()) && text.bytes().all(|b| b.is_ascii_alphanumeric()) +} + +fn ra(cfg: &Settings, root: &Path, command: &str) -> Result { + if !services::ready(root, "world", cfg.ra_port) { + return Err("Start this repack's worldserver first.".into()); + } + let mut console = coa_core::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password).map_err(|e| e.to_string())?; + console.run(command).map_err(|e| e.to_string()) +} + +fn run(args: Args) -> Result<(), String> { + let root = args.root.as_path(); + let e = |x: coa_core::Error| x.to_string(); + match args.action.as_str() { + "watch-world" => return world::watch_world(root, &|m| say(m)).map_err(e), + "relay-worker" => { + return Err("The bug-report relay runs through Scripts/manage.py relay-worker until it is ported.".into()) + } + "debug-logs-status" => { + let on = services::status(root)["debugLogs"].as_bool().unwrap_or(false); + say(&format!("Detailed server logging is {}.", if on { "ON" } else { "off" })); + if on { + say("Every AzerothCore logger is forced to Trace level in Core/Logs (Server.log, Auth.log, world-console.log, auth-console.log). Expect much larger, faster-growing log files."); + } + say("Run Debug_Logs_On.bat / Debug_Logs_Off.bat, then restart the affected service(s) to apply."); + return Ok(()); + } + "debug-logs-on" | "debug-logs-off" => { + let on = args.action == "debug-logs-on"; + let changed = { + let _lock = state::ControlLock::acquire(root, &args.action, Duration::from_secs(30), &|m| say(m)).map_err(e)?; + world::debug_logs(root, on).map_err(e)? + }; + if changed.is_empty() { + say(&format!("Detailed logging was already {}.", if on { "on" } else { "off" })); + } else { + say(&format!("{} detailed logging in: {}", if on { "Enabled" } else { "Restored" }, changed.join(", "))); + } + say("Restart the affected service(s) (Stop_All_Server.bat then Start_All_Server.bat) to apply this."); + return Ok(()); + } + _ => {} + } + let cfg = Settings::load(root, args.offset).map_err(e)?; + match args.action.as_str() { + "console" => { + say("World console. Enter a server command, or exit to close this window."); + loop { + let command = read_line("AC> ").map_err(|x| x.to_string())?; + let command = command.trim(); + if command.eq_ignore_ascii_case("exit") || command.eq_ignore_ascii_case("quit") { + return Ok(()); + } + if !command.is_empty() { + say(&ra(&cfg, root, command)?); + } + } + } + "create-account" => { + let name = read_line("New account name (letters and digits, up to 16): ").map_err(|x| x.to_string())?; + let name = name.trim(); + let password = read_secret("New account password (letters and digits, up to 16): ").map_err(|x| x.to_string())?; + let again = read_secret("Repeat password: ").map_err(|x| x.to_string())?; + if !valid_login(name) || !valid_login(&password) { + return Err("Use 1-16 letters or digits for the account name and password.".into()); + } + if password != again { + return Err("Passwords do not match.".into()); + } + say(&ra(&cfg, root, &format!("account create {name} {password}"))?); + if read_line("Give this account GM permissions? [y/N]: ").map_err(|x| x.to_string())?.trim().eq_ignore_ascii_case("y") { + say(&ra(&cfg, root, &format!("account set gmlevel {name} 3 -1"))?); + } + return Ok(()); + } + "ra-once" => { + let command = read_line("").map_err(|x| x.to_string())?; + let command = command.trim(); + if command.is_empty() { + return Err("No command given.".into()); + } + say(&ra(&cfg, root, command)?); + return Ok(()); + } + "create-account-once" => { + let line = read_line("").map_err(|x| x.to_string())?; + let request: serde_json::Value = serde_json::from_str(&line).map_err(|x| x.to_string())?; + let name = request.get("username").and_then(|v| v.as_str()).unwrap_or("").trim().to_string(); + let password = request.get("password").and_then(|v| v.as_str()).unwrap_or("").to_string(); + if !valid_login(&name) || !valid_login(&password) { + return Err("Use 1-16 letters or digits for the account name and password.".into()); + } + let mut messages = vec![ra(&cfg, root, &format!("account create {name} {password}"))?]; + if request.get("gm").and_then(|v| v.as_bool()).unwrap_or(false) { + messages.push(ra(&cfg, root, &format!("account set gmlevel {name} 3 -1"))?); + } + say(&serde_json::json!({ "messages": messages }).to_string()); + return Ok(()); + } + _ => {} + } + { + let _lock = state::ControlLock::acquire(root, &args.action, Duration::from_secs(30), &|m| say(m)).map_err(e)?; + match args.action.as_str() { + "status" => { + for name in ["mysql", "auth", "world", "relay"] { + let line = match state::running(root, name) { + Some(r) => format!("{name:12} running (PID {})", r.pid), + None => format!("{name:12} stopped"), + }; + say(&line); + } + return Ok(()); + } + "status-json" => { + say(&services::status(root).to_string()); + return Ok(()); + } + "stop-all" => return services::stop_all(root, &cfg, &|m| say(m)).map_err(e), + _ => {} + } + if matches!(args.action.as_str(), "start-all" | "start-world") { + coa_core::launcher::squid::validate_bots(root).map_err(e)?; + } + render::prepare(root, &cfg).map_err(e)?; + if args.action == "prepare" { + return Ok(()); + } + let progress = |m: &str| say(m); + if matches!(args.action.as_str(), "start-all" | "start-mysql") { + services::start_mysql(root, &cfg, &progress).map_err(e)?; + } + if matches!(args.action.as_str(), "start-all" | "start-auth") { + services::start_auth(root, &cfg, &progress).map_err(e)?; + } + if matches!(args.action.as_str(), "start-all" | "start-world") { + let me = std::env::current_exe().map_err(|x| x.to_string())?; + world::start_world(root, &cfg, args.offset, &me, &progress).map_err(e)?; + } + } + if args.action.starts_with("start-") { + say("Use Stop_All_Server.bat to shut down this repack safely."); + } + Ok(()) +} + +fn main() { + let result = parse().and_then(run); + if let Err(message) = result { + eprintln!("ERROR: {message}"); + std::process::exit(1); + } +} From 1211de5a77301f2de3cbd7958d93bcf2f2855682 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: Tue, 10 Nov 2026 07:48:04 +0500 Subject: [PATCH 03/29] launcher (Rust): services inherit only their log and NUL; MySQL errors carry the server's text std::process::Command lets a Windows child inherit every inheritable handle of the parent: a MySQL started by the launcher kept the caller's files and pipes open (found by the SQUID test, whose log stayed locked). Services now start through CreateProcessW with PROC_THREAD_ATTRIBUTE_HANDLE_LIST = [log, NUL], as Python's subprocess does. The MySQL client's outputs are read while it runs (a full pipe stopped it) and its last error line is reported. E2E on a disposable repack: launcher_e2e PASS again; squid_equivalence PASS: Rust and squid_playerbots.py leave identical journals, acore_playerbots tables (row counts) and playerbots.conf (4106 lines), and a second run of either changes nothing. Co-Authored-By: Claude Opus 5.5 --- crates/coa-core/examples/squid_equivalence.rs | 103 ++++++++ crates/coa-core/src/launcher/mod.rs | 1 + crates/coa-core/src/launcher/services.rs | 74 +++--- crates/coa-core/src/launcher/spawn.rs | 249 ++++++++++++++++++ crates/coa-core/src/launcher/world.rs | 42 +-- 5 files changed, 399 insertions(+), 70 deletions(-) create mode 100644 crates/coa-core/examples/squid_equivalence.rs create mode 100644 crates/coa-core/src/launcher/spawn.rs diff --git a/crates/coa-core/examples/squid_equivalence.rs b/crates/coa-core/examples/squid_equivalence.rs new file mode 100644 index 0000000..795c9f2 --- /dev/null +++ b/crates/coa-core/examples/squid_equivalence.rs @@ -0,0 +1,103 @@ +//! SQUID database provisioning in Rust gives exactly what Scripts/squid_playerbots.py gives, on a DISPOSABLE repack: +//! the same journals (coa_squid_migrations, coa_squid_pending) in every schema, the same acore_playerbots tables +//! with the same row counts, the same playerbots.conf. Each side starts from the same state (SQUID never +//! provisioned), and a second run of each must change nothing. +//! +//! usage: squid_equivalence +use std::path::Path; +use std::process::Command; + +use coa_core::launcher::{services, squid}; + +fn sql(root: &Path, q: &str) -> String { + services::mysql(root, Some(q), None).unwrap_or_else(|e| panic!("{q}: {e}")) +} + +/// What provisioning leaves behind, comparable between runs. +fn snapshot(root: &Path) -> String { + let mut out = Vec::new(); + for schema in ["acore_characters", "acore_world", "acore_playerbots"] { + let tables = sql(root, &format!("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='{schema}' ORDER BY TABLE_NAME;")); + for t in tables.lines() { + if schema != "acore_playerbots" && !t.starts_with("coa_squid") { + continue; + } + let n = sql(root, &format!("SELECT COUNT(*) FROM `{schema}`.`{t}`;")); + out.push(format!("{schema}.{t} rows={n}")); + if t == "coa_squid_migrations" || t == "coa_squid_pending" { + for row in sql(root, &format!("SELECT path, sha256 FROM `{schema}`.`{t}` ORDER BY path;")).lines() { + out.push(format!(" {row}")); + } + } + } + } + let conf = std::fs::read_to_string(root.join("Core/configs/modules/playerbots.conf")).unwrap(); + out.push(format!("playerbots.conf:\n{}", conf.replace("\r\n", "\n"))); + out.join("\n") +} + +fn reset(root: &Path, conf: &[u8]) { + sql(root, "DROP DATABASE IF EXISTS acore_playerbots;"); + for schema in ["acore_characters", "acore_world"] { + sql(root, &format!("DROP TABLE IF EXISTS `{schema}`.coa_squid_migrations, `{schema}`.coa_squid_pending;")); + } + std::fs::write(root.join("Core/configs/modules/playerbots.conf"), conf).unwrap(); +} + +fn python(root: &Path) { + let harness = root.join(".state/squid_harness.py"); + std::fs::write( + &harness, + "import sys, pathlib\nroot = pathlib.Path(sys.argv[1])\nsys.path.insert(0, str(root / 'Scripts'))\nsys.argv = ['manage.py']\nimport manage\nfrom squid_playerbots import prepare_playerbots\nprepare_playerbots(manage.ROOT, manage.settings(), manage.mysql)\n", + ) + .unwrap(); + let out = Command::new(root.join("Runtime/python/python.exe")).arg("-B").arg(&harness).arg(root).output().unwrap(); + assert!(out.status.success(), "python: {}{}", String::from_utf8_lossy(&out.stdout), String::from_utf8_lossy(&out.stderr)); + print!("{}", String::from_utf8_lossy(&out.stdout)); +} + +fn rust(root: &Path) { + let cfg = coa_core::launcher::Settings::load(root, 0).unwrap(); + squid::prepare_playerbots(root, cfg.mysql_port, &|q| services::mysql(root, Some(q), None), &|m| println!("{m}")).unwrap(); +} + +fn main() { + let a: Vec = std::env::args().skip(1).collect(); + let root = Path::new(&a[0]); + let exe = Path::new(&a[1]); + assert!(a[0].ends_with("-fixture")); + let modules = root.join("Core/configs/modules"); + // SQUID on, Companions off + let companions = std::fs::read_to_string(modules.join("mod_coa_playerbots.conf")).unwrap(); + std::fs::write(modules.join("mod_coa_playerbots.conf"), companions.replace("CoaBots.Enable = 1", "CoaBots.Enable = 0")).unwrap(); + let squid_conf = std::fs::read_to_string(modules.join("playerbots.conf")).unwrap().replace("AiPlayerbot.Enabled = 0", "AiPlayerbot.Enabled = 1"); + let r = root.to_string_lossy().into_owned(); + let started = Command::new(exe).args(["--root", &r, "start-mysql"]).output().unwrap(); + assert!(started.status.success(), "{}", String::from_utf8_lossy(&started.stderr)); + + reset(root, squid_conf.as_bytes()); + let t = std::time::Instant::now(); + python(root); + println!("python provisioned in {:?}", t.elapsed()); + let by_python = snapshot(root); + python(root); + assert_eq!(snapshot(root), by_python, "a second Python run changed something"); + + reset(root, squid_conf.as_bytes()); + let t = std::time::Instant::now(); + rust(root); + println!("rust provisioned in {:?}", t.elapsed()); + let by_rust = snapshot(root); + rust(root); + assert_eq!(snapshot(root), by_rust, "a second Rust run changed something"); + + if by_python != by_rust { + std::fs::write(root.join(".state/squid-python.txt"), &by_python).unwrap(); + std::fs::write(root.join(".state/squid-rust.txt"), &by_rust).unwrap(); + panic!("Rust and Python differ: see .state/squid-python.txt and squid-rust.txt"); + } + println!("{} lines of journal/table/config state are identical", by_rust.lines().count()); + let stopped = Command::new(exe).args(["--root", &r, "stop-all"]).output().unwrap(); + assert!(stopped.status.success()); + println!("SQUID EQUIVALENCE PASS"); +} diff --git a/crates/coa-core/src/launcher/mod.rs b/crates/coa-core/src/launcher/mod.rs index b1d79d1..900e8f6 100644 --- a/crates/coa-core/src/launcher/mod.rs +++ b/crates/coa-core/src/launcher/mod.rs @@ -14,6 +14,7 @@ pub mod render; pub mod services; pub mod settings; +pub mod spawn; pub mod squid; pub mod state; pub mod world; diff --git a/crates/coa-core/src/launcher/services.rs b/crates/coa-core/src/launcher/services.rs index 82160a1..c22e558 100644 --- a/crates/coa-core/src/launcher/services.rs +++ b/crates/coa-core/src/launcher/services.rs @@ -1,7 +1,6 @@ //! Starting, checking and stopping the services of one repack: MySQL, authserver, worldserver //! (`manage.py start_mysql`, `start_auth`, `stop_all` and their helpers), with the same rules. -use std::fs::OpenOptions; use std::net::{SocketAddr, TcpStream}; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; @@ -25,38 +24,10 @@ fn hidden(cmd: &mut Command) -> &mut Command { cmd } -/// Keep this process's own stdin/stdout/stderr out of the services it starts. Windows children inherit every -/// inheritable handle, and a server holding the launcher's output pipe keeps whoever reads that output (the -/// Manager, a test) waiting until the server exits. Python's subprocess passes only the handles it is given; this -/// gives the same result. -pub(crate) fn keep_std_handles_private() { - #[cfg(windows)] - unsafe { - use windows_sys::Win32::Foundation::{SetHandleInformation, HANDLE_FLAG_INHERIT}; - use windows_sys::Win32::System::Console::{GetStdHandle, STD_ERROR_HANDLE, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE}; - for which in [STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE] { - let h = GetStdHandle(which); - if !h.is_null() && h as isize != -1 { - SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0); - } - } - } -} - /// Start `exe` with its output appended to `log`, and record it as `name`. pub fn spawn(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { - keep_std_handles_private(); - if let Some(dir) = log.parent() { - std::fs::create_dir_all(dir)?; - } - let out = OpenOptions::new().create(true).append(true).open(log)?; - let err = out.try_clone()?; - let child = hidden(Command::new(exe).args(args).current_dir(cwd)) - .stdin(Stdio::null()) - .stdout(out) - .stderr(err) - .spawn()?; - state::record(root, name, child.id()) + let child = crate::launcher::spawn::start(exe, args, cwd, log)?; + state::record(root, name, child.pid) } // --------------------------------------------------------------------------------------------------------------- @@ -173,23 +144,46 @@ pub fn mysql(root: &Path, sql: Option<&str>, admin: Option<&str>) -> Result>| { + std::thread::spawn(move || { + let mut buf = Vec::new(); + if let Some(mut p) = pipe { + let _ = p.read_to_end(&mut buf); } - return Ok(String::from_utf8_lossy(&out.stdout).trim().to_string()); + buf + }) + }; + let out_reader = read(child.stdout.take().map(|p| Box::new(p) as Box)); + let err_reader = read(child.stderr.take().map(|p| Box::new(p) as Box)); + let started = Instant::now(); + let failed = |stderr: &[u8]| { + let text = String::from_utf8_lossy(stderr); + let detail = text.lines().rev().find(|l| !l.trim().is_empty()).unwrap_or("").trim().to_string(); + let mut message = "The repack database command failed; check mysql/logs/mysql-error.log.".to_string(); + if !detail.is_empty() { + message.push_str(&format!(" ({detail})")); + } + Error::Invalid(message) + }; + let status = loop { + if let Some(status) = child.try_wait()? { + break status; } if started.elapsed() > Duration::from_secs(timeout) { let _ = child.kill(); let _ = child.wait(); - return Err(failed()); + let _ = out_reader.join(); + return Err(failed(b"timed out")); } std::thread::sleep(Duration::from_millis(50)); + }; + let stdout = out_reader.join().unwrap_or_default(); + let stderr = err_reader.join().unwrap_or_default(); + if !status.success() { + return Err(failed(&stderr)); } + Ok(String::from_utf8_lossy(&stdout).trim().to_string()) } // --------------------------------------------------------------------------------------------------------------- diff --git a/crates/coa-core/src/launcher/spawn.rs b/crates/coa-core/src/launcher/spawn.rs new file mode 100644 index 0000000..763bcde --- /dev/null +++ b/crates/coa-core/src/launcher/spawn.rs @@ -0,0 +1,249 @@ +//! Starting a long-running service process that inherits exactly two handles: its log (as stdout and stderr) and +//! NUL (as stdin). +//! +//! `std::process::Command` on Windows lets a child inherit every inheritable handle of the parent. A server +//! started that way keeps open whatever the launcher's caller had open (the Manager's pipes, a test's log file), +//! for as long as the server runs. Python's subprocess passes an explicit handle list; this does the same with +//! `PROC_THREAD_ATTRIBUTE_HANDLE_LIST`. + +use std::path::Path; + +#[cfg(not(windows))] +use crate::error::Error; +use crate::error::Result; + +/// A started process. The handle is closed when this is dropped; the process keeps running. +pub struct Proc { + pub pid: u32, + #[cfg(windows)] + handle: windows_sys::Win32::Foundation::HANDLE, +} + +unsafe impl Send for Proc {} + +/// One argument quoted the way the Microsoft C runtime parses it back. +fn quote(arg: &str) -> String { + if !arg.is_empty() && !arg.contains([' ', '\t', '"']) { + return arg.to_string(); + } + let mut out = String::from('"'); + let mut backslashes = 0; + for c in arg.chars() { + match c { + '\\' => backslashes += 1, + '"' => { + out.push_str(&"\\".repeat(backslashes * 2 + 1)); + out.push('"'); + backslashes = 0; + } + _ => { + out.push_str(&"\\".repeat(backslashes)); + out.push(c); + backslashes = 0; + } + } + } + out.push_str(&"\\".repeat(backslashes * 2)); + out.push('"'); + out +} + +pub fn command_line(exe: &Path, args: &[&str]) -> String { + let mut parts = vec![quote(&exe.to_string_lossy())]; + parts.extend(args.iter().map(|a| quote(a))); + parts.join(" ") +} + +#[cfg(windows)] +mod sys { + use super::Proc; + use crate::error::{Error, Result}; + use std::os::windows::ffi::OsStrExt; + use std::path::Path; + use windows_sys::Win32::Foundation::{CloseHandle, GetLastError, HANDLE, INVALID_HANDLE_VALUE, WAIT_OBJECT_0}; + use windows_sys::Win32::Security::SECURITY_ATTRIBUTES; + use windows_sys::Win32::Storage::FileSystem::{ + CreateFileW, FILE_APPEND_DATA, FILE_ATTRIBUTE_NORMAL, FILE_GENERIC_READ, FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE, + OPEN_ALWAYS, OPEN_EXISTING, + }; + use windows_sys::Win32::System::Threading::{ + CreateProcessW, DeleteProcThreadAttributeList, GetExitCodeProcess, InitializeProcThreadAttributeList, UpdateProcThreadAttribute, + WaitForSingleObject, CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW, CREATE_UNICODE_ENVIRONMENT, EXTENDED_STARTUPINFO_PRESENT, + LPPROC_THREAD_ATTRIBUTE_LIST, PROCESS_INFORMATION, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, STARTF_USESTDHANDLES, STARTUPINFOEXW, + }; + + fn wide(s: &std::ffi::OsStr) -> Vec { + s.encode_wide().chain(Some(0)).collect() + } + + fn open_inheritable(path: &Path, access: u32, disposition: u32) -> Result { + let mut sa: SECURITY_ATTRIBUTES = unsafe { std::mem::zeroed() }; + sa.nLength = std::mem::size_of::() as u32; + sa.bInheritHandle = 1; + let name = wide(path.as_os_str()); + let h = unsafe { + CreateFileW( + name.as_ptr(), + access, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + &sa, + disposition, + FILE_ATTRIBUTE_NORMAL, + std::ptr::null_mut(), + ) + }; + if h == INVALID_HANDLE_VALUE { + return Err(std::io::Error::last_os_error().into()); + } + Ok(h) + } + + pub fn start(exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { + let out = open_inheritable(log, FILE_APPEND_DATA, OPEN_ALWAYS)?; + let nul = match open_inheritable(Path::new("NUL"), FILE_GENERIC_READ, OPEN_EXISTING) { + Ok(h) => h, + Err(e) => { + unsafe { CloseHandle(out) }; + return Err(e); + } + }; + let result = (|| -> Result { + let mut handles = [out, nul]; + let mut size = 0usize; + unsafe { InitializeProcThreadAttributeList(std::ptr::null_mut(), 1, 0, &mut size) }; + let mut buf = vec![0u8; size]; + let list: LPPROC_THREAD_ATTRIBUTE_LIST = buf.as_mut_ptr().cast(); + if unsafe { InitializeProcThreadAttributeList(list, 1, 0, &mut size) } == 0 { + return Err(std::io::Error::last_os_error().into()); + } + let ok = unsafe { + UpdateProcThreadAttribute( + list, + 0, + PROC_THREAD_ATTRIBUTE_HANDLE_LIST as usize, + handles.as_mut_ptr().cast(), + std::mem::size_of_val(&handles), + std::ptr::null_mut(), + std::ptr::null(), + ) + }; + if ok == 0 { + let e = std::io::Error::last_os_error(); + unsafe { DeleteProcThreadAttributeList(list) }; + return Err(e.into()); + } + let mut si: STARTUPINFOEXW = unsafe { std::mem::zeroed() }; + si.StartupInfo.cb = std::mem::size_of::() as u32; + si.StartupInfo.dwFlags = STARTF_USESTDHANDLES; + si.StartupInfo.hStdInput = nul; + si.StartupInfo.hStdOutput = out; + si.StartupInfo.hStdError = out; + si.lpAttributeList = list; + let mut cmd = wide(std::ffi::OsStr::new(&super::command_line(exe, args))); + let dir = wide(cwd.as_os_str()); + let mut pi: PROCESS_INFORMATION = unsafe { std::mem::zeroed() }; + let created = unsafe { + CreateProcessW( + std::ptr::null(), + cmd.as_mut_ptr(), + std::ptr::null(), + std::ptr::null(), + 1, + CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP | EXTENDED_STARTUPINFO_PRESENT | CREATE_UNICODE_ENVIRONMENT, + std::ptr::null(), + dir.as_ptr(), + &si.StartupInfo, + &mut pi, + ) + }; + let error = unsafe { GetLastError() }; + unsafe { DeleteProcThreadAttributeList(list) }; + if created == 0 { + return Err(Error::Invalid(format!( + "{} could not be started (Windows error {error}).", + exe.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default() + ))); + } + unsafe { CloseHandle(pi.hThread) }; + Ok(Proc { pid: pi.dwProcessId, handle: pi.hProcess }) + })(); + unsafe { + CloseHandle(out); + CloseHandle(nul); + } + result + } + + impl Proc { + /// The exit code once the process has ended. + pub fn try_wait(&self) -> Option { + unsafe { + if WaitForSingleObject(self.handle, 0) != WAIT_OBJECT_0 { + return None; + } + let mut code = 0u32; + GetExitCodeProcess(self.handle, &mut code); + Some(code) + } + } + } + + impl Drop for Proc { + fn drop(&mut self) { + unsafe { CloseHandle(self.handle) }; + } + } +} + +#[cfg(windows)] +pub fn start(exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { + if let Some(dir) = log.parent() { + std::fs::create_dir_all(dir)?; + } + sys::start(exe, args, cwd, log) +} + +#[cfg(not(windows))] +pub fn start(_: &Path, _: &[&str], _: &Path, _: &Path) -> Result { + Err(Error::Invalid("The repack launcher runs on Windows only.".into())) +} + +#[cfg(not(windows))] +impl Proc { + pub fn try_wait(&self) -> Option { + Some(0) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn arguments_round_trip_through_the_windows_command_line() { + assert_eq!(quote("plain"), "plain"); + assert_eq!(quote("with space"), "\"with space\""); + assert_eq!(quote(""), "\"\""); + assert_eq!(quote(r#"a"b"#), r#""a\"b""#); + assert_eq!(quote(r"C:\dir with space\"), r#""C:\dir with space\\""#); + } + + #[cfg(windows)] + #[test] + fn a_started_process_writes_to_its_log_and_ends() { + let d = tempfile::tempdir().unwrap(); + let log = d.path().join("out.log"); + let cmd = std::path::PathBuf::from(std::env::var("ComSpec").unwrap_or_else(|_| r"C:\Windows\System32\cmd.exe".into())); + let p = start(&cmd, &["/c", "echo hello & exit 3"], d.path(), &log).unwrap(); + let until = std::time::Instant::now() + std::time::Duration::from_secs(10); + let code = loop { + if let Some(c) = p.try_wait() { + break c; + } + assert!(std::time::Instant::now() < until); + std::thread::sleep(std::time::Duration::from_millis(50)); + }; + assert_eq!(code, 3); + assert!(std::fs::read_to_string(&log).unwrap().contains("hello")); + } +} diff --git a/crates/coa-core/src/launcher/world.rs b/crates/coa-core/src/launcher/world.rs index 52667db..b86fb2d 100644 --- a/crates/coa-core/src/launcher/world.rs +++ b/crates/coa-core/src/launcher/world.rs @@ -6,11 +6,11 @@ //! the Python `BugReport/relay.py`, run through the repack's Python, until it is ported too. use std::path::Path; -use std::process::{Child, Command, Stdio}; use std::time::{Duration, Instant}; use crate::error::{Error, Result}; use crate::launcher::services::{self, ensure_free, mysql, spawn, start_mysql, wait_ready, Progress}; +use crate::launcher::spawn::Proc; use crate::launcher::{settings::Settings, squid, state}; fn stop_relay_flag(root: &Path) -> std::path::PathBuf { @@ -77,29 +77,14 @@ pub fn start_world(root: &Path, cfg: &Settings, offset: i32, supervisor: &Path, Ok(()) } -fn hidden(cmd: &mut Command) -> &mut Command { - #[cfg(windows)] - { - use std::os::windows::process::CommandExt; - cmd.creation_flags(0x0800_0000 | 0x0000_0200); - } - cmd -} - -fn spawn_child(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { - services::keep_std_handles_private(); - if let Some(dir) = log.parent() { - std::fs::create_dir_all(dir)?; - } - let out = std::fs::OpenOptions::new().create(true).append(true).open(log)?; - let err = out.try_clone()?; - let child = hidden(Command::new(exe).args(args).current_dir(cwd)).stdin(Stdio::null()).stdout(out).stderr(err).spawn()?; - state::record(root, name, child.id())?; +fn spawn_child(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { + let child = crate::launcher::spawn::start(exe, args, cwd, log)?; + state::record(root, name, child.pid)?; Ok(child) } /// The relay worker: the repack's Python running `Scripts/manage.py relay-worker` (BugReport/relay.py). -fn spawn_relay(root: &Path) -> Result { +fn spawn_relay(root: &Path) -> Result { let python = squid::package_root(root).join("Runtime/python/python.exe"); let manage = root.join("Scripts/manage.py"); if !python.is_file() || !manage.is_file() { @@ -112,13 +97,10 @@ fn spawn_relay(root: &Path) -> Result { /// The supervisor (`watch-world`): run the world, keep the relay alive while it runs, stop the relay after it. pub fn watch_world(root: &Path, log: Progress) -> Result<()> { squid::validate_bots(root)?; - let mut world = spawn_child(root, "world", &root.join("Core/worldserver.exe"), &["-c", "configs/worldserver.conf"], &root.join("Core"), &root.join("Core/Logs/world-console.log"))?; - let mut relay: Option = None; - while world.try_wait()?.is_none() { - let dead = match relay.as_mut() { - None => true, - Some(r) => r.try_wait()?.is_some(), - }; + let world = spawn_child(root, "world", &root.join("Core/worldserver.exe"), &["-c", "configs/worldserver.conf"], &root.join("Core"), &root.join("Core/Logs/world-console.log"))?; + let mut relay: Option = None; + while world.try_wait().is_none() { + let dead = relay.as_ref().is_none_or(|r| r.try_wait().is_some()); if dead { match spawn_relay(root) { Ok(r) => relay = Some(r), @@ -132,12 +114,12 @@ pub fn watch_world(root: &Path, log: Progress) -> Result<()> { std::thread::sleep(Duration::from_secs(2)); } std::fs::write(stop_relay_flag(root), b"")?; - if let Some(mut r) = relay { + if let Some(r) = relay { let until = Instant::now() + Duration::from_secs(40); - while r.try_wait()?.is_none() && Instant::now() < until { + while r.try_wait().is_none() && Instant::now() < until { std::thread::sleep(Duration::from_millis(250)); } - if r.try_wait()?.is_none() { + if r.try_wait().is_none() { // An interrupted POST stays uncertain in the relay's journal; it is not resent. if let Some(record) = state::running(root, "relay") { services::terminate(&record)?; From a822bfc99b661b8e32c33175d06156dac19db046 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: Tue, 10 Nov 2026 08:45:08 +0500 Subject: [PATCH 04/29] Manager starts and stops servers through the Rust launcher driver::run now calls coa-core::launcher::ops::run in-process instead of running Scripts/manage.py through launcher_bridge.py. Failures carry a typed code (Error::Service) instead of being guessed from stderr text. Moved into the launcher: realm profiles (realm id, name and databases from Settings/realm-profile.json), extra worlds sharing the main database, the shared world startup deadline and console readiness check, the owned-world check on shutdown, force-stop-all, and an environment block without AC_REALM_SERVER_PORT for update validation. The world supervisor is Scripts/coa-launcher.exe when the repack ships it, otherwise manage.py watch-world. Extra worlds get an unmodified manage.py. The realm patch of manage.py stays for the repack's own .bat files. Verified with examples/manager_launcher_e2e on a disposable repack. Co-Authored-By: Claude Opus 5.5 --- .../coa-core/examples/manager_launcher_e2e.rs | 141 ++++++++ crates/coa-core/src/driver.rs | 303 ++++-------------- crates/coa-core/src/error.rs | 4 + crates/coa-core/src/launcher/mod.rs | 1 + crates/coa-core/src/launcher/ops.rs | 88 +++++ crates/coa-core/src/launcher/render.rs | 14 +- crates/coa-core/src/launcher/services.rs | 83 +++-- crates/coa-core/src/launcher/settings.rs | 59 +++- crates/coa-core/src/launcher/spawn.rs | Bin 9221 -> 10622 bytes crates/coa-core/src/launcher/state.rs | 2 +- crates/coa-core/src/launcher/world.rs | 116 +++++-- crates/coa-core/src/launcher_bridge.py | 85 ----- crates/coa-core/src/multiworld.rs | 40 +-- crates/coa-core/src/realms.rs | 10 +- crates/coa-launcher/src/main.rs | 45 +-- 15 files changed, 545 insertions(+), 446 deletions(-) create mode 100644 crates/coa-core/examples/manager_launcher_e2e.rs create mode 100644 crates/coa-core/src/launcher/ops.rs delete mode 100644 crates/coa-core/src/launcher_bridge.py diff --git a/crates/coa-core/examples/manager_launcher_e2e.rs b/crates/coa-core/examples/manager_launcher_e2e.rs new file mode 100644 index 0000000..a9dc9f9 --- /dev/null +++ b/crates/coa-core/examples/manager_launcher_e2e.rs @@ -0,0 +1,141 @@ +//! The Manager's start/stop (`driver`) on the Rust launcher, on a DISPOSABLE repack: +//! +//! 1. driver start-all: every service runs, the console answers, manage.py is not touched and sees the services; +//! 2. driver stop-all stops everything; +//! 3. manage.py start-all, then driver stop-all stops what Python started; +//! 4. a taken world port fails with the typed "port in use" code (no stderr parsing), then stop-all; +//! 5. driver start-all, then the forced stop; +//! 6. with a realm profile: the realm row gets the profile's name, the .bat launcher is adapted as before; +//! 7. nothing of the repack is left running. +//! +//! usage: manager_launcher_e2e +use std::path::Path; +use std::process::Command; +use std::time::Instant; + +use coa_core::driver::{self, Verb}; +use coa_core::error::ErrorCode; +use coa_core::launcher::{services, settings::Settings, state}; + +fn indent(s: &str) -> String { + s.lines().map(|l| format!(" {l}")).collect::>().join("\n") +} + +fn drive(root: &Path, verb: Verb) -> driver::DriverOutcome { + let t = Instant::now(); + let out = driver::run(root, verb).expect("driver"); + println!("[driver {verb:?}] ok={} code={:?} in {:?}\n{}", out.ok, out.code, t.elapsed(), indent(&out.output)); + out +} + +fn manage(root: &Path, action: &str) -> (bool, String) { + let python = root.join("Runtime/python/python.exe"); + let script = root.join("Scripts/manage.py").to_string_lossy().into_owned(); + let t = Instant::now(); + let out = Command::new(python).args(["-B", &script, action]).output().unwrap(); + let text = String::from_utf8_lossy(&out.stdout).into_owned() + &String::from_utf8_lossy(&out.stderr); + println!("[manage.py {action}] ok={} in {:?}\n{}", out.status.success(), t.elapsed(), indent(&text)); + (out.status.success(), text) +} + +fn python_status(root: &Path) -> serde_json::Value { + let (ok, out) = manage(root, "status-json"); + assert!(ok); + let line = out.lines().rev().find(|l| l.trim_start().starts_with('{')).expect("a JSON status line"); + serde_json::from_str(line).unwrap() +} + +fn all(v: &serde_json::Value, running: bool) -> bool { + ["mysql", "auth", "world", "relay"].iter().all(|k| v[*k] == running) +} + +fn nothing_running(root: &Path) -> bool { + ["mysql", "auth", "world", "supervisor", "relay"].iter().all(|n| state::running(root, n).is_none()) + && ["mysql/bin/mysqld.exe", "Core/authserver.exe", "Core/worldserver.exe"] + .iter() + .all(|exe| coa_core::process::find_by_exe(&root.join(exe)).is_empty()) +} + +fn console(root: &Path) -> String { + let cfg = Settings::load(root, 0).unwrap(); + let mut ra = coa_core::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password).unwrap(); + ra.run("server info").unwrap() +} + +fn realm_name(root: &Path) -> String { + services::mysql(root, Some("SELECT name FROM acore_auth.realmlist WHERE id=1;"), None).unwrap() +} + +fn main() { + let a: Vec = std::env::args().skip(1).collect(); + let root = Path::new(&a[0]); + assert!(a[0].ends_with("-fixture"), "a folder ending in -fixture is required"); + assert!(nothing_running(root), "the fixture must be stopped before the test"); + let manage_py = root.join("Scripts/manage.py"); + let original = std::fs::read(&manage_py).unwrap(); + let profile = root.join("Settings/realm-profile.json"); + assert!(!profile.exists(), "the fixture starts without a realm profile"); + + // 1 + let started = drive(root, Verb::StartAll); + assert!(started.ok, "start-all"); + assert!(all(&python_status(root), true), "manage.py sees what the Manager started"); + let info = console(root); + println!("[console] {}", info.lines().next().unwrap_or("")); + assert_eq!(std::fs::read(&manage_py).unwrap(), original, "manage.py is not rewritten"); + assert_eq!(realm_name(root), "AzerothCore", "no profile: the launcher's own realm name"); + + // 2 + assert!(drive(root, Verb::StopAll).ok, "stop-all"); + assert!(nothing_running(root), "1-2 left something running"); + + // 3 + assert!(manage(root, "start-all").0); + assert!(drive(root, Verb::StopAll).ok, "driver stops what manage.py started"); + assert!(nothing_running(root), "3 left something running"); + + // 4 + let cfg = Settings::load(root, 0).unwrap(); + let blocker = std::net::TcpListener::bind(("127.0.0.1", cfg.world_port)).unwrap(); + let refused = drive(root, Verb::StartAll); + assert!(!refused.ok); + assert_eq!(refused.code, Some(ErrorCode::PortInUse), "typed port error"); + assert!(refused.output.contains(&format!("Port {}", cfg.world_port))); + drop(blocker); + assert!(drive(root, Verb::StopAll).ok); + assert!(nothing_running(root), "4 left something running"); + + // 5 + assert!(drive(root, Verb::StartAll).ok); + let t = Instant::now(); + let forced = driver::force_stop(root).expect("force stop"); + println!("[driver force_stop] ok={} in {:?}\n{}", forced.ok, t.elapsed(), indent(&forced.output)); + assert!(forced.ok && forced.output.contains("Force-stopped")); + assert!(nothing_running(root), "5 left something running"); + + // 6 + std::fs::write(&profile, br#"{"active":"coa","wildcard_created":false}"#).unwrap(); + let result = std::panic::catch_unwind(|| { + assert!(drive(root, Verb::StartAll).ok, "start-all with a realm profile"); + assert_eq!(realm_name(root), "Conquest of Azeroth"); + let patched = std::fs::read_to_string(&manage_py).unwrap(); + assert!(patched.contains("# coa-manager-realm-profiles-v2"), "the .bat launcher still follows the realm"); + let fix = "sys.path.insert(0, str(Path(__file__).resolve().parent))"; + assert_eq!( + patched.matches(fix).count(), + String::from_utf8_lossy(&original).matches(fix).count(), + "no bridge import fix added" + ); + assert!(drive(root, Verb::StopAll).ok); + }); + std::fs::remove_file(&profile).unwrap(); + std::fs::write(&manage_py, &original).unwrap(); + if result.is_err() { + let _ = driver::run(root, Verb::StopAll); + panic!("step 6 failed"); + } + + // 7 + assert!(nothing_running(root), "something of the repack is still running"); + println!("PASS: the Manager starts and stops through the Rust launcher, interoperates with manage.py, typed errors"); +} diff --git a/crates/coa-core/src/driver.rs b/crates/coa-core/src/driver.rs index 337f591..bb139fe 100644 --- a/crates/coa-core/src/driver.rs +++ b/crates/coa-core/src/driver.rs @@ -1,11 +1,10 @@ -//! Start/stop of a repack-shaped installation by delegating to the repack's own supervisor -//! (`Runtime\python\python.exe Scripts\manage.py `), which already implements config rendering, the -//! bug-report relay, RA graceful shutdown and readiness. Observation stays native (see `process`). +//! Start/stop of a repack-shaped installation through the repack launcher in this crate +//! ([`crate::launcher`]): config rendering, the services, the world supervisor, graceful shutdown and readiness. +//! It writes the same `.state` records as the repack's `Scripts/manage.py`, so the server's own `.bat` files and +//! this Manager can be used on the same folder. Observation stays native (see `process`). -use std::io::Read; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; -use std::time::{Duration, Instant}; +use std::path::Path; +use std::sync::Mutex; use serde::Serialize; @@ -22,22 +21,13 @@ pub enum Verb { } impl Verb { - fn arg(self) -> &'static str { + fn action(self) -> crate::launcher::ops::Action { + use crate::launcher::ops::Action; match self { - Verb::StartAll => "start-all", - Verb::StartMysql => "start-mysql", - Verb::StartWorld => "start-world", - Verb::StopAll => "stop-all", - } - } - - fn timeout(self, _root: &Path) -> Duration { - match self { - // Includes database startup, optional bot provisioning and the shared 25-minute - // world/console wait in launcher_bridge.py, even for older installed scripts. - Verb::StartAll | Verb::StartWorld => Duration::from_secs(3600), - Verb::StartMysql => Duration::from_secs(360), - Verb::StopAll => Duration::from_secs(240), + Verb::StartAll => Action::StartAll, + Verb::StartMysql => Action::StartMysql, + Verb::StartWorld => Action::StartWorld, + Verb::StopAll => Action::StopAll, } } } @@ -52,41 +42,14 @@ pub struct DriverOutcome { pub output: String, } -/// Map the launcher's own messages onto stable error codes. Unknown text stays `Unknown` (details remain visible). -pub fn translate(output: &str) -> ErrorCode { - let o = output.to_lowercase(); - if o.contains("is already used") { - ErrorCode::PortInUse - } else if o.contains("another start/stop action is in progress") - || o.contains("shutdown is still finishing") - { - ErrorCode::OperationInProgress - } else if o.contains("packaged database is missing") - || o.contains("extract the complete repack") - { - ErrorCode::ServerFilesIncomplete - } else if o.contains("stopped during startup") - || o.contains("is still starting") - || o.contains("world startup failed") - { - ErrorCode::StartupFailed - } else if o.contains("invalid port") || o.contains("unresolved placeholder") { - ErrorCode::InvalidConfigValue - } else { - ErrorCode::Unknown - } -} - -fn launcher(root: &Path) -> Result<(PathBuf, PathBuf)> { - let python = root.join("Runtime/python/python.exe"); - let script = root.join("Scripts/manage.py"); - if !python.is_file() || !script.is_file() { +fn has_launcher_settings(root: &Path) -> Result<()> { + if !root.join("Settings/repack.json").is_file() { return Err(Error::Invalid( "This server has no CoA Repack launcher; start/stop is not available for it yet." .into(), )); } - Ok((python, script)) + Ok(()) } /// Run a launcher verb to completion (blocking; call from a worker thread). @@ -205,108 +168,51 @@ fn run_inner_mode( if matches!(verb, Verb::StartAll | Verb::StartWorld) { crate::modules::ensure_bot_exclusivity(&root)?; } - let (python, script) = launcher(&root)?; + has_launcher_settings(&root)?; prepare_headless_world(&root, verb)?; - let original = std::fs::read_to_string(&script)?; - let patched = patch_launcher_imports(&original)?; - if original != patched { - fsx::atomic_write(&script, patched.as_bytes())?; - if let Ok(dir) = crate::registry::metadata_dir_for(&root) { - if let Ok((_, mut meta)) = crate::registry::MetaDir::open(&dir) { - if meta.original_hashes.get("Scripts/manage.py") - == Some(&fsx::sha256_bytes(original.as_bytes())) - { - meta.original_hashes.insert( - "Scripts/manage.py".into(), - fsx::sha256_bytes(patched.as_bytes()), - ); - fsx::atomic_write_json(&dir.join("install.json"), &meta)?; - } - } - } - } - discard_damaged_launcher_state(&root); if matches!(verb, Verb::StopAll | Verb::StartMysql | Verb::StartAll) { recover_mysql_launcher_state(&root, verb != Verb::StopAll)?; } if force { recover_world_for_forced_stop(&root)?; } - let mut cmd = Command::new(&python); - if validating_update { - // Isolated startup must use the port from its temporary auth config. - cmd.env_remove("AC_REALM_SERVER_PORT"); - } - cmd.arg("-B") - .arg("-c") - .arg(LAUNCH_SCRIPT) - .arg(&script) - .arg(if force { "force-stop-all" } else { verb.arg() }) - .current_dir(&root) - .stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()); - #[cfg(windows)] - { - use std::os::windows::process::CommandExt; - cmd.creation_flags(0x0800_0000); // CREATE_NO_WINDOW - } - tracing::info!(?verb, root = %root.display(), "driver: starting launcher verb"); - let mut child = cmd.spawn()?; - let mut stdout = child.stdout.take().expect("piped"); - let mut stderr = child.stderr.take().expect("piped"); - let out_t = std::thread::spawn(move || { - let mut s = String::new(); - let _ = stdout.read_to_string(&mut s); - s - }); - let err_t = std::thread::spawn(move || { - let mut s = String::new(); - let _ = stderr.read_to_string(&mut s); - s - }); - let deadline = Instant::now() + verb.timeout(&root); - let status = loop { - if let Some(st) = child.try_wait()? { - break Some(st); - } - if Instant::now() > deadline { - // Never kill the servers themselves: only abandon the launcher process we spawned. - let _ = child.kill(); - break None; - } - std::thread::sleep(Duration::from_millis(200)); - }; - let mut output = out_t.join().unwrap_or_default(); - output.push_str(&err_t.join().unwrap_or_default()); - let mut output = output.trim().to_string(); - if status.is_none() { - output.push_str(&format!( - "\nLauncher {} exceeded its {} second deadline; check the server logs.", - verb.arg(), - verb.timeout(&root).as_secs() - )); - } - let (ok, exit_code) = match status { - Some(st) => (st.success(), st.code()), - None => (false, None), - }; - let code = if ok { - None + let action = if force { + crate::launcher::ops::Action::ForceStopAll } else { - // Log evidence beats the launcher's generic "stopped during startup" message. - let base = if status.is_none() { - ErrorCode::StartupFailed - } else { - translate(&output) - }; - match base { - ErrorCode::StartupFailed | ErrorCode::Unknown => { - Some(crate::health::diagnose_installation(&root).unwrap_or(base)) + verb.action() + }; + tracing::info!(?verb, root = %root.display(), "driver: starting launcher action"); + let lines = Mutex::new(Vec::::new()); + let progress = |line: &str| { + tracing::info!(?verb, "launcher: {line}"); + lines.lock().unwrap_or_else(|e| e.into_inner()).push(line.to_string()); + }; + let result = crate::launcher::Settings::load(&root, 0).and_then(|mut cfg| { + if validating_update { + // Isolated startup must use the port from its temporary auth config. + cfg.env_remove.push("AC_REALM_SERVER_PORT".into()); + } + crate::launcher::ops::run(&root, &cfg, 0, action, None, &progress) + }); + let mut output = lines.into_inner().unwrap_or_else(|e| e.into_inner()).join("\n"); + let ok = result.is_ok(); + let code = match &result { + Ok(()) => None, + Err(error) => { + if !output.is_empty() { + output.push('\n'); + } + output.push_str(&format!("ERROR: {error}")); + // Log evidence beats a generic "stopped during startup". + match error.code() { + ErrorCode::StartupFailed | ErrorCode::Unknown => Some( + crate::health::diagnose_installation(&root).unwrap_or(error.code()), + ), + other => Some(other), } - other => Some(other), } }; + let exit_code = Some(if ok { 0 } else { 1 }); if code == Some(ErrorCode::PortInUse) { let observed = crate::process::observe(&root, &crate::layout::read_ports(&root)); for service in [&observed.mysql, &observed.auth, &observed.world] @@ -374,35 +280,6 @@ fn prepare_headless_world(root: &Path, verb: Verb) -> Result<()> { Ok(()) } -/// 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 -} - /// A lost launcher record must not hide this installation's running MySQL from /// graceful shutdown. Adopt only the exact executable owning its configured port. fn recover_mysql_launcher_state(root: &Path, prefer_listener: bool) -> Result<()> { @@ -453,8 +330,8 @@ fn recover_mysql_launcher_state(root: &Path, prefer_listener: bool) -> Result<() Ok(()) } -const LAUNCH_SCRIPT: &str = include_str!("launcher_bridge.py"); - +/// The import fix older Managers wrote into `Scripts/manage.py` (needed only to run it through their bridge). It +/// is no longer applied; it stays so that file checks still recognise a file it changed. pub(crate) fn patch_launcher_imports(text: &str) -> Result { let line = "sys.path.insert(0, str(Path(__file__).resolve().parent))"; if !text.contains("from squid_playerbots import") || text.contains(line) { @@ -608,7 +485,7 @@ mod tests { text.contains("launcher request failed before completion") && text.contains("in progress") ); - assert!(!text.contains("starting launcher verb")); + assert!(!text.contains("starting launcher action")); } #[test] @@ -665,78 +542,10 @@ mod tests { } #[test] - fn slow_world_startup_has_time_with_either_bot_system_without_extending_shutdown() { - let folder = tempfile::tempdir().unwrap(); - let modules = folder.path().join("Core/configs/modules"); - std::fs::create_dir_all(&modules).unwrap(); - std::fs::write( - modules.join("playerbots.conf.dist"), - "AiPlayerbot.Enabled = 1\n", - ) - .unwrap(); - assert_eq!( - Verb::StartAll.timeout(folder.path()), - Duration::from_secs(3600) - ); - assert_eq!( - Verb::StopAll.timeout(folder.path()), - Duration::from_secs(240) - ); - std::fs::write(modules.join("playerbots.conf"), "AiPlayerbot.Enabled = 0\n").unwrap(); - assert_eq!( - Verb::StartWorld.timeout(folder.path()), - Duration::from_secs(3600) - ); - assert_eq!( - Verb::StartMysql.timeout(folder.path()), - Duration::from_secs(360) - ); - } - - #[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 - ); - assert_eq!( - translate("Another start/stop action is in progress."), - ErrorCode::OperationInProgress - ); - assert_eq!( - translate("The packaged database is missing. Extract the complete repack."), - ErrorCode::ServerFilesIncomplete - ); - assert_eq!( - translate("world stopped during startup. Check its log."), - ErrorCode::StartupFailed - ); - assert_eq!(translate("Exit code -1073741819"), ErrorCode::Unknown); + fn launcher_failures_carry_their_error_code() { + let e = Error::Service(ErrorCode::PortInUse, "Port 8085 is already used (PID 4).".into()); + assert_eq!(e.code(), ErrorCode::PortInUse); + assert_eq!(e.to_string(), "Port 8085 is already used (PID 4)."); } #[test] diff --git a/crates/coa-core/src/error.rs b/crates/coa-core/src/error.rs index 08769d8..5e648f8 100644 --- a/crates/coa-core/src/error.rs +++ b/crates/coa-core/src/error.rs @@ -24,6 +24,9 @@ pub enum Error { UnknownInstallation(String), #[error("{0}")] Invalid(String), + /// A server start or stop failed for a reason the UI can explain (the repack launcher's own errors). + #[error("{1}")] + Service(ErrorCode, String), #[error("package not published: {0}")] PackageNotPublished(String), #[error("download server unreachable: {0}")] @@ -199,6 +202,7 @@ impl Error { Error::PackageNotPublished(_) => ErrorCode::PackageNotPublished, Error::NetworkUnreachable(_) => ErrorCode::NetworkUnreachable, Error::BotModulesConflict => ErrorCode::BotModulesConflict, + Error::Service(code, _) => *code, Error::CompanionTemplatesMissing => ErrorCode::CompanionTemplatesMissing, Error::CompanionCommandUnsupported => ErrorCode::CompanionCommandUnsupported, _ => ErrorCode::Unknown, diff --git a/crates/coa-core/src/launcher/mod.rs b/crates/coa-core/src/launcher/mod.rs index 900e8f6..778b455 100644 --- a/crates/coa-core/src/launcher/mod.rs +++ b/crates/coa-core/src/launcher/mod.rs @@ -11,6 +11,7 @@ //! State files are written with a flush to disk before they replace the old ones (`manage.py` did not, and a //! power cut could leave a zero-filled record that stopped every later start). +pub mod ops; pub mod render; pub mod services; pub mod settings; diff --git a/crates/coa-core/src/launcher/ops.rs b/crates/coa-core/src/launcher/ops.rs new file mode 100644 index 0000000..9e78be8 --- /dev/null +++ b/crates/coa-core/src/launcher/ops.rs @@ -0,0 +1,88 @@ +//! One start/stop action of a repack, with the control lock held (`manage.py main()`): the entry point of both +//! `coa-launcher.exe` and the Manager. + +use std::path::Path; +use std::time::Duration; + +use crate::error::Result; +use crate::launcher::services::{self, Progress}; +use crate::launcher::world::{self, Supervisor}; +use crate::launcher::{render, settings::Settings, squid, state}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Action { + StartAll, + StartMysql, + StartAuth, + StartWorld, + StopAll, + /// Stop the world without its console first (unsaved progress is lost), then everything else. + ForceStopAll, + Prepare, +} + +impl Action { + /// The command name, as the `.bat` files and `manage.py` call it. + pub fn name(self) -> &'static str { + match self { + Action::StartAll => "start-all", + Action::StartMysql => "start-mysql", + Action::StartAuth => "start-auth", + Action::StartWorld => "start-world", + Action::StopAll => "stop-all", + Action::ForceStopAll => "force-stop-all", + Action::Prepare => "prepare", + } + } + + pub fn parse(name: &str) -> Option { + [ + Action::StartAll, + Action::StartMysql, + Action::StartAuth, + Action::StartWorld, + Action::StopAll, + Action::ForceStopAll, + Action::Prepare, + ] + .into_iter() + .find(|a| a.name() == name) + } +} + +/// Run `action`. A started world is supervised by `supervisor`, or by what the repack ships when it is `None`. +pub fn run(root: &Path, cfg: &Settings, offset: i32, action: Action, supervisor: Option<&Supervisor>, progress: Progress) -> Result<()> { + let _lock = state::ControlLock::acquire(root, action.name(), Duration::from_secs(30), progress)?; + match action { + // Shutdown uses the existing client and console settings: the templates may be exactly what a recovery + // needs to replace, so nothing is rendered. + Action::StopAll => return services::stop_all(root, cfg, progress), + Action::ForceStopAll => return services::force_stop_all(root, cfg, progress), + _ => {} + } + if matches!(action, Action::StartAll | Action::StartWorld) { + squid::validate_bots(root)?; + } + render::prepare(root, cfg)?; + if action == Action::Prepare { + return Ok(()); + } + if matches!(action, Action::StartAll | Action::StartMysql) { + services::start_mysql(root, cfg, progress)?; + } + if matches!(action, Action::StartAll | Action::StartAuth) { + services::start_auth(root, cfg, progress)?; + } + if matches!(action, Action::StartAll | Action::StartWorld) { + let shipped; + let supervisor = match supervisor { + Some(s) => s, + None => { + shipped = Supervisor::of(root)?; + &shipped + } + }; + world::start_world(root, cfg, offset, supervisor, progress)?; + } + Ok(()) +} diff --git a/crates/coa-core/src/launcher/render.rs b/crates/coa-core/src/launcher/render.rs index ef14740..a333eeb 100644 --- a/crates/coa-core/src/launcher/render.rs +++ b/crates/coa-core/src/launcher/render.rs @@ -106,7 +106,11 @@ pub fn prepare(root: &Path, config: &Settings) -> Result> { ("WORLD_PORT", config.world_port.to_string()), ("RA_PORT", config.ra_port.to_string()), ]; - for (key, db) in [("LoginDatabaseInfo", "acore_auth"), ("WorldDatabaseInfo", "acore_world"), ("CharacterDatabaseInfo", "acore_characters")] { + for (key, db) in [ + ("LoginDatabaseInfo", "acore_auth"), + ("WorldDatabaseInfo", config.realm.world_db), + ("CharacterDatabaseInfo", config.realm.characters_db), + ] { values.push((key, format!("127.0.0.1;{mysql_port};acore;{app_password};{db}"))); } let mut written = Vec::new(); @@ -127,10 +131,10 @@ pub fn prepare(root: &Path, config: &Settings) -> Result> { unresolved.sort(); unresolved.dedup(); if !unresolved.is_empty() { - return Err(Error::Invalid(format!( - "An unresolved placeholder remains in Settings/{name}.template: {}", - unresolved.join(", ") - ))); + return Err(Error::Service( + crate::error::ErrorCode::InvalidConfigValue, + format!("An unresolved placeholder remains in Settings/{name}.template: {}", unresolved.join(", ")), + )); } // these three keep "\n" (Python wrote them with newline="\n") std::fs::write(root.join(target), text.as_bytes())?; diff --git a/crates/coa-core/src/launcher/services.rs b/crates/coa-core/src/launcher/services.rs index c22e558..274b827 100644 --- a/crates/coa-core/src/launcher/services.rs +++ b/crates/coa-core/src/launcher/services.rs @@ -6,7 +6,7 @@ use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::time::{Duration, Instant}; -use crate::error::{Error, Result}; +use crate::error::{Error, ErrorCode, Result}; use crate::launcher::{settings::Settings, state}; use crate::process::ProcessIdentity; @@ -24,9 +24,10 @@ fn hidden(cmd: &mut Command) -> &mut Command { cmd } -/// Start `exe` with its output appended to `log`, and record it as `name`. -pub fn spawn(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { - let child = crate::launcher::spawn::start(exe, args, cwd, log)?; +/// Start `exe` with its output appended to `log`, and record it as `name`. `env_remove` are variables of this +/// process the service must not see. +pub fn spawn(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path, env_remove: &[String]) -> Result { + let child = crate::launcher::spawn::start(exe, args, cwd, log, env_remove)?; state::record(root, name, child.pid) } @@ -50,10 +51,10 @@ pub fn ensure_free(port: u16, progress: Progress) -> Result<()> { owners.dedup(); if owners.iter().any(|p| *p != 0) { let list: Vec = owners.iter().map(u32::to_string).collect(); - return Err(Error::Invalid(format!( - "Port {port} is already used (PID {}). Stop the other server or change Settings/repack.json.", - list.join(", ") - ))); + return Err(Error::Service( + ErrorCode::PortInUse, + format!("Port {port} is already used (PID {}). Stop the other server or change Settings/repack.json.", list.join(", ")), + )); } match sys::exclusive_bind(port) { Ok(()) => return Ok(()), @@ -111,13 +112,14 @@ pub fn wait_ready(root: &Path, name: &str, port: u16, seconds: u64) -> Result<() return Ok(()); } if state::running(root, name).is_none() { - return Err(Error::Invalid(format!("{name} stopped during startup. Check its log."))); + return Err(Error::Service(ErrorCode::StartupFailed, format!("{name} stopped during startup. Check its log."))); } std::thread::sleep(Duration::from_millis(500)); } - Err(Error::Invalid(format!( - "{name} is still starting: its expected TCP listener on port {port} was not found; check its log." - ))) + Err(Error::Service( + ErrorCode::StartupFailed, + format!("{name} is still starting: its expected TCP listener on port {port} was not found; check its log."), + )) } // --------------------------------------------------------------------------------------------------------------- @@ -191,6 +193,12 @@ pub fn mysql(root: &Path, sql: Option<&str>, admin: Option<&str>) -> Result Result<()> { + if cfg.shared_database { + // An extra world uses the main folder's database; it must already run. + return mysql(root, None, Some("ping")).map(|_| ()).map_err(|e| { + Error::Service(ErrorCode::DatabaseNotRunning, format!("The main server's database is not running. {e}")) + }); + } if state::running(root, "mysql").is_some() { wait_ready(root, "mysql", cfg.mysql_port, 300)?; mysql(root, None, Some("ping"))?; @@ -199,18 +207,18 @@ pub fn start_mysql(root: &Path, cfg: &Settings, progress: Progress) -> Result<() } ensure_free(cfg.mysql_port, progress)?; if !root.join("mysql/data/mysql").is_dir() { - return Err(Error::Invalid("The packaged database is missing. Extract the complete repack.".into())); + return Err(Error::Service(ErrorCode::ServerFilesIncomplete, "The packaged database is missing. Extract the complete repack.".into())); } progress("Starting MySQL..."); let ini = format!("--defaults-file={}", root.join("mysql/my.ini").display()); - spawn(root, "mysql", &root.join("mysql/bin/mysqld.exe"), &[&ini, "--no-monitor"], &root.join("mysql"), &root.join("mysql/logs/startup.log"))?; + spawn(root, "mysql", &root.join("mysql/bin/mysqld.exe"), &[&ini, "--no-monitor"], &root.join("mysql"), &root.join("mysql/logs/startup.log"), &cfg.env_remove)?; wait_ready(root, "mysql", cfg.mysql_port, 300)?; mysql(root, None, Some("ping"))?; mysql( root, Some(&format!( - "UPDATE acore_auth.realmlist SET name='AzerothCore',address='127.0.0.1',localAddress='127.0.0.1',port={} WHERE id=1;", - cfg.world_port + "UPDATE acore_auth.realmlist SET name='{}',address='127.0.0.1',localAddress='127.0.0.1',port={} WHERE id={};", + cfg.realm.name, cfg.world_port, cfg.realm.id )), None, )?; @@ -226,9 +234,9 @@ pub fn start_auth(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> } ensure_free(cfg.auth_port, progress)?; // An interrupted world startup can leave flag 3, which authserver excludes. - mysql(root, Some("UPDATE acore_auth.realmlist SET flag=0 WHERE id=1;"), None)?; + mysql(root, Some(&format!("UPDATE acore_auth.realmlist SET flag=0 WHERE id={};", cfg.realm.id)), None)?; progress("Starting authserver..."); - spawn(root, "auth", &root.join("Core/authserver.exe"), &["-c", "configs/authserver.conf"], &root.join("Core"), &root.join("Core/Logs/auth-console.log"))?; + spawn(root, "auth", &root.join("Core/authserver.exe"), &["-c", "configs/authserver.conf"], &root.join("Core"), &root.join("Core/Logs/auth-console.log"), &cfg.env_remove)?; wait_ready(root, "auth", cfg.auth_port, 60) } @@ -248,9 +256,40 @@ pub fn wait_stopped(record: &ProcessIdentity, seconds: u64) -> bool { !crate::process::is_alive(record) } -/// Stop everything of this repack, world first (gracefully through its console), its database last. +/// The recorded world, when it is this folder's own `Core/worldserver.exe` (never stop a process only because a +/// record names it). +fn owned_world(root: &Path) -> Result> { + let Some(world) = state::running(root, "world") else { return Ok(None) }; + let expected = root.join("Core/worldserver.exe"); + let same = std::fs::canonicalize(&world.exe).ok().zip(std::fs::canonicalize(&expected).ok()).is_some_and(|(a, b)| a == b); + if !same { + return Err(Error::Invalid("World process ownership could not be verified; the database was left running.".into())); + } + Ok(Some(world)) +} + +/// Stop this folder's world without its console (unsaved progress since the last save is lost). +fn stop_world_process(world: &ProcessIdentity) -> Result<()> { + terminate(world).map_err(|_| Error::Invalid("Worldserver could not be stopped safely; its database was left running.".into()))?; + if !wait_stopped(world, 90) { + return Err(Error::Invalid("Worldserver is still stopping; its database was left running.".into())); + } + Ok(()) +} + +/// Stop the world at once, then everything else as [`stop_all`] does. Only when the user asked for it. +pub fn force_stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { + if let Some(world) = owned_world(root)? { + stop_world_process(&world)?; + progress("Force-stopped this server's verified world process; unsaved progress may be lost."); + } + stop_all(root, cfg, progress) +} + +/// Stop everything of this repack, world first (gracefully through its console), its database last. An extra +/// world leaves the shared database alone. pub fn stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { - if let Some(world) = state::running(root, "world") { + if let Some(world) = owned_world(root)? { let asked = ready(root, "world", cfg.ra_port) .then(|| crate::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password)) .and_then(|r| r.ok()) @@ -259,7 +298,7 @@ pub fn stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { Some(Ok(())) => progress("Graceful world shutdown requested."), _ => { progress("World console unavailable; stopping this repack's recorded world process."); - terminate(&world)?; + stop_world_process(&world)?; } } if !wait_stopped(&world, 90) { @@ -283,7 +322,7 @@ pub fn stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { return Err(Error::Invalid("Authserver did not stop.".into())); } } - if let Some(database) = state::running(root, "mysql") { + if let Some(database) = state::running(root, "mysql").filter(|_| !cfg.shared_database) { let shutdown = mysql(root, None, Some("shutdown")); if !wait_stopped(&database, 60) { shutdown?; diff --git a/crates/coa-core/src/launcher/settings.rs b/crates/coa-core/src/launcher/settings.rs index 31dfe44..14097f4 100644 --- a/crates/coa-core/src/launcher/settings.rs +++ b/crates/coa-core/src/launcher/settings.rs @@ -6,6 +6,40 @@ use crate::error::{Error, Result}; pub const PORT_KEYS: [&str; 4] = ["mysqlPort", "authPort", "worldPort", "raPort"]; +/// The realm a folder runs: its row in `acore_auth.realmlist` and its two game databases. +/// +/// Without `Settings/realm-profile.json` this is what the repack launcher always did (realm 1 "AzerothCore" on +/// `acore_world`/`acore_characters`). With it, the active profile decides, as the Manager's realm patch of +/// `manage.py` did. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Realm { + pub id: u32, + pub name: &'static str, + pub world_db: &'static str, + pub characters_db: &'static str, +} + +impl Realm { + pub fn load(root: &Path) -> Result { + let path = root.join("Settings/realm-profile.json"); + if !path.exists() { + return Ok(Realm { id: 1, name: "AzerothCore", world_db: "acore_world", characters_db: "acore_characters" }); + } + let v: serde_json::Value = crate::fsx::read_json(&path)?; + Ok(match v.get("active").and_then(|a| a.as_str()).unwrap_or("coa") { + "wildcard" => Realm { id: 2, name: "Wildcard", world_db: "acore_world_wildcard", characters_db: "acore_characters_wildcard" }, + "reborn" => Realm { id: 3, name: "Warcraft Reborn", world_db: "acore_world_reborn", characters_db: "acore_characters_reborn" }, + _ => Realm { id: 1, name: "Conquest of Azeroth", world_db: "acore_world", characters_db: "acore_characters" }, + }) + } +} + +/// An extra world of a server (`/.realms/`): it shares the main folder's database and never +/// starts or stops it. +pub fn is_extra_world(root: &Path) -> bool { + root.parent().and_then(|p| p.file_name()).is_some_and(|n| n == ".realms") +} + #[derive(Debug, Clone, PartialEq, Eq)] pub struct Settings { pub mysql_port: u16, @@ -14,6 +48,12 @@ pub struct Settings { pub ra_port: u16, pub ra_username: String, pub ra_password: String, + pub realm: Realm, + /// The database belongs to the main folder of this server (an extra world): it is only checked, never + /// started. + pub shared_database: bool, + /// Environment variables the started services must not see (for example a port override of the caller). + pub env_remove: Vec, /// The whole document, for keys this code does not know (kept when it is written back). pub raw: serde_json::Map, } @@ -35,7 +75,7 @@ impl Settings { let shifted = value.map(|v| v + i64::from(offset)); match shifted { Some(p) if p > 1024 && p < 65536 => ports[i] = p as u16, - _ => return Err(Error::Invalid("Invalid port in Settings/repack.json".into())), + _ => return Err(Error::Service(crate::error::ErrorCode::InvalidConfigValue, "Invalid port in Settings/repack.json".into())), } } let mut unique = ports.to_vec(); @@ -52,6 +92,9 @@ impl Settings { ra_port: ports[3], ra_username: text_of("raUsername"), ra_password: text_of("raPassword"), + realm: Realm::load(root)?, + shared_database: is_extra_world(root), + env_remove: Vec::new(), raw, }) } @@ -108,4 +151,18 @@ mod tests { assert!(Settings::load(d.path(), 1).is_err(), "65536 after the offset"); assert!(Settings::load(d.path(), 0).is_ok(), "a byte order mark is accepted"); } + + #[test] + fn the_realm_follows_the_active_profile() { + let d = tempfile::tempdir().unwrap(); + assert_eq!(Realm::load(d.path()).unwrap().name, "AzerothCore"); + std::fs::create_dir_all(d.path().join("Settings")).unwrap(); + for (active, id, db) in [("coa", 1, "acore_world"), ("wildcard", 2, "acore_world_wildcard"), ("reborn", 3, "acore_world_reborn")] { + std::fs::write(d.path().join("Settings/realm-profile.json"), format!("{{\"active\":\"{active}\"}}")).unwrap(); + let r = Realm::load(d.path()).unwrap(); + assert_eq!((r.id, r.world_db), (id, db)); + } + assert!(is_extra_world(&d.path().join(".realms/secondary"))); + assert!(!is_extra_world(d.path())); + } } diff --git a/crates/coa-core/src/launcher/spawn.rs b/crates/coa-core/src/launcher/spawn.rs index 763bcde48f083f528acc289fe9f11164643a3d8f..6af680e9f4b0e42d308a678b0b06a72533b9ab50 100644 GIT binary patch delta 1519 zcma)6L2nyH6i%s-k&ALb(DXp6=dGH|N@fF!#9@mAQ5&g9C8=;q4k4PI>^{dMuV=P9 zV>=;^d_Y{e>>ucz3z839xWG^12O!?;+O;befe${s`QG=w`R0B5)6>7d{q>#NWM^jw zj=R!8mg^Xe**1V`D08j)s4R@6?dpLA+eL_S?CT*$phO=Huvqsqkz?{26bpk*5C%@9 zO7zG;qS5$GFgmvc6Q=H_%@6T1!+2s%*&!f$oTIS#ypnMe!Fj6VUI@|Q{x=7$p-2a~ z76ifCS`^eDoW`9CHmauhXZ4O+7R}2}R;dkP>$GiisV>fZ_+$^h!}yEAXP@uEbsgwe zd|&e?DO%{$C5Iw6VToYICSlm=$S^!IRXbf{rRMKJt16RcVd(m~Hq0-n9evP|sl}X) zS+5D)A48*36-Zb01EH?ic#@By7g)_rsgtMLm@7KOmt0;bog)_}mXbSrS?>Ew^s!D; zj4ksYl_Q;iz`4!OuXqoMdp`GV{4{ZpWtdM&Vt>XlH={I>u1AK2p~BI8Mn~u1Scg7H zRa!Q)(%rXg3h>gRN?0#I73&1~NG8bU{0mq%FkMD(F(IdO-Dl_9t?gCRjBNOS$UdFj z;ihy$c4m5{;n>eCdAcIiY1n3O_EncC)y)seQnA1J;q-&r&$W%FTQ|P4VAEIYztx`6 z5!uEX3rMgK;0Kf>#l~YW1F}902{jMfY;PBRzF++D(cS6k-QRCLqG})v&Fs)-^hL&X zUM*>6iA4?4lu^>gI0ke$suGSKmUg3njg4vR-h1zsVQ*WJTZr(Ig6z@_QK~N@ms)8J zP}Z}7ZNlM;XY-O&Wksljz5@UGp@Za`6R~^P_13! eq9?_9ia>9ow1vzyC!kdb*VKOF-FcmcoBBW7kn4v4 delta 126 zcmewt)atQ;iG6bb*F1Jc&B=Mf(wh~9X0vaWk~+XRSwUKDvyKc0>*S@1eqc%Q$x2Fv zljke>LwK7-l&hF0pHb78%%d(f`JAf6=0x>mMvlbd;?$xNMUBblG}L7ElJoOQ5;OCP XHIy<^b8_;PG&QZc6o8 " Owner information is unavailable.".into(), }; if Instant::now() >= deadline { - return Err(Error::Invalid(format!("Another start/stop action is in progress.{detail}"))); + return Err(Error::Service(crate::error::ErrorCode::OperationInProgress, format!("Another start/stop action is in progress.{detail}"))); } if !announced { progress(&format!("Waiting for the current server action.{detail}")); diff --git a/crates/coa-core/src/launcher/world.rs b/crates/coa-core/src/launcher/world.rs index b86fb2d..724fa31 100644 --- a/crates/coa-core/src/launcher/world.rs +++ b/crates/coa-core/src/launcher/world.rs @@ -2,13 +2,15 @@ //! and the detailed-logging switch (`debug_logs`). //! //! A world is started through a supervisor process that outlives the caller: it starts `worldserver.exe`, keeps -//! the relay running while the world runs, and stops the relay when the world ends. The relay itself is still -//! the Python `BugReport/relay.py`, run through the repack's Python, until it is ported too. +//! the relay running while the world runs, and stops the relay when the world ends. The supervisor is +//! `coa-launcher.exe watch-world`, or `manage.py watch-world` on a repack that does not ship it yet (both write +//! the same records). The relay itself is still the Python `BugReport/relay.py`, run through the repack's +//! Python, until it is ported too. -use std::path::Path; +use std::path::{Path, PathBuf}; use std::time::{Duration, Instant}; -use crate::error::{Error, Result}; +use crate::error::{Error, ErrorCode, Result}; use crate::launcher::services::{self, ensure_free, mysql, spawn, start_mysql, wait_ready, Progress}; use crate::launcher::spawn::Proc; use crate::launcher::{settings::Settings, squid, state}; @@ -31,54 +33,120 @@ pub fn wait_relay(root: &Path) -> Result<()> { Err(Error::Invalid("Bug-report relay is not ready; check BugReport/Logs/relay.log.".into())) } -/// Start the world (and its database). `supervisor` is the launcher executable that runs `watch-world`. -pub fn start_world(root: &Path, cfg: &Settings, offset: i32, supervisor: &Path, progress: Progress) -> Result<()> { +/// The process that runs `watch-world` for a started world. +#[derive(Debug, Clone)] +pub enum Supervisor { + /// `coa-launcher.exe` (this crate's launcher). + Launcher(PathBuf), + /// The repack's Python with `Scripts/manage.py`. + Python { python: PathBuf, script: PathBuf }, +} + +impl Supervisor { + /// The supervisor a repack ships: `Scripts/coa-launcher.exe` when present, otherwise its Python launcher. + pub fn of(root: &Path) -> Result { + let exe = root.join("Scripts/coa-launcher.exe"); + if exe.is_file() { + return Ok(Supervisor::Launcher(exe)); + } + let python = squid::package_root(root).join("Runtime/python/python.exe"); + let script = root.join("Scripts/manage.py"); + if python.is_file() && script.is_file() { + return Ok(Supervisor::Python { python, script }); + } + Err(Error::Service( + ErrorCode::ServerFilesIncomplete, + "This server has no world supervisor (Scripts/coa-launcher.exe or Scripts/manage.py). Repair its program files.".into(), + )) + } +} + +/// How long a world may take to open both of its listeners, together: slow worlds (many bots, a cold disk) are +/// common, and the limit must not depend on the bot module. +const WORLD_STARTUP_SECONDS: u64 = 1500; + +/// Wait until the world's console answers a command (it can listen before it accepts logins). +fn wait_console(root: &Path, cfg: &Settings, until: Instant) -> Result<()> { + let mut last = String::new(); + while Instant::now() < until { + if state::running(root, "world").is_none() { + return Err(Error::Service( + ErrorCode::StartupFailed, + "World startup failed: worldserver stopped before its console accepted commands.".into(), + )); + } + match crate::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password).and_then(|mut ra| ra.run("server info")) { + Ok(_) => return Ok(()), + Err(e) => last = e.to_string(), + } + std::thread::sleep(Duration::from_millis(500)); + } + Err(Error::Service(ErrorCode::StartupFailed, format!("World startup failed: its console is still starting. {last}"))) +} + +fn seconds_until(until: Instant) -> u64 { + until.saturating_duration_since(Instant::now()).as_secs() +} + +/// Start the world (and its database, unless it is shared), and wait until its console accepts commands. +pub fn start_world(root: &Path, cfg: &Settings, offset: i32, supervisor: &Supervisor, progress: Progress) -> Result<()> { start_mysql(root, cfg, progress)?; squid::validate_bots(root)?; - let seconds = squid::startup_timeout(root); + let until = Instant::now() + Duration::from_secs(squid::startup_timeout(root).max(WORLD_STARTUP_SECONDS)); if state::running(root, "world").is_some() { if state::running(root, "supervisor").is_none() { - return Err(Error::Invalid("Worldserver has no repack supervisor. Use Stop_All_Server.bat before restarting it.".into())); + return Err(Error::Service( + ErrorCode::WorldserverAlreadyRunning, + "Worldserver has no repack supervisor. Use Stop_All_Server.bat before restarting it.".into(), + )); } - wait_ready(root, "world", cfg.world_port, seconds)?; + wait_ready(root, "world", cfg.world_port, seconds_until(until))?; wait_relay(root)?; + wait_console(root, cfg, until)?; progress("Worldserver and bug-report relay are already running."); return Ok(()); } ensure_free(cfg.world_port, progress)?; ensure_free(cfg.ra_port, progress)?; if state::running(root, "supervisor").is_some() || state::running(root, "relay").is_some() { - return Err(Error::Invalid("The previous world/relay shutdown is still finishing. Try again shortly.".into())); + return Err(Error::Service( + ErrorCode::OperationInProgress, + "The previous world/relay shutdown is still finishing. Try again shortly.".into(), + )); } squid::prepare_playerbots(root, cfg.mysql_port, &|sql| mysql(root, Some(sql), None), progress)?; progress("Starting worldserver and its bug-report relay..."); let _ = std::fs::remove_file(stop_relay_flag(root)); let offset_text = offset.to_string(); let root_text = root.to_string_lossy().into_owned(); - spawn( - root, - "supervisor", - supervisor, - &["--root", &root_text, "--port-offset", &offset_text, "watch-world"], - root, - &root.join("Core/Logs/supervisor.log"), - )?; - let until = Instant::now() + Duration::from_secs(20); - while state::running(root, "world").is_none() && Instant::now() < until { + let log = root.join("Core/Logs/supervisor.log"); + match supervisor { + Supervisor::Launcher(exe) => { + spawn(root, "supervisor", exe, &["--root", &root_text, "--port-offset", &offset_text, "watch-world"], root, &log, &cfg.env_remove)? + } + Supervisor::Python { python, script } => { + let script = script.to_string_lossy().into_owned(); + spawn(root, "supervisor", python, &["-B", &script, "--port-offset", &offset_text, "watch-world"], root, &log, &cfg.env_remove)? + } + }; + let first = Instant::now() + Duration::from_secs(20); + while state::running(root, "world").is_none() && Instant::now() < first { if state::running(root, "supervisor").is_none() { - return Err(Error::Invalid("World startup failed; check Core/Logs/supervisor.log.".into())); + return Err(Error::Service(ErrorCode::StartupFailed, "World startup failed; check Core/Logs/supervisor.log.".into())); } std::thread::sleep(Duration::from_millis(250)); } - wait_ready(root, "world", cfg.world_port, seconds)?; - wait_ready(root, "world", cfg.ra_port, seconds)?; + wait_ready(root, "world", cfg.world_port, seconds_until(until))?; + wait_ready(root, "world", cfg.ra_port, seconds_until(until))?; wait_relay(root)?; + wait_console(root, cfg, until)?; progress("Worldserver and automatic bug reporting are ready."); Ok(()) } fn spawn_child(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log: &Path) -> Result { - let child = crate::launcher::spawn::start(exe, args, cwd, log)?; + // The supervisor was started with the environment its services should have. + let child = crate::launcher::spawn::start(exe, args, cwd, log, &[])?; state::record(root, name, child.pid)?; Ok(child) } diff --git a/crates/coa-core/src/launcher_bridge.py b/crates/coa-core/src/launcher_bridge.py deleted file mode 100644 index 3c003a1..0000000 --- a/crates/coa-core/src/launcher_bridge.py +++ /dev/null @@ -1,85 +0,0 @@ -import runpy -import sys -import time -from pathlib import Path - -script = sys.argv[1] -sys.path.insert(0, str(Path(script).resolve().parent)) -sys.argv = sys.argv[1:] -launcher = runpy.run_path(script, run_name="coa_manager_launcher") -original_wait = launcher["wait_ready"] -world_deadline = None - - -def wait_ready(name, port, seconds=180): - global world_deadline - if name == "mysql": - seconds = max(seconds, 300) - elif name == "world": - # Both game and console listeners belong to one startup, including on old repacks. - # Ordinary CoA worlds can load slowly too; this must not depend on SQUID. - if world_deadline is None: - world_deadline = time.monotonic() + max(seconds, 1500) - seconds = max(0, world_deadline - time.monotonic()) - return original_wait(name, port, seconds) - - -launcher["start_mysql"].__globals__["wait_ready"] = wait_ready -if sys.argv[1] in ("stop-all", "force-stop-all"): - shutdown = launcher["stop_all"].__globals__ - class UnsafeShutdown(Exception): - pass - - def stop_owned_world(world): - expected = Path(script).resolve().parents[1] / "Core" / "worldserver.exe" - if Path(world.get("exe", "")) != expected or not shutdown["same_process"](world): - raise UnsafeShutdown("World process ownership could not be verified; the database was left running.") - try: - shutdown["terminate"](world) - except (OSError, RuntimeError) as error: - raise UnsafeShutdown("Worldserver could not be stopped safely; its database was left running.") from error - if not shutdown["wait_stopped"](world, 90): - raise UnsafeShutdown("Worldserver is still stopping; its database was left running.") - - if "ra" in shutdown: - original_ra = shutdown["ra"] - - def shutdown_command(command, config): - try: - return original_ra(command, config) - except (OSError, RuntimeError): - if not command.startswith("server shutdown "): - raise - world = shutdown["process"]("world") - if not world: - return "Worldserver has already stopped." - stop_owned_world(world) - return "Stopped this server's recorded world process without its unavailable console." - - shutdown["ra"] = shutdown_command - config = launcher["settings"]() - with launcher["control_lock"](): - if sys.argv[1] == "force-stop-all": - world = shutdown["process"]("world") - if world: - stop_owned_world(world) - print("Force-stopped this server's verified world process; unsaved progress may be lost.", flush=True) - launcher["stop_all"](config) -else: - launcher["main"]() - if sys.argv[1] in ("start-all", "start-world"): - config = launcher["settings"]() - deadline = world_deadline if world_deadline is not None else time.monotonic() + 1500 - last_error = None - while time.monotonic() < deadline: - if not launcher["process"]("world"): - raise RuntimeError("World startup failed: worldserver stopped before its console accepted commands.") - try: - launcher["ra"]("server info", config) - print("World console is accepting commands.", flush=True) - break - except (OSError, RuntimeError) as error: - last_error = error - time.sleep(0.5) - else: - raise RuntimeError(f"World startup failed: its console is still starting. {last_error}") diff --git a/crates/coa-core/src/multiworld.rs b/crates/coa-core/src/multiworld.rs index 5634a36..96df9bb 100644 --- a/crates/coa-core/src/multiworld.rs +++ b/crates/coa-core/src/multiworld.rs @@ -176,7 +176,6 @@ fn set_tree(main: &Path, tree: Tree, enabled: bool) -> Result { } } } - secondary_launcher(&fs::read_to_string(main.join("Scripts/manage.py"))?)?; } let status = process::observe(main, &crate::layout::read_ports(main)); if status.world.state != ServiceState::Stopped @@ -349,25 +348,18 @@ fn prepare(main: &Path, tree: Tree) -> Result { ..Default::default() }, )?; - let source = fs::read_to_string(main.join("Scripts/manage.py"))?; - let source = secondary_launcher(&source)?; - fsx::atomic_write(&second.join("Scripts/manage.py"), source.as_bytes())?; - Ok(second) -} - -fn secondary_launcher(source: &str) -> Result { - let marker = "def start_world(config, offset):\n start_mysql(config)"; - let source = source.replace("\r\n", "\n"); - if !source.contains(marker) { - return Err(Error::Invalid( - "The launcher does not support a shared database world. Update the server first." - .into(), - )); + // The world supervisor and the bug-report relay of the extra world (the launcher itself runs in the Manager + // and knows that this world shares the main database). + for script in ["Scripts/coa-launcher.exe", "Scripts/manage.py"] { + let target = second.join(script); + if main.join(script).is_file() { + fs::create_dir_all(second.join("Scripts"))?; + fsx::atomic_write(&target, &fs::read(main.join(script))?)?; + } else if target.exists() { + fs::remove_file(&target)?; + } } - Ok(source.replace( - marker, - "def start_world(config, offset):\n mysql(admin=\"ping\")", - )) + Ok(second) } fn start_tree(main: &Path, tree: Tree) -> Result<()> { @@ -408,7 +400,7 @@ pub fn start(main: &Path) -> Result<()> { fn stop_tree(main: &Path, tree: Tree) -> Result<()> { let second = tree_root(main, tree); - if !second.join("Scripts/manage.py").exists() { + if !second.join("Settings/repack.json").exists() { if tree_running(main, tree) { return Err(Error::Invalid(format!( "The running {}'s launcher is missing. The shared database was left running.", @@ -505,12 +497,4 @@ mod tests { assert!(err.contains(expected), "{err}"); assert!(!realms::state(t.path()).unwrap().with_reborn); } - - #[test] - fn secondary_never_starts_the_shared_database() { - let patched = secondary_launcher("def start_world(config, offset):\r\n start_mysql(config)\r\n wait_ready('world', 8086)\r\n").unwrap(); - assert!(patched.contains("mysql(admin=\"ping\")")); - assert!(!patched.contains("start_mysql(config)")); - assert!(secondary_launcher("def start_world(): pass").is_err()); - } } diff --git a/crates/coa-core/src/realms.rs b/crates/coa-core/src/realms.rs index 32b4fb8..4c1e80c 100644 --- a/crates/coa-core/src/realms.rs +++ b/crates/coa-core/src/realms.rs @@ -614,7 +614,12 @@ pub fn prepare_launcher(root: &Path) -> Result<()> { if crate::docker::is_docker(root) { return Ok(()); } + // The Manager starts servers itself; this keeps the repack's own Python launcher (its .bat files) on the + // active realm. A repack without that launcher has nothing to adapt. let path = root.join("Scripts/manage.py"); + if !path.is_file() { + return Ok(()); + } let source = fs::read_to_string(&path)?; let patched = patch_launcher(&source)?; if patched != source { @@ -1161,8 +1166,9 @@ CoA.GameModeMask = 0 fn a_docker_server_has_no_launcher_to_adapt() { let d = tempfile::tempdir().unwrap(); fs::create_dir_all(d.path().join("Settings")).unwrap(); - // No Scripts/manage.py anywhere: on a repack this fails, on a Docker server there is nothing to do. - assert!(prepare_launcher(d.path()).is_err()); + // No Scripts/manage.py anywhere: neither a repack without the Python launcher nor a Docker server has + // anything to adapt. + assert!(prepare_launcher(d.path()).is_ok()); fs::write( d.path().join("Settings/docker.json"), br#"{"project":"t1"}"#, diff --git a/crates/coa-launcher/src/main.rs b/crates/coa-launcher/src/main.rs index 39d802d..2fcac70 100644 --- a/crates/coa-launcher/src/main.rs +++ b/crates/coa-launcher/src/main.rs @@ -8,10 +8,11 @@ use std::io::{BufRead, Write}; use std::path::{Path, PathBuf}; use std::time::Duration; -use coa_core::launcher::{render, services, settings::Settings, state, world}; +use coa_core::launcher::ops::{self, Action}; +use coa_core::launcher::{services, settings::Settings, state, world}; -const ACTIONS: [&str; 17] = [ - "start-all", "start-mysql", "start-auth", "start-world", "stop-all", "status", "status-json", "create-account", +const ACTIONS: [&str; 18] = [ + "start-all", "start-mysql", "start-auth", "start-world", "stop-all", "force-stop-all", "status", "status-json", "create-account", "create-account-once", "console", "ra-once", "prepare", "watch-world", "relay-worker", "debug-logs-on", "debug-logs-off", "debug-logs-status", ]; @@ -184,10 +185,12 @@ fn run(args: Args) -> Result<(), String> { } _ => {} } - { - let _lock = state::ControlLock::acquire(root, &args.action, Duration::from_secs(30), &|m| say(m)).map_err(e)?; - match args.action.as_str() { - "status" => { + match args.action.as_str() { + "status" | "status-json" => { + let _lock = state::ControlLock::acquire(root, &args.action, Duration::from_secs(30), &|m| say(m)).map_err(e)?; + if args.action == "status-json" { + say(&services::status(root).to_string()); + } else { for name in ["mysql", "auth", "world", "relay"] { let line = match state::running(root, name) { Some(r) => format!("{name:12} running (PID {})", r.pid), @@ -195,34 +198,14 @@ fn run(args: Args) -> Result<(), String> { }; say(&line); } - return Ok(()); } - "status-json" => { - say(&services::status(root).to_string()); - return Ok(()); - } - "stop-all" => return services::stop_all(root, &cfg, &|m| say(m)).map_err(e), - _ => {} - } - if matches!(args.action.as_str(), "start-all" | "start-world") { - coa_core::launcher::squid::validate_bots(root).map_err(e)?; - } - render::prepare(root, &cfg).map_err(e)?; - if args.action == "prepare" { return Ok(()); } - let progress = |m: &str| say(m); - if matches!(args.action.as_str(), "start-all" | "start-mysql") { - services::start_mysql(root, &cfg, &progress).map_err(e)?; - } - if matches!(args.action.as_str(), "start-all" | "start-auth") { - services::start_auth(root, &cfg, &progress).map_err(e)?; - } - if matches!(args.action.as_str(), "start-all" | "start-world") { - let me = std::env::current_exe().map_err(|x| x.to_string())?; - world::start_world(root, &cfg, args.offset, &me, &progress).map_err(e)?; - } + _ => {} } + let action = Action::parse(&args.action).ok_or_else(usage)?; + let me = world::Supervisor::Launcher(std::env::current_exe().map_err(|x| x.to_string())?); + ops::run(root, &cfg, args.offset, action, Some(&me), &|m| say(m)).map_err(e)?; if args.action.starts_with("start-") { say("Use Stop_All_Server.bat to shut down this repack safely."); } From a9fb982ab05ad48e2b2ede0dd8eef66c8c629aaa 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: Tue, 10 Nov 2026 09:38:59 +0500 Subject: [PATCH 05/29] Console shutdown request reads the reply before closing send_without_answer closed the socket right after writing "server shutdown". With the reply still unread, Windows resets the connection, and the world can drop the command: a world supervised by coa-launcher.exe ignored the shutdown and the stop timed out after 90 seconds. The reply is now read up to the next prompt, the end of the connection or 10 seconds. The E2E also checks which supervisor runs the world and that manage.py stops a world the Manager started. Co-Authored-By: Claude Opus 5.5 --- .../coa-core/examples/manager_launcher_e2e.rs | 11 +++++++++++ crates/coa-core/src/ra.rs | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/crates/coa-core/examples/manager_launcher_e2e.rs b/crates/coa-core/examples/manager_launcher_e2e.rs index a9dc9f9..777e4c8 100644 --- a/crates/coa-core/examples/manager_launcher_e2e.rs +++ b/crates/coa-core/examples/manager_launcher_e2e.rs @@ -85,10 +85,21 @@ fn main() { assert_eq!(std::fs::read(&manage_py).unwrap(), original, "manage.py is not rewritten"); assert_eq!(realm_name(root), "AzerothCore", "no profile: the launcher's own realm name"); + let shipped = root.join("Scripts/coa-launcher.exe"); + let supervisor = state::running(root, "supervisor").expect("a supervisor"); + println!("[supervisor] {}", supervisor.exe); + let expected = if shipped.is_file() { "coa-launcher.exe" } else { "python.exe" }; + assert!(supervisor.exe.to_lowercase().ends_with(expected), "the world is supervised by {expected}"); + // 2 assert!(drive(root, Verb::StopAll).ok, "stop-all"); assert!(nothing_running(root), "1-2 left something running"); + // 2b: the repack's Python launcher stops a world the Manager started + assert!(drive(root, Verb::StartAll).ok); + assert!(manage(root, "stop-all").0, "manage.py stops what the Manager started"); + assert!(nothing_running(root), "2b left something running"); + // 3 assert!(manage(root, "start-all").0); assert!(drive(root, Verb::StopAll).ok, "driver stops what manage.py started"); diff --git a/crates/coa-core/src/ra.rs b/crates/coa-core/src/ra.rs index 5764488..cad0bcd 100644 --- a/crates/coa-core/src/ra.rs +++ b/crates/coa-core/src/ra.rs @@ -88,12 +88,26 @@ impl Ra { self.command(c) } - /// Send a command the server does not answer before it closes the console (`server shutdown`), and return at - /// once. + /// Send a command whose answer does not matter (`server shutdown`). The reply is still read (up to the next + /// prompt, the end of the connection, or a few seconds): closing a socket that holds unread data resets the + /// connection, and the server can then drop the command it has not processed yet. pub fn send_without_answer(mut self, cmd: &str) -> Result<()> { let c = crate::console::check_command(cmd)?; self.stream.write_all(format!("{c}\r\n").as_bytes())?; self.stream.flush()?; + self.stream.set_read_timeout(Some(Duration::from_secs(10)))?; + let mut seen = Vec::new(); + let mut buf = [0u8; 4096]; + while let Ok(n) = self.stream.read(&mut buf) { + if n == 0 { + break; + } + seen.extend_from_slice(&buf[..n]); + if seen.ends_with(b"AC>") || seen.len() > 1 << 20 { + break; + } + } + let _ = self.stream.shutdown(std::net::Shutdown::Both); Ok(()) } From b81227b0eaf558c77d3cd777c49c65b6ae57dac0 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: Tue, 10 Nov 2026 12:00:40 +0500 Subject: [PATCH 06/29] Bug-report relay in Rust (coa-launcher relay-worker) launcher::relay does what BugReport/relay.py and manage.py relay-worker do, with the same spool: the .status files the world reads, the journal relay.sqlite3 (deliveries, settings), relay.lock (byte 0) and the relay-ready record. Service answers map to the same states and retry times; a post interrupted mid-flight stays uncertain and is never resent. When coa-launcher.exe supervises a world it runs the relay itself; the Python supervisor still runs relay.py. Verified: - examples/relay_equivalence: the same reports and scripted service answers through relay.py and the Rust relay give identical statuses, journal rows (including retry times) and posts, and each continues the other's journal. - examples/manager_launcher_e2e on a disposable repack: supervisor and relay are coa-launcher.exe, start/stop interoperates with manage.py. Co-Authored-By: Claude Opus 5.5 --- .../coa-core/examples/manager_launcher_e2e.rs | 4 + crates/coa-core/examples/relay_equivalence.rs | 170 ++++++ crates/coa-core/src/launcher/mod.rs | 1 + crates/coa-core/src/launcher/relay.rs | 493 ++++++++++++++++++ crates/coa-core/src/launcher/state.rs | 23 + crates/coa-core/src/launcher/world.rs | 15 +- crates/coa-launcher/src/main.rs | 7 +- 7 files changed, 706 insertions(+), 7 deletions(-) create mode 100644 crates/coa-core/examples/relay_equivalence.rs create mode 100644 crates/coa-core/src/launcher/relay.rs diff --git a/crates/coa-core/examples/manager_launcher_e2e.rs b/crates/coa-core/examples/manager_launcher_e2e.rs index 777e4c8..1552368 100644 --- a/crates/coa-core/examples/manager_launcher_e2e.rs +++ b/crates/coa-core/examples/manager_launcher_e2e.rs @@ -90,6 +90,10 @@ fn main() { println!("[supervisor] {}", supervisor.exe); let expected = if shipped.is_file() { "coa-launcher.exe" } else { "python.exe" }; assert!(supervisor.exe.to_lowercase().ends_with(expected), "the world is supervised by {expected}"); + let relay = state::running(root, "relay").expect("a bug-report relay"); + println!("[relay] {}", relay.exe); + assert!(relay.exe.to_lowercase().ends_with(expected), "the relay is run by {expected}"); + assert!(state::running(root, "relay-ready").is_some_and(|r| r.pid == relay.pid), "the relay reported ready"); // 2 assert!(drive(root, Verb::StopAll).ok, "stop-all"); diff --git a/crates/coa-core/examples/relay_equivalence.rs b/crates/coa-core/examples/relay_equivalence.rs new file mode 100644 index 0000000..dab7976 --- /dev/null +++ b/crates/coa-core/examples/relay_equivalence.rs @@ -0,0 +1,170 @@ +//! The Rust bug-report relay against the repack's `BugReport/relay.py`, offline (a scripted service, no network): +//! +//! 1. the same reports and the same service answers give the same `.status` files and journal rows; +//! 2. each relay continues the other's journal: what one delivered is never sent again by the other, and a post the +//! other left in progress is uncertain. +//! +//! usage: relay_equivalence +use std::path::{Path, PathBuf}; +use std::process::Command; +use std::sync::{Arc, Mutex}; + +use coa_core::launcher::relay::{Failure, Relay, Service}; + +const REPORTS: [(&str, &str); 5] = [ + ("1-00000000000000a1", "COABUG1\r\nQuest broken\r\nThe NPC is gone.\r\n"), + ("9-00000000000000b2", "COABUG1\nRate limited\nBody text\n"), + ("3-00000000000000c3", "COABUG1\nRejected\nBody\n"), + ("4-00000000000000d4", "COABUG1\nxy\nTitle too short\n"), + ("5-00000000000000e5", "COABUG1\nUnknown outcome\nBody\n"), +]; + +/// The answers per title, in the vocabulary of both relays. +fn answer(title: &str) -> std::result::Result { + match title { + "Quest broken" => Ok(101), + "Rate limited" => Err(Failure::Limited(60)), + "Rejected" => Err(Failure::Invalid), + _ => Err(Failure::Uncertain), + } +} + +const PYTHON: &str = r#" +import importlib.util, sys, json +from pathlib import Path +spec = importlib.util.spec_from_file_location("relay", sys.argv[1]); relay = importlib.util.module_from_spec(spec); spec.loader.exec_module(relay) +spool = Path(sys.argv[2]); calls = [] +class Fake: + def create(self, title, body): + calls.append(title) + if title == "Quest broken": return 101 + if title == "Rate limited": raise relay.DeliveryError("limited", 60) + if title == "Rejected": raise relay.DeliveryError("invalid") + raise relay.DeliveryError("uncertain") +t = [float(sys.argv[3])] +def clock(): + t[0] += 3 + return t[0] +r = relay.Relay(spool, Fake(), clock=clock) +for path in sorted(spool.glob("*.report")): + r.process(path) +r.close() +print(json.dumps(calls)) +"#; + +struct Scripted(Arc>>); +impl Service for Scripted { + fn create(&self, title: &str, _: &str) -> std::result::Result { + self.0.lock().unwrap().push(title.into()); + answer(title) + } +} + +fn spool(dir: &Path) -> PathBuf { + std::fs::create_dir_all(dir).unwrap(); + for (key, text) in REPORTS { + std::fs::write(dir.join(format!("{key}.report")), text).unwrap(); + } + dir.into() +} + +fn python(repack: &Path, spool: &Path, start: f64) -> Vec { + let out = Command::new(repack.join("Runtime/python/python.exe")) + .args(["-I", "-B", "-c", PYTHON]) + .arg(repack.join("BugReport/relay.py")) + .arg(spool) + .arg(start.to_string()) + .output() + .unwrap(); + assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr)); + serde_json::from_slice(&out.stdout).unwrap() +} + +/// The clock of both relays: `start`, then 3 seconds later at every reading. +fn rust(spool: &Path, start: f64) -> Vec { + let calls = Arc::new(Mutex::new(Vec::new())); + let t = Mutex::new(start); + let clock = move || { + let mut v = t.lock().unwrap(); + *v += 3.0; + *v + }; + let relay = Relay::with_clock(spool, Scripted(calls.clone()), Box::new(clock)).unwrap(); + relay.pass().unwrap(); + drop(relay); + let c = calls.lock().unwrap().clone(); + c +} + +/// `.status` files and journal rows (without the post time). +fn snapshot(spool: &Path) -> (Vec<(String, String)>, Vec) { + let mut statuses: Vec<(String, String)> = std::fs::read_dir(spool) + .unwrap() + .flatten() + .filter(|e| e.path().extension().is_some_and(|x| x == "status")) + .map(|e| (e.file_name().to_string_lossy().into_owned(), std::fs::read_to_string(e.path()).unwrap())) + .collect(); + statuses.sort(); + let db = rusqlite::Connection::open(spool.join("relay.sqlite3")).unwrap(); + let mut q = db.prepare("SELECT key, digest, marker, state, number, next_try FROM deliveries ORDER BY key").unwrap(); + let rows = q + .query_map([], |r| { + Ok(format!( + "{}|{}|{}|{}|{:?}|{}", + r.get::<_, String>(0)?, + r.get::<_, String>(1)?, + r.get::<_, String>(2)?, + r.get::<_, String>(3)?, + r.get::<_, Option>(4)?, + r.get::<_, f64>(5)? + )) + }) + .unwrap() + .map(Result::unwrap) + .collect(); + (statuses, rows) +} + +fn main() { + let repack = PathBuf::from(std::env::args().nth(1).expect("repack folder")); + let work = tempfile::tempdir().unwrap(); + + // 1 + let (a, b) = (spool(&work.path().join("python")), spool(&work.path().join("rust"))); + let py_calls = python(&repack, &a, 1000.0); + let rs_calls = rust(&b, 1000.0); + println!("python posted {py_calls:?}\nrust posted {rs_calls:?}"); + assert_eq!(py_calls, rs_calls, "the same reports are posted"); + let (pa, pb) = (snapshot(&a), snapshot(&b)); + for s in &pa.0 { + println!(" {} = {}", s.0, s.1.trim()); + } + assert_eq!(pa, pb, "the same statuses and journal"); + + + // 2: each continues the other's journal. Before the retry times nothing is sent again; after them only the + // rate-limited report is (created, rejected and uncertain ones never are). + assert!(python(&repack, &b, 1000.0).is_empty(), "Python does not resend what Rust handled"); + assert!(rust(&a, 1000.0).is_empty(), "Rust does not resend what Python handled"); + // Later passes: the queued reports go out, a refused or uncertain one never again. + for start in [5000.0, 6000.0, 7000.0] { + let (p, r) = (python(&repack, &b, start), rust(&a, start)); + println!("at {start}: python on rust's journal posted {p:?}, rust on python's posted {r:?}"); + assert_eq!(p, r, "the same retries"); + assert!(!p.iter().any(|t| t == "Quest broken" || t == "Unknown outcome"), "created and uncertain are final"); + } + assert_eq!(snapshot(&a), snapshot(&b), "the same after a retry by the other relay"); + for dir in [&a, &b] { + let db = rusqlite::Connection::open(dir.join("relay.sqlite3")).unwrap(); + db.execute("UPDATE deliveries SET state='posting' WHERE key='9-00000000000000b2'", []).unwrap(); + } + python(&repack, &b, 9000.0); + rust(&a, 9000.0); + for dir in [&a, &b] { + let db = rusqlite::Connection::open(dir.join("relay.sqlite3")).unwrap(); + let state: String = db.query_row("SELECT state FROM deliveries WHERE key='9-00000000000000b2'", [], |r| r.get(0)).unwrap(); + assert_eq!(state, "uncertain", "an interrupted post is not retried ({})", dir.display()); + } + assert_eq!(snapshot(&a), snapshot(&b), "still the same after the crossover"); + println!("PASS: relay journals, statuses and posts are the same in Python and Rust"); +} diff --git a/crates/coa-core/src/launcher/mod.rs b/crates/coa-core/src/launcher/mod.rs index 778b455..786583c 100644 --- a/crates/coa-core/src/launcher/mod.rs +++ b/crates/coa-core/src/launcher/mod.rs @@ -12,6 +12,7 @@ //! power cut could leave a zero-filled record that stopped every later start). pub mod ops; +pub mod relay; pub mod render; pub mod services; pub mod settings; diff --git a/crates/coa-core/src/launcher/relay.rs b/crates/coa-core/src/launcher/relay.rs new file mode 100644 index 0000000..2583b8f --- /dev/null +++ b/crates/coa-core/src/launcher/relay.rs @@ -0,0 +1,493 @@ +//! The bug-report relay (`BugReport/relay.py` and `manage.py relay-worker`): delivers the reports the world +//! writes to `BugReport/reports/*.report` through the CoA report service. +//! +//! On disk everything stays as the Python relay keeps it, so either can take over a spool: the `.status` +//! files the world reads back, the delivery journal `relay.sqlite3` (tables `deliveries` and `settings`), and +//! `relay.lock` (byte 0 locked while a worker runs). A delivery interrupted while it was posting becomes +//! `uncertain` and is never sent again (the service's duplicate filter may have been reset in the meantime). + +use std::path::{Path, PathBuf}; +use std::time::{Duration, SystemTime, UNIX_EPOCH}; + +use rusqlite::{params, Connection, OptionalExtension}; +use sha2::{Digest, Sha256}; + +use crate::error::{Error, Result}; +use crate::launcher::state; + +const REPOSITORY: &str = "jealous-sound/azerothcore-wotlk-coa"; +pub const SERVICE_URL: &str = "https://coa-bug-report.up.railway.app"; +/// Distribution credential for this narrow intake API (the same as relay.py's); not a GitHub token. +pub const DEFAULT_API_KEY: &str = "coa_zRatxUHShOn-HEkoreKGME6sd3DdMG7eKTTKlj2JCK4"; +const MAX_FILE: u64 = 16000; +const MAX_RESPONSE: usize = 64 * 1024; + +/// `[1-9][0-9]{0,9}-[0-9a-f]{16,48}`: the name of a report file (without `.report`). +pub fn valid_key(key: &str) -> bool { + let Some((id, hex)) = key.split_once('-') else { return false }; + (1..=10).contains(&id.len()) + && !id.starts_with('0') + && id.bytes().all(|b| b.is_ascii_digit()) + && (16..=48).contains(&hex.len()) + && hex.bytes().all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b)) +} + +/// Why a delivery did not create an issue. Only fixed local codes: never service bodies, credentials or report +/// content. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Failure { + /// 202 pending: the service is still creating it. + Pending(u64), + /// 429: try again later. + Limited(u64), + /// The report itself was refused. + Invalid, + /// The service refused this relay (redirect, auth, missing endpoint, GitHub access). + Blocked(u64), + /// The outcome is unknown (network, timeout, unexpected answer). + Uncertain, +} + +/// Where reports go. +pub trait Service { + fn create(&self, title: &str, body: &str) -> std::result::Result; +} + +/// The CoA report service over HTTPS. +pub struct ReportService { + api: String, + key: String, + client: reqwest::blocking::Client, +} + +impl ReportService { + pub fn new(base_url: &str, api_key: &str) -> Result { + if api_key.is_empty() || !api_key.is_ascii() || api_key.chars().any(char::is_whitespace) { + return Err(Error::Invalid("Configure a valid report-service intake key.".into())); + } + let client = reqwest::blocking::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .timeout(Duration::from_secs(30)) + // One report every few seconds at most: a fresh connection each time, never a stale pooled one. + .pool_max_idle_per_host(0) + .user_agent("CoA-InGame-BugReport/1") + .build() + .map_err(|e| Error::Invalid(format!("The report client could not start: {e}")))?; + Ok(ReportService { api: format!("{base_url}/v1/reports"), key: api_key.into(), client }) + } +} + +/// `Retry-After` in seconds, kept within 1 s .. 1 day; `default` when absent or not a number. +fn retry_delay(retry_after: Option<&str>, default: u64) -> u64 { + retry_after.and_then(|v| v.trim().parse::().ok()).map_or(default, |v| v.clamp(1, 86400) as u64) +} + +/// A JSON object of at most 64 KiB, or nothing. +fn json_object(raw: Option<&[u8]>) -> Option> { + let raw = raw?; + if raw.len() > MAX_RESPONSE { + return None; + } + match serde_json::from_slice(raw).ok()? { + serde_json::Value::Object(map) => Some(map), + _ => None, + } +} + +fn issue_number(data: &serde_json::Map) -> std::result::Result { + let number = data.get("issue_number").and_then(|n| if n.is_u64() { n.as_u64() } else { None }); + match number { + Some(n) + if data.get("status").and_then(|s| s.as_str()) == Some("created") + && (1..=4294967295).contains(&n) + && data.get("issue_url").and_then(|u| u.as_str()) + == Some(format!("https://github.com/{REPOSITORY}/issues/{n}").as_str()) => + { + Ok(n) + } + _ => Err(Failure::Uncertain), + } +} + +/// What a service answer means (relay.py's `create`): the status, its `Retry-After` and its body (`None` when it +/// could not be read or was longer than 64 KiB). +pub fn classify(status: u16, retry_after: Option<&str>, body: Option<&[u8]>) -> std::result::Result { + let field = |data: &serde_json::Map, k: &str| data.get(k).and_then(|v| v.as_str()).map(str::to_owned); + match status { + 200..=202 => { + let data = json_object(body).ok_or(Failure::Uncertain)?; + match status { + 202 if field(&data, "status").as_deref() == Some("pending") => Err(Failure::Pending(retry_delay(retry_after, 2))), + 202 => Err(Failure::Uncertain), + _ => issue_number(&data), + } + } + 429 => Err(Failure::Limited(retry_delay(retry_after, 300))), + 400 | 413 | 415 | 422 => Err(Failure::Invalid), + 301 | 302 | 303 | 307 | 308 | 401 | 403 | 404 | 405 => Err(Failure::Blocked(300)), + 503 => { + let data = json_object(body).unwrap_or_default(); + if field(&data, "status").as_deref() == Some("failed") && field(&data, "error").as_deref() == Some("github_access_denied") { + Err(Failure::Blocked(retry_delay(retry_after, 300))) + } else { + Err(Failure::Uncertain) + } + } + _ => Err(Failure::Uncertain), + } +} + +impl Service for ReportService { + fn create(&self, title: &str, body: &str) -> std::result::Result { + use std::io::Read; + let sent = self + .client + .post(&self.api) + .header("Authorization", format!("Bearer {}", self.key)) + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .body(serde_json::json!({ "title": title, "body": body }).to_string()) + .send(); + let response = sent.map_err(|_| Failure::Uncertain)?; + let status = response.status().as_u16(); + let retry_after = response.headers().get("Retry-After").and_then(|v| v.to_str().ok()).map(str::to_owned); + let mut raw = Vec::new(); + let read = response.take(MAX_RESPONSE as u64 + 1).read_to_end(&mut raw).is_ok() && raw.len() <= MAX_RESPONSE; + classify(status, retry_after.as_deref(), read.then_some(raw.as_slice())) + } +} + +/// A report: `COABUG1\n\n<body>`, checked as the world writes it. +pub struct Report { + pub digest: String, + pub marker: String, + pub title: String, + pub body: String, +} + +pub fn read_report(path: &Path) -> Result<Report> { + let bad = || Error::Invalid("Invalid report file".into()); + let key = path.file_stem().and_then(|s| s.to_str()).ok_or_else(bad)?; + let meta = std::fs::symlink_metadata(path)?; + if !valid_key(key) || meta.file_type().is_symlink() || meta.len() > MAX_FILE { + return Err(bad()); + } + let raw = std::fs::read(path)?; + let text = String::from_utf8(raw.clone()).map_err(|_| bad())?.replace("\r\n", "\n"); + let rest = text.strip_prefix("COABUG1\n").ok_or_else(|| Error::Invalid("Unsupported report format".into()))?; + let invalid = || Error::Invalid("Invalid report content".into()); + let (title, body) = rest.split_once('\n').ok_or_else(invalid)?; + if !(3..=200).contains(&title.len()) + || body.trim().is_empty() + || title.chars().any(|c| (c as u32) < 32) + || body.chars().any(|c| (c as u32) < 32 && !matches!(c, '\r' | '\n' | '\t')) + { + return Err(invalid()); + } + let digest = hex(&Sha256::digest(&raw)); + let id = hex(&Sha256::digest(format!("{key}:{digest}").as_bytes())); + Ok(Report { digest, marker: format!("<!-- coa-report:{id} -->"), title: title.into(), body: body.into() }) +} + +fn hex(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{b:02x}")).collect() +} + +/// `<key>.status`: what the world shows the player (`queued`, `created|<issue>`, `failed`, ...). +pub fn write_status(spool: &Path, key: &str, state: &str, number: Option<u64>) -> Result<()> { + let value = match (state, number) { + ("created", Some(n)) => format!("created|{n}"), + ("created", None) => "created|None".into(), + _ => state.to_string(), + }; + let data = format!("{value}\n"); + let destination = spool.join(format!("{key}.status")); + if std::fs::read(&destination).is_ok_and(|d| d == data.as_bytes()) { + return Ok(()); + } + crate::fsx::atomic_write(&destination, data.as_bytes()) +} + +fn now() -> f64 { + SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs_f64()).unwrap_or(0.0) +} + +/// The delivery journal of one spool. +pub struct Relay<S: Service> { + spool: PathBuf, + service: S, + db: Connection, + clock: Box<dyn Fn() -> f64 + Send>, +} + +impl<S: Service> Relay<S> { + pub fn open(spool: &Path, service: S) -> Result<Relay<S>> { + Self::with_clock(spool, service, Box::new(now)) + } + + pub fn with_clock(spool: &Path, service: S, clock: Box<dyn Fn() -> f64 + Send>) -> Result<Relay<S>> { + let db = Connection::open(spool.join("relay.sqlite3")).map_err(sql)?; + db.execute_batch( + "PRAGMA synchronous=FULL; + CREATE TABLE IF NOT EXISTS deliveries ( + key TEXT PRIMARY KEY, digest TEXT NOT NULL, marker TEXT NOT NULL, state TEXT NOT NULL, + number INTEGER, attempted REAL NOT NULL DEFAULT 0, next_try REAL NOT NULL DEFAULT 0 + ); + CREATE TABLE IF NOT EXISTS settings (key TEXT PRIMARY KEY, value REAL NOT NULL); + UPDATE deliveries SET state='uncertain' WHERE state='posting';", + ) + .map_err(sql)?; + Ok(Relay { spool: spool.into(), service, db, clock }) + } + + fn set_state(&self, key: &str, state: &str, number: Option<u64>, delay: u64) -> Result<()> { + self.db + .execute( + "UPDATE deliveries SET state=?1, number=?2, next_try=?3 WHERE key=?4", + params![state, number.map(|n| n as i64), (self.clock)() + delay as f64, key], + ) + .map_err(sql)?; + write_status(&self.spool, key, state, number) + } + + fn set_network_gate(&self, delay: u64) -> Result<()> { + self.db + .execute("INSERT OR REPLACE INTO settings VALUES('next_network',?1)", params![(self.clock)() + delay as f64]) + .map_err(sql)?; + Ok(()) + } + + /// Handle one report file; returns its delivery state. + pub fn process(&self, path: &Path) -> Result<String> { + let Some(key) = path.file_stem().and_then(|s| s.to_str()).filter(|k| valid_key(k)) else { + return Ok("ignored".into()); + }; + let report = match read_report(path) { + Ok(r) => r, + Err(_) => { + write_status(&self.spool, key, "failed", None)?; + return Ok("failed".into()); + } + }; + self.db + .execute( + "INSERT OR IGNORE INTO deliveries(key,digest,marker,state) VALUES(?1,?2,?3,'queued')", + params![key, report.digest, report.marker], + ) + .map_err(sql)?; + let (digest, row_state, number, next_try): (String, String, Option<i64>, f64) = self + .db + .query_row("SELECT digest, state, number, next_try FROM deliveries WHERE key=?1", params![key], |r| { + Ok((r.get(0)?, r.get(1)?, r.get(2)?, r.get(3)?)) + }) + .map_err(sql)?; + let number = number.map(|n| n as u64); + if digest != report.digest { + // Never replace an existing delivery or publish edited content under the same ID. + write_status(&self.spool, key, "failed", None)?; + return Ok("changed".into()); + } + if matches!(row_state.as_str(), "created" | "failed" | "uncertain") { + write_status(&self.spool, key, &row_state, number)?; + return Ok(row_state); + } + if next_try > (self.clock)() { + write_status(&self.spool, key, &row_state, None)?; + return Ok(row_state); + } + let gate: Option<f64> = self + .db + .query_row("SELECT value FROM settings WHERE key='next_network'", [], |r| r.get(0)) + .optional() + .map_err(sql)?; + if gate.is_some_and(|g| g > (self.clock)()) { + write_status(&self.spool, key, &row_state, None)?; + return Ok(row_state); + } + self.set_network_gate(5)?; + // A crash after this point needs review: the service's duplicate cache can reset on deploy. + self.db + .execute("UPDATE deliveries SET state='posting', attempted=?1 WHERE key=?2", params![(self.clock)(), key]) + .map_err(sql)?; + match self.service.create(&report.title, &report.body) { + Ok(n) => { + self.set_state(key, "created", Some(n), 0)?; + Ok("created".into()) + } + Err(failure) => { + let (state, delay) = match failure { + Failure::Limited(d) | Failure::Pending(d) => ("queued", d), + Failure::Blocked(d) => ("blocked", d), + Failure::Invalid => ("failed", 300), + Failure::Uncertain => ("uncertain", 300), + }; + self.set_state(key, state, None, delay)?; + if let Failure::Limited(d) | Failure::Blocked(d) = failure { + self.set_network_gate(d)?; + } + Ok(state.into()) + } + } + } + + /// One pass over the spool, in name order. + pub fn pass(&self) -> Result<()> { + let mut reports: Vec<PathBuf> = std::fs::read_dir(&self.spool)? + .flatten() + .map(|e| e.path()) + .filter(|p| p.extension().is_some_and(|x| x == "report")) + .collect(); + reports.sort(); + for path in reports { + self.process(&path)?; + } + Ok(()) + } +} + +fn sql(e: rusqlite::Error) -> Error { + Error::Invalid(format!("The bug-report journal failed ({e}).")) +} + +/// `relay-worker`: deliver reports until the supervisor asks the relay to stop (`.state/stop-relay`). +pub fn worker(root: &Path) -> Result<()> { + let spool = root.join("BugReport/reports"); + std::fs::create_dir_all(&spool)?; + let _lock = state::FileLock::try_acquire(&spool.join("relay.lock"))? + .ok_or_else(|| Error::Invalid("Another bug-report relay is already using this spool.".into()))?; + let key = std::env::var("COA_BUGREPORT_API_KEY").unwrap_or_else(|_| DEFAULT_API_KEY.into()); + let relay = Relay::open(&spool, ReportService::new(SERVICE_URL, &key)?)?; + state::record(root, "relay-ready", std::process::id())?; + println!("Bug-report relay ready. Waiting for in-game reports."); + let stop = state::dir(root).join("stop-relay"); + while !stop.exists() { + relay.pass()?; + for _ in 0..10 { + if stop.exists() { + return Ok(()); + } + std::thread::sleep(Duration::from_millis(500)); + } + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::sync::{Arc, Mutex}; + + type Answers = Arc<Mutex<Vec<std::result::Result<u64, Failure>>>>; + + struct Fake(Answers, Arc<Mutex<u32>>); + impl Service for Fake { + fn create(&self, _: &str, _: &str) -> std::result::Result<u64, Failure> { + *self.1.lock().unwrap() += 1; + self.0.lock().unwrap().remove(0) + } + } + + fn report(spool: &Path, key: &str, text: &str) -> PathBuf { + let p = spool.join(format!("{key}.report")); + std::fs::write(&p, text).unwrap(); + p + } + + #[test] + fn keys_follow_the_world_format() { + assert!(valid_key("1-0123456789abcdef")); + assert!(valid_key("4294967295-0123456789abcdef0123456789abcdef0123456789abcdef")); + for bad in ["0-0123456789abcdef", "1-0123456789abcde", "1-0123456789ABCDEF", "12345678901-0123456789abcdef", "x"] { + assert!(!valid_key(bad), "{bad}"); + } + } + + #[test] + fn service_answers_map_like_relay_py() { + let ok = format!(r#"{{"status":"created","issue_number":12,"issue_url":"https://github.com/{REPOSITORY}/issues/12"}}"#); + let cases: Vec<(u16, Option<&str>, Option<&[u8]>, std::result::Result<u64, Failure>)> = vec![ + (201, None, Some(ok.as_bytes()), Ok(12)), + (200, None, Some(ok.as_bytes()), Ok(12)), + (201, None, Some(br#"{"status":"created","issue_number":12,"issue_url":"https://evil/12"}"#), Err(Failure::Uncertain)), + (201, None, Some(br#"{"status":"created","issue_number":0,"issue_url":"x"}"#), Err(Failure::Uncertain)), + (201, None, Some(b"[1]"), Err(Failure::Uncertain)), + (201, None, None, Err(Failure::Uncertain)), + (202, Some("7"), Some(br#"{"status":"pending"}"#), Err(Failure::Pending(7))), + (202, None, Some(br#"{"status":"pending"}"#), Err(Failure::Pending(2))), + (202, None, Some(br#"{"status":"other"}"#), Err(Failure::Uncertain)), + (429, Some("999999"), None, Err(Failure::Limited(86400))), + (429, Some("0"), None, Err(Failure::Limited(1))), + (429, Some("soon"), None, Err(Failure::Limited(300))), + (422, None, None, Err(Failure::Invalid)), + (302, None, None, Err(Failure::Blocked(300))), + (401, None, None, Err(Failure::Blocked(300))), + (503, Some("30"), Some(br#"{"status":"failed","error":"github_access_denied"}"#), Err(Failure::Blocked(30))), + (503, None, Some(b"{}"), Err(Failure::Uncertain)), + (500, None, None, Err(Failure::Uncertain)), + ]; + for (i, (status, retry, body, expected)) in cases.into_iter().enumerate() { + assert_eq!(classify(status, retry, body), expected, "case {i}"); + } + assert!(json_object(Some(&vec![b' '; MAX_RESPONSE + 1])).is_none(), "oversized answers are refused"); + assert!(ReportService::new(SERVICE_URL, "has space").is_err()); + assert!(ReportService::new(SERVICE_URL, "coa_key").is_ok()); + } + + #[test] + fn a_report_is_checked_and_identified_like_relay_py() { + let d = tempfile::tempdir().unwrap(); + let p = report(d.path(), "7-0123456789abcdef", "COABUG1\r\nBroken quest\r\nThe NPC is missing.\r\n"); + let r = read_report(&p).unwrap(); + assert_eq!(r.title, "Broken quest"); + assert_eq!(r.body, "The NPC is missing.\n"); + assert_eq!(r.digest, hex(&Sha256::digest(std::fs::read(&p).unwrap()))); + assert!(r.marker.starts_with("<!-- coa-report:") && r.marker.len() == 16 + 64 + 4); + for bad in ["COABUG2\nTitle\nBody", "COABUG1\nab\nBody", "COABUG1\nTitle\n \n", "COABUG1\nTi\u{7}tle\nBody", "COABUG1\nTitle"] { + std::fs::write(&p, bad).unwrap(); + assert!(read_report(&p).is_err(), "{bad:?}"); + } + } + + #[test] + fn deliveries_follow_the_journal() { + let d = tempfile::tempdir().unwrap(); + let spool = d.path(); + let t = Arc::new(Mutex::new(1000.0f64)); + let calls = Arc::new(Mutex::new(0)); + let answers: Answers = Arc::new(Mutex::new(vec![Err(Failure::Limited(60)), Ok(42)])); + let clock = t.clone(); + let relay = Relay::with_clock(spool, Fake(answers, calls.clone()), Box::new(move || *clock.lock().unwrap())).unwrap(); + let p = report(spool, "7-0123456789abcdef", "COABUG1\nBroken quest\nThe NPC is missing.\n"); + let status = || std::fs::read_to_string(spool.join("7-0123456789abcdef.status")).unwrap(); + assert_eq!(relay.process(&p).unwrap(), "queued", "429 keeps it queued"); + assert_eq!(status(), "queued\n"); + assert_eq!(relay.process(&p).unwrap(), "queued", "not before its retry time"); + assert_eq!(*calls.lock().unwrap(), 1); + *t.lock().unwrap() += 61.0; + assert_eq!(relay.process(&p).unwrap(), "created"); + assert_eq!(status(), "created|42\n"); + assert_eq!(relay.process(&p).unwrap(), "created", "never sent twice"); + assert_eq!(*calls.lock().unwrap(), 2); + std::fs::write(&p, "COABUG1\nBroken quest\nEdited.\n").unwrap(); + assert_eq!(relay.process(&p).unwrap(), "changed"); + relay + .db + .execute("INSERT INTO deliveries(key,digest,marker,state) VALUES('8-0123456789abcdef','x','m','posting')", []) + .unwrap(); + drop(relay); + let reopened = Relay::open(spool, Fake(Arc::new(Mutex::new(vec![])), calls.clone())).unwrap(); + let state: String = + reopened.db.query_row("SELECT state FROM deliveries WHERE key='8-0123456789abcdef'", [], |r| r.get(0)).unwrap(); + assert_eq!(state, "uncertain", "an interrupted post is never retried"); + } + + #[test] + fn a_second_worker_cannot_take_the_spool() { + let d = tempfile::tempdir().unwrap(); + let first = state::FileLock::try_acquire(&d.path().join("relay.lock")).unwrap(); + assert!(first.is_some()); + assert!(state::FileLock::try_acquire(&d.path().join("relay.lock")).unwrap().is_none()); + drop(first); + assert!(state::FileLock::try_acquire(&d.path().join("relay.lock")).unwrap().is_some()); + } +} diff --git a/crates/coa-core/src/launcher/state.rs b/crates/coa-core/src/launcher/state.rs index b7a639f..3e33fc6 100644 --- a/crates/coa-core/src/launcher/state.rs +++ b/crates/coa-core/src/launcher/state.rs @@ -88,6 +88,29 @@ impl ControlLock { } } +/// Byte 0 of a file locked while held (`msvcrt.locking`), for example the bug-report relay's `relay.lock`. +pub struct FileLock { + file: File, +} + +impl FileLock { + /// Take the lock, or `None` when another process (or handle) holds it. + pub fn try_acquire(path: &Path) -> Result<Option<FileLock>> { + let mut file = OpenOptions::new().read(true).append(true).create(true).open(path)?; + if file.seek(SeekFrom::End(0))? == 0 { + file.write_all(b"0")?; + file.flush()?; + } + Ok(sys::try_lock(&file)?.then_some(FileLock { file })) + } +} + +impl Drop for FileLock { + fn drop(&mut self) { + sys::unlock(&self.file); + } +} + impl Drop for ControlLock { fn drop(&mut self) { let _ = std::fs::remove_file(&self.owner); diff --git a/crates/coa-core/src/launcher/world.rs b/crates/coa-core/src/launcher/world.rs index 724fa31..5d495aa 100644 --- a/crates/coa-core/src/launcher/world.rs +++ b/crates/coa-core/src/launcher/world.rs @@ -151,8 +151,14 @@ fn spawn_child(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, l Ok(child) } -/// The relay worker: the repack's Python running `Scripts/manage.py relay-worker` (BugReport/relay.py). -fn spawn_relay(root: &Path) -> Result<Proc> { +/// The relay worker: `coa-launcher relay-worker` when the supervisor is the launcher (`launcher`), otherwise the +/// repack's Python running `Scripts/manage.py relay-worker` (BugReport/relay.py). +fn spawn_relay(root: &Path, launcher: Option<&Path>) -> Result<Proc> { + let log = root.join("BugReport/Logs/relay.log"); + if let Some(exe) = launcher { + let root_text = root.to_string_lossy().into_owned(); + return spawn_child(root, "relay", exe, &["--root", &root_text, "relay-worker"], root, &log); + } let python = squid::package_root(root).join("Runtime/python/python.exe"); let manage = root.join("Scripts/manage.py"); if !python.is_file() || !manage.is_file() { @@ -163,14 +169,15 @@ fn spawn_relay(root: &Path) -> Result<Proc> { } /// The supervisor (`watch-world`): run the world, keep the relay alive while it runs, stop the relay after it. -pub fn watch_world(root: &Path, log: Progress) -> Result<()> { +/// `launcher` is the launcher executable that runs the relay (`None`: the Python relay). +pub fn watch_world(root: &Path, launcher: Option<&Path>, log: Progress) -> Result<()> { squid::validate_bots(root)?; let world = spawn_child(root, "world", &root.join("Core/worldserver.exe"), &["-c", "configs/worldserver.conf"], &root.join("Core"), &root.join("Core/Logs/world-console.log"))?; let mut relay: Option<Proc> = None; while world.try_wait().is_none() { let dead = relay.as_ref().is_none_or(|r| r.try_wait().is_some()); if dead { - match spawn_relay(root) { + match spawn_relay(root, launcher) { Ok(r) => relay = Some(r), Err(e) => { log(&format!("Report relay could not start ({e}); retrying.")); diff --git a/crates/coa-launcher/src/main.rs b/crates/coa-launcher/src/main.rs index 2fcac70..4c606cd 100644 --- a/crates/coa-launcher/src/main.rs +++ b/crates/coa-launcher/src/main.rs @@ -98,10 +98,11 @@ fn run(args: Args) -> Result<(), String> { let root = args.root.as_path(); let e = |x: coa_core::Error| x.to_string(); match args.action.as_str() { - "watch-world" => return world::watch_world(root, &|m| say(m)).map_err(e), - "relay-worker" => { - return Err("The bug-report relay runs through Scripts/manage.py relay-worker until it is ported.".into()) + "watch-world" => { + let me = std::env::current_exe().map_err(|x| x.to_string())?; + return world::watch_world(root, Some(&me), &|m| say(m)).map_err(e); } + "relay-worker" => return coa_core::launcher::relay::worker(root).map_err(e), "debug-logs-status" => { let on = services::status(root)["debugLogs"].as_bool().unwrap_or(false); say(&format!("Detailed server logging is {}.", if on { "ON" } else { "off" })); From 8353b791fb2407ef70d16c2dd1a7539119292d25 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?= <corfirean@gmail.com> Date: Tue, 10 Nov 2026 13:07:41 +0500 Subject: [PATCH 07/29] The Manager no longer edits Scripts/manage.py Repacks ship no .bat files, and the Manager starts servers with coa-core::launcher, so the realm-profile patch it wrote into manage.py served no one. It is no longer applied (realm creation, realm switching and start). Recognising the edits older Managers made (realm patch, bridge import fix) moves into legacy_launcher, so updates and file checks still treat such a file as unmodified. Nothing there writes a file. manage.py itself stays complete in the repack: Managers up to 0.9.10 run it through their bridge and patch its text, so it cannot become a thin wrapper until those Managers are no longer supported. Verified: coa-core unit tests; examples/manager_launcher_e2e on a disposable repack (manage.py unchanged after a start with a realm profile). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .../coa-core/examples/manager_launcher_e2e.rs | 11 +- crates/coa-core/src/driver.rs | 65 +---- crates/coa-core/src/legacy_launcher.rs | 222 ++++++++++++++++++ crates/coa-core/src/lib.rs | 1 + crates/coa-core/src/realms.rs | 202 ---------------- crates/coa-core/src/update.rs | 16 +- 6 files changed, 234 insertions(+), 283 deletions(-) create mode 100644 crates/coa-core/src/legacy_launcher.rs diff --git a/crates/coa-core/examples/manager_launcher_e2e.rs b/crates/coa-core/examples/manager_launcher_e2e.rs index 1552368..0f6e1d2 100644 --- a/crates/coa-core/examples/manager_launcher_e2e.rs +++ b/crates/coa-core/examples/manager_launcher_e2e.rs @@ -5,7 +5,7 @@ //! 3. manage.py start-all, then driver stop-all stops what Python started; //! 4. a taken world port fails with the typed "port in use" code (no stderr parsing), then stop-all; //! 5. driver start-all, then the forced stop; -//! 6. with a realm profile: the realm row gets the profile's name, the .bat launcher is adapted as before; +//! 6. with a realm profile: the realm row gets the profile's name, manage.py is still not edited; //! 7. nothing of the repack is left running. //! //! usage: manager_launcher_e2e <existing folder ending in -fixture> @@ -133,14 +133,7 @@ fn main() { let result = std::panic::catch_unwind(|| { assert!(drive(root, Verb::StartAll).ok, "start-all with a realm profile"); assert_eq!(realm_name(root), "Conquest of Azeroth"); - let patched = std::fs::read_to_string(&manage_py).unwrap(); - assert!(patched.contains("# coa-manager-realm-profiles-v2"), "the .bat launcher still follows the realm"); - let fix = "sys.path.insert(0, str(Path(__file__).resolve().parent))"; - assert_eq!( - patched.matches(fix).count(), - String::from_utf8_lossy(&original).matches(fix).count(), - "no bridge import fix added" - ); + assert_eq!(std::fs::read(&manage_py).unwrap(), original, "manage.py is not edited for a realm profile either"); assert!(drive(root, Verb::StopAll).ok); }); std::fs::remove_file(&profile).unwrap(); diff --git a/crates/coa-core/src/driver.rs b/crates/coa-core/src/driver.rs index bb139fe..b0a4305 100644 --- a/crates/coa-core/src/driver.rs +++ b/crates/coa-core/src/driver.rs @@ -1,6 +1,6 @@ //! Start/stop of a repack-shaped installation through the repack launcher in this crate //! ([`crate::launcher`]): config rendering, the services, the world supervisor, graceful shutdown and readiness. -//! It writes the same `.state` records as the repack's `Scripts/manage.py`, so the server's own `.bat` files and +//! It writes the same `.state` records as the repack's `Scripts/manage.py`, so the repack's own launcher and //! this Manager can be used on the same folder. Observation stays native (see `process`). use std::path::Path; @@ -330,60 +330,6 @@ fn recover_mysql_launcher_state(root: &Path, prefer_listener: bool) -> Result<() Ok(()) } -/// The import fix older Managers wrote into `Scripts/manage.py` (needed only to run it through their bridge). It -/// is no longer applied; it stays so that file checks still recognise a file it changed. -pub(crate) fn patch_launcher_imports(text: &str) -> Result<String> { - let line = "sys.path.insert(0, str(Path(__file__).resolve().parent))"; - if !text.contains("from squid_playerbots import") || text.contains(line) { - return Ok(text.into()); - } - let root = "ROOT = Path(__file__).resolve().parents[1]"; - if !text.contains(root) || !text.lines().any(|line| line.trim() == "import sys") { - return Err(Error::Invalid( - "The server launcher cannot load its integration scripts. Repair its program files." - .into(), - )); - } - Ok(text.replacen(root, &format!("{root}\n{line}"), 1)) -} - -pub(crate) fn launcher_matches(signed: &str, actual: &[u8]) -> bool { - if signed.as_bytes() == actual { - return true; - } - if patch_launcher_imports(signed).is_ok_and(|s| s.as_bytes() == actual) { - return true; - } - crate::realms::patch_launcher(signed).is_ok_and(|s| { - s.as_bytes() == actual || patch_launcher_imports(&s).is_ok_and(|p| p.as_bytes() == actual) - }) -} - -/// Recover legacy metadata only when undoing supported Manager edits reproduces the recorded hash. -pub(crate) fn launcher_matches_recorded(recorded: &str, actual: &[u8]) -> bool { - let Ok(text) = std::str::from_utf8(actual) else { - return false; - }; - let without_import = text.replacen( - "ROOT = Path(__file__).resolve().parents[1]\nsys.path.insert(0, str(Path(__file__).resolve().parent))", - "ROOT = Path(__file__).resolve().parents[1]", 1, - ); - for candidate in [ - Some(without_import.clone()), - crate::realms::unpatch_launcher(&without_import), - ] - .into_iter() - .flatten() - { - if crate::fsx::sha256_bytes(candidate.as_bytes()).eq_ignore_ascii_case(recorded) - && launcher_matches(&candidate, actual) - { - return true; - } - } - false -} - pub(crate) fn startup_failure(root: &Path, started: &DriverOutcome) -> String { let code = started .code @@ -588,13 +534,4 @@ mod tests { assert!(!reason.contains("private")); assert!(!reason.contains("Something went wrong")); } - - #[test] - fn launcher_import_fix_is_idempotent_and_retains_other_code() { - let text = "import sys\nROOT = Path(__file__).resolve().parents[1]\nfrom squid_playerbots import validate_bots\ncustom = 42\n"; - let fixed = patch_launcher_imports(text).unwrap(); - assert!(fixed.contains("sys.path.insert(0, str(Path(__file__).resolve().parent))")); - assert!(fixed.ends_with("custom = 42\n")); - assert_eq!(patch_launcher_imports(&fixed).unwrap(), fixed); - } } diff --git a/crates/coa-core/src/legacy_launcher.rs b/crates/coa-core/src/legacy_launcher.rs new file mode 100644 index 0000000..b649040 --- /dev/null +++ b/crates/coa-core/src/legacy_launcher.rs @@ -0,0 +1,222 @@ +//! `Scripts/manage.py` as Managers up to 0.9.10 edited it. +//! +//! Those Managers ran the repack's Python launcher themselves and changed its text: an import fix for their bridge +//! and a realm-profile patch (database and realm row of the active realm). This Manager starts servers with +//! [`crate::launcher`] and never edits the file; it only has to recognise those edits, so that an update or a file +//! check treats a file one of them changed as unmodified. Nothing here writes a file. + +use crate::error::{Error, Result}; + +const LAUNCHER_REALM_REPLACEMENTS: &[(&str, &str)] = &[ + ("(\"WorldDatabaseInfo\", \"acore_world\")", "(\"WorldDatabaseInfo\", \"acore_world_wildcard\" if coa_realm() == 'wildcard' else \"acore_world\")"), + ("(\"CharacterDatabaseInfo\", \"acore_characters\")", "(\"CharacterDatabaseInfo\", \"acore_characters_wildcard\" if coa_realm() == 'wildcard' else \"acore_characters\")"), + ("SET name='AzerothCore',address=", "SET name='{coa_realm_name()}',address="), + ("WHERE id=1;", "WHERE id={coa_realm_id()};"), + ("mysql(\"UPDATE acore_auth.realmlist SET flag=0", "mysql(f\"UPDATE acore_auth.realmlist SET flag=0"), +]; + +const LAUNCHER_REALM_INSERT: &str = "# coa-manager-realm-profiles-v1\ndef coa_realm():\n path = ROOT / 'Settings/realm-profile.json'\n return json.loads(path.read_text(encoding='utf-8')).get('active', 'coa') if path.exists() else 'coa'\n\ndef coa_realm_id():\n return 2 if coa_realm() == 'wildcard' else 1\n\ndef coa_realm_name():\n return 'Wildcard' if coa_realm() == 'wildcard' else 'Conquest of Azeroth'\n\n"; + +fn launcher_insert() -> String { + LAUNCHER_REALM_INSERT + .replace("profiles-v1", "profiles-v2") + .replace( + "return 2 if", + "return 3 if coa_realm() == 'reborn' else 2 if", + ) + .replace( + "return 'Wildcard' if", + "return 'Warcraft Reborn' if coa_realm() == 'reborn' else 'Wildcard' if", + ) +} + +fn launcher_replacements() -> Vec<(&'static str, String)> { + LAUNCHER_REALM_REPLACEMENTS.iter().map(|(from, to)| (*from, to + .replace("\"acore_world_wildcard\" if", "\"acore_world_reborn\" if coa_realm() == 'reborn' else \"acore_world_wildcard\" if") + .replace("\"acore_characters_wildcard\" if", "\"acore_characters_reborn\" if coa_realm() == 'reborn' else \"acore_characters_wildcard\" if"))).collect() +} + +/// The realm-profile patch older Managers wrote. +pub(crate) fn patch_launcher(source: &str) -> Result<String> { + if source.contains("# coa-manager-realm-profiles-v2") { + return Ok(source.into()); + } + if source.contains("# coa-manager-realm-profiles-v1") { + let original = unpatch_launcher(source) + .ok_or_else(|| Error::Invalid("Unrecognised realm launcher patch.".into()))?; + return patch_launcher(&original); + } + let mut out = source.to_string(); + for (from, to) in launcher_replacements() { + if !out.contains(from) { + return Err(Error::Invalid( + "This launcher does not support realm profiles. Update the server package first." + .into(), + )); + } + out = out.replace(from, &to); + } + // Insert before the entry point so ROOT, json and functions are all defined when called. + let marker = "if __name__ == \"__main__\":"; + if !out.contains(marker) { + return Err(Error::Invalid( + "Unrecognised server launcher entry point.".into(), + )); + } + Ok(out.replace(marker, &format!("{}{marker}", launcher_insert()))) +} + +/// Reverse only our exact realm transformation; callers must verify the recovered original hash. +pub(crate) fn unpatch_launcher(source: &str) -> Option<String> { + let (insert, replacements) = if source.contains(&launcher_insert()) { + (launcher_insert(), launcher_replacements()) + } else if source.contains(LAUNCHER_REALM_INSERT) { + ( + LAUNCHER_REALM_INSERT.into(), + LAUNCHER_REALM_REPLACEMENTS + .iter() + .map(|(a, b)| (*a, b.to_string())) + .collect(), + ) + } else { + return None; + }; + let mut original = source.replacen(&insert, "", 1); + for (from, to) in &replacements { + original = original.replace(to, from); + } + let mut check = original.clone(); + for (from, to) in &replacements { + check = check.replace(from, to); + } + check = check.replace( + "if __name__ == \"__main__\":", + &format!("{insert}if __name__ == \"__main__\":"), + ); + (check == source).then_some(original) +} + +/// The import fix older Managers wrote (needed to run manage.py through their bridge). +pub(crate) fn patch_launcher_imports(text: &str) -> Result<String> { + let line = "sys.path.insert(0, str(Path(__file__).resolve().parent))"; + if !text.contains("from squid_playerbots import") || text.contains(line) { + return Ok(text.into()); + } + let root = "ROOT = Path(__file__).resolve().parents[1]"; + if !text.contains(root) || !text.lines().any(|line| line.trim() == "import sys") { + return Err(Error::Invalid( + "The server launcher cannot load its integration scripts. Repair its program files." + .into(), + )); + } + Ok(text.replacen(root, &format!("{root}\n{line}"), 1)) +} + +pub(crate) fn launcher_matches(signed: &str, actual: &[u8]) -> bool { + if signed.as_bytes() == actual { + return true; + } + if patch_launcher_imports(signed).is_ok_and(|s| s.as_bytes() == actual) { + return true; + } + patch_launcher(signed).is_ok_and(|s| { + s.as_bytes() == actual || patch_launcher_imports(&s).is_ok_and(|p| p.as_bytes() == actual) + }) +} + +/// Recover legacy metadata only when undoing supported Manager edits reproduces the recorded hash. +pub(crate) fn launcher_matches_recorded(recorded: &str, actual: &[u8]) -> bool { + let Ok(text) = std::str::from_utf8(actual) else { + return false; + }; + let without_import = text.replacen( + "ROOT = Path(__file__).resolve().parents[1]\nsys.path.insert(0, str(Path(__file__).resolve().parent))", + "ROOT = Path(__file__).resolve().parents[1]", 1, + ); + for candidate in [ + Some(without_import.clone()), + unpatch_launcher(&without_import), + ] + .into_iter() + .flatten() + { + if crate::fsx::sha256_bytes(candidate.as_bytes()).eq_ignore_ascii_case(recorded) + && launcher_matches(&candidate, actual) + { + return true; + } + } + false +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::fsx; + use std::collections::BTreeMap; + use std::fs; + + #[test] + fn old_launcher_upgrades_and_both_patch_versions_are_reversible() { + let original = "(\"WorldDatabaseInfo\", \"acore_world\")\n(\"CharacterDatabaseInfo\", \"acore_characters\")\nSET name='AzerothCore',address=\nWHERE id=1;\nmysql(\"UPDATE acore_auth.realmlist SET flag=0\nif __name__ == \"__main__\":\n"; + let mut old = original.to_string(); + for (from, to) in LAUNCHER_REALM_REPLACEMENTS { + old = old.replace(from, to); + } + old = old.replace( + "if __name__ == \"__main__\":", + &format!("{LAUNCHER_REALM_INSERT}if __name__ == \"__main__\":"), + ); + assert_eq!(unpatch_launcher(&old).as_deref(), Some(original)); + let new = patch_launcher(&old).unwrap(); + assert!(new.contains("acore_world_reborn")); + assert!(new.contains("return 3 if coa_realm() == 'reborn'")); + assert!(new.contains("return 'Warcraft Reborn' if")); + assert_eq!(patch_launcher(&new).unwrap(), new); + assert_eq!(unpatch_launcher(&new).as_deref(), Some(original)); + } + + #[test] + fn unknown_launcher_is_refused_without_partial_patching() { + assert!(patch_launcher("print('custom launcher')").is_err()); + } + + #[test] + fn launcher_import_fix_is_idempotent_and_retains_other_code() { + let text = "import sys\nROOT = Path(__file__).resolve().parents[1]\nfrom squid_playerbots import validate_bots\ncustom = 42\n"; + let fixed = patch_launcher_imports(text).unwrap(); + assert!(fixed.contains("sys.path.insert(0, str(Path(__file__).resolve().parent))")); + assert!(fixed.ends_with("custom = 42\n")); + assert_eq!(patch_launcher_imports(&fixed).unwrap(), fixed); + } + + #[test] + fn a_launcher_patched_by_an_older_manager_stays_pristine_but_external_edits_conflict() { + let d = tempfile::tempdir().unwrap(); + let root = d.path().join("server"); + let source = "(\"WorldDatabaseInfo\", \"acore_world\")\n(\"CharacterDatabaseInfo\", \"acore_characters\")\nSET name='AzerothCore',address=\nWHERE id=1;\nmysql(\"UPDATE acore_auth.realmlist SET flag=0\nif __name__ == \"__main__\":\n"; + fsx::atomic_write(&root.join("Scripts/manage.py"), source.as_bytes()).unwrap(); + // What an older Manager left: the realm patch applied and its hash recorded as the pristine one. + let patched = patch_launcher(source).unwrap(); + fsx::atomic_write(&root.join("Scripts/manage.py"), patched.as_bytes()).unwrap(); + let mut meta = crate::registry::InstallMeta::new(crate::registry::InstallKind::New, &root); + meta.original_hashes.insert("Scripts/manage.py".into(), fsx::sha256_bytes(patched.as_bytes())); + crate::registry::MetaDir::create(&root, &meta).unwrap(); + assert!(crate::diag::verify_managed(&root, &meta).is_empty()); + let manifest: crate::manifest::Manifest = serde_json::from_value(serde_json::json!({ + "schema": 1, "kind": "update", "version": "2.0.0", "core": {"commit": null}, "builtAt": "fixture", "minManagerVersion": "0.1.0", + "files": [{"path":"Scripts/manage.py","sha256":fsx::sha256_bytes(b"next release"),"size":12,"owner":"core","policy":"replace"}] + })).unwrap(); + assert_eq!( + crate::update::plan(&root, &meta, &manifest, &BTreeMap::new(), None).unwrap()[0].action, + crate::update::Action::Replace + ); + let mut modified = fs::read(root.join("Scripts/manage.py")).unwrap(); + modified.extend_from_slice(b"# custom edit\n"); + fsx::atomic_write(&root.join("Scripts/manage.py"), &modified).unwrap(); + assert_eq!( + crate::update::plan(&root, &meta, &manifest, &BTreeMap::new(), None).unwrap()[0].action, + crate::update::Action::Conflict + ); + } +} diff --git a/crates/coa-core/src/lib.rs b/crates/coa-core/src/lib.rs index 67387b1..b401084 100644 --- a/crates/coa-core/src/lib.rs +++ b/crates/coa-core/src/lib.rs @@ -28,6 +28,7 @@ pub mod diag; pub mod docker; pub mod download; pub mod driver; +pub mod legacy_launcher; pub mod error; pub mod firewall; pub mod friends; diff --git a/crates/coa-core/src/realms.rs b/crates/coa-core/src/realms.rs index 4c1e80c..ba5bfb1 100644 --- a/crates/coa-core/src/realms.rs +++ b/crates/coa-core/src/realms.rs @@ -534,8 +534,6 @@ pub fn ensure_created(root: &Path, mode: Mode) -> Result<()> { "Update the server to a build with Warcraft Reborn support first.".into(), )); } - // Verify launcher support before creating databases, as selecting a realm does. - prepare_launcher(root)?; let before = configs(root)?; create_realm(root, &mut s, mode, &before) } @@ -565,8 +563,6 @@ pub fn select(root: &Path, mode: Mode) -> Result<View> { "Disable the realms that start together before switching realms.".into(), )); } - // Verify launcher support before creating databases or changing the selected realm. - prepare_launcher(root)?; let before = configs(root)?; fsx::atomic_write_json(&snapshot(root, s.active), &before)?; create_realm(root, &mut s, mode, &before)?; @@ -608,130 +604,6 @@ pub fn select(root: &Path, mode: Mode) -> Result<View> { view(root) } -/// Adapt the bundled launcher's canonical schema and realm choices without changing its supervision logic. -pub fn prepare_launcher(root: &Path) -> Result<()> { - // A Docker server has no launcher to adapt: the Docker backend reads the active realm itself. - if crate::docker::is_docker(root) { - return Ok(()); - } - // The Manager starts servers itself; this keeps the repack's own Python launcher (its .bat files) on the - // active realm. A repack without that launcher has nothing to adapt. - let path = root.join("Scripts/manage.py"); - if !path.is_file() { - return Ok(()); - } - let source = fs::read_to_string(&path)?; - let patched = patch_launcher(&source)?; - if patched != source { - fsx::atomic_write(&path, patched.as_bytes())?; - // A Manager-owned transformation is still pristine for subsequent updates and file checks. - if let Ok(dir) = crate::registry::metadata_dir_for(root) { - if let Ok((_, mut meta)) = crate::registry::MetaDir::open(&dir) { - if meta - .original_hashes - .get("Scripts/manage.py") - .is_some_and(|hash| hash == &fsx::sha256_bytes(source.as_bytes())) - { - meta.original_hashes.insert( - "Scripts/manage.py".into(), - fsx::sha256_bytes(patched.as_bytes()), - ); - fsx::atomic_write_json(&dir.join("install.json"), &meta)?; - } - } - } - } - Ok(()) -} - -const LAUNCHER_REALM_REPLACEMENTS: &[(&str, &str)] = &[ - ("(\"WorldDatabaseInfo\", \"acore_world\")", "(\"WorldDatabaseInfo\", \"acore_world_wildcard\" if coa_realm() == 'wildcard' else \"acore_world\")"), - ("(\"CharacterDatabaseInfo\", \"acore_characters\")", "(\"CharacterDatabaseInfo\", \"acore_characters_wildcard\" if coa_realm() == 'wildcard' else \"acore_characters\")"), - ("SET name='AzerothCore',address=", "SET name='{coa_realm_name()}',address="), - ("WHERE id=1;", "WHERE id={coa_realm_id()};"), - ("mysql(\"UPDATE acore_auth.realmlist SET flag=0", "mysql(f\"UPDATE acore_auth.realmlist SET flag=0"), -]; - -const LAUNCHER_REALM_INSERT: &str = "# coa-manager-realm-profiles-v1\ndef coa_realm():\n path = ROOT / 'Settings/realm-profile.json'\n return json.loads(path.read_text(encoding='utf-8')).get('active', 'coa') if path.exists() else 'coa'\n\ndef coa_realm_id():\n return 2 if coa_realm() == 'wildcard' else 1\n\ndef coa_realm_name():\n return 'Wildcard' if coa_realm() == 'wildcard' else 'Conquest of Azeroth'\n\n"; - -fn launcher_insert() -> String { - LAUNCHER_REALM_INSERT - .replace("profiles-v1", "profiles-v2") - .replace( - "return 2 if", - "return 3 if coa_realm() == 'reborn' else 2 if", - ) - .replace( - "return 'Wildcard' if", - "return 'Warcraft Reborn' if coa_realm() == 'reborn' else 'Wildcard' if", - ) -} - -fn launcher_replacements() -> Vec<(&'static str, String)> { - LAUNCHER_REALM_REPLACEMENTS.iter().map(|(from, to)| (*from, to - .replace("\"acore_world_wildcard\" if", "\"acore_world_reborn\" if coa_realm() == 'reborn' else \"acore_world_wildcard\" if") - .replace("\"acore_characters_wildcard\" if", "\"acore_characters_reborn\" if coa_realm() == 'reborn' else \"acore_characters_wildcard\" if"))).collect() -} - -pub(crate) fn patch_launcher(source: &str) -> Result<String> { - if source.contains("# coa-manager-realm-profiles-v2") { - return Ok(source.into()); - } - if source.contains("# coa-manager-realm-profiles-v1") { - let original = unpatch_launcher(source) - .ok_or_else(|| Error::Invalid("Unrecognised realm launcher patch.".into()))?; - return patch_launcher(&original); - } - let mut out = source.to_string(); - for (from, to) in launcher_replacements() { - if !out.contains(from) { - return Err(Error::Invalid( - "This launcher does not support realm profiles. Update the server package first." - .into(), - )); - } - out = out.replace(from, &to); - } - // Insert before the entry point so ROOT, json and functions are all defined when called. - let marker = "if __name__ == \"__main__\":"; - if !out.contains(marker) { - return Err(Error::Invalid( - "Unrecognised server launcher entry point.".into(), - )); - } - Ok(out.replace(marker, &format!("{}{marker}", launcher_insert()))) -} - -/// Reverse only our exact realm transformation; callers must verify the recovered original hash. -pub(crate) fn unpatch_launcher(source: &str) -> Option<String> { - let (insert, replacements) = if source.contains(&launcher_insert()) { - (launcher_insert(), launcher_replacements()) - } else if source.contains(LAUNCHER_REALM_INSERT) { - ( - LAUNCHER_REALM_INSERT.into(), - LAUNCHER_REALM_REPLACEMENTS - .iter() - .map(|(a, b)| (*a, b.to_string())) - .collect(), - ) - } else { - return None; - }; - let mut original = source.replacen(&insert, "", 1); - for (from, to) in &replacements { - original = original.replace(to, from); - } - let mut check = original.clone(); - for (from, to) in &replacements { - check = check.replace(from, to); - } - check = check.replace( - "if __name__ == \"__main__\":", - &format!("{insert}if __name__ == \"__main__\":"), - ); - (check == source).then_some(original) -} - /// The character-creation model the world server advertises for a realm. Every realm has its own database and its own /// entry on Overview, so it advertises exactly one model: a list such as `"coa wcr"` would let players create /// Warcraft Reborn characters in the Conquest of Azeroth realm. @@ -775,7 +647,6 @@ pub fn before_start(root: &Path) -> Result<()> { if !root.join(STATE).exists() { return Ok(()); } - prepare_launcher(root)?; if s.simultaneous && !view(root)?.supported { return Err(Error::Invalid( "The installed server build does not support simultaneous Wildcard startup.".into(), @@ -1112,26 +983,6 @@ CoA.GameModeMask = 0 assert!(!v.supported); } - #[test] - fn old_launcher_upgrades_and_both_patch_versions_are_reversible() { - let original = "(\"WorldDatabaseInfo\", \"acore_world\")\n(\"CharacterDatabaseInfo\", \"acore_characters\")\nSET name='AzerothCore',address=\nWHERE id=1;\nmysql(\"UPDATE acore_auth.realmlist SET flag=0\nif __name__ == \"__main__\":\n"; - let mut old = original.to_string(); - for (from, to) in LAUNCHER_REALM_REPLACEMENTS { - old = old.replace(from, to); - } - old = old.replace( - "if __name__ == \"__main__\":", - &format!("{LAUNCHER_REALM_INSERT}if __name__ == \"__main__\":"), - ); - assert_eq!(unpatch_launcher(&old).as_deref(), Some(original)); - let new = patch_launcher(&old).unwrap(); - assert!(new.contains("acore_world_reborn")); - assert!(new.contains("return 3 if coa_realm() == 'reborn'")); - assert!(new.contains("return 'Warcraft Reborn' if")); - assert_eq!(patch_launcher(&new).unwrap(), new); - assert_eq!(unpatch_launcher(&new).as_deref(), Some(original)); - } - #[test] fn a_docker_server_is_checked_for_wildcard_support_in_its_own_binary() { let d = tempfile::tempdir().unwrap(); @@ -1162,21 +1013,6 @@ CoA.GameModeMask = 0 assert!(view(d.path()).unwrap().supported); } - #[test] - fn a_docker_server_has_no_launcher_to_adapt() { - let d = tempfile::tempdir().unwrap(); - fs::create_dir_all(d.path().join("Settings")).unwrap(); - // No Scripts/manage.py anywhere: neither a repack without the Python launcher nor a Docker server has - // anything to adapt. - assert!(prepare_launcher(d.path()).is_ok()); - fs::write( - d.path().join("Settings/docker.json"), - br#"{"project":"t1"}"#, - ) - .unwrap(); - prepare_launcher(d.path()).unwrap(); - } - #[test] fn fresh_wildcard_disables_bots_and_preserves_scaling() { let mut f = Files::new(); @@ -1276,42 +1112,4 @@ CoA.GameModeMask = 0 .is_err()); assert!(guard_module(t.path(), "content-scaling").is_ok()); } - - #[test] - fn unknown_launcher_is_refused_without_partial_patching() { - assert!(patch_launcher("print('custom launcher')").is_err()); - } - - #[test] - fn managed_launcher_patch_remains_pristine_but_external_edits_conflict() { - let d = tempfile::tempdir().unwrap(); - let root = d.path().join("server"); - let source = "(\"WorldDatabaseInfo\", \"acore_world\")\n(\"CharacterDatabaseInfo\", \"acore_characters\")\nSET name='AzerothCore',address=\nWHERE id=1;\nmysql(\"UPDATE acore_auth.realmlist SET flag=0\nif __name__ == \"__main__\":\n"; - fsx::atomic_write(&root.join("Scripts/manage.py"), source.as_bytes()).unwrap(); - let mut meta = crate::registry::InstallMeta::new(crate::registry::InstallKind::New, &root); - meta.original_hashes.insert( - "Scripts/manage.py".into(), - fsx::sha256_bytes(source.as_bytes()), - ); - let dir = crate::registry::MetaDir::create(&root, &meta).unwrap(); - prepare_launcher(&root).unwrap(); - let (_, meta) = crate::registry::MetaDir::open(&dir.root).unwrap(); - assert!(crate::diag::verify_managed(&root, &meta).is_empty()); - let manifest: crate::manifest::Manifest = serde_json::from_value(serde_json::json!({ - "schema": 1, "kind": "update", "version": "2.0.0", "core": {"commit": null}, "builtAt": "fixture", "minManagerVersion": "0.1.0", - "files": [{"path":"Scripts/manage.py","sha256":fsx::sha256_bytes(b"next release"),"size":12,"owner":"core","policy":"replace"}] - })).unwrap(); - assert_eq!( - crate::update::plan(&root, &meta, &manifest, &BTreeMap::new(), None).unwrap()[0].action, - crate::update::Action::Replace - ); - let mut modified = fs::read(root.join("Scripts/manage.py")).unwrap(); - modified.extend_from_slice(b"# custom edit\n"); - fsx::atomic_write(&root.join("Scripts/manage.py"), &modified).unwrap(); - prepare_launcher(&root).unwrap(); - assert_eq!( - crate::update::plan(&root, &meta, &manifest, &BTreeMap::new(), None).unwrap()[0].action, - crate::update::Action::Conflict - ); - } } diff --git a/crates/coa-core/src/update.rs b/crates/coa-core/src/update.rs index a23b8cc..b13da2d 100644 --- a/crates/coa-core/src/update.rs +++ b/crates/coa-core/src/update.rs @@ -403,7 +403,7 @@ pub fn plan( match (fs::read_to_string(tree.join(&f.path)), fs::read(&target)) { (Ok(signed), Ok(actual)) => { fsx::sha256_bytes(signed.as_bytes()) == f.sha256 - && crate::driver::launcher_matches(&signed, &actual) + && crate::legacy_launcher::launcher_matches(&signed, &actual) } _ => false, } @@ -418,7 +418,7 @@ pub fn plan( let manager_launcher = f.path == "Scripts/manage.py" && recorded.is_some_and(|hash| { fs::read(&target).is_ok_and(|bytes| { - crate::driver::launcher_matches_recorded(hash, &bytes) + crate::legacy_launcher::launcher_matches_recorded(hash, &bytes) }) }); if f.path == "Core/worldserver.exe" @@ -614,7 +614,7 @@ fn launcher_already_integrated( if meta.original_hashes.get(&file.path) != Some(&fsx::sha256_bytes(&actual)) { return Ok(false); } - Ok(crate::driver::launcher_matches_recorded( + Ok(crate::legacy_launcher::launcher_matches_recorded( &file.sha256, &actual, )) @@ -968,7 +968,7 @@ fn finish( fs::read_to_string(tree.join(&op.path)), fs::read(root.join(&op.path)), ) { - (Ok(signed), Ok(actual)) if crate::driver::launcher_matches(&signed, &actual) => { + (Ok(signed), Ok(actual)) if crate::legacy_launcher::launcher_matches(&signed, &actual) => { fsx::sha256_bytes(&actual) } _ => op.new_sha256.clone(), @@ -1060,7 +1060,7 @@ pub fn retry_validation( && fs::read_to_string(dir.join("tree").join(&op.path)) .ok() .filter(|s| fsx::sha256_bytes(s.as_bytes()) == file.sha256) - .is_some_and(|s| crate::driver::launcher_matches(&s, &bytes)); + .is_some_and(|s| crate::legacy_launcher::launcher_matches(&s, &bytes)); if actual != file.sha256 && !launcher { return Err(Error::Invalid(format!( "{} changed since the update was applied; use repair or rollback.", @@ -2347,9 +2347,9 @@ mod tests { fn legacy_launcher_world(import_patch: bool) -> World { let w = world(&[("Scripts/manage.py", b"new release launcher")], false); - let mut source = crate::realms::patch_launcher(LEGACY_LAUNCHER).unwrap(); + let mut source = crate::legacy_launcher::patch_launcher(LEGACY_LAUNCHER).unwrap(); if import_patch { - source = crate::driver::patch_launcher_imports(&source).unwrap(); + source = crate::legacy_launcher::patch_launcher_imports(&source).unwrap(); } write(&w.root, "Scripts/manage.py", source.as_bytes()); let (_, mut meta) = MetaDir::open(&w.meta).unwrap(); @@ -2576,7 +2576,7 @@ mod tests { let w = world(&[("Scripts/manage.py", source)], false); run(&w, &Fake::ok(), BTreeMap::new(), None).unwrap(); let integrated = - crate::driver::patch_launcher_imports(std::str::from_utf8(source).unwrap()).unwrap(); + crate::legacy_launcher::patch_launcher_imports(std::str::from_utf8(source).unwrap()).unwrap(); write(&w.root, "Scripts/manage.py", integrated.as_bytes()); let (_, mut meta) = MetaDir::open(&w.meta).unwrap(); meta.original_hashes.insert( From abcc816581c87321366bc7a96ac20a9fcc20dc3e 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?= <corfirean@gmail.com> Date: Tue, 10 Nov 2026 16:07:54 +0500 Subject: [PATCH 08/29] Stop: ask the world again when a shutdown request is lost A console shutdown request is sometimes lost, and the world then keeps running until the stop times out. While the world still runs and its console still answers after 15 s, the launcher asks again (twice at most); asking twice is harmless. Verified on a disposable repack with the first World::ShutdownServ call suppressed in a debugger: the second request stopped the world. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/coa-core/src/launcher/services.rs | 37 +++++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/crates/coa-core/src/launcher/services.rs b/crates/coa-core/src/launcher/services.rs index 274b827..8b74b6b 100644 --- a/crates/coa-core/src/launcher/services.rs +++ b/crates/coa-core/src/launcher/services.rs @@ -268,6 +268,14 @@ fn owned_world(root: &Path) -> Result<Option<ProcessIdentity>> { Ok(Some(world)) } +/// Ask the world's console for a graceful shutdown. False when the console is not this world's or does not answer. +fn ask_shutdown(root: &Path, cfg: &Settings) -> bool { + ready(root, "world", cfg.ra_port) + && crate::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password) + .and_then(|ra| ra.send_without_answer("server shutdown 1s 0")) + .is_ok() +} + /// Stop this folder's world without its console (unsaved progress since the last save is lost). fn stop_world_process(world: &ProcessIdentity) -> Result<()> { terminate(world).map_err(|_| Error::Invalid("Worldserver could not be stopped safely; its database was left running.".into()))?; @@ -290,18 +298,25 @@ pub fn force_stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result /// world leaves the shared database alone. pub fn stop_all(root: &Path, cfg: &Settings, progress: Progress) -> Result<()> { if let Some(world) = owned_world(root)? { - let asked = ready(root, "world", cfg.ra_port) - .then(|| crate::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password)) - .and_then(|r| r.ok()) - .map(|ra| ra.send_without_answer("server shutdown 1s 0")); - match asked { - Some(Ok(())) => progress("Graceful world shutdown requested."), - _ => { - progress("World console unavailable; stopping this repack's recorded world process."); - stop_world_process(&world)?; - } + if ask_shutdown(root, cfg) { + progress("Graceful world shutdown requested."); + } else { + progress("World console unavailable; stopping this repack's recorded world process."); + stop_world_process(&world)?; } - if !wait_stopped(&world, 90) { + // A console request can be lost (seen when a client disconnected at once). While the world still runs + // and its console still answers, it has not begun to stop: ask again. Asking twice is harmless. + let mut stopped = wait_stopped(&world, 15); + for _ in 0..2 { + if stopped { + break; + } + if ask_shutdown(root, cfg) { + progress("The world has not begun to stop; shutdown requested again."); + } + stopped = wait_stopped(&world, 15); + } + if !stopped && !wait_stopped(&world, 45) { return Err(Error::Invalid("Worldserver is still stopping; its database has been left running.".into())); } } From 2e6fcceb05ed2e507b454a3d522cfdafc93a5fa7 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?= <corfirean@gmail.com> Date: Tue, 10 Nov 2026 16:48:17 +0500 Subject: [PATCH 09/29] CI: drop the launcher bridge test (the bridge was removed) tools/test_launcher_bridge.py tested crates/coa-core/src/launcher_bridge.py, which the Rust launcher replaced; check.yml and release.yml still ran it, so the release build failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/check.yml | 1 - .github/workflows/release.yml | 1 - tools/test_launcher_bridge.py | 223 ---------------------------------- 3 files changed, 225 deletions(-) delete mode 100644 tools/test_launcher_bridge.py diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 20d4693..c2309b4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,5 +26,4 @@ jobs: - run: node tools/check-i18n.mjs - run: npm run build - run: node --experimental-strip-types --test tools/*.test.mjs - - run: python -B -m unittest discover -s tools -p test_launcher_bridge.py - run: cargo test --workspace --locked diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d53e7ed..7df8ba6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,6 @@ jobs: - name: Tests run: cargo test --workspace --locked -- --test-threads=1 - run: node --experimental-strip-types --test tools/*.test.mjs - - run: python -B -m unittest discover -s tools -p test_launcher_bridge.py - name: Build and sign (publish only when requested) id: tauri uses: tauri-apps/tauri-action@v0 diff --git a/tools/test_launcher_bridge.py b/tools/test_launcher_bridge.py deleted file mode 100644 index 94c1637..0000000 --- a/tools/test_launcher_bridge.py +++ /dev/null @@ -1,223 +0,0 @@ -import pathlib -import runpy -import sys -import tempfile -import unittest -import time -from unittest.mock import patch - -BRIDGE = pathlib.Path(__file__).resolve().parents[1] / 'crates/coa-core/src/launcher_bridge.py' - - -class LauncherBridgeTests(unittest.TestCase): - def launch(self, action, body): - with tempfile.TemporaryDirectory() as directory: - script = pathlib.Path(directory) / 'Scripts/manage.py' - script.parent.mkdir() - script.write_text(body, encoding='utf8') - original = runpy.run_path - def capture(*args, **kwargs): - self.launcher = original(*args, **kwargs) - return self.launcher - with patch.object(sys, 'argv', ['bridge', str(script), action]), patch.object(runpy, 'run_path', side_effect=capture): - return original(str(BRIDGE)) - - def shutdown_fixture(self, *, console_error='RuntimeError', stopped=True, foreign=False, same=True, modern=False, terminate_error=False): - return f''' -from pathlib import Path -from contextlib import nullcontext -calls = [] -world = {{'pid': 123, 'created': 456, 'exe': str(Path(__file__).resolve().parents[1] / {'"foreign.exe"' if foreign else '"Core/worldserver.exe"'})}} -def wait_ready(*args): pass -def start_mysql(): raise AssertionError('must not start') -def main(): raise AssertionError('must not prepare') -def settings(): return {{}} -def control_lock(): return nullcontext() -def process(name): return world if name == 'world' else None -def same_process(record): return {same!r} -def ra(command, config): - calls.append('console') - {'raise '+console_error+'("Start this repack worldserver first")' if console_error else 'return "Graceful shutdown"'} -def terminate(record): - assert record is world - calls.append('terminate') - {'raise RuntimeError("identity changed")' if terminate_error else 'pass'} -def wait_stopped(record, seconds): - assert record is world - calls.append('wait') - return {stopped!r} -def stop_all(config): - record = process('world') - if record: - if {modern!r}: - try: ra('server shutdown 1s 0', config) - except (OSError, RuntimeError): terminate(record) - else: - ra('server shutdown 1s 0', config) - if not wait_stopped(record, 60): raise RuntimeError('world still alive') - calls.append('mysql-shutdown') -''' - - def test_unavailable_console_in_restored_legacy_launcher_stops_owned_world_before_mysql(self): - for error in ['RuntimeError', 'OSError']: - with self.subTest(error=error): - result = self.launch('stop-all', self.shutdown_fixture(console_error=error)) - self.assertEqual(result['launcher']['calls'], ['console', 'terminate', 'wait', 'wait', 'mysql-shutdown']) - - def test_force_stop_terminates_only_the_owned_world_before_mysql(self): - body = self.shutdown_fixture(console_error=None) - body = body.replace("return world if name == 'world' else None", "return world if name == 'world' and 'terminate' not in calls else None") - result = self.launch('force-stop-all', body) - self.assertEqual(result['launcher']['calls'], ['terminate', 'wait', 'mysql-shutdown']) - - def test_force_stop_rejects_foreign_or_reused_pids_and_a_world_that_stays_alive(self): - for options, message in [({'foreign': True}, 'ownership could not be verified'), - ({'same': False}, 'ownership could not be verified'), - ({'stopped': False}, 'database was left running')]: - with self.subTest(options=options): - with self.assertRaisesRegex(Exception, message): - self.launch('force-stop-all', self.shutdown_fixture(**options)) - self.assertNotIn('mysql-shutdown', self.launcher['calls']) - - def test_healthy_console_keeps_graceful_shutdown(self): - result = self.launch('stop-all', self.shutdown_fixture(console_error=None)) - self.assertEqual(result['launcher']['calls'], ['console', 'wait', 'mysql-shutdown']) - - def test_foreign_or_reused_process_is_never_terminated_even_by_a_modern_launcher_catch(self): - for modern in [False, True]: - for identity in [{'foreign': True}, {'same': False}]: - with self.subTest(modern=modern, **identity): - with self.assertRaisesRegex(Exception, 'ownership could not be verified'): - self.launch('stop-all', self.shutdown_fixture(modern=modern, **identity)) - self.assertEqual(self.launcher['calls'], ['console']) - - def test_world_that_stays_alive_blocks_database_shutdown(self): - for modern in [False, True]: - with self.subTest(modern=modern): - with self.assertRaisesRegex(Exception, 'database was left running'): - self.launch('stop-all', self.shutdown_fixture(stopped=False, modern=modern)) - self.assertEqual(self.launcher['calls'], ['console', 'terminate', 'wait']) - - def test_termination_identity_failure_leaves_mysql_untouched(self): - for modern in [False, True]: - with self.subTest(modern=modern): - with self.assertRaisesRegex(Exception, 'could not be stopped safely'): - self.launch('stop-all', self.shutdown_fixture(terminate_error=True, modern=modern)) - self.assertEqual(self.launcher['calls'], ['console', 'terminate']) - - def test_slow_mysql_gets_time_to_finish_but_other_waits_are_unchanged(self): - result = self.launch('start-mysql', ''' -calls = [] -def wait_ready(name, port, seconds=180): - calls.append((name, seconds)) - if name == 'mysql' and seconds < 162: - raise RuntimeError('mysql is still starting') -def start_mysql(): - wait_ready('mysql', 12345, 60) -def main(): - start_mysql() - wait_ready('world', 23456, 180) - wait_ready('mysql', 12345, 900) -''') - calls = result['launcher']['calls'] - self.assertEqual(calls[0], ('mysql', 300)) - self.assertEqual(calls[2], ('mysql', 900)) - self.assertEqual(calls[1][0], 'world') - self.assertAlmostEqual(calls[1][1], 1500, delta=1) - - def world_start(self, *, game_at=420, console_at=480, dies_at=None, requested=180): - clock = [0.0] - def sleep(seconds): clock[0] += seconds - body = f''' -import time -calls = [] -dies_at = {dies_at!r} -def wait_ready(name, port, seconds=180): - until = time.monotonic() + seconds - while time.monotonic() < until: - if dies_at is not None and time.monotonic() >= dies_at: - raise RuntimeError('world stopped during startup') - if time.monotonic() >= ({game_at!r} if port == 1 else {console_at!r}): - calls.append(port) - return - time.sleep(0.5) - raise RuntimeError('world is still starting') -def start_mysql(): pass -def settings(): return {{}} -def process(name): return {{'pid': 1}} -def ra(command, config): return 'server info ready' -def main(): - wait_ready('world', 1, {requested}) - wait_ready('world', 2, {requested}) -''' - with patch('time.monotonic', side_effect=lambda: clock[0]), patch('time.sleep', side_effect=sleep): - result = self.launch('start-all', body) - return clock[0], result['launcher']['calls'] - - def test_open_ports_do_not_finish_startup_until_commands_are_processed(self): - clock = [0.0] - def sleep(seconds): clock[0] += seconds - body = """ -import time -calls=[] -def wait_ready(*args): pass -def start_mysql(): pass -def settings(): return {} -def process(name): return {'pid': 1} -def ra(command, config): - calls.append(command) - if time.monotonic() < 5: raise TimeoutError('main loop is loading') - return 'ready' -def main(): - wait_ready('world',1) - wait_ready('world',2) -""" - with patch('time.monotonic', side_effect=lambda: clock[0]), patch('time.sleep', side_effect=sleep): - result=self.launch('start-all',body) - self.assertEqual(clock[0],5) - self.assertEqual(set(result['launcher']['calls']),{'server info'}) - - def test_world_death_after_ports_open_is_a_startup_failure(self): - body=""" -def wait_ready(*args): pass -def start_mysql(): pass -def settings(): return {} -def process(name): return None -def main(): pass -""" - with self.assertRaisesRegex(RuntimeError,'stopped before its console accepted'): - self.launch('start-world',body) - - def test_legacy_coa_world_waits_for_both_ports_after_three_minutes(self): - elapsed, calls = self.world_start() - self.assertEqual((elapsed, calls), (480, [1, 2])) - - def test_console_wait_shares_the_world_deadline(self): - with self.assertRaisesRegex(RuntimeError, 'still starting'): - self.world_start(game_at=1490, console_at=1510) - self.assertEqual(self.launcher['calls'], [1]) - - def test_world_exit_is_reported_without_waiting_out_the_extended_budget(self): - with self.assertRaisesRegex(RuntimeError, 'stopped during startup'): - self.world_start(dies_at=12) - self.assertEqual(self.launcher['calls'], []) - - def test_existing_longer_world_timeout_is_preserved(self): - self.assertEqual(self.world_start(game_at=1600, console_at=1700, requested=1800), (1700, [1, 2])) - - def test_stop_dispatch_does_not_prepare_or_start_anything(self): - result = self.launch('stop-all', ''' -from contextlib import nullcontext -calls = [] -def wait_ready(*args): raise AssertionError('must not wait') -def start_mysql(): raise AssertionError('must not start') -def main(): raise AssertionError('must not prepare') -def settings(): return {'mysqlPort': 12345} -def control_lock(): return nullcontext() -def stop_all(config): calls.append(config['mysqlPort']) -''') - self.assertEqual(result['launcher']['calls'], [12345]) - - -if __name__ == '__main__': - unittest.main() From 8a313b83b8df823dc8c85a2ed8200e10b99d56b3 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 19:55:40 +0500 Subject: [PATCH 10/29] Cargo.lock: coa-launcher follows the workspace version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 12d2229..2750cd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -621,7 +621,7 @@ dependencies = [ [[package]] name = "coa-launcher" -version = "0.9.10" +version = "0.9.13" dependencies = [ "coa-core", "serde_json", From 20d4c3351ef31a40bb2eb9aac8b7c8a43e1b01ed 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 19:59:20 +0500 Subject: [PATCH 11/29] Ports: name Windows reservations at once, move the database to a free port A reserved or taken database port no longer fails the start after 30 seconds: the launcher recognises Windows excluded ranges (netsh), moves MySQL to a free port and records it in Settings/repack.json. Only the server's own services use that port. The database connection of with_database is rebuilt after the start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .../20261115-database-port-relocation.md | 7 + crates/coa-core/src/backup.rs | 8 +- crates/coa-core/src/launcher/ops.rs | 15 ++ crates/coa-core/src/launcher/services.rs | 227 ++++++++++++++++-- 4 files changed, 240 insertions(+), 17 deletions(-) create mode 100644 changelog.d/20261115-database-port-relocation.md diff --git a/changelog.d/20261115-database-port-relocation.md b/changelog.d/20261115-database-port-relocation.md new file mode 100644 index 0000000..c6c0e89 --- /dev/null +++ b/changelog.d/20261115-database-port-relocation.md @@ -0,0 +1,7 @@ +--- +area: manager +type: fixed +audience: admins +title: The database moves to a free port when Windows reserves or another program takes 3307 +--- +Hyper-V, WSL and Docker can reserve a range that includes the database port; the start then waited 30 seconds and failed. The database now picks a free port and records it, and a reserved game port is named as such at once. diff --git a/crates/coa-core/src/backup.rs b/crates/coa-core/src/backup.rs index 627d820..3eca9a3 100644 --- a/crates/coa-core/src/backup.rs +++ b/crates/coa-core/src/backup.rs @@ -308,7 +308,9 @@ pub fn with_database<T>(root: &Path, f: impl FnOnce(&Db) -> Result<T>) -> Result let db = Db::from_repack(root, Account::Admin)?; let observed = process::observe(root, &read_ports(root)); let mysql_was_up = observed.mysql.state == ServiceState::Running && db.ping(); - if !mysql_was_up { + let db = if mysql_was_up { + db + } else { let out = driver::run(root, Verb::StartMysql)?; if !out.ok { // Keep the launcher's own last lines: the title alone ("Something went wrong") hides the cause. @@ -317,7 +319,9 @@ pub fn with_database<T>(root: &Path, f: impl FnOnce(&Db) -> Result<T>) -> Result driver::startup_failure(root, &out) ))); } - } + // The start may have moved the database to another port (a reserved or taken one). + Db::from_repack(root, Account::Admin)? + }; let result = f(&db); if !mysql_was_up { let now = process::observe(root, &read_ports(root)); diff --git a/crates/coa-core/src/launcher/ops.rs b/crates/coa-core/src/launcher/ops.rs index 9e78be8..5caa59e 100644 --- a/crates/coa-core/src/launcher/ops.rs +++ b/crates/coa-core/src/launcher/ops.rs @@ -63,6 +63,21 @@ pub fn run(root: &Path, cfg: &Settings, offset: i32, action: Action, supervisor: if matches!(action, Action::StartAll | Action::StartWorld) { squid::validate_bots(root)?; } + let relocated; + let cfg = match action { + Action::StartAll | Action::StartMysql | Action::StartAuth | Action::StartWorld => { + match services::relocate_database_port(root, cfg, offset, progress)? { + Some(_) => { + let mut moved = Settings::load(root, offset)?; + moved.env_remove = cfg.env_remove.clone(); + relocated = moved; + &relocated + } + None => cfg, + } + } + _ => cfg, + }; render::prepare(root, cfg)?; if action == Action::Prepare { return Ok(()); diff --git a/crates/coa-core/src/launcher/services.rs b/crates/coa-core/src/launcher/services.rs index 8b74b6b..e85cbfc 100644 --- a/crates/coa-core/src/launcher/services.rs +++ b/crates/coa-core/src/launcher/services.rs @@ -35,12 +35,24 @@ pub fn spawn(root: &Path, name: &str, exe: &Path, args: &[&str], cwd: &Path, log // Ports // --------------------------------------------------------------------------------------------------------------- -/// Wait (up to 30 s) until `port` can be bound by a new server. A port with a listening owner is refused at -/// once; a port Windows still holds for a stopped process (a PID-zero row) is waited for. The test bind is -/// exclusive (`SO_EXCLUSIVEADDRUSE`), never a shared one. -pub fn ensure_free(port: u16, progress: Progress) -> Result<()> { - let deadline = Instant::now() + Duration::from_secs(30); +/// What keeps a new server off a port. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum PortBlock { + /// Processes listen on it. + Owned(Vec<u32>), + /// Windows keeps it in an excluded range (Hyper-V, WSL and Docker reserve such ranges); waiting never helps. + Reserved(u16, u16), + /// Windows still refuses it after the wait (a stopped process' socket, or an owner the table does not show). + Unavailable(i32), +} + +/// Wait (up to `wait`) until `port` can be bound by a new server. A port with a listening owner or inside a +/// Windows excluded range is reported at once; a port Windows still holds for a stopped process (a PID-zero row) +/// is waited for. The test bind is exclusive (`SO_EXCLUSIVEADDRUSE`), never a shared one. +pub fn port_block(port: u16, wait: Duration, progress: Progress) -> std::result::Result<(), PortBlock> { + let deadline = Instant::now() + wait; let mut announced = false; + let mut reserved: Option<Vec<(u16, u16)>> = None; loop { let mut owners: Vec<u32> = sys::tcp_rows_v4() .into_iter() @@ -50,19 +62,17 @@ pub fn ensure_free(port: u16, progress: Progress) -> Result<()> { owners.sort_unstable(); owners.dedup(); if owners.iter().any(|p| *p != 0) { - let list: Vec<String> = owners.iter().map(u32::to_string).collect(); - return Err(Error::Service( - ErrorCode::PortInUse, - format!("Port {port} is already used (PID {}). Stop the other server or change Settings/repack.json.", list.join(", ")), - )); + return Err(PortBlock::Owned(owners)); } match sys::exclusive_bind(port) { Ok(()) => return Ok(()), Err(code) if code == 10013 || code == 10048 => { + let ranges = reserved.get_or_insert_with(sys::excluded_ranges); + if let Some((start, end)) = ranges.iter().copied().find(|(s, e)| (*s..=*e).contains(&port)) { + return Err(PortBlock::Reserved(start, end)); + } if Instant::now() >= deadline { - return Err(Error::Invalid(format!( - "Port {port} remains unavailable after 30 seconds (Windows bind error {code}). No process was stopped. Retry after the previous database shutdown has finished, or check the Windows port reservation." - ))); + return Err(PortBlock::Unavailable(code)); } if !announced { progress(&format!("Waiting for Windows to release port {port}...")); @@ -70,11 +80,119 @@ pub fn ensure_free(port: u16, progress: Progress) -> Result<()> { } std::thread::sleep(Duration::from_millis(250)); } - Err(code) => return Err(Error::Invalid(format!("Port {port} cannot be checked (Windows error {code})."))), + Err(code) => return Err(PortBlock::Unavailable(code)), } } } +fn port_error(port: u16, block: PortBlock) -> Error { + match block { + PortBlock::Owned(owners) => { + let list: Vec<String> = owners.iter().map(u32::to_string).collect(); + Error::Service( + ErrorCode::PortInUse, + format!("Port {port} is already used (PID {}). Stop the other server or change Settings/repack.json.", list.join(", ")), + ) + } + PortBlock::Reserved(start, end) => Error::Service( + ErrorCode::PortInUse, + format!( + "Port {port} is reserved by Windows (excluded range {start}-{end}; Hyper-V, WSL and Docker reserve such ranges). Choose another port in Settings/repack.json, or restart the Windows NAT service as administrator (net stop winnat, then net start winnat)." + ), + ), + PortBlock::Unavailable(code) if code == 10013 || code == 10048 => Error::Invalid(format!( + "Port {port} remains unavailable after 30 seconds (Windows bind error {code}). No process was stopped. Retry after the previous database shutdown has finished, or check the Windows port reservation." + )), + PortBlock::Unavailable(code) => Error::Invalid(format!("Port {port} cannot be checked (Windows error {code}).")), + } +} + +/// [`port_block`] with up to 30 s of waiting, as an error a person can act on. +pub fn ensure_free(port: u16, progress: Progress) -> Result<()> { + port_block(port, Duration::from_secs(30), progress).map_err(|block| port_error(port, block)) +} + +/// The ports of this server's other services and extra worlds, which the database must not take. +fn ports_in_use_by_server(root: &Path, cfg: &Settings) -> Vec<u16> { + let mut ports = vec![cfg.auth_port, cfg.world_port, cfg.ra_port]; + for tree in crate::multiworld::Tree::ALL { + let other = crate::multiworld::tree_root(root, tree); + if let Ok(other) = Settings::load(&other, 0) { + ports.extend([other.world_port, other.ra_port, other.auth_port]); + } + } + ports +} + +/// Before the database starts: when its port is reserved by Windows or held by a program that is not this +/// server's MySQL, move the database to a free port and record it in `Settings/repack.json`. Only this server's +/// own services connect to MySQL (players never do), and every start renders their configs from that file, so +/// the move needs nothing else. Returns the new port, or `None` when the configured one is usable. +pub fn relocate_database_port(root: &Path, cfg: &Settings, offset: i32, progress: Progress) -> Result<Option<u16>> { + if cfg.shared_database || offset != 0 || state::running(root, "mysql").is_some() { + return Ok(None); + } + let block = match port_block(cfg.mysql_port, Duration::from_secs(30), progress) { + Ok(()) => return Ok(None), + Err(block) => block, + }; + let ours = root.join("mysql/bin/mysqld.exe"); + if let PortBlock::Owned(owners) = &block { + // This server's own database without a record: never start a second one on the same data. + let same = |pid: &u32| { + crate::process::identity(*pid).is_some_and(|p| same_file(Path::new(&p.exe), &ours)) + }; + if owners.iter().any(same) { + return Err(port_error(cfg.mysql_port, block)); + } + } + let taken = ports_in_use_by_server(root, cfg); + let reserved = sys::excluded_ranges(); + let candidate = (cfg.mysql_port.saturating_add(1)..=cfg.mysql_port.saturating_add(400)) + .chain(33070..=33470) + .filter(|p| *p > 1024) + .find(|p| { + !taken.contains(p) + && !reserved.iter().any(|(s, e)| (*s..=*e).contains(p)) + && port_block(*p, Duration::ZERO, &|_| {}).is_ok() + }); + let Some(port) = candidate else { + return Err(port_error(cfg.mysql_port, block)); + }; + let reason = match &block { + PortBlock::Owned(_) => "used by another program", + PortBlock::Reserved(..) => "reserved by Windows", + PortBlock::Unavailable(_) => "unavailable", + }; + let path = root.join("Settings/repack.json"); + let mut raw = cfg.raw.clone(); + raw.insert("mysqlPort".into(), port.into()); + crate::fsx::atomic_write_json(&path, &serde_json::Value::Object(raw))?; + tracing::warn!(old = cfg.mysql_port, new = port, reason, "database moved to a free port"); + progress(&format!("Port {} is {reason}; the database now uses port {port}.", cfg.mysql_port)); + Ok(Some(port)) +} + +fn same_file(a: &Path, b: &Path) -> bool { + match (std::fs::canonicalize(a), std::fs::canonicalize(b)) { + (Ok(a), Ok(b)) => a.to_string_lossy().eq_ignore_ascii_case(&b.to_string_lossy()), + _ => false, + } +} + +/// The ranges of `netsh interface ipv4 show excludedportrange protocol=tcp`: every line that starts with two +/// port numbers (the headers are translated, the numbers are not). +pub(crate) fn parse_excluded_ranges(text: &str) -> Vec<(u16, u16)> { + text.lines() + .filter_map(|line| { + let mut parts = line.split_whitespace(); + let start = parts.next()?.parse::<u16>().ok()?; + let end = parts.next()?.parse::<u16>().ok()?; + (start <= end).then_some((start, end)) + }) + .collect() +} + /// Is the recorded process of `name` serving `port`? Its listener row is the evidence; when a system does not /// show the owner of a listener, the server side of a fresh loopback connection is (never for MySQL, whose /// listener has always been visible and which should not get stray connections). @@ -473,6 +591,29 @@ mod sys { } /// Bind 0.0.0.0:port exclusively and release it. Err carries the Windows socket error. + /// Windows' excluded TCP port ranges, read with the system's own netsh (never one from PATH or the server). + pub fn excluded_ranges() -> Vec<(u16, u16)> { + use std::os::windows::process::CommandExt; + let mut directory = vec![0u16; 32768]; + let length = unsafe { + windows_sys::Win32::System::SystemInformation::GetSystemDirectoryW(directory.as_mut_ptr(), directory.len() as u32) + } as usize; + if length == 0 || length >= directory.len() { + return Vec::new(); + } + let netsh = std::path::PathBuf::from(String::from_utf16_lossy(&directory[..length])).join("netsh.exe"); + let output = std::process::Command::new(netsh) + .args(["interface", "ipv4", "show", "excludedportrange", "protocol=tcp"]) + .stdin(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .creation_flags(super::CREATE_NO_WINDOW) + .output(); + match output { + Ok(out) if out.status.success() => super::parse_excluded_ranges(&String::from_utf8_lossy(&out.stdout)), + _ => Vec::new(), + } + } + pub fn exclusive_bind(port: u16) -> std::result::Result<(), i32> { use socket2::{Domain, Socket, Type}; use std::os::windows::io::AsRawSocket; @@ -527,6 +668,9 @@ mod sys { pub fn exclusive_bind(_: u16) -> std::result::Result<(), i32> { Ok(()) } + pub fn excluded_ranges() -> Vec<(u16, u16)> { + Vec::new() + } pub fn terminate(_: &ProcessIdentity) -> Result<()> { Err(Error::Invalid("not supported".into())) } @@ -536,6 +680,57 @@ mod sys { mod tests { use super::*; + #[test] + fn excluded_ranges_are_read_from_translated_netsh_output() { + let english = "\r\nProtocol tcp Port Exclusion Ranges\r\n\r\nStart Port End Port\r\n---------- --------\r\n 3250 3349\r\n 50000 50059 *\r\n\r\n* - Administered port exclusions.\r\n"; + assert_eq!(parse_excluded_ranges(english), vec![(3250, 3349), (50000, 50059)]); + let russian = "\r\nПротокол tcp Диапазоны исключения портов\r\n\r\nНачальный порт Конечный порт\r\n---------- --------\r\n 50000 50059 *\r\n\r\n* — управляемые исключения портов.\r\n"; + assert_eq!(parse_excluded_ranges(russian), vec![(50000, 50059)]); + assert!(parse_excluded_ranges("").is_empty()); + } + + fn repack(dir: &Path, mysql: u16) { + std::fs::create_dir_all(dir.join("Settings")).unwrap(); + std::fs::write( + dir.join("Settings/repack.json"), + format!(r#"{{"mysqlPort":{mysql},"authPort":3724,"worldPort":8085,"raPort":3443,"raUsername":"U","raPassword":"P"}}"#), + ) + .unwrap(); + } + + #[test] + fn a_taken_database_port_moves_to_a_free_one_and_is_recorded() { + let d = tempfile::tempdir().unwrap(); + let held = std::net::TcpListener::bind("0.0.0.0:0").unwrap(); + let port = held.local_addr().unwrap().port(); + repack(d.path(), port); + let cfg = Settings::load(d.path(), 0).unwrap(); + let said = std::cell::RefCell::new(Vec::new()); + let moved = relocate_database_port(d.path(), &cfg, 0, &|line| said.borrow_mut().push(line.to_string())) + .unwrap() + .expect("moved"); + assert_ne!(moved, port); + let again = Settings::load(d.path(), 0).unwrap(); + assert_eq!(again.mysql_port, moved); + assert_eq!((again.auth_port, again.ra_username.as_str()), (3724, "U"), "other keys are kept"); + assert!(said.borrow().iter().any(|l| l.contains("used by another program")), "{said:?}"); + // The new port is usable: nothing moves on the next start. + assert_eq!(relocate_database_port(d.path(), &again, 0, &|_| {}).unwrap(), None); + } + + #[test] + fn extra_worlds_and_shifted_test_ports_never_move_the_database() { + let d = tempfile::tempdir().unwrap(); + let held = std::net::TcpListener::bind("0.0.0.0:0").unwrap(); + let port = held.local_addr().unwrap().port(); + repack(d.path(), port); + let cfg = Settings::load(d.path(), 0).unwrap(); + let shared = Settings { shared_database: true, ..cfg.clone() }; + assert_eq!(relocate_database_port(d.path(), &shared, 0, &|_| {}).unwrap(), None); + assert_eq!(relocate_database_port(d.path(), &cfg, 5, &|_| {}).unwrap(), None); + assert_eq!(Settings::load(d.path(), 0).unwrap().mysql_port, port); + } + #[test] fn a_port_with_a_listener_is_refused_and_a_free_one_passes() { let held = std::net::TcpListener::bind("0.0.0.0:0").unwrap(); @@ -554,9 +749,11 @@ mod tests { assert!(!ready(d.path(), "auth", port), "no record yet"); state::record(d.path(), "auth", std::process::id()).unwrap(); assert!(ready(d.path(), "auth", port)); + // A port nobody listens on now (port + 1 may belong to a test running in parallel in this process). let other = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); + let free = other.local_addr().unwrap().port(); drop(other); - assert!(!ready(d.path(), "auth", port + 1) || port + 1 == 0); + assert!(!ready(d.path(), "auth", free)); } #[test] From d1534ebc92f408d9c6cbe90a5a261659fd12da7a 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:08:48 +0500 Subject: [PATCH 12/29] Realm names chosen in the Manager (#61, #209) Settings, Startup lists every realm of the server with its name. The choice is kept in Settings/realm-names.json of the main folder; the launcher, the realm-list setup and the client's Config.wtf use it, and a running database gets it at once. Names are 1-32 characters without quotation marks or control characters, written as escaped SQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-realm-names.md | 7 + crates/coa-core/src/client.rs | 23 ++- crates/coa-core/src/launcher/services.rs | 4 +- crates/coa-core/src/launcher/settings.rs | 24 +-- crates/coa-core/src/lib.rs | 1 + crates/coa-core/src/realm_names.rs | 216 +++++++++++++++++++++++ crates/coa-core/src/realms.rs | 4 +- src-tauri/src/lib.rs | 34 +++- src/dev/mock.ts | 1 + src/i18n/locales/de.ts | 7 + src/i18n/locales/en.ts | 7 + src/i18n/locales/es.ts | 7 + src/i18n/locales/fr.ts | 7 + src/i18n/locales/ru.ts | 7 + src/i18n/locales/zh.ts | 7 + src/lib/api.ts | 3 + src/screens/RealmNameSettings.tsx | 60 +++++++ src/screens/SettingsHome.tsx | 3 +- 18 files changed, 396 insertions(+), 26 deletions(-) create mode 100644 changelog.d/20261115-realm-names.md create mode 100644 crates/coa-core/src/realm_names.rs create mode 100644 src/screens/RealmNameSettings.tsx diff --git a/changelog.d/20261115-realm-names.md b/changelog.d/20261115-realm-names.md new file mode 100644 index 0000000..2fb7df8 --- /dev/null +++ b/changelog.d/20261115-realm-names.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Rename your realms in the Manager +--- +Settings, Startup has a name for every realm. A running server shows it at once, the game client picks it on the next Play, and it stays after restarts and updates. Before, the launcher wrote the default name back at every start. diff --git a/crates/coa-core/src/client.rs b/crates/coa-core/src/client.rs index 25d2294..e94b06c 100644 --- a/crates/coa-core/src/client.rs +++ b/crates/coa-core/src/client.rs @@ -72,13 +72,23 @@ fn realm_config(old: &[u8], realm: &str) -> Vec<u8> { } pub fn sync_realm(client: &Path, meta: &Path, mode: crate::realms::Mode) -> Result<bool> { - sync_realm_when_closed(client, meta, mode, is_running(client)) + let realm = match mode { + crate::realms::Mode::Coa => "Conquest of Azeroth", + crate::realms::Mode::Wildcard => "Wildcard", + crate::realms::Mode::Reborn => "Warcraft Reborn", + }; + sync_realm_when_closed(client, meta, realm, is_running(client)) +} + +/// [`sync_realm`] with the realm's name as the server shows it (the owner may have renamed it). +pub fn sync_realm_named(client: &Path, meta: &Path, realm: &str) -> Result<bool> { + sync_realm_when_closed(client, meta, realm, is_running(client)) } fn sync_realm_when_closed( client: &Path, meta: &Path, - mode: crate::realms::Mode, + realm: &str, running: bool, ) -> Result<bool> { if running { @@ -90,11 +100,6 @@ fn sync_realm_when_closed( Err(e) if e.kind() == std::io::ErrorKind::NotFound => Vec::new(), Err(e) => return Err(e.into()), }; - let realm = match mode { - crate::realms::Mode::Coa => "Conquest of Azeroth", - crate::realms::Mode::Wildcard => "Wildcard", - crate::realms::Mode::Reborn => "Warcraft Reborn", - }; let new = realm_config(&old, realm); if new == old { return Ok(true); @@ -678,10 +683,10 @@ mod tests { let meta = d.path().join("meta"); let original = b"SET realmName \"Wildcard\"\n"; fs::write(c.join("WTF/Config.wtf"), original).unwrap(); - assert!(!sync_realm_when_closed(&c, &meta, crate::realms::Mode::Coa, true).unwrap()); + assert!(!sync_realm_when_closed(&c, &meta, "Conquest of Azeroth", true).unwrap()); assert_eq!(fs::read(c.join("WTF/Config.wtf")).unwrap(), original); assert!(!backup_dir(&meta).exists()); - assert!(sync_realm_when_closed(&c, &meta, crate::realms::Mode::Coa, false).unwrap()); + assert!(sync_realm_when_closed(&c, &meta, "Conquest of Azeroth", false).unwrap()); assert_eq!( fs::read(c.join("WTF/Config.wtf")).unwrap(), b"SET realmName \"Conquest of Azeroth\"\n" diff --git a/crates/coa-core/src/launcher/services.rs b/crates/coa-core/src/launcher/services.rs index e85cbfc..bb2c3f0 100644 --- a/crates/coa-core/src/launcher/services.rs +++ b/crates/coa-core/src/launcher/services.rs @@ -335,8 +335,8 @@ pub fn start_mysql(root: &Path, cfg: &Settings, progress: Progress) -> Result<() mysql( root, Some(&format!( - "UPDATE acore_auth.realmlist SET name='{}',address='127.0.0.1',localAddress='127.0.0.1',port={} WHERE id={};", - cfg.realm.name, cfg.world_port, cfg.realm.id + "UPDATE acore_auth.realmlist SET name={},address='127.0.0.1',localAddress='127.0.0.1',port={} WHERE id={};", + crate::realm_names::sql_literal(&cfg.realm.name), cfg.world_port, cfg.realm.id )), None, )?; diff --git a/crates/coa-core/src/launcher/settings.rs b/crates/coa-core/src/launcher/settings.rs index 14097f4..41b2532 100644 --- a/crates/coa-core/src/launcher/settings.rs +++ b/crates/coa-core/src/launcher/settings.rs @@ -14,7 +14,7 @@ pub const PORT_KEYS: [&str; 4] = ["mysqlPort", "authPort", "worldPort", "raPort" #[derive(Debug, Clone, PartialEq, Eq)] pub struct Realm { pub id: u32, - pub name: &'static str, + pub name: String, pub world_db: &'static str, pub characters_db: &'static str, } @@ -22,15 +22,19 @@ pub struct Realm { impl Realm { pub fn load(root: &Path) -> Result<Realm> { let path = root.join("Settings/realm-profile.json"); - if !path.exists() { - return Ok(Realm { id: 1, name: "AzerothCore", world_db: "acore_world", characters_db: "acore_characters" }); - } - let v: serde_json::Value = crate::fsx::read_json(&path)?; - Ok(match v.get("active").and_then(|a| a.as_str()).unwrap_or("coa") { - "wildcard" => Realm { id: 2, name: "Wildcard", world_db: "acore_world_wildcard", characters_db: "acore_characters_wildcard" }, - "reborn" => Realm { id: 3, name: "Warcraft Reborn", world_db: "acore_world_reborn", characters_db: "acore_characters_reborn" }, - _ => Realm { id: 1, name: "Conquest of Azeroth", world_db: "acore_world", characters_db: "acore_characters" }, - }) + let (id, name, world_db, characters_db) = if !path.exists() { + (1, "AzerothCore", "acore_world", "acore_characters") + } else { + let v: serde_json::Value = crate::fsx::read_json(&path)?; + match v.get("active").and_then(|a| a.as_str()).unwrap_or("coa") { + "wildcard" => (2, "Wildcard", "acore_world_wildcard", "acore_characters_wildcard"), + "reborn" => (3, "Warcraft Reborn", "acore_world_reborn", "acore_characters_reborn"), + _ => (1, "Conquest of Azeroth", "acore_world", "acore_characters"), + } + }; + // The owner's own name for this realm, when one was chosen in the Manager. + let name = crate::realm_names::name_or(root, id, name); + Ok(Realm { id, name, world_db, characters_db }) } } diff --git a/crates/coa-core/src/lib.rs b/crates/coa-core/src/lib.rs index b401084..53f1b71 100644 --- a/crates/coa-core/src/lib.rs +++ b/crates/coa-core/src/lib.rs @@ -56,6 +56,7 @@ pub mod ra; pub mod race_availability; pub mod realm_registry; pub mod realmlist; +pub mod realm_names; pub mod realms; pub mod registry; pub mod release; diff --git a/crates/coa-core/src/realm_names.rs b/crates/coa-core/src/realm_names.rs new file mode 100644 index 0000000..e0cce12 --- /dev/null +++ b/crates/coa-core/src/realm_names.rs @@ -0,0 +1,216 @@ +//! The names players see in the realm list, chosen by the server owner. +//! +//! The launcher writes `acore_auth.realmlist.name` at every start, so a name typed into the database (or into +//! an old `manage.py`) did not last. The owner's choice lives in `Settings/realm-names.json` of the server's main +//! folder, keyed by realm id, and every start and every realm-list setup uses it; extra worlds read their main +//! folder's file. + +use std::collections::BTreeMap; +use std::path::{Path, PathBuf}; + +use serde::{Deserialize, Serialize}; + +use crate::error::{Error, Result}; +use crate::fsx; + +const FILE: &str = "Settings/realm-names.json"; + +/// `acore_auth.realmlist.name` is `varchar(32)`. +pub const MAX_CHARS: usize = 32; + +#[derive(Debug, Default, Serialize, Deserialize)] +struct Names { + #[serde(default)] + names: BTreeMap<u32, String>, +} + +/// The folder that owns the names: an extra world (`<server>/.realms/<name>`) belongs to `<server>`. +fn main_folder(root: &Path) -> PathBuf { + if crate::launcher::settings::is_extra_world(root) { + if let Some(main) = root.parent().and_then(Path::parent) { + return main.to_path_buf(); + } + } + root.to_path_buf() +} + +fn read(root: &Path) -> Names { + let path = main_folder(root).join(FILE); + if !path.is_file() { + return Names::default(); + } + match fsx::read_json(&path) { + Ok(names) => names, + Err(error) => { + tracing::warn!(%error, "realm names could not be read; the default names are used"); + Names::default() + } + } +} + +/// A trimmed name the realm list can hold: 1 to 32 characters, no control characters. +pub fn validate(name: &str) -> Result<String> { + let name = name.trim(); + if name.is_empty() { + return Err(Error::Invalid("The realm name cannot be empty.".into())); + } + if name.chars().count() > MAX_CHARS { + return Err(Error::Invalid(format!( + "The realm name can have at most {MAX_CHARS} characters." + ))); + } + // The game client stores the realm as `SET realmName "<name>"` in Config.wtf. + if name.chars().any(|c| c.is_control() || c == '"') { + return Err(Error::Invalid( + "The realm name cannot contain quotation marks or control characters.".into(), + )); + } + Ok(name.to_string()) +} + +/// The owner's name for realm `id`, if one was chosen. +pub fn custom(root: &Path, id: u32) -> Option<String> { + read(root) + .names + .remove(&id) + .and_then(|name| validate(&name).ok()) +} + +/// The name realm `id` shows: the owner's choice, or `default`. +pub fn name_or(root: &Path, id: u32, default: &str) -> String { + custom(root, id).unwrap_or_else(|| default.to_string()) +} + +/// The name the realm of `mode` shows. +pub fn for_mode(root: &Path, mode: crate::realms::Mode) -> String { + name_or(root, mode.realm_id(), mode.label()) +} + +/// Every chosen name. +pub fn all(root: &Path) -> BTreeMap<u32, String> { + read(root) + .names + .into_iter() + .filter_map(|(id, name)| validate(&name).ok().map(|name| (id, name))) + .collect() +} + +/// Choose a name for realm `id`; `None` (or an empty name) returns it to its default. +pub fn set(root: &Path, id: u32, name: Option<&str>) -> Result<Option<String>> { + let mut names = read(root); + let chosen = match name.map(str::trim).filter(|n| !n.is_empty()) { + Some(name) => Some(validate(name)?), + None => None, + }; + match &chosen { + Some(name) => names.names.insert(id, name.clone()), + None => names.names.remove(&id), + }; + fsx::atomic_write_json(&main_folder(root).join(FILE), &names)?; + Ok(chosen) +} + +/// A realm of this server and the name it shows. +#[derive(Debug, Clone, Serialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct RealmName { + pub id: u32, + pub name: String, + pub default_name: String, + pub custom: bool, +} + +/// The realms of a server with their names: Conquest of Azeroth (or the plain repack's "AzerothCore") and the +/// Wildcard and Warcraft Reborn realms that were created. +pub fn list(root: &Path) -> Result<Vec<RealmName>> { + let main = main_folder(root); + let mut realms: Vec<(u32, &'static str)> = Vec::new(); + if main.join("Settings/realm-profile.json").exists() { + let state = crate::realms::state(&main)?; + realms.extend(state.modes().into_iter().map(|m| (m.realm_id(), m.label()))); + } else { + realms.push((1, "AzerothCore")); + } + realms.sort_unstable(); + realms.dedup(); + Ok(realms + .into_iter() + .map(|(id, default)| { + let custom = custom(&main, id); + RealmName { + id, + name: custom.clone().unwrap_or_else(|| default.to_string()), + default_name: default.to_string(), + custom: custom.is_some(), + } + }) + .collect()) +} + +/// Choose a name and, when the database runs, write it to the realm list at once (the auth server shows it +/// within its realm refresh interval). Returns the realms with their names. +pub fn rename(root: &Path, id: u32, name: Option<&str>) -> Result<Vec<RealmName>> { + let main = main_folder(root); + let known = list(&main)?; + let realm = known + .iter() + .find(|r| r.id == id) + .ok_or_else(|| Error::Invalid(format!("This server has no realm {id}.")))?; + let shown = set(&main, id, name)?.unwrap_or_else(|| realm.default_name.clone()); + crate::backup::with_running_database(&main, |db| { + db.query(&format!( + "UPDATE acore_auth.realmlist SET name={} WHERE id={id};", + sql_literal(&shown) + )) + .map(|_| ()) + })?; + list(&main) +} + +/// `text` as a MySQL string literal (quotes and backslashes escaped). +pub fn sql_literal(text: &str) -> String { + let mut out = String::with_capacity(text.len() + 2); + out.push('\''); + for c in text.chars() { + match c { + '\'' => out.push_str("''"), + '\\' => out.push_str("\\\\"), + c => out.push(c), + } + } + out.push('\''); + out +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn names_are_validated_trimmed_and_reset() { + let d = tempfile::tempdir().unwrap(); + assert_eq!(name_or(d.path(), 1, "Conquest of Azeroth"), "Conquest of Azeroth"); + assert_eq!(set(d.path(), 1, Some(" Owner's Realm ")).unwrap().as_deref(), Some("Owner's Realm")); + assert_eq!(name_or(d.path(), 1, "x"), "Owner's Realm"); + assert!(set(d.path(), 2, Some(&"a".repeat(33))).is_err()); + assert!(set(d.path(), 2, Some("bad\nname")).is_err()); + assert_eq!(set(d.path(), 2, Some("Царство")).unwrap().as_deref(), Some("Царство")); + assert_eq!(all(d.path()).len(), 2); + assert_eq!(set(d.path(), 1, Some(" ")).unwrap(), None); + assert_eq!(name_or(d.path(), 1, "Conquest of Azeroth"), "Conquest of Azeroth"); + } + + #[test] + fn an_extra_world_reads_its_main_folders_names() { + let d = tempfile::tempdir().unwrap(); + set(d.path(), 2, Some("Wild Side")).unwrap(); + let extra = d.path().join(".realms/secondary"); + std::fs::create_dir_all(&extra).unwrap(); + assert_eq!(custom(&extra, 2).as_deref(), Some("Wild Side")); + } + + #[test] + fn names_are_safe_in_sql() { + assert_eq!(sql_literal(r"O'Neil \ realm"), r"'O''Neil \\ realm'"); + } +} diff --git a/crates/coa-core/src/realms.rs b/crates/coa-core/src/realms.rs index ba5bfb1..96532d3 100644 --- a/crates/coa-core/src/realms.rs +++ b/crates/coa-core/src/realms.rs @@ -707,8 +707,8 @@ pub fn setup_realmlist(root: &Path) -> Result<()> { let port = layout::read_ports(root).world; for mode in s.modes().into_iter().filter(|m| *m != Mode::Coa) { let id = mode.realm_id(); - let name = mode.label(); - db.query(&format!("INSERT INTO acore_auth.realmlist (id,name,address,localAddress,localSubnetMask,port,icon,flag,timezone,gamebuild) SELECT {id},'{name}',address,localAddress,localSubnetMask,{port},icon,2,timezone,gamebuild FROM acore_auth.realmlist WHERE id=1 ON DUPLICATE KEY UPDATE port={port};"))?; + let name = crate::realm_names::sql_literal(&crate::realm_names::name_or(root, id, mode.label())); + db.query(&format!("INSERT INTO acore_auth.realmlist (id,name,address,localAddress,localSubnetMask,port,icon,flag,timezone,gamebuild) SELECT {id},{name},address,localAddress,localSubnetMask,{port},icon,2,timezone,gamebuild FROM acore_auth.realmlist WHERE id=1 ON DUPLICATE KEY UPDATE port={port},name={name};"))?; } let ids = s .modes() diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 38c262f..d8b595b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1217,7 +1217,11 @@ async fn realm_select( let view = coa_core::realms::select(&root, mode)?; let (dir, meta) = install_meta(&root)?; if let Some(client) = meta.client_path { - coa_core::client::sync_realm(std::path::Path::new(&client), &dir, view.active)?; + coa_core::client::sync_realm_named( + std::path::Path::new(&client), + &dir, + &coa_core::realm_names::for_mode(&root, view.active), + )?; } if restart { let out = driver::run(&root, Verb::StartAll)?; @@ -1234,6 +1238,29 @@ async fn realm_select( result } +#[tauri::command] +async fn realm_names( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<Vec<coa_core::realm_names::RealmName>, UiError> { + let root = path_of(&state, &id)?; + blocking(move || coa_core::realm_names::list(&root)).await +} + +/// Rename a realm (`None` brings back its default name). The realm list changes at once when the database runs, +/// and the linked game client selects the new name on the next Play. +#[tauri::command] +async fn realm_rename( + state: State<'_, AppState>, + id: String, + realm_id: u32, + name: Option<String>, +) -> std::result::Result<Vec<coa_core::realm_names::RealmName>, UiError> { + let root = path_of(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || coa_core::realm_names::rename(&root, realm_id, name.as_deref())).await +} + #[tauri::command] async fn realm_simultaneous( state: State<'_, AppState>, @@ -2427,7 +2454,8 @@ async fn play( } blocking(move || { let mode = coa_core::realms::state(&root)?.active; - if !coa_core::client::sync_realm(&client, &dir, mode)? { + let realm = coa_core::realm_names::for_mode(&root, mode); + if !coa_core::client::sync_realm_named(&client, &dir, &realm)? { return Err(Error::Invalid( "Close the game client before pressing Play so its selected realm can be updated." .into(), @@ -2981,6 +3009,8 @@ pub fn run() { realm_select, realm_simultaneous, realm_with_reborn, + realm_names, + realm_rename, check_database, repair_server, module_set_enabled, diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 7b8e566..1965c6a 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -39,6 +39,7 @@ export {}; if(cmd==="pending_update") return null; if(cmd==="plugin:app|version") return "0.8.2"; if(cmd==="release_history") throw new Error("Offline demo: using bundled notes"); + if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));} if(cmd==="realm_profiles") return {active:realm,wildcard_created:wildcardCreated,reborn_created:rebornCreated,reborn_supported:true,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:simultaneous&&running,with_reborn:withReborn,reborn_world_port:withReborn?8087:null,reborn_running:withReborn&&running}; if(cmd==="realm_simultaneous") { if(running) throw new Error("Stop both realms before changing simultaneous startup."); simultaneous=args.enabled; wildcardCreated ||= simultaneous; return {active:realm,wildcard_created:wildcardCreated,reborn_created:rebornCreated,reborn_supported:true,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:false,with_reborn:withReborn,reborn_world_port:withReborn?8087:null,reborn_running:false}; } if(cmd==="realm_with_reborn") { if(running) throw new Error("Stop all realms before changing which realms start together."); withReborn=args.enabled; rebornCreated ||= withReborn; return {active:realm,wildcard_created:wildcardCreated,reborn_created:rebornCreated,reborn_supported:true,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:false,with_reborn:withReborn,reborn_world_port:withReborn?8087:null,reborn_running:false}; } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 44c2f27..308dbb2 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -773,6 +773,13 @@ const de: Partial<Record<keyof typeof en, string>> = { "overview.reportBtn": "Diagnose sammeln und melden", // Realmlist switcher and modules page + "realm.namesTitle": "Realmnamen", + "realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.", + "realm.nameSave": "Speichern", + "realm.nameReset": "Standardname", + "realm.nameDefault": "Standard: {name}", + "realm.nameSaved": "Gespeichert.", + "realm.nameQuotes": "Anführungszeichen sind nicht erlaubt: Der Spielclient speichert den Namen in Anführungszeichen.", "realm.profileLabel": "Realm", "realm.switching": "Realm wird gewechselt…", "realm.rebornCreate": "Warcraft-Reborn-Realm erstellen", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 5029df8..8d67fab 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -57,6 +57,13 @@ const en = { "remote.hostInstead": "Host my own server", "welcome.roleSubtitle": "How would you like to play?", + "realm.namesTitle": "Realm names", + "realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.", + "realm.nameSave": "Save", + "realm.nameReset": "Default name", + "realm.nameDefault": "Default: {name}", + "realm.nameSaved": "Saved.", + "realm.nameQuotes": "Quotation marks are not allowed: the game client stores the name in quotes.", "realm.profileLabel": "Realm", "realm.startupTitle": "Realm startup", "realm.secondWorld": "Second world", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 7f9f2da..3bc0fdc 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -773,6 +773,13 @@ const es: Partial<Record<keyof typeof en, string>> = { "overview.reportBtn": "Reunir el diagnóstico y avisar", // Realmlist switcher and modules page + "realm.namesTitle": "Nombres de los reinos", + "realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.", + "realm.nameSave": "Guardar", + "realm.nameReset": "Nombre predeterminado", + "realm.nameDefault": "Predeterminado: {name}", + "realm.nameSaved": "Guardado.", + "realm.nameQuotes": "No se permiten comillas: el cliente del juego guarda el nombre entre comillas.", "realm.profileLabel": "Reino", "realm.switching": "Cambiando de reino…", "realm.rebornCreate": "Crear reino Warcraft Reborn", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index a00a770..3476e74 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -773,6 +773,13 @@ const fr: Partial<Record<keyof typeof en, string>> = { "overview.reportBtn": "Rassembler le diagnostic et signaler", // Realmlist switcher and modules page + "realm.namesTitle": "Noms des royaumes", + "realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.", + "realm.nameSave": "Enregistrer", + "realm.nameReset": "Nom par défaut", + "realm.nameDefault": "Par défaut : {name}", + "realm.nameSaved": "Enregistré.", + "realm.nameQuotes": "Les guillemets ne sont pas autorisés : le client du jeu enregistre le nom entre guillemets.", "realm.profileLabel": "Royaume", "realm.switching": "Changement de royaume…", "realm.rebornCreate": "Créer le royaume Warcraft Reborn", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 97d51ac..afaba73 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -60,6 +60,13 @@ const ru: Partial<Record<keyof typeof en, string>> = { "remote.hostInstead": "Создать свой сервер", "welcome.roleSubtitle": "Как вы хотите играть?", + "realm.namesTitle": "Названия реалмов", + "realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.", + "realm.nameSave": "Сохранить", + "realm.nameReset": "Стандартное название", + "realm.nameDefault": "По умолчанию: {name}", + "realm.nameSaved": "Сохранено.", + "realm.nameQuotes": "Кавычки нельзя: клиент игры хранит название в кавычках.", "realm.profileLabel": "Реалм", "realm.startupTitle": "Запуск реалмов", "realm.secondWorld": "Второй мир", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index b42c05c..3d7dda9 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -58,6 +58,13 @@ const zh = { "remote.hostInstead": "搭建自己的服务器", "welcome.roleSubtitle": "你想如何游玩?", + "realm.namesTitle": "服务器名称", + "realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。", + "realm.nameSave": "保存", + "realm.nameReset": "默认名称", + "realm.nameDefault": "默认:{name}", + "realm.nameSaved": "已保存。", + "realm.nameQuotes": "不能使用引号:游戏客户端用引号保存名称。", "realm.profileLabel": "服务器", "realm.switching": "正在切换服务器…", "realm.rebornCreate": "创建 Warcraft Reborn 服务器", diff --git a/src/lib/api.ts b/src/lib/api.ts index e4c0ee3..24572b5 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -57,6 +57,7 @@ export interface StatusView { } export type RealmMode = "coa" | "wildcard" | "reborn"; +export interface RealmName { id: number; name: string; defaultName: string; custom: boolean } export interface RealmProfiles { active: RealmMode; wildcard_created: boolean; reborn_created: boolean; reborn_supported: boolean; supported: boolean; recovery_pending: boolean; simultaneous: boolean; secondary_world_port: number | null; secondary_running: boolean; with_reborn: boolean; reborn_world_port: number | null; reborn_running: boolean } export interface DatabaseCheck { realm: RealmMode; @@ -486,6 +487,8 @@ export const api = { realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }), realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }), realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }), + realmNames: (id: string) => invoke<RealmName[]>("realm_names", { id }), + realmRename: (id: string, realmId: number, name: string | null) => invoke<RealmName[]>("realm_rename", { id, realmId, name }), realmWithReborn: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_with_reborn", { id, enabled }), checkDatabase: (id: string) => invoke<DatabaseCheck[]>("check_database", { id }), repairServer: (id: string) => invoke<RepairReport>("repair_server", { id }), diff --git a/src/screens/RealmNameSettings.tsx b/src/screens/RealmNameSettings.tsx new file mode 100644 index 0000000..490a24b --- /dev/null +++ b/src/screens/RealmNameSettings.tsx @@ -0,0 +1,60 @@ +import { useEffect, useState } from "react"; +import { api, asUiError, type RealmName } from "@/lib/api"; +import { Card } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { useT } from "@/i18n"; + +const MAX_CHARS = 32; + +export function RealmNameSettings({ serverId }: { serverId: string }) { + const t = useT(); + const [realms, setRealms] = useState<RealmName[] | null>(null); + const [drafts, setDrafts] = useState<Record<number, string>>({}); + const [busy, setBusy] = useState(false); + const [saved, setSaved] = useState<number | null>(null); + const [error, setError] = useState<string | null>(null); + + function show(list: RealmName[]) { + setRealms(list); + setDrafts(Object.fromEntries(list.map(r => [r.id, r.name]))); + } + + useEffect(() => { + let alive = true; + void api.realmNames(serverId).then(list => { if (alive) show(list); }).catch(e => { if (alive) setError(asUiError(e).technical); }); + return () => { alive = false; }; + }, [serverId]); + + async function rename(id: number, name: string | null) { + setBusy(true); setError(null); setSaved(null); + try { show(await api.realmRename(serverId, id, name)); setSaved(id); } + catch (e) { setError(asUiError(e).technical); } + finally { setBusy(false); } + } + + return <Card className="mt-6 p-6" aria-busy={busy}> + <h2 className="font-semibold">{t("realm.namesTitle")}</h2> + <p className="mt-1 text-sm text-muted">{t("realm.namesHint")}</p> + {realms?.map(r => { + const draft = drafts[r.id] ?? r.name; + const invalid = draft.trim().length === 0 || draft.trim().length > MAX_CHARS || draft.includes('"'); + return <div key={r.id} className="mt-4"> + <div className="flex flex-wrap items-center gap-2"> + <input + className="min-w-0 flex-1 rounded border border-line bg-bg px-3 py-1.5 text-sm text-ink outline-none focus:border-gold" + value={draft} + maxLength={MAX_CHARS} + aria-label={t("realm.nameDefault", { name: r.defaultName })} + disabled={busy} + onChange={e => setDrafts(d => ({ ...d, [r.id]: e.target.value }))} + /> + <Button size="sm" disabled={busy || invalid || draft.trim() === r.name} onClick={() => void rename(r.id, draft)}>{t("realm.nameSave")}</Button> + {r.custom && <Button size="sm" variant="ghost" disabled={busy} onClick={() => void rename(r.id, null)}>{t("realm.nameReset")}</Button>} + </div> + <p className="mt-1 text-xs text-muted">{t("realm.nameDefault", { name: r.defaultName })}{saved === r.id ? ` · ${t("realm.nameSaved")}` : ""}</p> + {draft.includes('"') && <p className="mt-1 text-xs text-warn">{t("realm.nameQuotes")}</p>} + </div>; + })} + {error && <p className="mt-3 text-sm text-bad" role="alert">{error}</p>} + </Card>; +} diff --git a/src/screens/SettingsHome.tsx b/src/screens/SettingsHome.tsx index e8b21da..e6c6290 100644 --- a/src/screens/SettingsHome.tsx +++ b/src/screens/SettingsHome.tsx @@ -12,6 +12,7 @@ import { ReleaseHistory, type HistorySelection } from "./ReleaseHistory"; import { ClientCard } from "./ClientCard"; import { GameDataCard } from "./GameDataCard"; import { RealmStartupSettings } from "./RealmStartupSettings"; +import { RealmNameSettings } from "./RealmNameSettings"; import { AutoRestartSettings } from "./AutoRestartSettings"; import { DiagnosticsCard } from "./DiagnosticsCard"; import { RepairCard } from "./RepairCard"; @@ -50,7 +51,7 @@ export function SettingsHome({ serverId, path, onForget }: { serverId: string; s <button onClick={() => setSection("client")} className="mt-5 flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border border-line px-5 py-4 text-left text-sm hover:bg-white/5"><span>{t("settings.clientLink")}</span><span aria-hidden>→</span></button> <ReleaseHistory selection={history} onSelect={setHistory} /> </div> - <div hidden={section !== "startup"} className="max-w-3xl"><RealmStartupSettings serverId={serverId} /><AutoRestartSettings serverId={serverId} /></div> + <div hidden={section !== "startup"} className="max-w-3xl"><RealmNameSettings serverId={serverId} /><RealmStartupSettings serverId={serverId} /><AutoRestartSettings serverId={serverId} /></div> <div hidden={section !== "client"} className="max-w-3xl"><ClientCard serverId={serverId} /><GameDataCard serverId={serverId} /></div> <div hidden={section !== "service"} className="max-w-3xl"><ServerLoggingSettings serverId={serverId} /><DiagnosticsCard serverId={serverId} /><RepairCard serverId={serverId} /><RemoveServerCard serverId={serverId} path={path} onForget={onForget} /></div> <div hidden={section !== "interface"} className="max-w-3xl"><Card className="mt-6 p-6"><h2 className="font-semibold">{t("settings.language")}</h2><p className="mt-1 text-sm text-muted">{t("settings.languageHint")}</p><LanguagePicker className="mt-4" /></Card><WindowSettings /><PublicServerSettings /></div> From 3c26004e047b3272f339fb172cd7ed328f64261d 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:10:43 +0500 Subject: [PATCH 13/29] Custom races: switch in seconds (append-only journal, entry points only, hash cache) V2 has 7,220 files. Switching rewrote the whole transaction journal with fsync after every file (quadratic: minutes on fast disks, far longer with antivirus) and renamed every file. Now: - the journal is append-only JSON lines; recovery replays it, ignores a torn last line and still reads the old journal.json of 0.9.13; - only what the stock client loads is hidden (Data/*.MPQ, root dll/exe/bat, addons, any file that replaced the player's own); Data/Retail, VulkanShaders and the Esteria data stay in place, and a client disabled by 0.9.13 is recognised; - payload hashes are remembered for the run, keyed by name, size and times. Real V2 archives, release build: disable 1.9 s, enable 2.2 s, 224 of 7,220 files moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .../20261115-custom-races-fast-toggle.md | 7 + crates/coa-core/src/custom_races.rs | 364 ++++++++++++++++-- 2 files changed, 340 insertions(+), 31 deletions(-) create mode 100644 changelog.d/20261115-custom-races-fast-toggle.md diff --git a/changelog.d/20261115-custom-races-fast-toggle.md b/changelog.d/20261115-custom-races-fast-toggle.md new file mode 100644 index 0000000..9c061c1 --- /dev/null +++ b/changelog.d/20261115-custom-races-fast-toggle.md @@ -0,0 +1,7 @@ +--- +area: manager +type: fixed +audience: players +title: Turning the custom races client patch on or off takes seconds again +--- +V2 has over 7,000 files and switching it could run for many minutes. Now only the files the game itself loads are hidden, and the rest stays in place. A switch that was cut short is undone safely. diff --git a/crates/coa-core/src/custom_races.rs b/crates/coa-core/src/custom_races.rs index b31cfe0..8a26506 100644 --- a/crates/coa-core/src/custom_races.rs +++ b/crates/coa-core/src/custom_races.rs @@ -463,8 +463,56 @@ fn suffix(path: &Path, extension: &str) -> PathBuf { )) } +/// SHA-256 of a payload file, remembered for this run of the Manager. V2 is 8.7 GB, and every status check and +/// switch verifies all of it; a rename keeps size, creation and write time, while a replaced file changes them. +fn cached_sha256(path: &Path) -> Option<String> { + use std::collections::HashMap; + use std::sync::{Mutex, OnceLock}; + use std::time::UNIX_EPOCH; + static HASHES: OnceLock<Mutex<HashMap<(String, u64, u128, u128), String>>> = OnceLock::new(); + let meta = fs::metadata(path).ok()?; + let nanos = |time: io::Result<std::time::SystemTime>| { + time.ok() + .and_then(|t| t.duration_since(UNIX_EPOCH).ok()) + .map(|d| d.as_nanos()) + }; + // The name without `.disabled`: switching renames only that suffix. + let name = path.file_name()?.to_string_lossy().to_ascii_lowercase(); + let name = name.strip_suffix(".disabled").unwrap_or(&name).to_string(); + let key = match (nanos(meta.modified()), nanos(meta.created())) { + (Some(modified), Some(created)) => Some((name, meta.len(), modified, created)), + _ => None, + }; + let hashes = HASHES.get_or_init(Mutex::default); + if let Some(hash) = key.as_ref().and_then(|key| hashes.lock().ok()?.get(key).cloned()) { + return Some(hash); + } + let hash = fsx::sha256_file(path).ok()?; + if let (Some(key), Ok(mut hashes)) = (key, hashes.lock()) { + hashes.insert(key, hash.clone()); + } + Some(hash) +} + fn matches_patch(path: &Path, file: &PatchFile) -> bool { - path.is_file() && fsx::sha256_file(path).is_ok_and(|hash| hash == file.sha256) + path.is_file() && cached_sha256(path).is_some_and(|hash| hash == file.sha256) +} + +/// Whether disabling the patch must hide this file. The stock client loads only the MPQs in Data, +/// dinput8.dll and the addons; the rest (Data/Retail, VulkanShaders, the Esteria data files) is read by the +/// custom races executable and its libraries alone, so it stays in place: thousands of renames bought nothing. +/// A file that replaced one of the player's own (an `.original` exists) is always switched. +fn is_switched(client: &Path, file: &PatchFile) -> bool { + let lower = file.path.to_ascii_lowercase(); + let entry_point = lower.starts_with("interface/addons/") + || lower + .strip_prefix("data/") + .is_some_and(|name| !name.contains('/') && name.ends_with(".mpq")) + || (!lower.contains('/') + && [".dll", ".exe", ".bat"] + .iter() + .any(|extension| lower.ends_with(extension))); + entry_point || suffix(&client.join(&file.path), "original").is_file() } /// Only complete, verified payloads are reported as enabled or disabled. @@ -495,9 +543,11 @@ pub fn client_patch_status(client_path: &Path) -> ClientPatchStatus { ClientPatchState::Enabled } Ok(files) - if files - .iter() - .all(|f| matches_patch(&suffix(&client_path.join(&f.path), "disabled"), f)) => + if files.iter().all(|f| { + let active = client_path.join(&f.path); + matches_patch(&suffix(&active, "disabled"), f) + || (!is_switched(client_path, f) && matches_patch(&active, f)) + }) => { ClientPatchState::Disabled } @@ -539,9 +589,24 @@ struct SavedFile { moved_to: Option<String>, } +/// One line of the append-only journal. A payload has thousands of files, so the journal is never rewritten: +/// each step adds one synced line, and recovery replays the lines in order. +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +enum JournalRecord { + Saved { path: String, existed: bool }, + Moved { index: usize, to: String }, + Returned { index: usize }, +} + +const LEGACY_JOURNAL: &str = "journal.json"; +const JOURNAL: &str = "journal.jsonl"; + struct PatchTransaction<'a> { root: &'a Path, entries: Vec<SavedFile>, + index: std::collections::HashMap<String, usize>, + journal: Option<File>, finished: bool, } @@ -564,37 +629,102 @@ fn move_patch_file(source: &Path, target: &Path) -> io::Result<()> { fs::remove_file(source) } +fn append_record(journal: &mut File, record: &JournalRecord) -> Result<()> { + use std::io::Write; + let mut line = serde_json::to_vec(record)?; + line.push(b'\n'); + journal.write_all(&line)?; + journal.sync_data()?; + Ok(()) +} + +/// Replays a journal. A line cut short by a crash is the last one and was never followed by its file +/// operation (each line is synced before the operation it describes), so reading stops there. +fn read_journal(directory: &Path) -> Result<Vec<SavedFile>> { + let legacy = directory.join(LEGACY_JOURNAL); + if legacy.is_file() { + return fsx::read_json(&legacy); + } + let bytes = match fs::read(directory.join(JOURNAL)) { + Ok(bytes) => bytes, + Err(error) if error.kind() == io::ErrorKind::NotFound => return Ok(Vec::new()), + Err(error) => return Err(error.into()), + }; + let mut entries: Vec<SavedFile> = Vec::new(); + for line in bytes.split(|byte| *byte == b'\n') { + let Ok(record) = serde_json::from_slice::<JournalRecord>(line) else { + break; + }; + match record { + JournalRecord::Saved { path, existed } => entries.push(SavedFile { + path, + existed, + moved_to: None, + }), + JournalRecord::Moved { index, to } => { + let entry = entries + .get_mut(index) + .ok_or_else(|| Error::Invalid("Invalid custom races journal.".into()))?; + entry.moved_to = Some(to); + } + JournalRecord::Returned { index } => { + let entry = entries + .get_mut(index) + .ok_or_else(|| Error::Invalid("Invalid custom races journal.".into()))?; + entry.moved_to = None; + } + } + } + Ok(entries) +} + impl<'a> PatchTransaction<'a> { fn new(root: &'a Path) -> Result<Self> { recover_patch_transaction(root)?; - fs::create_dir(root.join(".coa-races-transaction"))?; + let directory = root.join(".coa-races-transaction"); + fs::create_dir(&directory)?; + let journal = fs::OpenOptions::new() + .create_new(true) + .append(true) + .open(directory.join(JOURNAL))?; Ok(Self { root, entries: Vec::new(), + index: std::collections::HashMap::new(), + journal: Some(journal), finished: false, }) } - fn save(&mut self, path: &Path) -> Result<()> { + fn relative(&self, path: &Path) -> Result<String> { let relative = path .strip_prefix(self.root) .map_err(|_| Error::Invalid("Patch path escaped the client directory.".into()))? .to_string_lossy() .replace('\\', "/"); fsx::safe_join(self.root, &relative)?; - if self.entries.iter().any(|entry| entry.path == relative) { + Ok(relative) + } + fn save(&mut self, path: &Path) -> Result<()> { + let relative = self.relative(path)?; + if self.index.contains_key(&relative) { return Ok(()); } let index = self.entries.len(); + let existed = path.is_file(); + append_record( + self.journal.as_mut().expect("open journal"), + &JournalRecord::Saved { + path: relative.clone(), + existed, + }, + )?; + self.index.insert(relative.clone(), index); self.entries.push(SavedFile { path: relative, - existed: path.is_file(), + existed, moved_to: None, }); - fsx::atomic_write_json( - &self.root.join(".coa-races-transaction/journal.json"), - &self.entries, - )?; - if path.is_file() { + if existed { move_patch_file( path, &self @@ -619,21 +749,16 @@ impl<'a> PatchTransaction<'a> { // Save the destination first so recovery restores the moved source before it. self.save(target)?; self.save(source)?; - let index = self - .entries - .iter() - .position(|entry| self.root.join(&entry.path) == source) - .unwrap(); - let relative = target - .strip_prefix(self.root) - .map_err(|_| Error::Invalid("Patch path escaped the client directory.".into()))? - .to_string_lossy() - .replace('\\', "/"); - self.entries[index].moved_to = Some(relative); - fsx::atomic_write_json( - &self.root.join(".coa-races-transaction/journal.json"), - &self.entries, + let index = self.index[&self.relative(source)?]; + let relative = self.relative(target)?; + append_record( + self.journal.as_mut().expect("open journal"), + &JournalRecord::Moved { + index, + to: relative.clone(), + }, )?; + self.entries[index].moved_to = Some(relative); fs::create_dir_all(target.parent().unwrap())?; move_patch_file( &self @@ -651,6 +776,8 @@ impl<'a> PatchTransaction<'a> { b"committed", )?; self.finished = true; + // Windows cannot remove a directory while a file in it is open. + self.journal = None; fs::remove_dir_all(self.root.join(".coa-races-transaction"))?; Ok(()) } @@ -658,6 +785,7 @@ impl<'a> PatchTransaction<'a> { impl Drop for PatchTransaction<'_> { fn drop(&mut self) { if !self.finished { + self.journal = None; let _ = recover_patch_transaction(self.root); } } @@ -668,8 +796,19 @@ fn recover_patch_transaction(root: &Path) -> Result<()> { if !directory.is_dir() { return Ok(()); } - if !directory.join("committed").exists() && directory.join("journal.json").exists() { - let mut entries: Vec<SavedFile> = fsx::read_json(&directory.join("journal.json"))?; + if !directory.join("committed").exists() { + let legacy = directory.join(LEGACY_JOURNAL).is_file(); + let mut entries = read_journal(&directory)?; + let mut journal = if legacy { + None + } else { + Some( + fs::OpenOptions::new() + .create(true) + .append(true) + .open(directory.join(JOURNAL))?, + ) + }; for index in (0..entries.len()).rev() { let entry = &entries[index]; let path = fsx::safe_join(root, &entry.path)?; @@ -681,7 +820,10 @@ fn recover_patch_transaction(root: &Path) -> Result<()> { } // Persist recovery progress before restoring the source, making retries safe. entries[index].moved_to = None; - fsx::atomic_write_json(&directory.join("journal.json"), &entries)?; + match journal.as_mut() { + Some(journal) => append_record(journal, &JournalRecord::Returned { index })?, + None => fsx::atomic_write_json(&directory.join(LEGACY_JOURNAL), &entries)?, + } } let entry = &entries[index]; if saved.is_file() { @@ -693,6 +835,7 @@ fn recover_patch_transaction(root: &Path) -> Result<()> { fs::remove_file(path)?; } } + drop(journal); } fs::remove_dir_all(directory)?; Ok(()) @@ -783,7 +926,8 @@ pub fn set_client_patch_enabled(client: &Path, enabled: bool) -> Result<()> { let active = client.join(&file.path); let disabled = suffix(&active, "disabled"); let original = suffix(&active, "original"); - if enabled { + // Data the stock client never reads stays active, and an older Manager's disabled copy comes back. + if enabled || !is_switched(client, &file) { if active.is_file() && !matches_patch(&active, &file) { preserve_original(&mut tx, &active)?; } @@ -1422,6 +1566,7 @@ mod tests { ("ADDON", base) } else { name.strip_prefix("Data/") + .filter(|base| !base.contains('/')) .map_or(("ROOT", *name), |base| ("MPQ", base)) }; manifest.push_str(&format!( @@ -1432,6 +1577,146 @@ mod tests { fs::write(root.join(MANIFEST_FILENAME), manifest).unwrap(); } + const SWITCHED: &[&str] = &[ + "Data/patch-ZE1.MPQ", + "dinput8.dll", + "CoACustomRace.exe", + "Start-CoACustomRace.bat", + "Interface/AddOns/CoAHideArmor/CoAHideArmor.lua", + ]; + const INERT: &[&str] = &[ + "Data/Retail/Cache/Retail/wow/decoded/2/strict/id-1.bin", + "Data/Retail/RetailCasc.ini", + "VulkanShaders/a.spv", + "Vulkan/d3d9.dll", + "forever_data/hd_forever_fog.txt", + "EsteriaAppearance.bin", + ]; + + fn client_with(root: &Path, names: &[&str]) { + for name in names { + let path = root.join(name); + fs::create_dir_all(path.parent().unwrap()).unwrap(); + fs::write(&path, format!("custom {name}")).unwrap(); + } + record_files(root, names); + } + + #[test] + fn disabling_hides_only_what_the_stock_client_loads() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path(); + let all: Vec<&str> = SWITCHED.iter().chain(INERT).copied().collect(); + client_with(root, &all); + set_client_patch_enabled(root, false).unwrap(); + for name in SWITCHED { + assert!(!root.join(name).exists(), "{name} stays active"); + assert!(suffix(&root.join(name), "disabled").is_file(), "{name}"); + } + for name in INERT { + assert!(root.join(name).is_file(), "{name} was moved"); + assert!(!suffix(&root.join(name), "disabled").exists(), "{name}"); + } + assert_eq!(client_patch_status(root).state, ClientPatchState::Disabled); + set_client_patch_enabled(root, true).unwrap(); + assert_eq!(client_patch_status(root).state, ClientPatchState::Enabled); + for name in &all { + assert!(root.join(name).is_file(), "{name}"); + } + } + + #[test] + fn a_file_that_replaced_the_players_own_is_still_switched() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path(); + let name = "Data/Retail/RetailCasc.ini"; + client_with(root, &[name]); + fs::write(suffix(&root.join(name), "original"), b"player").unwrap(); + set_client_patch_enabled(root, false).unwrap(); + assert_eq!(fs::read(root.join(name)).unwrap(), b"player"); + assert!(suffix(&root.join(name), "disabled").is_file()); + assert_eq!(client_patch_status(root).state, ClientPatchState::Disabled); + } + + #[test] + fn a_client_disabled_by_an_older_manager_is_disabled_and_enables() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path(); + let all: Vec<&str> = SWITCHED.iter().chain(INERT).copied().collect(); + client_with(root, &all); + // 0.9.13 renamed every file of the payload. + for name in &all { + fs::rename(root.join(name), suffix(&root.join(name), "disabled")).unwrap(); + } + assert_eq!(client_patch_status(root).state, ClientPatchState::Disabled); + set_client_patch_enabled(root, false).unwrap(); + for name in INERT { + assert!(root.join(name).is_file(), "{name} not restored"); + } + assert_eq!(client_patch_status(root).state, ClientPatchState::Disabled); + set_client_patch_enabled(root, true).unwrap(); + assert_eq!(client_patch_status(root).state, ClientPatchState::Enabled); + } + + #[test] + fn a_transaction_left_by_an_older_manager_is_recovered() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path(); + let directory = root.join(".coa-races-transaction"); + fs::create_dir(&directory).unwrap(); + // The source was moved into the journal and then on to its destination when the old Manager stopped. + fs::write(root.join("patch.MPQ.disabled"), b"patch bytes").unwrap(); + fs::write( + directory.join(LEGACY_JOURNAL), + r#"[{"path":"patch.MPQ.disabled","existed":false},{"path":"patch.MPQ","existed":true,"moved_to":"patch.MPQ.disabled"}]"#, + ) + .unwrap(); + recover_patch_transaction(root).unwrap(); + assert_eq!(fs::read(root.join("patch.MPQ")).unwrap(), b"patch bytes"); + assert!(!root.join("patch.MPQ.disabled").exists()); + assert!(!directory.exists()); + } + + #[test] + fn a_journal_line_cut_short_by_a_crash_is_ignored() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path(); + let file = root.join("dinput8.dll"); + fs::write(&file, b"previous").unwrap(); + let mut tx = PatchTransaction::new(root).unwrap(); + tx.save(&file).unwrap(); + fs::write(&file, b"replacement").unwrap(); + drop(tx.journal.take()); + std::mem::forget(tx); + let journal = root.join(".coa-races-transaction").join(JOURNAL); + let mut bytes = fs::read(&journal).unwrap(); + bytes.extend_from_slice(br#"{"saved":{"path":"other.dll","exi"#); + fs::write(&journal, bytes).unwrap(); + recover_patch_transaction(root).unwrap(); + assert_eq!(fs::read(&file).unwrap(), b"previous"); + assert!(!root.join(".coa-races-transaction").exists()); + } + + #[test] + fn switching_a_release_sized_payload_takes_seconds() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path(); + let mut names: Vec<String> = (0..7000) + .map(|i| format!("VulkanShaders/shader-{i}.spv")) + .collect(); + names.extend((0..80).map(|i| format!("Data/patch-Z{i}.MPQ"))); + names.extend((0..140).map(|i| format!("Interface/AddOns/Addon{}/file{i}.lua", i % 9))); + let names: Vec<&str> = names.iter().map(String::as_str).collect(); + client_with(root, &names); + let started = std::time::Instant::now(); + set_client_patch_enabled(root, false).unwrap(); + set_client_patch_enabled(root, true).unwrap(); + let elapsed = started.elapsed(); + assert_eq!(client_patch_status(root).state, ClientPatchState::Enabled); + // 0.9.13 needed minutes here: it moved every file and rewrote the whole journal after each one. + assert!(elapsed < std::time::Duration::from_secs(60), "{elapsed:?}"); + } + #[test] fn an_update_retires_files_the_new_release_no_longer_ships() { let temp = tempfile::tempdir().unwrap(); @@ -1548,8 +1833,23 @@ mod tests { assert!(root .join("Interface/AddOns/Ascension_Subclass") .is_dir()); + let started = std::time::Instant::now(); set_client_patch_enabled(root, false).unwrap(); + eprintln!("disable took {:?}", started.elapsed()); assert_eq!(client_patch_status(root).state, ClientPatchState::Disabled); + // Only what the stock client loads is hidden; the data its executable alone reads stays put. + assert!(!root.join("CoACustomRace.exe").exists()); + assert!(!root.join("dinput8.dll").exists()); + assert!(!root.join("Data/patch-ZZZD.MPQ").exists()); + assert!(!root.join("Interface/AddOns/CoAHideArmor/CoAHideArmor.lua").exists()); + assert!(root.join("Vulkan/d3d9.dll").is_file()); + assert!(root.join("Data/Retail/RetailCasc.ini").is_file()); + let hidden = patch_files(root) + .unwrap() + .iter() + .filter(|file| suffix(&root.join(&file.path), "disabled").is_file()) + .count(); + eprintln!("hidden {hidden} of {}", patch_files(root).unwrap().len()); assert_eq!( fs::read(root.join("Ascension.exe")).unwrap(), b"original game executable" @@ -1558,7 +1858,9 @@ mod tests { fs::read(root.join("Data/patch-T.MPQ")).unwrap(), b"original game patch" ); + let started = std::time::Instant::now(); set_client_patch_enabled(root, true).unwrap(); + eprintln!("enable took {:?}", started.elapsed()); assert_eq!(client_patch_status(root).state, ClientPatchState::Enabled); uninstall_client_patches(root).unwrap(); assert_eq!( From 4fc133c35e78a71a4848eda1485ac863c1fc993d 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:14:59 +0500 Subject: [PATCH 14/29] Race restriction survives a catalog that only adds races The worldserver ignores DisabledRaceIds saved against another ChrRaces catalog and with it CoACustomRaces.Enable, so every server that had a restriction from 1.9.2 lost custom races after the V2 update. Before a start the Manager binds the restriction to the new catalog when every disabled race keeps its RaceID and name, judged by the server's own snapshot (written by every save) or the table of every catalog a build has shipped (race_catalogs.json, generated from the core history). Renamed races (1.9.1 reused 32/33) and unknown catalogs still wait for the owner's review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-race-restriction-kept.md | 7 + crates/coa-core/src/driver.rs | 4 + crates/coa-core/src/race_availability.rs | 171 +++++ crates/coa-core/src/race_catalogs.json | 639 ++++++++++++++++++ 4 files changed, 821 insertions(+) create mode 100644 changelog.d/20261115-race-restriction-kept.md create mode 100644 crates/coa-core/src/race_catalogs.json diff --git a/changelog.d/20261115-race-restriction-kept.md b/changelog.d/20261115-race-restriction-kept.md new file mode 100644 index 0000000..0b30600 --- /dev/null +++ b/changelog.d/20261115-race-restriction-kept.md @@ -0,0 +1,7 @@ +--- +area: manager +type: fixed +audience: admins +title: Disabled custom races stay disabled after a server update that adds races +--- +A race list saved before Custom Races V2 no longer matched V2's race catalog, and the server then ignored it and turned custom races off. Before a start the Manager now keeps the list when every disabled race kept its ID and name. diff --git a/crates/coa-core/src/driver.rs b/crates/coa-core/src/driver.rs index b0a4305..d96dfba 100644 --- a/crates/coa-core/src/driver.rs +++ b/crates/coa-core/src/driver.rs @@ -144,6 +144,10 @@ fn run_inner_mode( } if matches!(verb, Verb::StartAll | Verb::StartWorld) { crate::modules::ensure_bot_exclusivity(&root)?; + // A server update that only added races keeps the owner's race restriction (and custom races on). + if let Err(error) = crate::race_availability::rebind_unchanged(&root) { + tracing::warn!(%error, "the race restriction could not be checked against the race catalog"); + } } if crate::docker::is_docker(&root) { prepare_headless_world(&root, verb)?; diff --git a/crates/coa-core/src/race_availability.rs b/crates/coa-core/src/race_availability.rs index 0080f71..6791a72 100644 --- a/crates/coa-core/src/race_availability.rs +++ b/crates/coa-core/src/race_availability.rs @@ -269,9 +269,95 @@ pub fn save( ), ]), )?; + write_snapshot(root, ¤t.catalog_sha256, ¤t.races)?; status(root) } +/// Every race catalog (`ChrRaces.dbc` of the custom races overlay) a server build has shipped, by SHA-256: +/// RaceID -> name. Generated from the core repository's history of the overlay. +const SHIPPED_CATALOGS: &str = include_str!("race_catalogs.json"); +/// The names of the catalog a restriction was saved against, written by every save. +const SNAPSHOT: &str = "Settings/race-catalog.json"; + +#[derive(serde::Deserialize, Serialize)] +struct Snapshot { + sha256: String, + races: BTreeMap<u32, String>, +} + +/// RaceID -> name of the catalog with `hash`: this server's own snapshot, or a catalog a build shipped. +fn names_of(root: &Path, hash: &str) -> Option<BTreeMap<u32, String>> { + if let Ok(snapshot) = crate::fsx::read_json::<Snapshot>(&root.join(SNAPSHOT)) { + if snapshot.sha256.eq_ignore_ascii_case(hash) { + return Some(snapshot.races); + } + } + #[derive(serde::Deserialize)] + struct Shipped { + catalogs: BTreeMap<String, BTreeMap<u32, String>>, + } + let shipped: Shipped = serde_json::from_str(SHIPPED_CATALOGS).ok()?; + shipped.catalogs.get(&hash.to_ascii_lowercase()).cloned() +} + +fn write_snapshot(root: &Path, hash: &str, races: &[Race]) -> Result<()> { + crate::fsx::atomic_write_json( + &root.join(SNAPSHOT), + &Snapshot { + sha256: hash.to_string(), + races: races.iter().map(|race| (race.id, race.name.clone())).collect(), + }, + ) +} + +/// A server update that only adds races keeps the owner's restriction. The worldserver ignores a restriction +/// saved against another catalog (and with it the whole custom races switch), so before a start: when every +/// disabled race still has its RaceID and name in the new catalog, the restriction is bound to the new catalog. +/// Anything else (an unknown old catalog, a renamed or missing race) is left for the owner to review. Returns +/// whether the restriction was bound again. +pub fn rebind_unchanged(root: &Path) -> Result<bool> { + let conf_path = root.join(CONF); + let Ok(conf_bytes) = fs::read(&conf_path) else { + return Ok(false); + }; + let mut conf = ConfFile::parse_bytes(&conf_bytes)?; + let configured = parse_ids(conf.get(KEY).unwrap_or(""))?; + let saved = conf + .get(CATALOG_KEY) + .unwrap_or("") + .trim() + .trim_matches('"') + .to_ascii_lowercase(); + if configured.is_empty() || saved.is_empty() { + return Ok(false); + } + let Ok(bytes) = fs::read(dbc_path(root)?) else { + return Ok(false); + }; + let current = hex::encode(Sha256::digest(&bytes)); + if saved == current { + return Ok(false); + } + let races = catalog(&bytes)?; + let Some(before) = names_of(root, &saved) else { + tracing::warn!("race restriction saved against an unknown catalog; it needs the owner's review"); + return Ok(false); + }; + let now: BTreeMap<u32, &str> = races.iter().map(|race| (race.id, race.name.as_str())).collect(); + let unchanged = configured + .iter() + .all(|id| before.get(id).is_some_and(|name| now.get(id) == Some(&name.as_str()))); + if !unchanged { + tracing::warn!("a restricted race changed in the new catalog; the restriction needs the owner's review"); + return Ok(false); + } + conf.set(CATALOG_KEY, &format!("\"{current}\""), &[]); + crate::fsx::atomic_write(&conf_path, conf.to_text().as_bytes())?; + write_snapshot(root, ¤t, &races)?; + tracing::info!(races = configured.len(), "race restriction kept for the updated race catalog"); + Ok(true) +} + #[cfg(test)] mod tests { use super::*; @@ -292,6 +378,91 @@ mod tests { bytes } + fn catalog_of(rows: &[(u32, &str)]) -> Vec<u8> { + let mut strings = vec![0u8]; + let mut offsets = Vec::new(); + for (_, name) in rows { + offsets.push(strings.len() as u32); + strings.extend(name.as_bytes()); + strings.push(0); + } + let mut bytes = b"WDBC".to_vec(); + for value in [rows.len() as u32, 69, 276, strings.len() as u32] { + bytes.extend(value.to_le_bytes()); + } + for ((id, _), offset) in rows.iter().zip(offsets) { + let mut row = vec![0; 276]; + row[..4].copy_from_slice(&id.to_le_bytes()); + row[56..60].copy_from_slice(&offset.to_le_bytes()); + bytes.extend(row); + } + bytes.extend(strings); + bytes + } + + fn restricted_server(catalog: &[u8], disabled: &str, saved_hash: &str) -> tempfile::TempDir { + let d = tempfile::tempdir().unwrap(); + fs::create_dir_all(d.path().join("Data/dbc_races")).unwrap(); + fs::create_dir_all(d.path().join("Core/configs/modules")).unwrap(); + fs::write(d.path().join("Data/dbc_races/ChrRaces.dbc"), catalog).unwrap(); + fs::write( + d.path().join(CONF), + format!("CoACustomRaces.Enable = 1\nCoACustomRaces.DisabledRaceIds = \"{disabled}\"\nCoACustomRaces.DisabledRaceCatalogSha256 = \"{saved_hash}\"\n"), + ) + .unwrap(); + d + } + + fn sha(bytes: &[u8]) -> String { + hex::encode(Sha256::digest(bytes)) + } + + #[test] + fn a_catalog_that_only_adds_races_keeps_the_restriction() { + let old = catalog_of(&[(83, "Vulpera"), (97, "Gnoll")]); + let new = catalog_of(&[(83, "Vulpera"), (97, "Gnoll"), (120, "Nerubian")]); + let d = restricted_server(&new, "83", &sha(&old)); + write_snapshot(d.path(), &sha(&old), &catalog(&old).unwrap()).unwrap(); + assert!(rebind_unchanged(d.path()).unwrap()); + let conf = ConfFile::parse_bytes(&fs::read(d.path().join(CONF)).unwrap()).unwrap(); + assert_eq!(conf.get(KEY), Some("\"83\"")); + assert_eq!( + conf.get(CATALOG_KEY).map(|h| h.trim_matches('"').to_string()), + Some(sha(&new)) + ); + assert_eq!(conf.get("CoACustomRaces.Enable"), Some("1")); + assert!(!rebind_unchanged(d.path()).unwrap(), "already bound"); + } + + #[test] + fn a_renamed_race_or_unknown_catalog_waits_for_review() { + let old = catalog_of(&[(83, "Thin Human"), (97, "Gnoll")]); + let renamed = catalog_of(&[(83, "Forgotten"), (97, "Gnoll")]); + let d = restricted_server(&renamed, "83", &sha(&old)); + write_snapshot(d.path(), &sha(&old), &catalog(&old).unwrap()).unwrap(); + assert!(!rebind_unchanged(d.path()).unwrap()); + let unknown = restricted_server(&renamed, "97", &"ab".repeat(32)); + assert!(!rebind_unchanged(unknown.path()).unwrap()); + // Nothing is restricted: nothing to bind. + let empty = restricted_server(&renamed, "", &sha(&old)); + assert!(!rebind_unchanged(empty.path()).unwrap()); + } + + #[test] + fn the_shipped_catalogs_include_1_9_2_and_v2_with_stable_ids() { + let shipped: serde_json::Value = serde_json::from_str(SHIPPED_CATALOGS).unwrap(); + let catalogs = shipped["catalogs"].as_object().unwrap(); + let size = |c: &serde_json::Value| c.as_object().unwrap().len(); + assert!(catalogs.values().any(|c| size(c) == 95), "1.9.2 has 95 races"); + let v2: Vec<_> = catalogs.values().filter(|c| size(c) == 112).collect(); + assert_eq!(v2.len(), 1, "V2 has 112 races"); + for old in catalogs.values().filter(|c| size(c) == 95) { + for (id, name) in old.as_object().unwrap() { + assert_eq!(&v2[0][id], name, "race {id}"); + } + } + } + #[test] fn catalog_preserves_ids_and_excludes_stock_and_nonplayable() { let mut bytes = dbc(); diff --git a/crates/coa-core/src/race_catalogs.json b/crates/coa-core/src/race_catalogs.json new file mode 100644 index 0000000..f95f454 --- /dev/null +++ b/crates/coa-core/src/race_catalogs.json @@ -0,0 +1,639 @@ +{ + "catalogs": { + "0f9e05112d56609a87f0b1900be88f8130a8fcb24ee4acae585f1fd8d9144bf0": { + "1": "Human", + "10": "Blood Elf", + "100": "Drakonid", + "103": "Grummle", + "11": "Draenei", + "12": "Zandalari Troll", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Thin Human", + "33": "Thin Human", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "77": "High Order Skyborne", + "78": "Jinyu", + "79": "Arakkoa", + "8": "Troll", + "80": "Darkfallen", + "81": "Darkfallen", + "82": "Sethrak", + "83": "Gnoll", + "9": "Goblin", + "97": "Saberon", + "98": "Drakonid", + "99": "Drakkin" + }, + "358503359af5b05d16a76f61bab77b5c6221c792bcb0e11793eba8e279689ff7": { + "1": "Human", + "10": "Blood Elf", + "11": "Draenei", + "12": "Zandalari Troll", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Thin Human", + "33": "Thin Human", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "77": "High Order Skyborne", + "78": "Jinyu", + "8": "Troll", + "80": "Darkfallen", + "81": "Darkfallen", + "82": "Sethrak", + "83": "Gnoll", + "9": "Goblin", + "97": "Saberon" + }, + "6ad3ac1ad6ef7f32ed347e979cd1667bb5393d7a0967a859e5ba3cfa2a5d04c7": { + "1": "Human", + "10": "Blood Elf", + "100": "Drakonid", + "101": "Venthyr", + "102": "Centaur", + "103": "Grummle", + "104": "Slime Giant", + "106": "Mantid", + "107": "Kyrian", + "109": "Ethereal", + "11": "Draenei", + "110": "Sylvari", + "112": "Hozen", + "12": "Zandalari Troll", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Forgotten", + "33": "Forgotten", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "75": "Centaur", + "77": "High Order Skyborne", + "78": "Jinyu", + "79": "Arakkoa", + "8": "Troll", + "80": "Darkfallen", + "81": "Darkfallen", + "82": "Sethrak", + "83": "Gnoll", + "87": "Faceless One", + "9": "Goblin", + "90": "Banshee", + "97": "Saberon", + "98": "Drakonid", + "99": "Drakkin" + }, + "833e18c0f0550d400e78ee5db00bd65bf86d051861fe6b795c0539e3fd9f125d": { + "1": "Human", + "10": "Blood Elf", + "11": "Draenei", + "12": "Zandalari Troll", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Thin Human", + "33": "Thin Human", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "77": "High Order Skyborne", + "8": "Troll", + "9": "Goblin" + }, + "9a49163b9a330d844f0add5a2023f538b828bd5c57d6ecbb3cd5b4196930c5da": { + "1": "Human", + "10": "Blood Elf", + "103": "Grummle", + "11": "Draenei", + "12": "Zandalari Troll", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Thin Human", + "33": "Thin Human", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "77": "High Order Skyborne", + "78": "Jinyu", + "79": "Arakkoa", + "8": "Troll", + "80": "Darkfallen", + "81": "Darkfallen", + "82": "Sethrak", + "83": "Gnoll", + "9": "Goblin", + "97": "Saberon" + }, + "b78635b08bf0bd63d2898fce97c1fb162c8a9c41632703172eefa88bae79061f": { + "1": "Human", + "10": "Blood Elf", + "100": "Drakonid", + "101": "Venthyr", + "102": "Centaur", + "103": "Grummle", + "104": "Slime Giant", + "106": "Mantid", + "107": "Kyrian", + "109": "Ethereal", + "11": "Draenei", + "110": "Sylvari", + "112": "Hozen", + "12": "Zandalari Troll", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Forgotten", + "33": "Forgotten", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "75": "Centaur", + "77": "High Order Skyborne", + "78": "Jinyu", + "79": "Arakkoa", + "8": "Troll", + "80": "Darkfallen", + "81": "Darkfallen", + "82": "Sethrak", + "83": "Gnoll", + "87": "Faceless One", + "9": "Goblin", + "90": "Banshee", + "97": "Saberon", + "98": "Drakonid", + "99": "Drakkin" + }, + "bff09e612ba44567a5c7d928562d6261755504dc8948daa334e675bf49b54938": { + "1": "Human", + "10": "Blood Elf", + "100": "Drakonid", + "101": "Venthyr", + "102": "Centaur", + "103": "Grummle", + "104": "Slime Giant", + "105": "Gilgoblin", + "106": "Mantid", + "107": "Kyrian", + "109": "Ethereal", + "11": "Draenei", + "110": "Sylvari", + "111": "Sporeling", + "112": "Hozen", + "114": "Stormforged", + "118": "Elune's Chosen", + "119": "Mo'arg", + "12": "Zandalari Troll", + "120": "Nerubian", + "122": "Lich", + "123": "Mogu", + "125": "Lost One", + "13": "Worgen", + "14": "High Elf", + "15": "Tuskarr", + "16": "Kul Tiran", + "17": "Taunka", + "18": "Vrykul", + "19": "Vulpera", + "2": "Orc", + "20": "Pandaren", + "21": "Naga", + "22": "Broken", + "23": "Fel Orc", + "24": "Forest Troll", + "25": "Ice Troll", + "26": "Skeleton", + "27": "Earthen", + "28": "Drakkari Troll", + "29": "Pandaren", + "3": "Dwarf", + "30": "Murloc", + "31": "Murloc", + "32": "Forgotten", + "33": "Forgotten", + "34": "Fel Orc", + "35": "Naga", + "36": "Broken", + "37": "Skeleton", + "38": "Vrykul", + "39": "Tuskarr", + "4": "Night Elf", + "40": "Forest Troll", + "41": "Taunka", + "42": "Northrend Skeleton", + "43": "Ice Troll", + "44": "Drakkari Troll", + "45": "Leper Troll", + "46": "Troglodyte", + "47": "Alpha Worgen", + "48": "Dark Iron Dwarf", + "49": "Mag'har Orc", + "5": "Undead", + "50": "Furbolg", + "51": "Undead Gnome", + "52": "Orc", + "53": "Ogre", + "54": "Dracthyr", + "55": "Eredar", + "56": "Harpy", + "57": "Alpha Goblin", + "58": "Dracthyr", + "59": "Void Elf", + "6": "Tauren", + "60": "Illidari Blood Elf", + "61": "Illidari Night Elf", + "62": "Lightforged Draenei", + "63": "Nightborne", + "65": "Test Race", + "66": "Highmountain Tauren", + "67": "Mechagnome", + "68": "Earthen", + "69": "Earthen", + "7": "Gnome", + "70": "Haranir", + "71": "Haranir", + "72": "Windshaper Skyborne", + "74": "Vulpera", + "75": "Centaur", + "77": "High Order Skyborne", + "78": "Jinyu", + "79": "Arakkoa", + "8": "Troll", + "80": "Darkfallen", + "81": "Darkfallen", + "82": "Sethrak", + "83": "Gnoll", + "85": "Two-Headed Ogre", + "86": "Sureki", + "87": "Faceless One", + "88": "Qiraji", + "89": "Dreadlord", + "9": "Goblin", + "90": "Banshee", + "91": "Titan", + "92": "Wretched", + "93": "Fungarian", + "96": "Thin Human", + "97": "Saberon", + "98": "Drakonid", + "99": "Drakkin" + } + }, + "schema": 1, + "source": "Corfirean/azerothcore-wotlk-coa modules/mod-coa-custom-races/data/dbc/ChrRaces.dbc" +} From f08ae1c76b5c72bb326e81bd7ebe305bfd7fa02d 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:17:04 +0500 Subject: [PATCH 15/29] Modules: switches for the Custom Races V2 subclasses and the /dev menu mod-subclass (Subclass.Enable, the Thin Twins and Two-Headed Ogre races, two players per character, levels) and mod-ilusixn-devmenu (DevMenu.Enable, who may use it) were shipped with V2 but had no place in the Manager. They are catalog modules now, with translated controls for their main settings; the rest stays under the advanced settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-v2-feature-switches.md | 7 ++++ modules/catalog.json | 38 +++++++++++++++++++++ src/dev/mock.ts | 4 ++- src/lib/moduleSettings.ts | 8 +++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20261115-v2-feature-switches.md diff --git a/changelog.d/20261115-v2-feature-switches.md b/changelog.d/20261115-v2-feature-switches.md new file mode 100644 index 0000000..421ee37 --- /dev/null +++ b/changelog.d/20261115-v2-feature-switches.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu +--- +Modules now has Subclasses and Hero Races (turn off subclasses, the Thin Twins or the Two-Headed Ogre, two players per character) and Dev Menu (the GM /dev editor). Servers without them show them as not part of the server. diff --git a/modules/catalog.json b/modules/catalog.json index b5c780c..6874527 100644 --- a/modules/catalog.json +++ b/modules/catalog.json @@ -165,6 +165,44 @@ "enable_key": "CoACustomRaces.Enable", "default_on": false }, + { + "id": "subclass", + "name": "Subclasses and Hero Races", + "description": { + "en": "Part of Custom Races V2: a second class for the Thin Twins and the Two-Headed Ogre, and two players sharing one character.", + "ru": "Часть Custom Races V2: второй класс для Хрупких близнецов и Двуглавого огра и один персонаж на двух игроков.", + "de": "Teil von Custom Races V2: eine zweite Klasse für die Dünnen Zwillinge und die Zweiköpfige Ogerin sowie zwei Spieler an einer Figur.", + "fr": "Partie de Custom Races V2 : une seconde classe pour les Jumeaux maigres et l'Ogre à deux têtes, et deux joueurs pour un personnage.", + "es": "Parte de Custom Races V2: una segunda clase para los Gemelos delgados y el Ogro de dos cabezas, y dos jugadores en un personaje.", + "zh": "Custom Races V2 的一部分:为瘦弱双子和双头食人魔提供第二职业,并允许两名玩家共用一个角色。" + }, + "repo": "https://github.com/Corfirean/azerothcore-wotlk-coa", + "conf": "mod_subclass.conf", + "switchable": true, + "status": "early", + "icon": "races", + "enable_key": "Subclass.Enable", + "default_on": true + }, + { + "id": "dev-menu", + "name": "Dev Menu", + "description": { + "en": "Part of Custom Races V2: the in-game /dev editor for game masters (NPCs, items).", + "ru": "Часть Custom Races V2: внутриигровой редактор /dev для гейм-мастеров (НПС, предметы).", + "de": "Teil von Custom Races V2: der /dev-Editor im Spiel für Spielleiter (NPCs, Gegenstände).", + "fr": "Partie de Custom Races V2 : l'éditeur /dev en jeu pour les maîtres du jeu (PNJ, objets).", + "es": "Parte de Custom Races V2: el editor /dev del juego para los máster (PNJ, objetos).", + "zh": "Custom Races V2 的一部分:供游戏管理员使用的游戏内 /dev 编辑器(NPC、物品)。" + }, + "repo": "https://github.com/Corfirean/azerothcore-wotlk-coa", + "conf": "mod_ilusixn_devmenu.conf", + "switchable": true, + "status": "early", + "icon": "sparkles", + "enable_key": "DevMenu.Enable", + "default_on": true + }, { "id": "time-is-time", "name": "TimeIsTime", diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 1965c6a..d8a778b 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -85,13 +85,15 @@ export {}; if(cmd==="realmlist_save"){const w=window as any;const rl=w.__rl;if(args.profileId){const p=rl.profiles.find((x: any)=>x.id===args.profileId);p.name=args.name;p.data=args.data;return p;}if(rl.profiles.some((x: any)=>x.name.toLowerCase()===String(args.name).toLowerCase()))throw {human:{code:"unknown",title:"",message:"",actions:[]},technical:"A realmlist with that name already exists."};const p={id:String(args.name).toLowerCase().replace(/[^a-z0-9]+/g,"-"),name:args.name,data:(/\s/.test(args.data.trim())?args.data.trim():"set realmlist "+args.data.trim())+"\r\n"};rl.profiles.push(p);return p;} if(cmd==="realmlist_delete"){const rl=(window as any).__rl;rl.profiles=rl.profiles.filter((x: any)=>x.id!==args.profileId);return null;} if(cmd==="account_delete") return null; - if(cmd==="modules_list") return [{id:"companions",name:"CoA Companions",description:{en:"Companion bots for groups, dungeons and your guild.",ru:"Боты-компаньоны для групп, подземелий и гильдии."},repo:"https://github.com/Corfirean/mod-coa-playerbots",installed:true,enabled:modState["companions"],switchable:true,status:"beta",icon:"bot",page:"bots"},{id:"content-scaling",name:"Content Scaling",description:{en:"Scales dungeons and raids to your group, with solo modes.",ru:"Подстраивает подземелья и рейды под вашу группу, есть соло-режимы."},repo:"https://github.com/Corfirean/mod-coa-content-scaling",installed:true,enabled:modState["content-scaling"],switchable:true,status:"early",icon:"scaling",page:null},{id:"tbc-content",name:"TBC Content",description:{en:"Outland dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Запределья, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-tbc-content",installed:true,enabled:modState["tbc-content"],switchable:true,status:"early",icon:"tbc",page:null},{id:"wotlk-content",name:"WotLK Content",description:{en:"Northrend dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Нордскола, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-wotlk-content",installed:true,enabled:modState["wotlk-content"],switchable:true,status:"early",icon:"wotlk",page:null},{id:"ah-bot",name:"Auction House Bot",description:{en:"Fills the auction house with realistic, adjustable listings.",ru:"Наполняет аукцион реалистичными настраиваемыми лотами."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["ah-bot"] ?? false,switchable:true,status:"early",icon:"gavel",page:null,hidden:false},{id:"npc-enchanter",name:"NPC Enchanter",description:{en:"An NPC that enchants your gear for you.",ru:"НПС, который зачаровывает ваше снаряжение."},repo:"https://github.com/azerothcore/mod-npc-enchanter",installed:true,enabled:modState["npc-enchanter"],switchable:true,status:"early",icon:"sparkles",page:null,hidden:false},{id:"playerbots",name:"SQUID's Playerbots",description:{en:"An alternative bot system with random bots and full AI.",ru:"Альтернативная система ботов со случайными ботами и полным ИИ."},repo:"https://github.com/Zyth45/mod-playerbots",installed:true,enabled:modState["playerbots"] ?? false,switchable:true,status:"early",icon:"swords",page:"bots",hidden:false},{id:"client-compat",name:"Client compatibility",description:{en:"Client-server link and appearance unlocks.",ru:"Связь клиента с сервером и разблокировка внешних видов."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["client-compat"],switchable:false,status:"release",icon:"plug",page:null,hidden:true}, ...moduleCatalog.modules.filter(m => m.id === "time-is-time").map(m => ({...m, installed:true, enabled:modState[m.id] ?? true, switchable:true, page:null, hidden:false}))].map(m => ({...m, has_settings: !["tbc-content", "wotlk-content"].includes(m.id), compatibility: realm !== "coa" ? (["companions", "playerbots"].includes(m.id) ? "unsupported" : m.id === "client-compat" ? "compatible" : "experimental") : "compatible", switchable: realm !== "coa" && ["companions", "playerbots"].includes(m.id) ? false : m.switchable})); + if(cmd==="modules_list") return [{id:"companions",name:"CoA Companions",description:{en:"Companion bots for groups, dungeons and your guild.",ru:"Боты-компаньоны для групп, подземелий и гильдии."},repo:"https://github.com/Corfirean/mod-coa-playerbots",installed:true,enabled:modState["companions"],switchable:true,status:"beta",icon:"bot",page:"bots"},{id:"content-scaling",name:"Content Scaling",description:{en:"Scales dungeons and raids to your group, with solo modes.",ru:"Подстраивает подземелья и рейды под вашу группу, есть соло-режимы."},repo:"https://github.com/Corfirean/mod-coa-content-scaling",installed:true,enabled:modState["content-scaling"],switchable:true,status:"early",icon:"scaling",page:null},{id:"tbc-content",name:"TBC Content",description:{en:"Outland dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Запределья, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-tbc-content",installed:true,enabled:modState["tbc-content"],switchable:true,status:"early",icon:"tbc",page:null},{id:"wotlk-content",name:"WotLK Content",description:{en:"Northrend dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Нордскола, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-wotlk-content",installed:true,enabled:modState["wotlk-content"],switchable:true,status:"early",icon:"wotlk",page:null},{id:"ah-bot",name:"Auction House Bot",description:{en:"Fills the auction house with realistic, adjustable listings.",ru:"Наполняет аукцион реалистичными настраиваемыми лотами."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["ah-bot"] ?? false,switchable:true,status:"early",icon:"gavel",page:null,hidden:false},{id:"npc-enchanter",name:"NPC Enchanter",description:{en:"An NPC that enchants your gear for you.",ru:"НПС, который зачаровывает ваше снаряжение."},repo:"https://github.com/azerothcore/mod-npc-enchanter",installed:true,enabled:modState["npc-enchanter"],switchable:true,status:"early",icon:"sparkles",page:null,hidden:false},{id:"playerbots",name:"SQUID's Playerbots",description:{en:"An alternative bot system with random bots and full AI.",ru:"Альтернативная система ботов со случайными ботами и полным ИИ."},repo:"https://github.com/Zyth45/mod-playerbots",installed:true,enabled:modState["playerbots"] ?? false,switchable:true,status:"early",icon:"swords",page:"bots",hidden:false},{id:"client-compat",name:"Client compatibility",description:{en:"Client-server link and appearance unlocks.",ru:"Связь клиента с сервером и разблокировка внешних видов."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["client-compat"],switchable:false,status:"release",icon:"plug",page:null,hidden:true}, ...moduleCatalog.modules.filter(m => ["time-is-time", "custom-races", "subclass", "dev-menu"].includes(m.id)).map(m => ({...m, installed:true, enabled:modState[m.id] ?? true, switchable:true, page:null, hidden:false}))].map(m => ({...m, has_settings: !["tbc-content", "wotlk-content"].includes(m.id), compatibility: realm !== "coa" ? (["companions", "playerbots"].includes(m.id) ? "unsupported" : m.id === "client-compat" ? "compatible" : "experimental") : "compatible", switchable: realm !== "coa" && ["companions", "playerbots"].includes(m.id) ? false : m.switchable})); if(cmd==="module_set_enabled"){ if(args.enabled && ["companions","playerbots"].includes(args.module) && modState[args.module === "companions" ? "playerbots" : "companions"]) throw {human:{code:"bot_modules_conflict",title:"",message:"",actions:[]},technical:"Only one bot system may be enabled."}; modState[args.module]=args.enabled; return null; } if(cmd==="all_settings") return [{key:"Visibility.Distance.Continents",value:"100",default:"90",doc:"Description: Visibility distance on continents. Range: 45-250 Default: 90",changed:true},{key:"Death.SicknessLevel",value:"11",default:"11",doc:"Description: Character level up to which characters get resurrection sickness. Default: 11",changed:false},{key:"Rate.Drop.Item.Epic",value:"3",default:"1",doc:"Description: Drop rates for money and items based on quality. Default: 1",changed:true},{key:"Instance.ResetTimeHour",value:"4",default:"4",doc:"Description: Hour of the day when the global instance reset occurs. Range: 0-23 Default: 4 - (04:00 AM)",changed:false},{key:"PlayerLimit",value:"1000",default:"1000",doc:"Description: Maximum number of players in the world.",changed:false}]; if(cmd==="all_settings_save") return Object.keys(args&&args.changes||{}); if(cmd==="module_settings" && args.module==="client-compat") return [{key:"CoA.UnlockLocalAppearanceCatalog",value:"1",default:"1",doc:""},{key:"CoA.UnlockAllVanity",value:"1",default:"1",doc:""},{key:"CoA.AutoCollectAppearances",value:"0",default:"1",doc:""},{key:"CoA.LearnOwnedCompanions",value:"1",default:"1",doc:""},{key:"CoA.MaxRidingFromStart",value:"1",default:"1",doc:""}]; if(cmd==="module_settings"){ const S:Record<string,{key:string;value:string;default:string;doc:string}[]>={ + "subclass": [["Subclass.Enable","1"],["Subclass.MinLevel","20"],["Subclass.ThinHuman.Enable","1"],["Subclass.TwoHeadedOgre.Enable","1"],["Subclass.TwoPlayers.Enable","1"],["Subclass.StandardClasses","0"],["Subclass.StandardMains","0"],["Subclass.HeroRaces.RequiredLevel","60"],["Subclass.BookDropChance","5"]].map(([key,value])=>({key,value,default:value,doc:"Option of mod-subclass."})), + "dev-menu": [{key:"DevMenu.Enable",value:"1",default:"1",doc:"Answer the addon's requests."},{key:"DevMenu.MinSecurity",value:"2",default:"2",doc:"Lowest account security level allowed to use the menu."},{key:"DevMenu.Items.FirstId",value:"0",default:"0",doc:"First id of the item ids the Create an item tab uses."}], "time-is-time": [{key:"TimeIsTime.Enable",value:"1",default:"1",doc:""},{key:"TimeIsTime.Announce",value:"1",default:"1",doc:""},{key:"TimeIsTime.SpeedRate",value:"1.0",default:"1.0",doc:""},{key:"TimeIsTime.TimeStart",value:"0",default:"0",doc:""},{key:"TimeIsTime.HourOffset",value:"0.0",default:"0.0",doc:""}], "npc-enchanter":[{key:"Enchanter.Enable",value:"1",default:"1",doc:"Enable the module."},{key:"Enchanter.Announce",value:"0",default:"0",doc:"Announce the module when the player logs in."},{key:"Enchanter.CostCopper",value:"0",default:"0",doc:"What one enchantment costs, in copper (10000 = 1 gold). 0 = free."},{key:"Enchanter.MessageTimer",value:"60000",default:"60000",doc:"How often the NPC emotes, in milliseconds."}], "playerbots":[{"key": "AiPlayerbot.RandomBotAutologin", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.MinRandomBots", "value": "500", "default": "500", "doc": ""}, {"key": "AiPlayerbot.MaxRandomBots", "value": "500", "default": "500", "doc": ""}, {"key": "AiPlayerbot.RandomBotAccountCount", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.RandomBotMinLevel", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.RandomBotMaxLevel", "value": "60", "default": "60", "doc": ""}, {"key": "AiPlayerbot.SyncLevelWithPlayers", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.RandomBotInvitePlayer", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.RandomBotJoinLfg", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.RandomBotJoinBG", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.RandomBotAutoJoinBG", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.RandomBotTalk", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.RandomBotEmote", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.RandomBotSuggestDungeons", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.CoaClassesOnly", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.CoaSmartHeal", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.CoaSmartTank", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.CoaSpecRotations", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.CoaInterruptCoordination", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.MaxAddedBots", "value": "40", "default": "40", "doc": ""}, {"key": "AiPlayerbot.BotAutologin", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.DisabledWithoutRealPlayer", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.AddClassCommand", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.KeepAltsInGroup", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.CoaRecruitSameFaction", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.CoaLfgBots", "value": "1", "default": "1", "doc": ""}, {"key": "AiPlayerbot.RandomBotXPRate", "value": "1.0", "default": "1.0", "doc": ""}, {"key": "AiPlayerbot.FollowDistance", "value": "1.5", "default": "1.5", "doc": ""}, {"key": "AiPlayerbot.Enabled", "value": "0", "default": "0", "doc": ""}, {"key": "AiPlayerbot.RandomBotAccountPrefix", "value": "\"rndbot\"", "default": "\"rndbot\"", "doc": ""}, {"key": "AiPlayerbot.RandomBotUpdateInterval", "value": "20", "default": "20", "doc": ""}], diff --git a/src/lib/moduleSettings.ts b/src/lib/moduleSettings.ts index 81e375d..4346028 100644 --- a/src/lib/moduleSettings.ts +++ b/src/lib/moduleSettings.ts @@ -97,6 +97,14 @@ for (const [key, title, desc] of [ ] as [string, string[], string[]][]) add(`Enchanter.${key}`, "int", title, desc, { min: 0, advanced: true }); for (let n = 1; n <= 3; n++) add(`EC.P${n}`, "string", [`NPC phrase ${n}`, `Реплика НПС ${n}`, `NPC-Satz ${n}`, `Phrase du PNJ ${n}`, `Frase del PNJ ${n}`, `NPC台词 ${n}`], ["Text spoken by the NPC. Keep the enclosing quotes.", "Текст реплики НПС. Сохраните кавычки вокруг текста.", "Gesprochener Text. Anführungszeichen beibehalten.", "Texte prononcé. Conservez les guillemets.", "Texto hablado. Conserva las comillas.", "NPC发言内容,请保留外层引号。"], { advanced: true }); +add("Subclass.ThinHuman.Enable", "bool", ["Thin Twins race", "Раса «Хрупкие близнецы»", "Volk der Dünnen Zwillinge", "Race des Jumeaux maigres", "Raza de los Gemelos delgados", "瘦弱双子种族"], ["Off refuses new characters of this race; existing ones lose the brother and any subclass at their next login.", "Выключено — новых персонажей этой расы создать нельзя; у существующих при следующем входе пропадают брат и подкласс.", "Aus verweigert neue Figuren dieses Volkes; vorhandene verlieren beim nächsten Login den Bruder und eine Unterklasse.", "Désactivé refuse les nouveaux personnages de cette race ; les existants perdent le frère et la sous-classe à la prochaine connexion.", "Desactivado rechaza personajes nuevos de esta raza; los existentes pierden al hermano y la subclase al volver a entrar.", "关闭后不能创建此种族的新角色;现有角色在下次登录时失去兄弟和副职业。"]); +add("Subclass.TwoHeadedOgre.Enable", "bool", ["Two-Headed Ogre race", "Раса «Двуглавый огр»", "Volk der Zweiköpfigen Oger", "Race de l'Ogre à deux têtes", "Raza del Ogro de dos cabezas", "双头食人魔种族"], ["Off refuses new characters of this race; existing ones lose the second head and any subclass at their next login.", "Выключено — новых персонажей этой расы создать нельзя; у существующих при следующем входе пропадают вторая голова и подкласс.", "Aus verweigert neue Figuren dieses Volkes; vorhandene verlieren beim nächsten Login den zweiten Kopf und eine Unterklasse.", "Désactivé refuse les nouveaux personnages de cette race ; les existants perdent la seconde tête et la sous-classe à la prochaine connexion.", "Desactivado rechaza personajes nuevos de esta raza; los existentes pierden la segunda cabeza y la subclase al volver a entrar.", "关闭后不能创建此种族的新角色;现有角色在下次登录时失去第二个头和副职业。"]); +add("Subclass.TwoPlayers.Enable", "bool", ["Two players, one character", "Два игрока на одного персонажа", "Zwei Spieler, eine Figur", "Deux joueurs, un personnage", "Dos jugadores, un personaje", "两名玩家共用一个角色"], ["Two players share one Two-Headed Ogre or one pair of Twins. Off: no new pairs, and existing pairs play as single characters.", "Два игрока делят одного Двуглавого огра или пару близнецов. Выключено — новых пар нет, существующие играют как обычные персонажи.", "Zwei Spieler teilen sich einen Zweiköpfigen Oger oder ein Zwillingspaar. Aus: keine neuen Paare, bestehende spielen als einzelne Figuren.", "Deux joueurs partagent un Ogre à deux têtes ou une paire de Jumeaux. Désactivé : plus de nouvelles paires, les existantes jouent en solo.", "Dos jugadores comparten un Ogro de dos cabezas o una pareja de Gemelos. Desactivado: no hay parejas nuevas y las existentes juegan por separado.", "两名玩家共用一个双头食人魔或一对双子。关闭后不能组成新配对,现有配对按单人角色游戏。"]); +add("Subclass.MinLevel", "int", ["Subclass from level", "Подкласс с уровня", "Unterklasse ab Stufe", "Sous-classe dès le niveau", "Subclase desde el nivel", "副职业开放等级"], ["The level from which the borrowed class trees open.", "Уровень, с которого открываются деревья второго класса.", "Stufe, ab der die geliehenen Klassenbäume öffnen.", "Niveau à partir duquel les arbres de la classe empruntée s'ouvrent.", "Nivel a partir del cual se abren los árboles de la clase prestada.", "借用职业天赋树开放的等级。"], {"min": 1, "max": 80}); +add("Subclass.StandardClasses", "bool", ["Offer standard classes as subclass", "Стандартные классы как подкласс", "Standardklassen als Unterklasse", "Classes standard en sous-classe", "Clases estándar como subclase", "提供标准职业作为副职业"], ["Class trainers also offer Warrior ... Druid as the subclass. Off keeps CoA classes only.", "Учителя классов предлагают как подкласс и Воина … Друида. Выключено — только классы CoA.", "Klassenlehrer bieten auch Krieger … Druide als Unterklasse an. Aus: nur CoA-Klassen.", "Les maîtres de classe proposent aussi Guerrier … Druide en sous-classe. Désactivé : classes CoA seulement.", "Los instructores también ofrecen Guerrero … Druida como subclase. Desactivado: solo clases de CoA.", "职业训练师也提供战士……德鲁伊作为副职业。关闭则仅限 CoA 职业。"], {"advanced": true}); +add("Subclass.StandardMains", "bool", ["Standard classes at character creation", "Стандартные классы при создании", "Standardklassen bei der Erstellung", "Classes standard à la création", "Clases estándar al crear", "创建角色时提供标准职业"], ["Open Warrior ... Druid on the creation screen of a CoA realm for races with start data.", "Открывает Воина … Друида на экране создания в реалме CoA для рас со стартовыми данными.", "Öffnet Krieger … Druide im Erstellungsbildschirm eines CoA-Realms für Völker mit Startdaten.", "Ouvre Guerrier … Druide à la création sur un royaume CoA pour les races ayant des données de départ.", "Abre Guerrero … Druida en la creación de un reino CoA para razas con datos de inicio.", "在 CoA 服务器的创建界面为有起始数据的种族开放战士……德鲁伊。"], {"advanced": true}); +add("Subclass.HeroRaces.RequiredLevel", "int", ["Hero Races need a character of level", "Героические расы: нужен персонаж уровня", "Heldenvölker brauchen eine Figur der Stufe", "Races héroïques : personnage requis de niveau", "Razas heroicas: personaje necesario de nivel", "英雄种族需要的角色等级"], ["Like the Death Knight, the Thin Twins and the Two-Headed Ogre need a character of this level on the account first. 0 removes the requirement.", "Как для рыцаря смерти: Хрупким близнецам и Двуглавому огру нужен персонаж этого уровня на аккаунте. 0 — без условия.", "Wie beim Todesritter brauchen die Dünnen Zwillinge und die Zweiköpfige Ogerin zuerst eine Figur dieser Stufe auf dem Konto. 0 hebt die Bedingung auf.", "Comme le chevalier de la mort, les Jumeaux maigres et l'Ogre à deux têtes exigent d'abord un personnage de ce niveau sur le compte. 0 supprime la condition.", "Como el caballero de la muerte, los Gemelos delgados y el Ogro de dos cabezas necesitan antes un personaje de este nivel en la cuenta. 0 quita el requisito.", "与死亡骑士一样,瘦弱双子和双头食人魔需要账号中先有此等级的角色。0 表示无要求。"], {"min": 0, "max": 80}); +add("DevMenu.MinSecurity", "enum", ["Who may use /dev", "Кому доступно /dev", "Wer /dev nutzen darf", "Qui peut utiliser /dev", "Quién puede usar /dev", "谁可以使用 /dev"], ["The lowest account security level allowed to open the menu.", "Минимальный уровень прав аккаунта, которому доступно меню.", "Niedrigste Kontosicherheitsstufe, die das Menü öffnen darf.", "Niveau de sécurité de compte minimal autorisé à ouvrir le menu.", "Nivel de seguridad mínimo de la cuenta para abrir el menú.", "可打开该菜单的最低账号权限等级。"], {"options": [{"value": "2", "label": ["Game masters", "Гейм-мастера", "Spielleiter", "Maîtres du jeu", "Másteres", "游戏管理员"]}, {"value": "3", "label": ["Administrators", "Администраторы", "Administratoren", "Administrateurs", "Administradores", "管理员"]}]}); add("CoACustomRaces.BotsEnable", "bool", ["Bots can be custom races", "Боты кастомных рас", "Bots benutzerdefinierter Völker", "Bots de races personnalisées", "Bots de razas personalizadas", "允许机器人为自定义种族"], [ From 20657df203b4090bc72df74e228a9337f8d3a030 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:21:24 +0500 Subject: [PATCH 16/29] MySQL options of the owner kept across starts (#103) Settings, Service edits Settings/mysql-custom.ini. Every start adds its name = value lines (outside a section or in [mysqld]) to the rendered my.ini, after the defaults so they win; the port, addresses, data and log paths, sockets and !include stay managed. Nothing changes for a server without the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-mysql-custom-options.md | 7 ++ crates/coa-core/src/launcher/render.rs | 98 +++++++++++++++++++- src-tauri/src/lib.rs | 23 +++++ src/dev/mock.ts | 1 + src/i18n/locales/de.ts | 5 + src/i18n/locales/en.ts | 5 + src/i18n/locales/es.ts | 5 + src/i18n/locales/fr.ts | 5 + src/i18n/locales/ru.ts | 5 + src/i18n/locales/zh.ts | 5 + src/lib/api.ts | 3 + src/screens/MySqlSettings.tsx | 48 ++++++++++ src/screens/SettingsHome.tsx | 3 +- 13 files changed, 211 insertions(+), 2 deletions(-) create mode 100644 changelog.d/20261115-mysql-custom-options.md create mode 100644 src/screens/MySqlSettings.tsx diff --git a/changelog.d/20261115-mysql-custom-options.md b/changelog.d/20261115-mysql-custom-options.md new file mode 100644 index 0000000..424017c --- /dev/null +++ b/changelog.d/20261115-mysql-custom-options.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Your own MySQL settings survive restarts and updates +--- +Settings, Service has a MySQL settings box. Its options are added to my.ini at every start of the database; before, my.ini was rewritten and hand edits were lost. Port, addresses and data paths stay managed. diff --git a/crates/coa-core/src/launcher/render.rs b/crates/coa-core/src/launcher/render.rs index a333eeb..55161b6 100644 --- a/crates/coa-core/src/launcher/render.rs +++ b/crates/coa-core/src/launcher/render.rs @@ -140,6 +140,7 @@ pub fn prepare(root: &Path, config: &Settings) -> Result<Vec<PathBuf>> { std::fs::write(root.join(target), text.as_bytes())?; written.push(root.join(target)); } + let custom = custom_mysql_options(root); let files: [(&str, String); 3] = [ ( "Core/configs/modules/coa_bugreport.conf", @@ -150,7 +151,7 @@ pub fn prepare(root: &Path, config: &Settings) -> Result<Vec<PathBuf>> { ( "mysql/my.ini", format!( - "[mysqld]\nbasedir=\"{base}/mysql\"\ndatadir=\"{base}/mysql/data\"\nport={mysql_port}\nbind-address=127.0.0.1\nmysqlx=0\ncharacter-set-server=utf8mb4\ncollation-server=utf8mb4_unicode_ci\nmax_allowed_packet=128M\ninnodb_buffer_pool_size=256M\nskip-log-bin\nlog-error=\"{base}/mysql/logs/mysql-error.log\"\npid-file=\"{base}/mysql/mysql.pid\"\n" + "[mysqld]\nbasedir=\"{base}/mysql\"\ndatadir=\"{base}/mysql/data\"\nport={mysql_port}\nbind-address=127.0.0.1\nmysqlx=0\ncharacter-set-server=utf8mb4\ncollation-server=utf8mb4_unicode_ci\nmax_allowed_packet=128M\ninnodb_buffer_pool_size=256M\nskip-log-bin\nlog-error=\"{base}/mysql/logs/mysql-error.log\"\npid-file=\"{base}/mysql/mysql.pid\"\n{custom}" ), ), ( @@ -168,6 +169,85 @@ pub fn prepare(root: &Path, config: &Settings) -> Result<Vec<PathBuf>> { Ok(written) } +/// The owner's file of extra MySQL options; the launcher rewrites `mysql/my.ini` at every start. +pub const CUSTOM_MYSQL: &str = "Settings/mysql-custom.ini"; + +/// The owner's MySQL options as written, and the lines a start will add to `[mysqld]`. +#[derive(Debug, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CustomMysql { + pub text: String, + pub applied: String, +} + +pub fn read_custom_mysql(root: &Path) -> CustomMysql { + let text = std::fs::read(root.join(CUSTOM_MYSQL)) + .map(|b| String::from_utf8_lossy(&b).into_owned()) + .unwrap_or_default(); + CustomMysql { text, applied: custom_mysql_options(root) } +} + +/// Save the owner's MySQL options; they apply at the next start of the database. +pub fn write_custom_mysql(root: &Path, text: &str) -> Result<CustomMysql> { + if text.len() > 16 * 1024 || text.contains(char::from(0)) { + return Err(Error::Invalid("The MySQL options must be plain text of at most 16 KB.".into())); + } + crate::fsx::atomic_write(&root.join(CUSTOM_MYSQL), text.replace("\r\n", "\n").as_bytes())?; + Ok(read_custom_mysql(root)) +} + +/// Options the server cannot run without, which only the launcher sets. +const MANAGED_MYSQL_OPTIONS: [&str; 10] = [ + "basedir", + "datadir", + "port", + "bind-address", + "mysqlx", + "log-error", + "pid-file", + "socket", + "skip-networking", + "defaults-file", +]; + +/// `name = value` lines of the owner's file (outside any section or in `[mysqld]`), as lines for `[mysqld]`. +/// Comments, other sections, `!include` and the options the launcher manages are left out. +pub fn custom_mysql_options(root: &Path) -> String { + let Ok(bytes) = std::fs::read(root.join(CUSTOM_MYSQL)) else { + return String::new(); + }; + let text = String::from_utf8_lossy(&bytes); + let mut in_mysqld = true; + let mut out = String::new(); + for line in text.trim_start_matches('\u{feff}').lines() { + let line = line.trim(); + if line.is_empty() || line.starts_with('#') || line.starts_with(';') { + continue; + } + if line.starts_with('[') { + in_mysqld = line.eq_ignore_ascii_case("[mysqld]"); + continue; + } + if !in_mysqld || line.starts_with('!') { + continue; + } + let name = line + .split('=') + .next() + .unwrap_or("") + .trim() + .to_ascii_lowercase() + .replace('_', "-"); + let name = name.strip_prefix("loose-").unwrap_or(&name); + if name.is_empty() || MANAGED_MYSQL_OPTIONS.contains(&name) { + continue; + } + out.push_str(line); + out.push('\n'); + } + out +} + #[cfg(windows)] mod sys { use std::os::windows::ffi::OsStrExt; @@ -206,6 +286,22 @@ mod tests { w("Settings/mod_ascension_compat.conf.template", b"Ascension.DbcDir = \"@ASCENSION_DBC@\"\rOld.Mac = 1\r"); } + #[test] + fn the_owners_mysql_options_are_kept_except_the_managed_ones() { + let d = tempfile::tempdir().unwrap(); + std::fs::create_dir_all(d.path().join("Settings")).unwrap(); + std::fs::write( + d.path().join(CUSTOM_MYSQL), + "\u{feff}# tuning\ninnodb_buffer_pool_size = 2G\nport=3999\nloose_bind_address=0.0.0.0\n!include C:/x.ini\n[client]\nuser=evil\n[mysqld]\nmax_connections=500\nDATADIR=D:/elsewhere\n", + ) + .unwrap(); + assert_eq!( + custom_mysql_options(d.path()), + "innodb_buffer_pool_size = 2G\nmax_connections=500\n" + ); + assert_eq!(custom_mysql_options(&d.path().join("missing")), ""); + } + #[test] fn placeholders_left_outside_comments_are_refused() { let d = tempfile::tempdir().unwrap(); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index d8b595b..39a1b1d 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1238,6 +1238,27 @@ async fn realm_select( result } +#[tauri::command] +async fn mysql_custom( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<coa_core::launcher::render::CustomMysql, UiError> { + let root = path_of(&state, &id)?; + blocking(move || Ok(coa_core::launcher::render::read_custom_mysql(&root))).await +} + +/// The owner's own MySQL options (Settings/mysql-custom.ini); they apply at the next start of the database. +#[tauri::command] +async fn mysql_custom_save( + state: State<'_, AppState>, + id: String, + text: String, +) -> std::result::Result<coa_core::launcher::render::CustomMysql, UiError> { + let root = path_of(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || coa_core::launcher::render::write_custom_mysql(&root, &text)).await +} + #[tauri::command] async fn realm_names( state: State<'_, AppState>, @@ -3011,6 +3032,8 @@ pub fn run() { realm_with_reborn, realm_names, realm_rename, + mysql_custom, + mysql_custom_save, check_database, repair_server, module_set_enabled, diff --git a/src/dev/mock.ts b/src/dev/mock.ts index d8a778b..a6719ec 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -39,6 +39,7 @@ export {}; if(cmd==="pending_update") return null; if(cmd==="plugin:app|version") return "0.8.2"; if(cmd==="release_history") throw new Error("Offline demo: using bundled notes"); + if(cmd==="mysql_custom"||cmd==="mysql_custom_save"){const w=window as any;if(cmd==="mysql_custom_save")w.__my=args.text;const text:string=w.__my??"";const applied=text.split("\n").map((l:string)=>l.trim()).filter((l:string)=>l&&!l.startsWith("#")&&!/^(port|datadir|basedir|bind[-_]address)\b/i.test(l)).map((l:string)=>l+"\n").join("");return {text,applied};} if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));} if(cmd==="realm_profiles") return {active:realm,wildcard_created:wildcardCreated,reborn_created:rebornCreated,reborn_supported:true,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:simultaneous&&running,with_reborn:withReborn,reborn_world_port:withReborn?8087:null,reborn_running:withReborn&&running}; if(cmd==="realm_simultaneous") { if(running) throw new Error("Stop both realms before changing simultaneous startup."); simultaneous=args.enabled; wildcardCreated ||= simultaneous; return {active:realm,wildcard_created:wildcardCreated,reborn_created:rebornCreated,reborn_supported:true,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:false,with_reborn:withReborn,reborn_world_port:withReborn?8087:null,reborn_running:false}; } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 308dbb2..80d0b47 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -773,6 +773,11 @@ const de: Partial<Record<keyof typeof en, string>> = { "overview.reportBtn": "Diagnose sammeln und melden", // Realmlist switcher and modules page + "mysql.title": "MySQL-Einstellungen", + "mysql.hint": "Eigene MySQL-Optionen, eine Zeile name = wert. Sie werden bei jedem Start der Datenbank zu my.ini hinzugefügt und bleiben nach Updates erhalten. Port, Adressen und Datenpfade verwaltet der Manager; hier werden sie ignoriert.", + "mysql.save": "Speichern", + "mysql.saved": "Gespeichert; Server neu starten, um sie anzuwenden.", + "mysql.applied": "Angewandte Optionen: {count}", "realm.namesTitle": "Realmnamen", "realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.", "realm.nameSave": "Speichern", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 8d67fab..3eb093e 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -57,6 +57,11 @@ const en = { "remote.hostInstead": "Host my own server", "welcome.roleSubtitle": "How would you like to play?", + "mysql.title": "MySQL settings", + "mysql.hint": "Your own MySQL options, one name = value per line. They are added to my.ini at every start of the database and stay after updates. The port, addresses and data paths are managed by the Manager and ignored here.", + "mysql.save": "Save", + "mysql.saved": "Saved; restart the server to apply.", + "mysql.applied": "Options applied: {count}", "realm.namesTitle": "Realm names", "realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.", "realm.nameSave": "Save", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 3bc0fdc..affdc3c 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -773,6 +773,11 @@ const es: Partial<Record<keyof typeof en, string>> = { "overview.reportBtn": "Reunir el diagnóstico y avisar", // Realmlist switcher and modules page + "mysql.title": "Ajustes de MySQL", + "mysql.hint": "Tus propias opciones de MySQL, una línea nombre = valor. Se añaden a my.ini en cada inicio de la base de datos y se mantienen tras las actualizaciones. El puerto, las direcciones y las rutas de datos los gestiona el Manager y aquí se ignoran.", + "mysql.save": "Guardar", + "mysql.saved": "Guardado; reinicia el servidor para aplicarlo.", + "mysql.applied": "Opciones aplicadas: {count}", "realm.namesTitle": "Nombres de los reinos", "realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.", "realm.nameSave": "Guardar", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 3476e74..a9765e4 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -773,6 +773,11 @@ const fr: Partial<Record<keyof typeof en, string>> = { "overview.reportBtn": "Rassembler le diagnostic et signaler", // Realmlist switcher and modules page + "mysql.title": "Paramètres MySQL", + "mysql.hint": "Vos propres options MySQL, une ligne nom = valeur. Elles sont ajoutées à my.ini à chaque démarrage de la base et restent après les mises à jour. Le port, les adresses et les chemins de données sont gérés par le Manager et ignorés ici.", + "mysql.save": "Enregistrer", + "mysql.saved": "Enregistré ; redémarrez le serveur pour appliquer.", + "mysql.applied": "Options appliquées : {count}", "realm.namesTitle": "Noms des royaumes", "realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.", "realm.nameSave": "Enregistrer", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index afaba73..e6a9d75 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -60,6 +60,11 @@ const ru: Partial<Record<keyof typeof en, string>> = { "remote.hostInstead": "Создать свой сервер", "welcome.roleSubtitle": "Как вы хотите играть?", + "mysql.title": "Настройки MySQL", + "mysql.hint": "Свои параметры MySQL, по одному «имя = значение» в строке. Они добавляются в my.ini при каждом запуске базы и сохраняются после обновлений. Порт, адреса и пути к данным задаёт Manager, здесь они игнорируются.", + "mysql.save": "Сохранить", + "mysql.saved": "Сохранено; перезапустите сервер, чтобы применить.", + "mysql.applied": "Применяется параметров: {count}", "realm.namesTitle": "Названия реалмов", "realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.", "realm.nameSave": "Сохранить", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 3d7dda9..354948c 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -58,6 +58,11 @@ const zh = { "remote.hostInstead": "搭建自己的服务器", "welcome.roleSubtitle": "你想如何游玩?", + "mysql.title": "MySQL 设置", + "mysql.hint": "自定义 MySQL 选项,每行一个“名称 = 值”。每次数据库启动时都会加入 my.ini,更新后也会保留。端口、地址和数据路径由 Manager 管理,此处会被忽略。", + "mysql.save": "保存", + "mysql.saved": "已保存;重启服务器后生效。", + "mysql.applied": "生效的选项:{count}", "realm.namesTitle": "服务器名称", "realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。", "realm.nameSave": "保存", diff --git a/src/lib/api.ts b/src/lib/api.ts index 24572b5..b7a366f 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -57,6 +57,7 @@ export interface StatusView { } export type RealmMode = "coa" | "wildcard" | "reborn"; +export interface CustomMysql { text: string; applied: string } export interface RealmName { id: number; name: string; defaultName: string; custom: boolean } export interface RealmProfiles { active: RealmMode; wildcard_created: boolean; reborn_created: boolean; reborn_supported: boolean; supported: boolean; recovery_pending: boolean; simultaneous: boolean; secondary_world_port: number | null; secondary_running: boolean; with_reborn: boolean; reborn_world_port: number | null; reborn_running: boolean } export interface DatabaseCheck { @@ -487,6 +488,8 @@ export const api = { realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }), realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }), realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }), + mysqlCustom: (id: string) => invoke<CustomMysql>("mysql_custom", { id }), + mysqlCustomSave: (id: string, text: string) => invoke<CustomMysql>("mysql_custom_save", { id, text }), realmNames: (id: string) => invoke<RealmName[]>("realm_names", { id }), realmRename: (id: string, realmId: number, name: string | null) => invoke<RealmName[]>("realm_rename", { id, realmId, name }), realmWithReborn: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_with_reborn", { id, enabled }), diff --git a/src/screens/MySqlSettings.tsx b/src/screens/MySqlSettings.tsx new file mode 100644 index 0000000..0570ee9 --- /dev/null +++ b/src/screens/MySqlSettings.tsx @@ -0,0 +1,48 @@ +import { useEffect, useState } from "react"; +import { api, asUiError, type CustomMysql } from "@/lib/api"; +import { Card } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { useT } from "@/i18n"; + +/** The owner's own MySQL options (#103): kept in Settings/mysql-custom.ini and added to my.ini at every start. */ +export function MySqlSettings({ serverId }: { serverId: string }) { + const t = useT(); + const [saved, setSaved] = useState<CustomMysql | null>(null); + const [draft, setDraft] = useState(""); + const [busy, setBusy] = useState(false); + const [done, setDone] = useState(false); + const [error, setError] = useState<string | null>(null); + + useEffect(() => { + let alive = true; + void api.mysqlCustom(serverId).then(v => { if (alive) { setSaved(v); setDraft(v.text); } }).catch(e => { if (alive) setError(asUiError(e).technical); }); + return () => { alive = false; }; + }, [serverId]); + + async function save() { + setBusy(true); setError(null); setDone(false); + try { const v = await api.mysqlCustomSave(serverId, draft); setSaved(v); setDraft(v.text); setDone(true); } + catch (e) { setError(asUiError(e).technical); } + finally { setBusy(false); } + } + + const applied = saved?.applied.trim() ? saved.applied.trim().split("\n").length : 0; + return <Card className="mt-6 p-6" aria-busy={busy}> + <h2 className="font-semibold">{t("mysql.title")}</h2> + <p className="mt-1 text-sm text-muted">{t("mysql.hint")}</p> + <textarea + className="selectable mt-3 h-36 w-full rounded border border-line bg-bg p-3 font-mono text-xs text-ink outline-none focus:border-gold" + spellCheck={false} + placeholder={"innodb_buffer_pool_size = 1G\nmax_connections = 300"} + aria-label={t("mysql.title")} + value={draft} + disabled={busy || !saved} + onChange={e => { setDraft(e.target.value); setDone(false); }} + /> + <div className="mt-3 flex flex-wrap items-center gap-3"> + <Button size="sm" disabled={busy || !saved || draft === saved.text} onClick={() => void save()}>{t("mysql.save")}</Button> + <span className="text-xs text-muted">{t("mysql.applied", { count: applied })}{done ? ` · ${t("mysql.saved")}` : ""}</span> + </div> + {error && <p className="mt-3 text-sm text-bad" role="alert">{error}</p>} + </Card>; +} diff --git a/src/screens/SettingsHome.tsx b/src/screens/SettingsHome.tsx index e6c6290..dda693e 100644 --- a/src/screens/SettingsHome.tsx +++ b/src/screens/SettingsHome.tsx @@ -13,6 +13,7 @@ import { ClientCard } from "./ClientCard"; import { GameDataCard } from "./GameDataCard"; import { RealmStartupSettings } from "./RealmStartupSettings"; import { RealmNameSettings } from "./RealmNameSettings"; +import { MySqlSettings } from "./MySqlSettings"; import { AutoRestartSettings } from "./AutoRestartSettings"; import { DiagnosticsCard } from "./DiagnosticsCard"; import { RepairCard } from "./RepairCard"; @@ -53,7 +54,7 @@ export function SettingsHome({ serverId, path, onForget }: { serverId: string; s </div> <div hidden={section !== "startup"} className="max-w-3xl"><RealmNameSettings serverId={serverId} /><RealmStartupSettings serverId={serverId} /><AutoRestartSettings serverId={serverId} /></div> <div hidden={section !== "client"} className="max-w-3xl"><ClientCard serverId={serverId} /><GameDataCard serverId={serverId} /></div> - <div hidden={section !== "service"} className="max-w-3xl"><ServerLoggingSettings serverId={serverId} /><DiagnosticsCard serverId={serverId} /><RepairCard serverId={serverId} /><RemoveServerCard serverId={serverId} path={path} onForget={onForget} /></div> + <div hidden={section !== "service"} className="max-w-3xl"><ServerLoggingSettings serverId={serverId} /><MySqlSettings serverId={serverId} /><DiagnosticsCard serverId={serverId} /><RepairCard serverId={serverId} /><RemoveServerCard serverId={serverId} path={path} onForget={onForget} /></div> <div hidden={section !== "interface"} className="max-w-3xl"><Card className="mt-6 p-6"><h2 className="font-semibold">{t("settings.language")}</h2><p className="mt-1 text-sm text-muted">{t("settings.languageHint")}</p><LanguagePicker className="mt-4" /></Card><WindowSettings /><PublicServerSettings /></div> </div>; } From 260d10b7297c50306c8c7a1a8aea4b2dcf2e0b93 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:26:14 +0500 Subject: [PATCH 17/29] Scheduled daily restart of the world (#202) Settings/restart-schedule.json (Settings, Startup) holds a local time and a countdown. The Rust world supervisor asks the world for 'server restart <seconds>' once that time has passed (by at most 15 minutes, for a world that ran before it), and starts the world again when it exits with RESTART_EXIT_CODE; the database and auth keep running. While it is under way (.state/scheduled-restart) the status says so and the Manager does not take the down world for a crash. Extra worlds follow their server's schedule. Repacks with the Python supervisor do not run the schedule; the card says the server needs an update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-scheduled-restart.md | 7 + crates/coa-core/src/launcher/mod.rs | 1 + crates/coa-core/src/launcher/schedule.rs | 162 ++++++++++++++++++++++ crates/coa-core/src/launcher/world.rs | 74 ++++++++-- crates/coa-launcher/src/main.rs | 2 +- src-tauri/src/lib.rs | 52 ++++++- src/dev/mock.ts | 1 + src/i18n/locales/de.ts | 8 ++ src/i18n/locales/en.ts | 8 ++ src/i18n/locales/es.ts | 8 ++ src/i18n/locales/fr.ts | 8 ++ src/i18n/locales/ru.ts | 8 ++ src/i18n/locales/zh.ts | 8 ++ src/lib/api.ts | 5 + src/screens/Overview.tsx | 2 +- src/screens/RestartScheduleSettings.tsx | 57 ++++++++ src/screens/SettingsHome.tsx | 3 +- 17 files changed, 395 insertions(+), 19 deletions(-) create mode 100644 changelog.d/20261115-scheduled-restart.md create mode 100644 crates/coa-core/src/launcher/schedule.rs create mode 100644 src/screens/RestartScheduleSettings.tsx diff --git a/changelog.d/20261115-scheduled-restart.md b/changelog.d/20261115-scheduled-restart.md new file mode 100644 index 0000000..eca0af3 --- /dev/null +++ b/changelog.d/20261115-scheduled-restart.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Restart the world every day at a chosen time +--- +Settings, Startup, Scheduled restart: at that local time the world restarts with an in-game countdown and comes back by itself; the database keeps running. It works without the Manager open and needs a server with the new launcher. diff --git a/crates/coa-core/src/launcher/mod.rs b/crates/coa-core/src/launcher/mod.rs index 786583c..a400f22 100644 --- a/crates/coa-core/src/launcher/mod.rs +++ b/crates/coa-core/src/launcher/mod.rs @@ -14,6 +14,7 @@ pub mod ops; pub mod relay; pub mod render; +pub mod schedule; pub mod services; pub mod settings; pub mod spawn; diff --git a/crates/coa-core/src/launcher/schedule.rs b/crates/coa-core/src/launcher/schedule.rs new file mode 100644 index 0000000..97eb9d6 --- /dev/null +++ b/crates/coa-core/src/launcher/schedule.rs @@ -0,0 +1,162 @@ +//! Restarts on a schedule (#202): once a day at the owner's local time, the world supervisor asks the world to +//! restart with an in-game countdown, waits for it to exit with AzerothCore's restart code and starts it again. +//! The database and the auth server keep running. + +use std::path::{Path, PathBuf}; +use std::time::Duration; + +use chrono::{Local, NaiveDateTime, NaiveTime, Timelike}; +use serde::{Deserialize, Serialize}; + +use crate::error::{Error, Result}; + +const FILE: &str = "Settings/restart-schedule.json"; +/// Present while a scheduled restart is under way, so a world that is briefly down is not taken for a crash. +const UNDER_WAY: &str = ".state/scheduled-restart"; +/// The exit code of `server restart` (AzerothCore's `RESTART_EXIT_CODE`). +pub const RESTART_EXIT_CODE: i32 = 2; +/// A restart missed by more than this (the computer slept, the world started late) waits for the next day. +const LATE: Duration = Duration::from_secs(15 * 60); +/// A world that has not come back within this time no longer counts as restarting. +const UNDER_WAY_LIMIT: Duration = Duration::from_secs(45 * 60); + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RestartSchedule { + pub enabled: bool, + /// Local time, `HH:MM`. + pub time: String, + /// The in-game countdown before the restart, in minutes (1-60). + pub warning_minutes: u32, +} + +impl Default for RestartSchedule { + fn default() -> Self { + Self { + enabled: false, + time: "05:00".into(), + warning_minutes: 5, + } + } +} + +impl RestartSchedule { + fn at(&self) -> Option<NaiveTime> { + NaiveTime::parse_from_str(self.time.trim(), "%H:%M").ok() + } + + fn validate(&self) -> Result<()> { + if self.at().is_none() { + return Err(Error::Invalid("The restart time must be HH:MM, for example 05:00.".into())); + } + if !(1..=60).contains(&self.warning_minutes) { + return Err(Error::Invalid("The restart warning must be 1 to 60 minutes.".into())); + } + Ok(()) + } + + /// The scheduled moment of `now`'s day, when a restart is due at `now` for a world started at `started`: + /// the moment has passed by less than [`LATE`] and the world was already running before it. + pub fn due(&self, now: NaiveDateTime, started: NaiveDateTime) -> Option<NaiveDateTime> { + if !self.enabled { + return None; + } + let moment = now.date().and_time(self.at()?); + let late = now.signed_duration_since(moment).to_std().ok()?; + (late <= LATE && started < moment).then_some(moment) + } +} + +/// The folder whose schedule a world follows: an extra world (`<server>/.realms/<name>`) follows its server's. +fn owner(root: &Path) -> PathBuf { + if crate::launcher::settings::is_extra_world(root) { + if let Some(main) = root.parent().and_then(Path::parent) { + return main.to_path_buf(); + } + } + root.to_path_buf() +} + +pub fn load(root: &Path) -> RestartSchedule { + crate::fsx::read_json(&owner(root).join(FILE)).unwrap_or_default() +} + +pub fn save(root: &Path, schedule: &RestartSchedule) -> Result<RestartSchedule> { + let mut schedule = schedule.clone(); + schedule.time = schedule.time.trim().to_string(); + if schedule.enabled { + schedule.validate()?; + } else if schedule.at().is_none() { + schedule.time = RestartSchedule::default().time; + } + crate::fsx::atomic_write_json(&owner(root).join(FILE), &schedule)?; + Ok(schedule) +} + +pub fn now() -> NaiveDateTime { + Local::now().naive_local().with_nanosecond(0).unwrap_or_else(|| Local::now().naive_local()) +} + +pub fn mark_under_way(root: &Path) -> Result<()> { + let path = root.join(UNDER_WAY); + if let Some(parent) = path.parent() { + std::fs::create_dir_all(parent)?; + } + std::fs::write(path, b"")?; + Ok(()) +} + +pub fn clear_under_way(root: &Path) { + let _ = std::fs::remove_file(root.join(UNDER_WAY)); +} + +/// A scheduled restart of this world is under way (its world may be down for a few minutes). +pub fn under_way(root: &Path) -> bool { + std::fs::metadata(root.join(UNDER_WAY)) + .and_then(|m| m.modified()) + .is_ok_and(|t| t.elapsed().is_ok_and(|age| age < UNDER_WAY_LIMIT)) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn at(text: &str) -> NaiveDateTime { + NaiveDateTime::parse_from_str(text, "%Y-%m-%d %H:%M").unwrap() + } + + #[test] + fn a_restart_is_due_once_after_its_time_for_a_world_that_ran_before_it() { + let s = RestartSchedule { enabled: true, time: "05:00".into(), warning_minutes: 5 }; + let started = at("2026-11-14 20:00"); + assert_eq!(s.due(at("2026-11-15 04:59"), started), None); + assert_eq!(s.due(at("2026-11-15 05:00"), started), Some(at("2026-11-15 05:00"))); + assert_eq!(s.due(at("2026-11-15 05:14"), started), Some(at("2026-11-15 05:00"))); + assert_eq!(s.due(at("2026-11-15 05:16"), started), None, "missed by too much"); + // The world that came back at 05:06 is not restarted again that day. + assert_eq!(s.due(at("2026-11-15 05:10"), at("2026-11-15 05:06")), None); + assert_eq!(s.due(at("2026-11-16 05:01"), at("2026-11-15 05:06")), Some(at("2026-11-16 05:00"))); + let off = RestartSchedule { enabled: false, ..s }; + assert_eq!(off.due(at("2026-11-15 05:00"), started), None); + } + + #[test] + fn schedules_are_validated_and_extra_worlds_follow_their_server() { + let d = tempfile::tempdir().unwrap(); + assert_eq!(load(d.path()), RestartSchedule::default()); + let bad = RestartSchedule { enabled: true, time: "25:00".into(), warning_minutes: 5 }; + assert!(save(d.path(), &bad).is_err()); + let quiet = RestartSchedule { enabled: true, time: "05:00".into(), warning_minutes: 0 }; + assert!(save(d.path(), &quiet).is_err()); + let good = RestartSchedule { enabled: true, time: " 04:30 ".into(), warning_minutes: 10 }; + assert_eq!(save(d.path(), &good).unwrap().time, "04:30"); + let extra = d.path().join(".realms/secondary"); + std::fs::create_dir_all(&extra).unwrap(); + assert!(load(&extra).enabled); + assert!(!under_way(d.path())); + mark_under_way(d.path()).unwrap(); + assert!(under_way(d.path())); + clear_under_way(d.path()); + assert!(!under_way(d.path())); + } +} diff --git a/crates/coa-core/src/launcher/world.rs b/crates/coa-core/src/launcher/world.rs index 5d495aa..12206d5 100644 --- a/crates/coa-core/src/launcher/world.rs +++ b/crates/coa-core/src/launcher/world.rs @@ -13,7 +13,7 @@ use std::time::{Duration, Instant}; use crate::error::{Error, ErrorCode, Result}; use crate::launcher::services::{self, ensure_free, mysql, spawn, start_mysql, wait_ready, Progress}; use crate::launcher::spawn::Proc; -use crate::launcher::{settings::Settings, squid, state}; +use crate::launcher::{schedule, settings::Settings, squid, state}; fn stop_relay_flag(root: &Path) -> std::path::PathBuf { state::dir(root).join("stop-relay") @@ -169,24 +169,70 @@ fn spawn_relay(root: &Path, launcher: Option<&Path>) -> Result<Proc> { } /// The supervisor (`watch-world`): run the world, keep the relay alive while it runs, stop the relay after it. -/// `launcher` is the launcher executable that runs the relay (`None`: the Python relay). -pub fn watch_world(root: &Path, launcher: Option<&Path>, log: Progress) -> Result<()> { +/// `launcher` is the launcher executable that runs the relay (`None`: the Python relay). At the owner's scheduled +/// time it asks the world to restart with an in-game countdown and starts it again when it exits for that. +pub fn watch_world(root: &Path, launcher: Option<&Path>, offset: i32, log: Progress) -> Result<()> { squid::validate_bots(root)?; - let world = spawn_child(root, "world", &root.join("Core/worldserver.exe"), &["-c", "configs/worldserver.conf"], &root.join("Core"), &root.join("Core/Logs/world-console.log"))?; let mut relay: Option<Proc> = None; - while world.try_wait().is_none() { - let dead = relay.as_ref().is_none_or(|r| r.try_wait().is_some()); - if dead { - match spawn_relay(root, launcher) { - Ok(r) => relay = Some(r), - Err(e) => { - log(&format!("Report relay could not start ({e}); retrying.")); - std::thread::sleep(Duration::from_secs(5)); - continue; + loop { + let world = spawn_child(root, "world", &root.join("Core/worldserver.exe"), &["-c", "configs/worldserver.conf"], &root.join("Core"), &root.join("Core/Logs/world-console.log"))?; + let started = schedule::now(); + let mut requested = false; + let mut last_check: Option<Instant> = None; + let code = loop { + if let Some(code) = world.try_wait() { + break code; + } + let dead = relay.as_ref().is_none_or(|r| r.try_wait().is_some()); + if dead { + match spawn_relay(root, launcher) { + Ok(r) => relay = Some(r), + Err(e) => { + log(&format!("Report relay could not start ({e}); retrying.")); + std::thread::sleep(Duration::from_secs(5)); + continue; + } } } + if last_check.is_none_or(|t| t.elapsed() >= Duration::from_secs(30)) { + last_check = Some(Instant::now()); + if schedule::under_way(root) && !requested { + // The world that a scheduled restart started again is back once it accepts connections. + if Settings::load(root, offset).is_ok_and(|cfg| services::ready(root, "world", cfg.world_port)) { + schedule::clear_under_way(root); + } + } + if !requested { + let plan = schedule::load(root); + if plan.due(schedule::now(), started).is_some() { + let seconds = plan.warning_minutes * 60; + let asked = Settings::load(root, offset).and_then(|cfg| { + crate::ra::Ra::connect_to(cfg.ra_port, &cfg.ra_username, &cfg.ra_password) + .and_then(|mut ra| ra.run(&format!("server restart {seconds}"))) + }); + match asked { + Ok(_) => { + schedule::mark_under_way(root)?; + requested = true; + log(&format!("Scheduled restart: the world restarts in {} minutes.", plan.warning_minutes)); + } + Err(e) => log(&format!("Scheduled restart could not be requested ({e}); retrying.")), + } + } + } + } + std::thread::sleep(Duration::from_secs(2)); + }; + if requested && code == schedule::RESTART_EXIT_CODE as u32 { + log("Scheduled restart: starting the world again."); + if let Err(e) = squid::validate_bots(root) { + schedule::clear_under_way(root); + return Err(e); + } + continue; } - std::thread::sleep(Duration::from_secs(2)); + schedule::clear_under_way(root); + break; } std::fs::write(stop_relay_flag(root), b"")?; if let Some(r) = relay { diff --git a/crates/coa-launcher/src/main.rs b/crates/coa-launcher/src/main.rs index 4c606cd..031ea0e 100644 --- a/crates/coa-launcher/src/main.rs +++ b/crates/coa-launcher/src/main.rs @@ -100,7 +100,7 @@ fn run(args: Args) -> Result<(), String> { match args.action.as_str() { "watch-world" => { let me = std::env::current_exe().map_err(|x| x.to_string())?; - return world::watch_world(root, Some(&me), &|m| say(m)).map_err(e); + return world::watch_world(root, Some(&me), args.offset, &|m| say(m)).map_err(e); } "relay-worker" => return coa_core::launcher::relay::worker(root).map_err(e), "debug-logs-status" => { diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 39a1b1d..c84c637 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -350,6 +350,8 @@ struct StatusView { observed: Observed, busy: bool, path_exists: bool, + /// A scheduled restart is under way: a world that is down for a few minutes did not crash. + scheduled_restart: bool, } /// Where the Manager keeps its own state (server list, logs). `%LOCALAPPDATA%` on Windows, the XDG data folder elsewhere. @@ -548,9 +550,12 @@ async fn server_status( let root = path_of(&state, &id)?; let busy = state.busy.lock().map(|b| b.contains(&id)).unwrap_or(false); let path_exists = root.is_dir(); - let observed = tauri::async_runtime::spawn_blocking(move || { + let (observed, scheduled_restart) = tauri::async_runtime::spawn_blocking(move || { let ports = layout::read_ports(&root); - process::observe(&root, &ports) + ( + process::observe(&root, &ports), + coa_core::launcher::schedule::under_way(&root), + ) }) .await .map_err(|e| Error::Invalid(e.to_string()))?; @@ -558,6 +563,7 @@ async fn server_status( observed, busy, path_exists, + scheduled_restart, }) } @@ -1238,6 +1244,46 @@ async fn realm_select( result } +#[derive(serde::Serialize)] +struct RestartScheduleView { + schedule: coa_core::launcher::schedule::RestartSchedule, + /// The server ships the Rust world supervisor that carries out the schedule. + supported: bool, +} + +#[tauri::command] +async fn restart_schedule( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<RestartScheduleView, UiError> { + let root = path_of(&state, &id)?; + blocking(move || { + Ok(RestartScheduleView { + schedule: coa_core::launcher::schedule::load(&root), + supported: root.join("Scripts/coa-launcher.exe").is_file(), + }) + }) + .await +} + +/// Restart the world every day at the owner's local time; the running supervisor reads it within a minute. +#[tauri::command] +async fn restart_schedule_save( + state: State<'_, AppState>, + id: String, + schedule: coa_core::launcher::schedule::RestartSchedule, +) -> std::result::Result<RestartScheduleView, UiError> { + let root = path_of(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || { + Ok(RestartScheduleView { + schedule: coa_core::launcher::schedule::save(&root, &schedule)?, + supported: root.join("Scripts/coa-launcher.exe").is_file(), + }) + }) + .await +} + #[tauri::command] async fn mysql_custom( state: State<'_, AppState>, @@ -3034,6 +3080,8 @@ pub fn run() { realm_rename, mysql_custom, mysql_custom_save, + restart_schedule, + restart_schedule_save, check_database, repair_server, module_set_enabled, diff --git a/src/dev/mock.ts b/src/dev/mock.ts index a6719ec..01e0057 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -39,6 +39,7 @@ export {}; if(cmd==="pending_update") return null; if(cmd==="plugin:app|version") return "0.8.2"; if(cmd==="release_history") throw new Error("Offline demo: using bundled notes"); + if(cmd==="restart_schedule"||cmd==="restart_schedule_save"){const w=window as any;w.__sched=w.__sched??{enabled:false,time:"05:00",warningMinutes:5};if(cmd==="restart_schedule_save"){const s=args.schedule;if(s.enabled&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(s.time))throw new Error("The restart time must be HH:MM, for example 05:00.");w.__sched={...s};}return {schedule:w.__sched,supported:true};} if(cmd==="mysql_custom"||cmd==="mysql_custom_save"){const w=window as any;if(cmd==="mysql_custom_save")w.__my=args.text;const text:string=w.__my??"";const applied=text.split("\n").map((l:string)=>l.trim()).filter((l:string)=>l&&!l.startsWith("#")&&!/^(port|datadir|basedir|bind[-_]address)\b/i.test(l)).map((l:string)=>l+"\n").join("");return {text,applied};} if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));} if(cmd==="realm_profiles") return {active:realm,wildcard_created:wildcardCreated,reborn_created:rebornCreated,reborn_supported:true,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:simultaneous&&running,with_reborn:withReborn,reborn_world_port:withReborn?8087:null,reborn_running:withReborn&&running}; diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 80d0b47..45480ff 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -778,6 +778,14 @@ const de: Partial<Record<keyof typeof en, string>> = { "mysql.save": "Speichern", "mysql.saved": "Gespeichert; Server neu starten, um sie anzuwenden.", "mysql.applied": "Angewandte Optionen: {count}", + "sched.title": "Geplanter Neustart", + "sched.enable": "Die Welt jeden Tag neu starten", + "sched.time": "Uhrzeit", + "sched.warning": "Vorwarnung (Minuten)", + "sched.hint": "Die Welt startet zu dieser Uhrzeit dieses Computers neu, mit einem Countdown im Spielchat; die Datenbank läuft weiter, Spieler melden sich danach wieder an. Ein laufender Server übernimmt die neue Zeit innerhalb einer Minute.", + "sched.save": "Speichern", + "sched.saved": "Gespeichert.", + "sched.unsupported": "Dieser Server kann das noch nicht: Aktualisiere ihn auf einen Build mit dem neuen Launcher.", "realm.namesTitle": "Realmnamen", "realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.", "realm.nameSave": "Speichern", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 3eb093e..0a0e49e 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -62,6 +62,14 @@ const en = { "mysql.save": "Save", "mysql.saved": "Saved; restart the server to apply.", "mysql.applied": "Options applied: {count}", + "sched.title": "Scheduled restart", + "sched.enable": "Restart the world every day", + "sched.time": "Time", + "sched.warning": "Warning (minutes)", + "sched.hint": "The world restarts at this time of this computer with a countdown in the game chat; the database keeps running and players log in again after it. A minute after saving, the running server follows the new time.", + "sched.save": "Save", + "sched.saved": "Saved.", + "sched.unsupported": "This server cannot do it yet: update the server to a build with the new launcher.", "realm.namesTitle": "Realm names", "realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.", "realm.nameSave": "Save", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index affdc3c..8277914 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -778,6 +778,14 @@ const es: Partial<Record<keyof typeof en, string>> = { "mysql.save": "Guardar", "mysql.saved": "Guardado; reinicia el servidor para aplicarlo.", "mysql.applied": "Opciones aplicadas: {count}", + "sched.title": "Reinicio programado", + "sched.enable": "Reiniciar el mundo cada día", + "sched.time": "Hora", + "sched.warning": "Aviso (minutos)", + "sched.hint": "El mundo se reinicia a esta hora de este ordenador con una cuenta atrás en el chat del juego; la base de datos sigue en marcha y los jugadores vuelven a entrar después. Un servidor en marcha sigue la nueva hora en menos de un minuto.", + "sched.save": "Guardar", + "sched.saved": "Guardado.", + "sched.unsupported": "Este servidor aún no puede hacerlo: actualízalo a una versión con el nuevo lanzador.", "realm.namesTitle": "Nombres de los reinos", "realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.", "realm.nameSave": "Guardar", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index a9765e4..83af20b 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -778,6 +778,14 @@ const fr: Partial<Record<keyof typeof en, string>> = { "mysql.save": "Enregistrer", "mysql.saved": "Enregistré ; redémarrez le serveur pour appliquer.", "mysql.applied": "Options appliquées : {count}", + "sched.title": "Redémarrage planifié", + "sched.enable": "Redémarrer le monde chaque jour", + "sched.time": "Heure", + "sched.warning": "Avertissement (minutes)", + "sched.hint": "Le monde redémarre à cette heure de cet ordinateur avec un compte à rebours dans le chat du jeu ; la base de données continue de tourner et les joueurs se reconnectent ensuite. Un serveur en marche suit la nouvelle heure en moins d'une minute.", + "sched.save": "Enregistrer", + "sched.saved": "Enregistré.", + "sched.unsupported": "Ce serveur ne le permet pas encore : mettez-le à jour vers une version avec le nouveau lanceur.", "realm.namesTitle": "Noms des royaumes", "realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.", "realm.nameSave": "Enregistrer", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index e6a9d75..d89b6cd 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -65,6 +65,14 @@ const ru: Partial<Record<keyof typeof en, string>> = { "mysql.save": "Сохранить", "mysql.saved": "Сохранено; перезапустите сервер, чтобы применить.", "mysql.applied": "Применяется параметров: {count}", + "sched.title": "Перезапуск по расписанию", + "sched.enable": "Перезапускать мир каждый день", + "sched.time": "Время", + "sched.warning": "Предупреждение (минуты)", + "sched.hint": "Мир перезапускается в это время этого компьютера, с обратным отсчётом в игровом чате; база данных продолжает работать, игроки заходят снова после перезапуска. Работающий сервер подхватывает новое время в течение минуты.", + "sched.save": "Сохранить", + "sched.saved": "Сохранено.", + "sched.unsupported": "Этот сервер пока так не умеет: обновите его до сборки с новым лаунчером.", "realm.namesTitle": "Названия реалмов", "realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.", "realm.nameSave": "Сохранить", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 354948c..be8c31a 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -63,6 +63,14 @@ const zh = { "mysql.save": "保存", "mysql.saved": "已保存;重启服务器后生效。", "mysql.applied": "生效的选项:{count}", + "sched.title": "定时重启", + "sched.enable": "每天重启世界", + "sched.time": "时间", + "sched.warning": "提前警告(分钟)", + "sched.hint": "世界会在本机的这个时间重启,并在游戏聊天中倒计时;数据库保持运行,玩家在重启后重新登录。正在运行的服务器会在一分钟内采用新时间。", + "sched.save": "保存", + "sched.saved": "已保存。", + "sched.unsupported": "此服务器暂不支持:请将服务器更新到带有新启动器的版本。", "realm.namesTitle": "服务器名称", "realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。", "realm.nameSave": "保存", diff --git a/src/lib/api.ts b/src/lib/api.ts index b7a366f..aa84fd7 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -54,9 +54,12 @@ export interface StatusView { observed: { mysql: ServiceStatus; auth: ServiceStatus; world: ServiceStatus; secondary_world?: ServiceStatus | null; reborn_world?: ServiceStatus | null }; busy: boolean; path_exists: boolean; + scheduled_restart?: boolean; } export type RealmMode = "coa" | "wildcard" | "reborn"; +export interface RestartSchedule { enabled: boolean; time: string; warningMinutes: number } +export interface RestartScheduleView { schedule: RestartSchedule; supported: boolean } export interface CustomMysql { text: string; applied: string } export interface RealmName { id: number; name: string; defaultName: string; custom: boolean } export interface RealmProfiles { active: RealmMode; wildcard_created: boolean; reborn_created: boolean; reborn_supported: boolean; supported: boolean; recovery_pending: boolean; simultaneous: boolean; secondary_world_port: number | null; secondary_running: boolean; with_reborn: boolean; reborn_world_port: number | null; reborn_running: boolean } @@ -488,6 +491,8 @@ export const api = { realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }), realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }), realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }), + restartSchedule: (id: string) => invoke<RestartScheduleView>("restart_schedule", { id }), + restartScheduleSave: (id: string, schedule: RestartSchedule) => invoke<RestartScheduleView>("restart_schedule_save", { id, schedule }), mysqlCustom: (id: string) => invoke<CustomMysql>("mysql_custom", { id }), mysqlCustomSave: (id: string, text: string) => invoke<CustomMysql>("mysql_custom_save", { id, text }), realmNames: (id: string) => invoke<RealmName[]>("realm_names", { id }), diff --git a/src/screens/Overview.tsx b/src/screens/Overview.tsx index 9252e89..edb4127 100644 --- a/src/screens/Overview.tsx +++ b/src/screens/Overview.tsx @@ -228,7 +228,7 @@ export function Overview({ server, companions = true, onForget, onOpenUpdates, o } else { if (alive.current) setPop(null); if ( - lifecycle.observe(false, actionRef.current !== null, serverUpdateBlocksRestart(server.id)) + lifecycle.observe(false, actionRef.current !== null || s.scheduled_restart === true, serverUpdateBlocksRestart(server.id)) ) { setHasCrashHistory(true); const now = Date.now(); diff --git a/src/screens/RestartScheduleSettings.tsx b/src/screens/RestartScheduleSettings.tsx new file mode 100644 index 0000000..0734ffe --- /dev/null +++ b/src/screens/RestartScheduleSettings.tsx @@ -0,0 +1,57 @@ +import { useEffect, useState } from "react"; +import { api, asUiError, type RestartSchedule } from "@/lib/api"; +import { Card } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { useT } from "@/i18n"; + +/** A daily world restart at a chosen local time, with an in-game countdown (#202). */ +export function RestartScheduleSettings({ serverId }: { serverId: string }) { + const t = useT(); + const [saved, setSaved] = useState<RestartSchedule | null>(null); + const [draft, setDraft] = useState<RestartSchedule>({ enabled: false, time: "05:00", warningMinutes: 5 }); + const [supported, setSupported] = useState(true); + const [busy, setBusy] = useState(false); + const [done, setDone] = useState(false); + const [error, setError] = useState<string | null>(null); + + useEffect(() => { + let alive = true; + void api.restartSchedule(serverId).then(v => { if (alive) { setSaved(v.schedule); setDraft(v.schedule); setSupported(v.supported); } }).catch(e => { if (alive) setError(asUiError(e).technical); }); + return () => { alive = false; }; + }, [serverId]); + + async function save() { + setBusy(true); setError(null); setDone(false); + try { const v = await api.restartScheduleSave(serverId, draft); setSaved(v.schedule); setDraft(v.schedule); setSupported(v.supported); setDone(true); } + catch (e) { setError(asUiError(e).technical); } + finally { setBusy(false); } + } + + const changed = !!saved && JSON.stringify(saved) !== JSON.stringify(draft); + const minutesOk = Number.isInteger(draft.warningMinutes) && draft.warningMinutes >= 1 && draft.warningMinutes <= 60; + const input = "rounded border border-line bg-bg px-2 py-1 text-sm text-ink outline-none focus:border-gold"; + return <Card className="mt-6 p-6" aria-busy={busy}> + <h2 className="font-semibold">{t("sched.title")}</h2> + <label className="mt-3 flex cursor-pointer items-center gap-3"> + <input type="checkbox" className="h-4 w-4 accent-[#c9a24a]" checked={draft.enabled} disabled={busy || !saved} onChange={e => { setDraft(d => ({ ...d, enabled: e.target.checked })); setDone(false); }} /> + <span className="text-sm font-medium">{t("sched.enable")}</span> + </label> + <div className="mt-3 flex flex-wrap items-center gap-4 text-sm"> + <label className="flex items-center gap-2"> + <span>{t("sched.time")}</span> + <input type="time" className={input} value={draft.time} disabled={busy || !draft.enabled} onChange={e => { setDraft(d => ({ ...d, time: e.target.value })); setDone(false); }} /> + </label> + <label className="flex items-center gap-2"> + <span>{t("sched.warning")}</span> + <input type="number" min={1} max={60} step={1} className={`${input} w-20`} value={draft.warningMinutes} disabled={busy || !draft.enabled} onChange={e => { setDraft(d => ({ ...d, warningMinutes: Number(e.target.value) })); setDone(false); }} /> + </label> + </div> + <p className="mt-2 text-sm text-muted">{t("sched.hint")}</p> + {!supported && <p className="mt-2 text-sm text-warn">{t("sched.unsupported")}</p>} + <div className="mt-3 flex items-center gap-3"> + <Button size="sm" disabled={busy || !changed || (draft.enabled && !minutesOk)} onClick={() => void save()}>{t("sched.save")}</Button> + {done && <span className="text-xs text-muted">{t("sched.saved")}</span>} + </div> + {error && <p className="mt-3 text-sm text-bad" role="alert">{error}</p>} + </Card>; +} diff --git a/src/screens/SettingsHome.tsx b/src/screens/SettingsHome.tsx index dda693e..bbe3875 100644 --- a/src/screens/SettingsHome.tsx +++ b/src/screens/SettingsHome.tsx @@ -14,6 +14,7 @@ import { GameDataCard } from "./GameDataCard"; import { RealmStartupSettings } from "./RealmStartupSettings"; import { RealmNameSettings } from "./RealmNameSettings"; import { MySqlSettings } from "./MySqlSettings"; +import { RestartScheduleSettings } from "./RestartScheduleSettings"; import { AutoRestartSettings } from "./AutoRestartSettings"; import { DiagnosticsCard } from "./DiagnosticsCard"; import { RepairCard } from "./RepairCard"; @@ -52,7 +53,7 @@ export function SettingsHome({ serverId, path, onForget }: { serverId: string; s <button onClick={() => setSection("client")} className="mt-5 flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border border-line px-5 py-4 text-left text-sm hover:bg-white/5"><span>{t("settings.clientLink")}</span><span aria-hidden>→</span></button> <ReleaseHistory selection={history} onSelect={setHistory} /> </div> - <div hidden={section !== "startup"} className="max-w-3xl"><RealmNameSettings serverId={serverId} /><RealmStartupSettings serverId={serverId} /><AutoRestartSettings serverId={serverId} /></div> + <div hidden={section !== "startup"} className="max-w-3xl"><RealmNameSettings serverId={serverId} /><RealmStartupSettings serverId={serverId} /><AutoRestartSettings serverId={serverId} /><RestartScheduleSettings serverId={serverId} /></div> <div hidden={section !== "client"} className="max-w-3xl"><ClientCard serverId={serverId} /><GameDataCard serverId={serverId} /></div> <div hidden={section !== "service"} className="max-w-3xl"><ServerLoggingSettings serverId={serverId} /><MySqlSettings serverId={serverId} /><DiagnosticsCard serverId={serverId} /><RepairCard serverId={serverId} /><RemoveServerCard serverId={serverId} path={path} onForget={onForget} /></div> <div hidden={section !== "interface"} className="max-w-3xl"><Card className="mt-6 p-6"><h2 className="font-semibold">{t("settings.language")}</h2><p className="mt-1 text-sm text-muted">{t("settings.languageHint")}</p><LanguagePicker className="mt-4" /></Card><WindowSettings /><PublicServerSettings /></div> From d64fdb51bedf79f77fc0d765242dee6eac97d860 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:51:40 +0500 Subject: [PATCH 18/29] Client: clear the game cache on Play, remember the friend's server login - clear_game_cache removes Cache/WDB/<locale>/*.wdb before every Play (own server and friend's), on by default, switch in the client card; nothing else in Cache or Data. - The connection profile keeps the listed realm it was joined through; Play fills that realm's saved account into GlueConfig.json every time. A host typed by hand drops it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-clear-game-cache.md | 7 +++ .../20261115-remembered-friend-login.md | 7 +++ crates/coa-core/src/client.rs | 49 +++++++++++++++++++ crates/coa-core/src/remote_client.rs | 14 ++++++ src-tauri/src/control_cmds.rs | 1 + src-tauri/src/lib.rs | 35 +++++++++++++ src-tauri/src/window_preferences.rs | 12 +++++ src/dev/mock.ts | 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/lib/api.ts | 2 + src/screens/ClientGraphics.tsx | 8 +++ 16 files changed, 149 insertions(+) create mode 100644 changelog.d/20261115-clear-game-cache.md create mode 100644 changelog.d/20261115-remembered-friend-login.md diff --git a/changelog.d/20261115-clear-game-cache.md b/changelog.d/20261115-clear-game-cache.md new file mode 100644 index 0000000..a23df77 --- /dev/null +++ b/changelog.d/20261115-clear-game-cache.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: players +title: The game cache is cleared before every Play +--- +After a server update the game showed old names and stats from its own cache (Cache/WDB). Play now clears that cache first; it fills again within seconds. A switch next to the client graphics settings turns it off. diff --git a/changelog.d/20261115-remembered-friend-login.md b/changelog.d/20261115-remembered-friend-login.md new file mode 100644 index 0000000..51dee3a --- /dev/null +++ b/changelog.d/20261115-remembered-friend-login.md @@ -0,0 +1,7 @@ +--- +area: manager +type: fixed +audience: players +title: The account for a friend's server is in the login box at every Play +--- +The account the Manager made on a listed server was filled in only when joining. Play now fills it in every time, also after another server's account was used. diff --git a/crates/coa-core/src/client.rs b/crates/coa-core/src/client.rs index e94b06c..1a7fb72 100644 --- a/crates/coa-core/src/client.rs +++ b/crates/coa-core/src/client.rs @@ -415,6 +415,38 @@ pub fn install_addon(client: &Path, meta: &Path, source: &Path) -> Result<()> { Ok(()) } +/// Remove the game's cache of server data (`Cache/WDB/<locale>/*.wdb`: creatures, items, quests, pages). The client +/// keeps answers it got from a server; after the server's data changes they show old names and stats until the +/// cache is gone. Only `.wdb` files under `Cache/WDB` are removed. Returns how many. +pub fn clear_game_cache(client: &Path) -> Result<usize> { + if is_running(client) { + return Ok(0); + } + let root = client.join("Cache").join("WDB"); + let mut removed = 0; + let Ok(locales) = fs::read_dir(&root) else { + return Ok(0); + }; + for locale in locales.flatten() { + if !locale.file_type().is_ok_and(|t| t.is_dir()) { + continue; + } + let Ok(files) = fs::read_dir(locale.path()) else { + continue; + }; + for file in files.flatten() { + let path = file.path(); + let is_wdb = path + .extension() + .is_some_and(|e| e.eq_ignore_ascii_case("wdb")); + if is_wdb && file.file_type().is_ok_and(|t| t.is_file()) && fs::remove_file(&path).is_ok() { + removed += 1; + } + } + } + Ok(removed) +} + /// Start the game client. The caller is responsible for making sure the server is ready first. pub fn launch(client: &Path) -> Result<u32> { let exe = @@ -613,6 +645,23 @@ pub fn recover_all_realmlist_overrides(meta_roots: &[PathBuf]) -> usize { #[cfg(test)] mod tests { use super::*; + #[test] + fn only_the_server_data_cache_is_cleared() { + let d = tempfile::tempdir().unwrap(); + let wdb = d.path().join("Cache/WDB/enUS"); + fs::create_dir_all(&wdb).unwrap(); + fs::write(wdb.join("creaturecache.wdb"), b"x").unwrap(); + fs::write(wdb.join("itemcache.WDB"), b"x").unwrap(); + fs::write(wdb.join("notes.txt"), b"keep").unwrap(); + fs::create_dir_all(d.path().join("Data/Retail/Cache")).unwrap(); + fs::write(d.path().join("Data/Retail/Cache/id-1.bin"), b"keep").unwrap(); + assert_eq!(clear_game_cache(d.path()).unwrap(), 2); + assert!(wdb.join("notes.txt").is_file()); + assert!(d.path().join("Data/Retail/Cache/id-1.bin").is_file()); + assert_eq!(clear_game_cache(d.path()).unwrap(), 0); + assert_eq!(clear_game_cache(&d.path().join("missing")).unwrap(), 0); + } + #[cfg(windows)] #[test] diff --git a/crates/coa-core/src/remote_client.rs b/crates/coa-core/src/remote_client.rs index d0523b6..816c827 100644 --- a/crates/coa-core/src/remote_client.rs +++ b/crates/coa-core/src/remote_client.rs @@ -7,6 +7,10 @@ use std::path::{Path, PathBuf}; pub struct Profile { pub host: String, pub client_path: Option<String>, + /// The listed server `host` belongs to, when the player joined it through the server list: its account is + /// filled into the game's login box at every Play. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub realm: Option<String>, } pub fn load(dir: &Path) -> Result<Profile> { @@ -43,12 +47,21 @@ pub fn save(dir: &Path, profile: &Profile) -> Result<()> { #[cfg(test)] mod tests { use super::*; + + #[test] + fn a_profile_from_before_the_realm_field_still_loads() { + let d = tempfile::tempdir().unwrap(); + std::fs::write(d.path().join("connection.json"), br#"{"host":"1.2.3.4","client_path":null}"#).unwrap(); + let p = load(d.path()).unwrap(); + assert_eq!((p.host.as_str(), p.realm), ("1.2.3.4", None)); + } #[test] fn connection_needs_no_server_and_survives_restart() { let dir = tempfile::tempdir().unwrap(); let profile = Profile { host: "192.168.1.10".into(), client_path: None, + realm: None, }; save(dir.path(), &profile).unwrap(); assert_eq!(load(dir.path()).unwrap().host, profile.host); @@ -70,6 +83,7 @@ mod tests { let profile = Profile { host: "192.168.1.10".into(), client_path: Some(game.to_string_lossy().into()), + realm: None, }; save(dir.path(), &profile).unwrap(); assert!( diff --git a/src-tauri/src/control_cmds.rs b/src-tauri/src/control_cmds.rs index 384cf39..210996d 100644 --- a/src-tauri/src/control_cmds.rs +++ b/src-tauri/src/control_cmds.rs @@ -439,6 +439,7 @@ pub(crate) async fn join_realm( let mut profile = coa_core::remote_client::load(&dir) .map_err(|e| fail("other", e.to_string()))?; profile.host = host; + profile.realm = Some(realm.clone()); coa_core::remote_client::save(&dir, &profile) .map_err(|e| fail("launch", e.to_string()))?; super::play(state, REMOTE_CLIENT_ID.to_string()) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index c84c637..9f740c0 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -240,6 +240,7 @@ async fn portable_launch( let mut profile = coa_core::remote_client::load(&dir).map_err(|e| other(e.into()))?; profile.host = address; + profile.realm = Some(realm.clone()); coa_core::remote_client::save(&dir, &profile).map_err(|e| other(e.into()))?; if let Some(ref cp) = profile.client_path { if let Ok(pc) = control_cmds::player(&state) { @@ -2076,6 +2077,10 @@ fn remote_connect( if host.is_empty() { return Err(Error::Invalid("Enter the host's IP address or hostname.".into()).into()); } + if profile.host != host { + // A host typed by hand is not the listed server whose account was remembered. + profile.realm = None; + } profile.host = host.into(); coa_core::remote_client::save(&dir, &profile)?; Ok(profile) @@ -2476,6 +2481,15 @@ async fn play( if id == REMOTE_CLIENT_ID { let ctx = client_context(&state, &id)?; let client = ctx.require()?; + // The account the Manager made (or linked) on that listed server goes into the login box at every Play, + // also when another server's account was used in between. + let login = coa_core::remote_client::load(&remote_dir()) + .ok() + .and_then(|profile| profile.realm) + .and_then(|realm| { + let pc = control_cmds::player(&state).ok()?; + pc.credentials(&control_cmds::realm_id(&realm).ok()?).ok()? + }); return blocking(move || { if ctx.host.is_empty() { return Err(Error::Invalid( @@ -2486,6 +2500,12 @@ async fn play( return Err(Error::Invalid("The game is already running.".into())); } coa_core::client::begin_realmlist_override(&client, &ctx.dir, &ctx.host)?; + if let Some(creds) = &login { + let _ = coa_core::glue_config::prefill_login(&client, &creds.username, &creds.password); + } + if window_preferences::clear_cache_on_play(&data_dir()) { + let _ = coa_core::client::clear_game_cache(&client); + } coa_core::client::launch(&client)?; let client_c = client.clone(); let meta_c = ctx.dir.clone(); @@ -2532,6 +2552,9 @@ async fn play( if existing.is_empty() { let _ = coa_core::glue_config::prefill_login(&client, "local", "local"); } + if window_preferences::clear_cache_on_play(&data_dir()) { + let _ = coa_core::client::clear_game_cache(&client); + } coa_core::client::launch(&client)?; Ok(DriverOutcome { ok: true, @@ -2998,6 +3021,16 @@ fn set_close_to_tray(enabled: bool) -> std::result::Result<(), UiError> { Ok(window_preferences::save(&data_dir(), enabled)?) } +#[tauri::command] +fn clear_game_cache_on_play() -> bool { + window_preferences::clear_cache_on_play(&data_dir()) +} + +#[tauri::command] +fn set_clear_game_cache_on_play(enabled: bool) -> std::result::Result<(), UiError> { + Ok(window_preferences::save_clear_cache_on_play(&data_dir(), enabled)?) +} + fn show_main_window(app: &AppHandle) { let handle = app.clone(); if let Err(error) = app.run_on_main_thread(move || { @@ -3082,6 +3115,8 @@ pub fn run() { mysql_custom_save, restart_schedule, restart_schedule_save, + clear_game_cache_on_play, + set_clear_game_cache_on_play, check_database, repair_server, module_set_enabled, diff --git a/src-tauri/src/window_preferences.rs b/src-tauri/src/window_preferences.rs index 1a7d927..2018375 100644 --- a/src-tauri/src/window_preferences.rs +++ b/src-tauri/src/window_preferences.rs @@ -11,3 +11,15 @@ pub fn close_to_tray(dir: &Path) -> coa_core::Result<bool> { pub fn save(dir: &Path, enabled: bool) -> coa_core::Result<()> { coa_core::fsx::atomic_write_json(&dir.join("close-to-tray.json"), &enabled) } + +/// Clear the game's cache of server data before every Play (on unless the player turned it off). +pub fn clear_cache_on_play(dir: &Path) -> bool { + std::fs::read(dir.join("clear-game-cache.json")) + .ok() + .and_then(|bytes| serde_json::from_slice(&bytes).ok()) + .unwrap_or(true) +} + +pub fn save_clear_cache_on_play(dir: &Path, enabled: bool) -> coa_core::Result<()> { + coa_core::fsx::atomic_write_json(&dir.join("clear-game-cache.json"), &enabled) +} diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 01e0057..6c2afd3 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -29,6 +29,8 @@ export {}; (window as any).__TAURI_INTERNALS__ = { transformCallback: (cb: unknown)=>cb, unregisterCallback(){}, convertFileSrc:(x: unknown)=>x, invoke: async (cmd: string, args?: any)=>{ + if(cmd==="clear_game_cache_on_play") return localStorage.getItem("demo-clear-cache")!=="0"; + if(cmd==="set_clear_game_cache_on_play"){localStorage.setItem("demo-clear-cache",args.enabled?"1":"0");return;} if(cmd==="close_to_tray") return localStorage.getItem("demo-close-tray")==="1"; if(cmd==="set_close_to_tray"){localStorage.setItem("demo-close-tray",args.enabled?"1":"0");return;} if(cmd==="client_graphics") return JSON.parse(localStorage.getItem("demo-graphics")??'{"dxvk_disabled":false,"enhancements_disabled":false}'); diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 45480ff..bf8554e 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -786,6 +786,8 @@ const de: Partial<Record<keyof typeof en, string>> = { "sched.save": "Speichern", "sched.saved": "Gespeichert.", "sched.unsupported": "Dieser Server kann das noch nicht: Aktualisiere ihn auf einen Build mit dem neuen Launcher.", + "client.clearCache": "Spiel-Cache vor jedem Start leeren", + "client.clearCacheHint": "Das Spiel merkt sich Kreaturen, Gegenstände und Quests vom Server (Cache/WDB). Nach einem Server-Update zeigen sie sonst alte Namen und Werte; der Cache füllt sich in Sekunden wieder.", "realm.namesTitle": "Realmnamen", "realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.", "realm.nameSave": "Speichern", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 0a0e49e..506a0ba 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -70,6 +70,8 @@ const en = { "sched.save": "Save", "sched.saved": "Saved.", "sched.unsupported": "This server cannot do it yet: update the server to a build with the new launcher.", + "client.clearCache": "Clear the game cache before every Play", + "client.clearCacheHint": "The game remembers creatures, items and quests it got from a server (Cache/WDB). After a server update they can show old names and stats; the cache fills again within seconds.", "realm.namesTitle": "Realm names", "realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.", "realm.nameSave": "Save", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 8277914..ff61aac 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -786,6 +786,8 @@ const es: Partial<Record<keyof typeof en, string>> = { "sched.save": "Guardar", "sched.saved": "Guardado.", "sched.unsupported": "Este servidor aún no puede hacerlo: actualízalo a una versión con el nuevo lanzador.", + "client.clearCache": "Vaciar la caché del juego antes de cada inicio", + "client.clearCacheHint": "El juego recuerda criaturas, objetos y misiones recibidos del servidor (Cache/WDB). Tras actualizar el servidor pueden mostrar nombres y estadísticas antiguos; la caché se llena de nuevo en segundos.", "realm.namesTitle": "Nombres de los reinos", "realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.", "realm.nameSave": "Guardar", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 83af20b..305b4d5 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -786,6 +786,8 @@ const fr: Partial<Record<keyof typeof en, string>> = { "sched.save": "Enregistrer", "sched.saved": "Enregistré.", "sched.unsupported": "Ce serveur ne le permet pas encore : mettez-le à jour vers une version avec le nouveau lanceur.", + "client.clearCache": "Vider le cache du jeu avant chaque lancement", + "client.clearCacheHint": "Le jeu garde les créatures, objets et quêtes reçus du serveur (Cache/WDB). Après une mise à jour du serveur, ils peuvent montrer d'anciens noms et statistiques ; le cache se remplit en quelques secondes.", "realm.namesTitle": "Noms des royaumes", "realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.", "realm.nameSave": "Enregistrer", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index d89b6cd..0758ac1 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -73,6 +73,8 @@ const ru: Partial<Record<keyof typeof en, string>> = { "sched.save": "Сохранить", "sched.saved": "Сохранено.", "sched.unsupported": "Этот сервер пока так не умеет: обновите его до сборки с новым лаунчером.", + "client.clearCache": "Очищать кэш игры перед каждым запуском", + "client.clearCacheHint": "Игра запоминает существ, предметы и задания, полученные от сервера (Cache/WDB). После обновления сервера там остаются старые названия и характеристики; кэш снова заполняется за секунды.", "realm.namesTitle": "Названия реалмов", "realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.", "realm.nameSave": "Сохранить", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index be8c31a..cd3758a 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -71,6 +71,8 @@ const zh = { "sched.save": "保存", "sched.saved": "已保存。", "sched.unsupported": "此服务器暂不支持:请将服务器更新到带有新启动器的版本。", + "client.clearCache": "每次启动前清空游戏缓存", + "client.clearCacheHint": "游戏会保存从服务器获得的生物、物品和任务(Cache/WDB)。服务器更新后,这些缓存可能显示旧的名称和属性;缓存会在几秒内重新生成。", "realm.namesTitle": "服务器名称", "realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。", "realm.nameSave": "保存", diff --git a/src/lib/api.ts b/src/lib/api.ts index aa84fd7..8fe2890 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -491,6 +491,8 @@ export const api = { realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }), realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }), realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }), + clearGameCacheOnPlay: () => invoke<boolean>("clear_game_cache_on_play"), + setClearGameCacheOnPlay: (enabled: boolean) => invoke<void>("set_clear_game_cache_on_play", { enabled }), restartSchedule: (id: string) => invoke<RestartScheduleView>("restart_schedule", { id }), restartScheduleSave: (id: string, schedule: RestartSchedule) => invoke<RestartScheduleView>("restart_schedule_save", { id, schedule }), mysqlCustom: (id: string) => invoke<CustomMysql>("mysql_custom", { id }), diff --git a/src/screens/ClientGraphics.tsx b/src/screens/ClientGraphics.tsx index fc29330..b66c45c 100644 --- a/src/screens/ClientGraphics.tsx +++ b/src/screens/ClientGraphics.tsx @@ -9,6 +9,12 @@ export function ClientGraphics({ serverId }: { serverId: string }) { const [busy, setBusy] = useState(false); const [error, setError] = useState<string | null>(null); useEffect(() => { void api.clientGraphics(serverId).then(setState).catch(e => setError(asUiError(e).technical)); }, [serverId]); + const [clearCache, setClearCache] = useState<boolean | null>(null); + useEffect(() => { void api.clearGameCacheOnPlay().then(setClearCache).catch(() => setClearCache(true)); }, []); + async function changeClearCache(on: boolean) { + setClearCache(on); + try { await api.setClearGameCacheOnPlay(on); } catch (e) { setClearCache(!on); setError(asUiError(e).technical); } + } async function change(name: string, disabled: boolean) { setBusy(true); setError(null); try { setState(await api.clientSetGraphics(serverId, name, disabled)); await checkClient(serverId); } @@ -19,6 +25,8 @@ export function ClientGraphics({ serverId }: { serverId: string }) { <label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={state?.dxvk_disabled ?? false} disabled={!state || busy} onChange={e => void change("d3d9.dll", e.target.checked)} />{t("client.graphics.dxvk")}</label> <label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={state?.enhancements_disabled ?? false} disabled={!state || busy} onChange={e => void change("dxgi.dll", e.target.checked)} />{t("client.graphics.enhancements")}</label> <p className="text-xs text-muted">{t("client.graphics.hint")}</p> + <label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={clearCache ?? true} disabled={clearCache === null} onChange={e => void changeClearCache(e.target.checked)} />{t("client.clearCache")}</label> + <p className="text-xs text-muted">{t("client.clearCacheHint")}</p> {error && <p className="text-sm text-bad" role="alert">{error}</p>} </div>; } From 05630ec9ebfead325c335b5e4f0f34a371a8c15a 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?= <corfirean@gmail.com> Date: Sun, 15 Nov 2026 20:58:29 +0500 Subject: [PATCH 19/29] Addon catalog in the game client card addons/catalog.json pins SquidBots Lite, DragonUI (+Options), IncahootsCoA and CoACombat to a commit and lists every file with its git blob SHA-1 and size. Install downloads GitHub's archive of that commit, verifies each file (archives are not byte-stable, their contents are), stages next to AddOns and moves the folders in; a foreign folder of the same name goes to AddOns/.coa-addons-backup. .coa-addons.json records what the Manager installed; update and remove touch only that. CoA_DevMenu ships with Custom Races V2, so the separate dev menu addon is not in the catalog. Checked against the real GitHub archives of the three small addons (ignored test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- addons/catalog.json | 7247 +++++++++++++++++++++++++ changelog.d/20261115-addon-catalog.md | 7 + crates/coa-core/src/addons.rs | 459 ++ crates/coa-core/src/lib.rs | 1 + src-tauri/src/lib.rs | 38 + src/dev/mock.ts | 2 + src/i18n/locales/de.ts | 10 + src/i18n/locales/en.ts | 10 + src/i18n/locales/es.ts | 10 + src/i18n/locales/fr.ts | 10 + src/i18n/locales/ru.ts | 10 + src/i18n/locales/zh.ts | 10 + src/lib/api.ts | 4 + src/screens/AddonCatalog.tsx | 57 + src/screens/ClientCard.tsx | 2 + 15 files changed, 7877 insertions(+) create mode 100644 addons/catalog.json create mode 100644 changelog.d/20261115-addon-catalog.md create mode 100644 crates/coa-core/src/addons.rs create mode 100644 src/screens/AddonCatalog.tsx diff --git a/addons/catalog.json b/addons/catalog.json new file mode 100644 index 0000000..119b230 --- /dev/null +++ b/addons/catalog.json @@ -0,0 +1,7247 @@ +{ + "schema": 1, + "addons": [ + { + "id": "squidbots-lite", + "name": "SquidBots Lite", + "description": { + "en": "A slim bar for SQUID's Playerbots: your bots' roles on the party frames and their offers as small toasts.", + "ru": "Тонкая панель для SQUID's Playerbots: роли ботов на рамках группы и их предложения короткими уведомлениями.", + "de": "Eine schmale Leiste für SQUID's Playerbots: Rollen der Bots an den Gruppenrahmen, Angebote als kurze Hinweise.", + "fr": "Une barre fine pour SQUID's Playerbots : rôles des bots sur les cadres de groupe et leurs offres en notifications.", + "es": "Una barra fina para SQUID's Playerbots: roles de los bots en los marcos de grupo y sus ofertas como avisos.", + "zh": "SQUID's Playerbots 的精简工具栏:在队伍框体上显示机器人职责,并以小提示显示它们的请求。" + }, + "author": "Zyth45", + "license": "GPL-2.0", + "needs": "playerbots", + "repo": "https://github.com/Zyth45/squidbots-addon", + "commit": "8d39be37b05baaa200e4420f73e3c4c11c36fc66", + "archive": "https://codeload.github.com/Zyth45/squidbots-addon/zip/8d39be37b05baaa200e4420f73e3c4c11c36fc66", + "folders": [ + "SquidBotsLite" + ], + "files": [ + { + "path": "SquidBotsLite/Alts.lua", + "from": "SquidBotsLite/Alts.lua", + "sha1": "0a9614e80b26e7e404d1e12bb2770daae6897cff", + "size": 82366 + }, + { + "path": "SquidBotsLite/Bindings.xml", + "from": "SquidBotsLite/Bindings.xml", + "sha1": "2b56f811dc3f9ddd82bad41c88dff8e88778b7aa", + "size": 1908 + }, + { + "path": "SquidBotsLite/Dashboard.lua", + "from": "SquidBotsLite/Dashboard.lua", + "sha1": "e6b130e975ed10d3e84c8a5841853b0a9a723b61", + "size": 36056 + }, + { + "path": "SquidBotsLite/KeySpells.lua", + "from": "SquidBotsLite/KeySpells.lua", + "sha1": "20af521cb759b6fca40847c9e8a5b78533872358", + "size": 19759 + }, + { + "path": "SquidBotsLite/LICENSE", + "from": "SquidBotsLite/LICENSE", + "sha1": "d159169d1050894d3ea3b98e1c965c4058208fe1", + "size": 18092 + }, + { + "path": "SquidBotsLite/MainTank.lua", + "from": "SquidBotsLite/MainTank.lua", + "sha1": "185ba39feeeb150db6c1fd1f4d35699753dee816", + "size": 40823 + }, + { + "path": "SquidBotsLite/Manager.lua", + "from": "SquidBotsLite/Manager.lua", + "sha1": "39a835b0c9a5eb8d5f61162d79ae6b9ff7d62439", + "size": 135705 + }, + { + "path": "SquidBotsLite/Missions.lua", + "from": "SquidBotsLite/Missions.lua", + "sha1": "915151f5958f28f64f1ea93775b1f90f79a68d4c", + "size": 63690 + }, + { + "path": "SquidBotsLite/SquidBotsLite.lua", + "from": "SquidBotsLite/SquidBotsLite.lua", + "sha1": "c70de60e3e97f85b05bf43d3a8fbceab40a9dc18", + "size": 188813 + }, + { + "path": "SquidBotsLite/SquidBotsLite.toc", + "from": "SquidBotsLite/SquidBotsLite.toc", + "sha1": "981e4f1fa9e044fb5c84c0e53471a5f4dfd06d4e", + "size": 617 + }, + { + "path": "SquidBotsLite/TalentLayouts.lua", + "from": "SquidBotsLite/TalentLayouts.lua", + "sha1": "09280dcef79238d3ebe8bed25680fb86abf2b586", + "size": 222829 + }, + { + "path": "SquidBotsLite/TalentTree.lua", + "from": "SquidBotsLite/TalentTree.lua", + "sha1": "214b8fbc61c31e5c6debd146d8a1b1e9e5eab847", + "size": 17405 + }, + { + "path": "SquidBotsLite/World.lua", + "from": "SquidBotsLite/World.lua", + "sha1": "81dfb102799c9cd58016d861047a5a86b048cc2f", + "size": 90593 + } + ] + }, + { + "id": "dragonui", + "name": "DragonUI", + "description": { + "en": "A modern Dragonflight-style interface (action bars, unit frames, minimap) adapted for Conquest of Azeroth.", + "ru": "Современный интерфейс в стиле Dragonflight (панели, рамки, миникарта), адаптированный под Conquest of Azeroth.", + "de": "Eine moderne Oberfläche im Dragonflight-Stil (Leisten, Rahmen, Minikarte), angepasst an Conquest of Azeroth.", + "fr": "Une interface moderne façon Dragonflight (barres, cadres, minicarte) adaptée à Conquest of Azeroth.", + "es": "Una interfaz moderna al estilo Dragonflight (barras, marcos, minimapa) adaptada a Conquest of Azeroth.", + "zh": "现代的巨龙时代风格界面(动作条、单位框体、小地图),为 Conquest of Azeroth 适配。" + }, + "author": "PentSec", + "license": "see repository", + "repo": "https://github.com/PentSec/DragonUI-CoA", + "commit": "f82f13ea33050782175577fcbb5e5264a9f44204", + "archive": "https://codeload.github.com/PentSec/DragonUI-CoA/zip/f82f13ea33050782175577fcbb5e5264a9f44204", + "folders": [ + "DragonUI", + "DragonUI_Options" + ], + "files": [ + { + "path": "DragonUI/Bindings.xml", + "from": "DragonUI/Bindings.xml", + "sha1": "cfcf5f4a8e0b1305cd32b66c7a0de1957c6496ad", + "size": 1459 + }, + { + "path": "DragonUI/DragonUI.blp", + "from": "DragonUI/DragonUI.blp", + "sha1": "cfc1d4ecd1b9fae78f359b0fe90af2292b1ef675", + "size": 525460 + }, + { + "path": "DragonUI/DragonUI.toc", + "from": "DragonUI/DragonUI.toc", + "sha1": "a9593202e18519a51481d7381707f5fe9e8cfd23", + "size": 1328 + }, + { + "path": "DragonUI/DragonUI.xml", + "from": "DragonUI/DragonUI.xml", + "sha1": "0d48d05a2758a0ed5fd40755f81d9c98b338bb72", + "size": 763 + }, + { + "path": "DragonUI/Fonts/expressway.ttf", + "from": "DragonUI/Fonts/expressway.ttf", + "sha1": "1ca255c03ca057a27c4351cd705046bd3112fdc8", + "size": 119384 + }, + { + "path": "DragonUI/LICENSE.txt", + "from": "DragonUI/LICENSE.txt", + "sha1": "d09670b20afb7418cd8b89665701b4275334e4a3", + "size": 2143 + }, + { + "path": "DragonUI/LICENSES/Ace3.txt", + "from": "DragonUI/LICENSES/Ace3.txt", + "sha1": "e4c383e10782f09406f29f7e7389a4a679128a60", + "size": 1698 + }, + { + "path": "DragonUI/LICENSES/GPL-2.0.txt", + "from": "DragonUI/LICENSES/GPL-2.0.txt", + "sha1": "9efa6fbc962836e243e20f7f23db062e2c077d28", + "size": 17984 + }, + { + "path": "DragonUI/LICENSES/MIT-Combuctor.txt", + "from": "DragonUI/LICENSES/MIT-Combuctor.txt", + "sha1": "2966dc413f2ca71aa55fe774b4a8a346a61985a5", + "size": 1073 + }, + { + "path": "DragonUI/LICENSES/MIT-DragonflightUI.txt", + "from": "DragonUI/LICENSES/MIT-DragonflightUI.txt", + "sha1": "3b93d94a04781010133b1189f5b9d709aaf260f4", + "size": 1076 + }, + { + "path": "DragonUI/LICENSES/MIT-KPack.txt", + "from": "DragonUI/LICENSES/MIT-KPack.txt", + "sha1": "45ed5097ede06d5ebdfd6b9f5a2cac7da619e7a2", + "size": 1553 + }, + { + "path": "DragonUI/LICENSES/MIT-NotPlater.txt", + "from": "DragonUI/LICENSES/MIT-NotPlater.txt", + "sha1": "4400346084614d654a2702b9629591b9ec63ad79", + "size": 1067 + }, + { + "path": "DragonUI/LICENSES/MIT-RetailUI.txt", + "from": "DragonUI/LICENSES/MIT-RetailUI.txt", + "sha1": "f6a80058254f7f32e3f6325cbb96f7aae950b1f1", + "size": 1064 + }, + { + "path": "DragonUI/LICENSES/OFL-1.1.txt", + "from": "DragonUI/LICENSES/OFL-1.1.txt", + "sha1": "3e42bd984d6112ae12da18d8fcf3f408f052cf98", + "size": 4433 + }, + { + "path": "DragonUI/LICENSES/Typodermic-EULA.txt", + "from": "DragonUI/LICENSES/Typodermic-EULA.txt", + "sha1": "ed6ed172184bb4dec2f384e5f5b35d379d03bfe7", + "size": 8441 + }, + { + "path": "DragonUI/Locales/Load_Locales.xml", + "from": "DragonUI/Locales/Load_Locales.xml", + "sha1": "4063aac89088f1f002efabce4c96b68723d7dc77", + "size": 569 + }, + { + "path": "DragonUI/Locales/deDE.lua", + "from": "DragonUI/Locales/deDE.lua", + "sha1": "877ba7668196d5fa67c6809f837b9c80874d704f", + "size": 75906 + }, + { + "path": "DragonUI/Locales/enUS.lua", + "from": "DragonUI/Locales/enUS.lua", + "sha1": "d0a8b6181fd898298c224c379991bf64109d92e4", + "size": 45536 + }, + { + "path": "DragonUI/Locales/esES.lua", + "from": "DragonUI/Locales/esES.lua", + "sha1": "4b102b4c3b84737660dd70283342573c14745353", + "size": 76640 + }, + { + "path": "DragonUI/Locales/esMX.lua", + "from": "DragonUI/Locales/esMX.lua", + "sha1": "6aa720a18428a7114635995095a5bfc83cc62601", + "size": 76577 + }, + { + "path": "DragonUI/Locales/frFR.lua", + "from": "DragonUI/Locales/frFR.lua", + "sha1": "11fca462554dc70fb4bac1c8da0d217e5dd31dbf", + "size": 99430 + }, + { + "path": "DragonUI/Locales/koKR.lua", + "from": "DragonUI/Locales/koKR.lua", + "sha1": "9e527fd0dc9f22ce76d9f8bce1d2d34b040d3a0b", + "size": 78874 + }, + { + "path": "DragonUI/Locales/locale_override.lua", + "from": "DragonUI/Locales/locale_override.lua", + "sha1": "b9a5c57fa83f1fe22dd014c30101588cb52145fa", + "size": 1737 + }, + { + "path": "DragonUI/Locales/ptBR.lua", + "from": "DragonUI/Locales/ptBR.lua", + "sha1": "79a5167c640cf60c2d6939cb33aee1686eb991c4", + "size": 96580 + }, + { + "path": "DragonUI/Locales/ruRU.lua", + "from": "DragonUI/Locales/ruRU.lua", + "sha1": "688726e999c16180fdbc447d46e5498af5485797", + "size": 98624 + }, + { + "path": "DragonUI/Locales/zhCN.lua", + "from": "DragonUI/Locales/zhCN.lua", + "sha1": "218a90f09e824a6b2425934a3345f3bef406aedc", + "size": 69105 + }, + { + "path": "DragonUI/Locales/zhTW.lua", + "from": "DragonUI/Locales/zhTW.lua", + "sha1": "46bf4c965abd897a4239b859dd4dc7def6040b4d", + "size": 88118 + }, + { + "path": "DragonUI/THIRD_PARTY_NOTICES.md", + "from": "DragonUI/THIRD_PARTY_NOTICES.md", + "sha1": "d86c6a20c2e5522a26e42d84fcfd58dd97fe6557", + "size": 17988 + }, + { + "path": "DragonUI/Textures/ActionBars/mainmenubar.blp", + "from": "DragonUI/Textures/ActionBars/mainmenubar.blp", + "sha1": "5a6ca02e48353949fed8ffb505b544ce3507f075", + "size": 263316 + }, + { + "path": "DragonUI/Textures/ActionBars/mechanical2.blp", + "from": "DragonUI/Textures/ActionBars/mechanical2.blp", + "sha1": "ee08619001a8b687678f21b3f8d192d0c20c325c", + "size": 263316 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbar.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbar.blp", + "sha1": "1e2f7089a0e62eeeb8ba0906e10f81ba78f377ea", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbar2x_.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbar2x_.blp", + "sha1": "ccb5ce3bae3c36ae586ff1514061766e2ba9c36e", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbar2x_flying.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbar2x_flying.blp", + "sha1": "fe6a314196d9b8400a1e4026ad515117dedb45bf", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbar2x_forever.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbar2x_forever.blp", + "sha1": "a1f7ae76a62a8eaf2b299c965d4f1d0a469ff603", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbar2x_new.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbar2x_new.blp", + "sha1": "0be37cb36e5702c76f2abc3bfcd1cf250bb5afe4", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbar2x_new2.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbar2x_new2.blp", + "sha1": "25da7ab597fe1b4bbd3cab47b3fef6fa79019fe7", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbariconframe.tga", + "from": "DragonUI/Textures/ActionBars/uiactionbariconframe.tga", + "sha1": "8feef5009f10406d6c0611179287c2de73f85f64", + "size": 16923 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbariconframe2x_white.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbariconframe2x_white.blp", + "sha1": "a524e8ef6c9433e7394078a8d050e4953eb5e13c", + "size": 23044 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbariconframe_white.tga", + "from": "DragonUI/Textures/ActionBars/uiactionbariconframe_white.tga", + "sha1": "3954fd89ee913a33a9470c95c52363231123810d", + "size": 16402 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbariconframehighlight.tga", + "from": "DragonUI/Textures/ActionBars/uiactionbariconframehighlight.tga", + "sha1": "70569b4acb19d989ca5edba12b25b0bc3c6bb208", + "size": 16923 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbarvertical.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbarvertical.blp", + "sha1": "00c2341fdf25593f78fda9fa60b460e0f304ae40", + "size": 33940 + }, + { + "path": "DragonUI/Textures/ActionBars/uiactionbarvertical2x.blp", + "from": "DragonUI/Textures/ActionBars/uiactionbarvertical2x.blp", + "sha1": "abbe5741ef04d388b0870011e9402826b2880e91", + "size": 66708 + }, + { + "path": "DragonUI/Textures/Bags/INV_Misc_Bag_08_round.blp", + "from": "DragonUI/Textures/Bags/INV_Misc_Bag_08_round.blp", + "sha1": "d00b77bea1cfc390f5c42ce14a3d5eccd4accfa8", + "size": 23020 + }, + { + "path": "DragonUI/Textures/Bags/bagborder2.blp", + "from": "DragonUI/Textures/Bags/bagborder2.blp", + "sha1": "cd85b17da06eba086ad215f798eb47fddf899e68", + "size": 6676 + }, + { + "path": "DragonUI/Textures/Bags/bagsitembankslot2x.blp", + "from": "DragonUI/Textures/Bags/bagsitembankslot2x.blp", + "sha1": "6cdc3aed3956ccd55c5e55d699974cae2f0c5494", + "size": 5268 + }, + { + "path": "DragonUI/Textures/Bags/bagsitemslot2x.blp", + "from": "DragonUI/Textures/Bags/bagsitemslot2x.blp", + "sha1": "788f3b394925e20660b638674ddf3ff2b2589777", + "size": 5268 + }, + { + "path": "DragonUI/Textures/Bags/bagslotCutout.blp", + "from": "DragonUI/Textures/Bags/bagslotCutout.blp", + "sha1": "48a78c220ebfc97d3c81b65fa797c83407d912b1", + "size": 23060 + }, + { + "path": "DragonUI/Textures/Bags/bagslots2key.tga", + "from": "DragonUI/Textures/Bags/bagslots2key.tga", + "sha1": "de739841236776412eede22eb34c0c6790b5eba7", + "size": 66075 + }, + { + "path": "DragonUI/Textures/Bags/bagslots2x.blp", + "from": "DragonUI/Textures/Bags/bagslots2x.blp", + "sha1": "cdc2a44266dbed04710624bf1c3621d72cf1f668", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Castbar/CastingBarChannel-Plate.tga", + "from": "DragonUI/Textures/Castbar/CastingBarChannel-Plate.tga", + "sha1": "84d08faae6a25a25c25ac0a64ba1e1a0c148ef4e", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Castbar/CastingBarChannel.tga", + "from": "DragonUI/Textures/Castbar/CastingBarChannel.tga", + "sha1": "110527973a3306396336988a12f6c9090fb744ac", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Castbar/CastingBarInterrupted2.tga", + "from": "DragonUI/Textures/Castbar/CastingBarInterrupted2.tga", + "sha1": "03da61796885255b385fa9527f23c10b257ec914", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Castbar/CastingBarSpark.tga", + "from": "DragonUI/Textures/Castbar/CastingBarSpark.tga", + "sha1": "b11ece05de25603b41a998625b575b014a0d0d96", + "size": 4140 + }, + { + "path": "DragonUI/Textures/Castbar/CastingBarStandard2.tga", + "from": "DragonUI/Textures/Castbar/CastingBarStandard2.tga", + "sha1": "2e932832fdca0d3d1b2d27093d9b6ab0c97fb242", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Castbar/uicastingbar.tga", + "from": "DragonUI/Textures/Castbar/uicastingbar.tga", + "sha1": "e03a23ad4598385071002ff6694682b0059455f0", + "size": 255155 + }, + { + "path": "DragonUI/Textures/Castbar/uicastingbar2x.tga", + "from": "DragonUI/Textures/Castbar/uicastingbar2x.tga", + "sha1": "697750468a5f7f2ef62e7d8da7434b29e14451b6", + "size": 898287 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomdeathknight.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomdeathknight.blp", + "sha1": "0c059ed49ca94c0aba486d0abf9c28eed5204102", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomdruid.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomdruid.blp", + "sha1": "32f5e5f444970547ae995e63392eb4dc3783987b", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomhunter.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomhunter.blp", + "sha1": "8925f257f51deacffa08350072cacf27f5a2c968", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroommage.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroommage.blp", + "sha1": "db097b8f26b261ff572abfbc95368affcb1f906b", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroompaladin.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroompaladin.blp", + "sha1": "e6818a47f7b1568ebb7df376924dbcd0970aa6ea", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroompriest.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroompriest.blp", + "sha1": "07cd78335163e93fc02131fbcce5a197530efe84", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomrogue.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomrogue.blp", + "sha1": "17e5ff9fa355c9e10720809fbb5442fe45246752", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomshaman.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomshaman.blp", + "sha1": "e666285bbbbb206dfbc281ae3ef40686be165a50", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomwarlock.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomwarlock.blp", + "sha1": "e1bac3c7bad5b35e1d06b6e9b50883ff45cf8ec9", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomwarrior.blp", + "from": "DragonUI/Textures/CharacterPanel/DressingRoom/dressingroomwarrior.blp", + "sha1": "6e032f559ca04ddeabbfe689f3bead8d645c5099", + "size": 132244 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/bloodelf-floor3.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/bloodelf-floor3.tga", + "sha1": "bc42f5da3ccc80247ececfe534831c3480725d0f", + "size": 61954 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/bloodelf-floor4.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/bloodelf-floor4.tga", + "sha1": "626da6c57c6f7c33657e23fa15faf3e8e8bdf66c", + "size": 16957 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/draenei-floor3.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/draenei-floor3.tga", + "sha1": "5f346d316856b0d639dd0f7b019d03fd59728693", + "size": 66197 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/draenei-floor4.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/draenei-floor4.tga", + "sha1": "da5c91a5072dd21028e4ab8112ca6ece8187e46d", + "size": 19259 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/dwarf-cap.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/dwarf-cap.tga", + "sha1": "672edc5edb17cc43c4c77d146aaca43c61b22a15", + "size": 80062 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/nightelf-floor3.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/nightelf-floor3.tga", + "sha1": "6a0281020c4b3d8f09fd43a0323570290c34c3f8", + "size": 82636 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/nightelf-floor4.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/nightelf-floor4.tga", + "sha1": "477b956796a6dc38b699ecf848559193190b9689", + "size": 24202 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/scourge-floor3.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/scourge-floor3.tga", + "sha1": "2dc0addb53c9475f2e3df0e9793b8e022c2e30b5", + "size": 74464 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/scourge-floor4.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/scourge-floor4.tga", + "sha1": "238befcbf8404b4a6ce2e0337ce190b34bee1a9c", + "size": 20484 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/tauren-floor3.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/tauren-floor3.tga", + "sha1": "467ac69434283e197f339f3abee78ee0c5453019", + "size": 108449 + }, + { + "path": "DragonUI/Textures/CharacterPanel/RaceBackground/tauren-floor4.tga", + "from": "DragonUI/Textures/CharacterPanel/RaceBackground/tauren-floor4.tga", + "sha1": "2333519f6e3af0c4f622444c8d36f33312082c4a", + "size": 26895 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_backstab.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_backstab.blp", + "sha1": "5ef38719140119528e8a07df300192e40100823f", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_hunter_beasttaming.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_hunter_beasttaming.blp", + "sha1": "e3986a4eded88a0609154e3938752198fa0d141f", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_hunter_swiftstrike.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_hunter_swiftstrike.blp", + "sha1": "1309c159a33eb31a37f3725fbd6a161e58099009", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_marksmanship.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_marksmanship.blp", + "sha1": "b65f30d8486e20dc8320a98cc9f94a5cd3ee5e54", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_racial_bearform.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_racial_bearform.blp", + "sha1": "9a8f08cffb2d0b0a4bcfd1602e4a9c62759ed0bf", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_rogue_eviscerate.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_rogue_eviscerate.blp", + "sha1": "6f7579ef5930169c35ef5ea7f4d72c854469943a", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_stealth.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_stealth.blp", + "sha1": "4cb6b68a424e9afd1df37f537281fd05835d31dd", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_warrior_innerrage.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/ability_warrior_innerrage.blp", + "sha1": "7cc686f35667e5f4640a8e5042bfe1e3dc286bed", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/inv_shield_06.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/inv_shield_06.blp", + "sha1": "9ada9ea205a3b9856e78a70376db664178bd6e76", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_deathknight_bloodpresence.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_deathknight_bloodpresence.blp", + "sha1": "cefed6caca310c8b7790eb01705eaa819e6ccc9a", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_deathknight_frostpresence.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_deathknight_frostpresence.blp", + "sha1": "f8f21ba46de6093af03160e2a2da8dbf82e99d9f", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_deathknight_unholypresence.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_deathknight_unholypresence.blp", + "sha1": "580167494689c5da951f91a608ed272bb3c1acc0", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_fire_firebolt02.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_fire_firebolt02.blp", + "sha1": "1c310f0b106598338b5dc93e9683491335539206", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_frost_frostbolt02.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_frost_frostbolt02.blp", + "sha1": "1503ab2d9c7e45c8c0386a813cfeede65f63d91d", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_auraoflight.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_auraoflight.blp", + "sha1": "0542108209de96d2d4e782a5bc1392edf611c6d0", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_devotionaura.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_devotionaura.blp", + "sha1": "b1a0a78dfa3fe743bdf4f42587b9b158d0ebfc0a", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_guardianspirit.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_guardianspirit.blp", + "sha1": "dab48a281632c8c668a67af922d6ec64bb3dc7ac", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_holybolt.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_holybolt.blp", + "sha1": "b54ff4e94d1885a9ee6137f1b76f791c1ae038fd", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_magicalsentry.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_magicalsentry.blp", + "sha1": "9173f69f509abd0829d0b88482805792aa7089ef", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_wordfortitude.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_holy_wordfortitude.blp", + "sha1": "d845d496ffdddea0d775a12a94f863f7384739a2", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_healingtouch.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_healingtouch.blp", + "sha1": "04a2c223e45387a7c9d489d86dd10f8984b0c5bd", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_lightning.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_lightning.blp", + "sha1": "a0d2d0601553df0a54922c23963579e54288e35e", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_lightningshield.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_lightningshield.blp", + "sha1": "525300d152a230e2e4317f237e6d8954a558035f", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_magicimmunity.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_magicimmunity.blp", + "sha1": "2f09c24378513680c1dca22b15443057e31a6cad", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_starfall.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_nature_starfall.blp", + "sha1": "4fe5d497082e7f92e7f9de5b479d386de9aa7512", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_deathcoil.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_deathcoil.blp", + "sha1": "ca4929484bc4a5f1d4a72cd5c0449d5f58aa9e09", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_metamorphosis.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_metamorphosis.blp", + "sha1": "a9fc0a025036535e6e54132d5d317b45d8a0cb71", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_rainoffire.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_rainoffire.blp", + "sha1": "761c24d25835dc0b854fbe7a2b75354e78ff5c42", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_shadowwordpain.blp", + "from": "DragonUI/Textures/CharacterPanel/SpecPortraits/spell_shadow_shadowwordpain.blp", + "sha1": "763adbee403039bc6ea64b24b15dd3a485ee8b05", + "size": 88552 + }, + { + "path": "DragonUI/Textures/CharacterPanel/characterinfoclasses-a.blp", + "from": "DragonUI/Textures/CharacterPanel/characterinfoclasses-a.blp", + "sha1": "be5f1625485254846a8917bcebc45574b63ee961", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/CharacterPanel/characterinfoclasses-b.blp", + "from": "DragonUI/Textures/CharacterPanel/characterinfoclasses-b.blp", + "sha1": "b0851d430eee4d221c8bcd37dadc8add94ce7388", + "size": 525460 + }, + { + "path": "DragonUI/Textures/CharacterPanel/characterpanelbackground.blp", + "from": "DragonUI/Textures/CharacterPanel/characterpanelbackground.blp", + "sha1": "8876891a87a31ceb4ef30a8243783e8fba75fb26", + "size": 525460 + }, + { + "path": "DragonUI/Textures/CharacterPanel/characterplus.blp", + "from": "DragonUI/Textures/CharacterPanel/characterplus.blp", + "sha1": "e072c6d868335e1aef30db970021795b2860097e", + "size": 6660 + }, + { + "path": "DragonUI/Textures/CharacterPanel/charpaperdollparts.blp", + "from": "DragonUI/Textures/CharacterPanel/charpaperdollparts.blp", + "sha1": "4a03b645511199c60e6e43ae6e9f3ee68e10238f", + "size": 44900 + }, + { + "path": "DragonUI/Textures/CharacterPanel/charstatmiddle.blp", + "from": "DragonUI/Textures/CharacterPanel/charstatmiddle.blp", + "sha1": "242221f812658cd4f69226765635560fea59131a", + "size": 4260 + }, + { + "path": "DragonUI/Textures/CharacterPanel/collapsebuttons.tga", + "from": "DragonUI/Textures/CharacterPanel/collapsebuttons.tga", + "sha1": "cb00eb5a28b86601c9d911e9efaeff813192bce3", + "size": 16402 + }, + { + "path": "DragonUI/Textures/CharacterPanel/commonbuttons.tga", + "from": "DragonUI/Textures/CharacterPanel/commonbuttons.tga", + "sha1": "ef9217e7919f04be14bb87a9bdbbab8c2d106395", + "size": 68938 + }, + { + "path": "DragonUI/Textures/CharacterPanel/commonicons.tga", + "from": "DragonUI/Textures/CharacterPanel/commonicons.tga", + "sha1": "23d226e321fcbf0900abe3e5cfb0e3353d30b996", + "size": 74269 + }, + { + "path": "DragonUI/Textures/CharacterPanel/happinessicons.tga", + "from": "DragonUI/Textures/CharacterPanel/happinessicons.tga", + "sha1": "ab9ba9a4162fc9e2f331ead2fdbf60565eb64117", + "size": 65580 + }, + { + "path": "DragonUI/Textures/CharacterPanel/listexpand.blp", + "from": "DragonUI/Textures/CharacterPanel/listexpand.blp", + "sha1": "55f77c37de5fd111d91d767a091357fc0ce8f076", + "size": 66708 + }, + { + "path": "DragonUI/Textures/CharacterPanel/paperdollsidebartabs.tga", + "from": "DragonUI/Textures/CharacterPanel/paperdollsidebartabs.tga", + "sha1": "2a438ea11a87ddefee725550b84539835d907ddd", + "size": 65580 + }, + { + "path": "DragonUI/Textures/CharacterPanel/reputation-detailbg.blp", + "from": "DragonUI/Textures/CharacterPanel/reputation-detailbg.blp", + "sha1": "8bd9c67a5033734069df33555a07351e9e0fef21", + "size": 44900 + }, + { + "path": "DragonUI/Textures/CharacterPanel/resistanceicons.tga", + "from": "DragonUI/Textures/CharacterPanel/resistanceicons.tga", + "sha1": "49cbf876b7e40ca49ea8462a980e3f2b3f09c7ea", + "size": 131116 + }, + { + "path": "DragonUI/Textures/CharacterPanel/ring-alliance.tga", + "from": "DragonUI/Textures/CharacterPanel/ring-alliance.tga", + "sha1": "8266152b7c46601c1ab744feec064f3f9a7b0938", + "size": 65580 + }, + { + "path": "DragonUI/Textures/CharacterPanel/ring-horde.tga", + "from": "DragonUI/Textures/CharacterPanel/ring-horde.tga", + "sha1": "12fc43a7ed99fea57116b2eac0268846849c5a2b", + "size": 65580 + }, + { + "path": "DragonUI/Textures/CharacterPanel/ring-neutral.tga", + "from": "DragonUI/Textures/CharacterPanel/ring-neutral.tga", + "sha1": "6aa0dce00847af2c9315154c9b8831f151d28a77", + "size": 65580 + }, + { + "path": "DragonUI/Textures/CharacterPanel/scrollbararrows.tga", + "from": "DragonUI/Textures/CharacterPanel/scrollbararrows.tga", + "sha1": "dd3ad14934a871f4fb4c96675b0a5b1f2725ab0b", + "size": 1664 + }, + { + "path": "DragonUI/Textures/CharacterPanel/scrollbarthumb.tga", + "from": "DragonUI/Textures/CharacterPanel/scrollbarthumb.tga", + "sha1": "5672c7f604c66f7d8ae29bb5fed58844b3fb77a0", + "size": 2067 + }, + { + "path": "DragonUI/Textures/ClassIcons/DEATHKNIGHT.blp", + "from": "DragonUI/Textures/ClassIcons/DEATHKNIGHT.blp", + "sha1": "e133fd6ea5c930af214eda7ff2e8aceeed70df8d", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/DRUID.blp", + "from": "DragonUI/Textures/ClassIcons/DRUID.blp", + "sha1": "48e2d585dd976b28598c2671754973946b25590e", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/HUNTER.blp", + "from": "DragonUI/Textures/ClassIcons/HUNTER.blp", + "sha1": "9d791b70114cd205e613c6e8c513c8a3aa034772", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MAGE.blp", + "from": "DragonUI/Textures/ClassIcons/MAGE.blp", + "sha1": "e9cb40314a319c3eef3eea10795d923ea174d249", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/DRUID.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/DRUID.blp", + "sha1": "ef2ab4e620b10b80a2bbf96ad2a8b5a327039c72", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/HUNTER.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/HUNTER.blp", + "sha1": "980d0b470837f3177155a9587f75111f4eabb8cb", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/MAGE.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/MAGE.blp", + "sha1": "6e9c9bab22e310e840158219a28d0158f565c4b7", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/PALADIN.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/PALADIN.blp", + "sha1": "988cd03465730de4074dd8915bb50154c3944a79", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/PRIEST.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/PRIEST.blp", + "sha1": "eee6e1aaff735cfda303835e0c7aa7f0ed3b01bf", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/ROGUE.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/ROGUE.blp", + "sha1": "264add9bb6f1b20c4336a6a04bee76f7a7e45e57", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/SHAMAN.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/SHAMAN.blp", + "sha1": "63a65c06456c920e56d82c4ef289ac086ee6d0de", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/WARLOCK.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/WARLOCK.blp", + "sha1": "42933b013bae6b0dfaae3e245211de75d385f631", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/MORE_ICONS/WARRIOR.blp", + "from": "DragonUI/Textures/ClassIcons/MORE_ICONS/WARRIOR.blp", + "sha1": "5c50d6e154664abe0000ed2e2f87d2de85bbd7ba", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/PALADIN.blp", + "from": "DragonUI/Textures/ClassIcons/PALADIN.blp", + "sha1": "4eb8fe282ebcbaadcebe5f299e66915b94226743", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/PRIEST.blp", + "from": "DragonUI/Textures/ClassIcons/PRIEST.blp", + "sha1": "770b090066d607fe1dad215f571c6eb6fe6fdb38", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/ROGUE.blp", + "from": "DragonUI/Textures/ClassIcons/ROGUE.blp", + "sha1": "8358a9ecc9a1c403a907c613d260048cfa822f61", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/SHAMAN.blp", + "from": "DragonUI/Textures/ClassIcons/SHAMAN.blp", + "sha1": "b3e921d52a2c432cea33a395b11c7b701d17edbe", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/WARLOCK.blp", + "from": "DragonUI/Textures/ClassIcons/WARLOCK.blp", + "sha1": "352aa5db88a8e55bd61a1ace45e85cc7e49e8cc1", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/WARRIOR.blp", + "from": "DragonUI/Textures/ClassIcons/WARRIOR.blp", + "sha1": "904bf0e347c312f47680c73af53c88da8f14d384", + "size": 23060 + }, + { + "path": "DragonUI/Textures/ClassIcons/classes_alpha.blp", + "from": "DragonUI/Textures/ClassIcons/classes_alpha.blp", + "sha1": "3389b71c0d33f348193774b64740837e8b5a3d6d", + "size": 1399316 + }, + { + "path": "DragonUI/Textures/Coins/coincopper.blp", + "from": "DragonUI/Textures/Coins/coincopper.blp", + "sha1": "c84e12dca152484d28f9f8461e9e25534d44de51", + "size": 6636 + }, + { + "path": "DragonUI/Textures/Coins/coingold.blp", + "from": "DragonUI/Textures/Coins/coingold.blp", + "sha1": "79364eff26a444cec50e049cc6efaef81fad5df9", + "size": 6636 + }, + { + "path": "DragonUI/Textures/Coins/coinsilver.blp", + "from": "DragonUI/Textures/Coins/coinsilver.blp", + "sha1": "a50ebcb69cfc1df5924d094b2c0d88b25d792006", + "size": 6636 + }, + { + "path": "DragonUI/Textures/Coins/commoncoinbox.blp", + "from": "DragonUI/Textures/Coins/commoncoinbox.blp", + "sha1": "5897efae9e39ebe8db77dcd37ec8c56cdccf52cb", + "size": 17556 + }, + { + "path": "DragonUI/Textures/Coins/commoncurrencybox.blp", + "from": "DragonUI/Textures/Coins/commoncurrencybox.blp", + "sha1": "dbb7e3f276f510c973616e470d94b177a5265bda", + "size": 17556 + }, + { + "path": "DragonUI/Textures/Collections/FavoritesIcon.blp", + "from": "DragonUI/Textures/Collections/FavoritesIcon.blp", + "sha1": "8599088ff4f264a3aa9d7e06a4fa3e420f57e8ea", + "size": 1172 + }, + { + "path": "DragonUI/Textures/Collections/IconFrameGold.tga", + "from": "DragonUI/Textures/Collections/IconFrameGold.tga", + "sha1": "852a24246789d9904e51649f32eecda5a3e333d5", + "size": 65554 + }, + { + "path": "DragonUI/Textures/Collections/ListButtons.blp", + "from": "DragonUI/Textures/Collections/ListButtons.blp", + "sha1": "0646fddce92758b0de7f3ecff91f72b464cda29e", + "size": 65684 + }, + { + "path": "DragonUI/Textures/Collections/MountJournal-BG.blp", + "from": "DragonUI/Textures/Collections/MountJournal-BG.blp", + "sha1": "4eabc10bcf404719cbe3489a5a643bf43f8cbe9c", + "size": 175948 + }, + { + "path": "DragonUI/Textures/Collections/MountJournalIcons.blp", + "from": "DragonUI/Textures/Collections/MountJournalIcons.blp", + "sha1": "f66ef19bee259caa166af474409a41ab71ec3ba4", + "size": 9364 + }, + { + "path": "DragonUI/Textures/Collections/MountPortrait.tga", + "from": "DragonUI/Textures/Collections/MountPortrait.tga", + "sha1": "9332a5d49d13c87ad9c32e11a8c887a8f52d2a6a", + "size": 16402 + }, + { + "path": "DragonUI/Textures/Collections/PetPortrait.tga", + "from": "DragonUI/Textures/Collections/PetPortrait.tga", + "sha1": "a83fb51a2114d87359c92f62dc86b4ddeff646f3", + "size": 16402 + }, + { + "path": "DragonUI/Textures/Collections/UI-Searchbox-Icon.blp", + "from": "DragonUI/Textures/Collections/UI-Searchbox-Icon.blp", + "sha1": "0ab7ae51efc0bc310a557576fcfe16a8f07a541b", + "size": 404 + }, + { + "path": "DragonUI/Textures/Common/136441-poiicons.blp", + "from": "DragonUI/Textures/Common/136441-poiicons.blp", + "sha1": "8c83783083ca5512a992ee59b4948b5965a2f50b", + "size": 175972 + }, + { + "path": "DragonUI/Textures/Common/1536801-128redbutton.blp", + "from": "DragonUI/Textures/Common/1536801-128redbutton.blp", + "sha1": "e63ad0718260ed0a55db0254e2a11187a34f66ed", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/Common/1723831-uiframe-inner.blp", + "from": "DragonUI/Textures/Common/1723831-uiframe-inner.blp", + "sha1": "a70fb76e2d1abb309e4e06156faf6a53244e81c2", + "size": 17556 + }, + { + "path": "DragonUI/Textures/Common/1723832-uiframe-inner.blp", + "from": "DragonUI/Textures/Common/1723832-uiframe-inner.blp", + "sha1": "0f845585dbcaabcee669409702ef27fe63bbb96b", + "size": 17556 + }, + { + "path": "DragonUI/Textures/Common/1723833-uiframe-inner.blp", + "from": "DragonUI/Textures/Common/1723833-uiframe-inner.blp", + "sha1": "66135b105652af9a760fdc54f999de5a759efdae", + "size": 33940 + }, + { + "path": "DragonUI/Textures/Common/2406979-uiframe-metal-corners.blp", + "from": "DragonUI/Textures/Common/2406979-uiframe-metal-corners.blp", + "sha1": "44c2f12581f2f4aca17a8d873896b10cd9551178", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/Common/2406984-uiframe-metal-edges-vert.blp", + "from": "DragonUI/Textures/Common/2406984-uiframe-metal-edges-vert.blp", + "sha1": "837ea8c1057d57cc1efae7ecaa2ee66eb34c302e", + "size": 66708 + }, + { + "path": "DragonUI/Textures/Common/2406987-uiframe-metal-edges-horiz.blp", + "from": "DragonUI/Textures/Common/2406987-uiframe-metal-edges-horiz.blp", + "sha1": "86d76fc7a05183602d84e1f28bce43d3302373d9", + "size": 66708 + }, + { + "path": "DragonUI/Textures/Common/3056750-diamondmetal-frame.blp", + "from": "DragonUI/Textures/Common/3056750-diamondmetal-frame.blp", + "sha1": "bf594040bbee0c654a8a27678a6e4dff5e0bfc0f", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Common/3056755-diamondmetal-edges.blp", + "from": "DragonUI/Textures/Common/3056755-diamondmetal-edges.blp", + "sha1": "0fde5d9afbe2af61885c53df76289917846fcf53", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Common/374155-uibackground-rock.blp", + "from": "DragonUI/Textures/Common/374155-uibackground-rock.blp", + "sha1": "7d953d8d5c8a559305fa5f5b4952c764f6a97238", + "size": 525460 + }, + { + "path": "DragonUI/Textures/Common/423808-squarebuttontextures.blp", + "from": "DragonUI/Textures/Common/423808-squarebuttontextures.blp", + "sha1": "af75193378accd10ad4abef17a98d74e84cb2d27", + "size": 6660 + }, + { + "path": "DragonUI/Textures/Common/4331838-minimal-scrollbar.blp", + "from": "DragonUI/Textures/Common/4331838-minimal-scrollbar.blp", + "sha1": "abb7819ed123488f22451e4b163f73e4e3323cdf", + "size": 33940 + }, + { + "path": "DragonUI/Textures/Common/4332072-minimal-scrollbar-track-middle.blp", + "from": "DragonUI/Textures/Common/4332072-minimal-scrollbar-track-middle.blp", + "sha1": "ded6af385c7f6735de16345e09ce4d2c63894297", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Common/4567914-minimalsliderbar.blp", + "from": "DragonUI/Textures/Common/4567914-minimalsliderbar.blp", + "sha1": "2c71d5a0834dc069d654fba967bc2dd2a1cf7204", + "size": 5268 + }, + { + "path": "DragonUI/Textures/Common/4698972-redbutton-exit-2x.blp", + "from": "DragonUI/Textures/Common/4698972-redbutton-exit-2x.blp", + "sha1": "21111c83467fd1c46567e9fe9a3eefb72205848a", + "size": 132244 + }, + { + "path": "DragonUI/Textures/Common/4707839-uiframe-tab.blp", + "from": "DragonUI/Textures/Common/4707839-uiframe-tab.blp", + "sha1": "da20c7bb86e788d6f6149596a6883fda28fca473", + "size": 66708 + }, + { + "path": "DragonUI/Textures/Common/5142784-minimal-scrollbar-small-thumb-middle.blp", + "from": "DragonUI/Textures/Common/5142784-minimal-scrollbar-small-thumb-middle.blp", + "sha1": "e52a8e72ce51fa4b64bdd80f9884dde7b1562171", + "size": 66708 + }, + { + "path": "DragonUI/Textures/Common/5142787-minimal-scrollbar-small.blp", + "from": "DragonUI/Textures/Common/5142787-minimal-scrollbar-small.blp", + "sha1": "c7319f7149a81131810e42ead0fa3e85f232c013", + "size": 5268 + }, + { + "path": "DragonUI/Textures/Common/5390329-common-dropdown-bg.blp", + "from": "DragonUI/Textures/Common/5390329-common-dropdown-bg.blp", + "sha1": "76535ddc02bf0b63395f8c11139e612e2fe9487d", + "size": 525460 + }, + { + "path": "DragonUI/Textures/DetailsSkin/6704514-dm-bar-fill.blp", + "from": "DragonUI/Textures/DetailsSkin/6704514-dm-bar-fill.blp", + "sha1": "6b6d0f487d890420bfb412e51bd9e1c51adbb1d7", + "size": 33940 + }, + { + "path": "DragonUI/Textures/DetailsSkin/7499559-dm-bar-shadowbg.blp", + "from": "DragonUI/Textures/DetailsSkin/7499559-dm-bar-shadowbg.blp", + "sha1": "ea9064f72a2fe7de9b9576492abeff1377031dfa", + "size": 33940 + }, + { + "path": "DragonUI/Textures/DetailsSkin/7499559-dm-header.blp", + "from": "DragonUI/Textures/DetailsSkin/7499559-dm-header.blp", + "sha1": "5be70e1047b46e2750b9d3d421c1c18b471c15ca", + "size": 33940 + }, + { + "path": "DragonUI/Textures/DetailsSkin/7499559-dm-panel-bg.blp", + "from": "DragonUI/Textures/DetailsSkin/7499559-dm-panel-bg.blp", + "sha1": "80c0aeffc3102a6d39d7fc45eca2d683e1fbaa05", + "size": 66708 + }, + { + "path": "DragonUI/Textures/Editmode/editmodeui.blp", + "from": "DragonUI/Textures/Editmode/editmodeui.blp", + "sha1": "829325246aedfea7a7d2b7b03626c19221beaab7", + "size": 33940 + }, + { + "path": "DragonUI/Textures/Editmode/editmodeuihighlightbackground.blp", + "from": "DragonUI/Textures/Editmode/editmodeuihighlightbackground.blp", + "sha1": "29fa73aab55637337ab08e9d4163a8d65b83e391", + "size": 2196 + }, + { + "path": "DragonUI/Textures/Editmode/editmodeuiselectedbackground.blp", + "from": "DragonUI/Textures/Editmode/editmodeuiselectedbackground.blp", + "sha1": "c0e55b014c43dfec22467018ce57bad80a0f7622", + "size": 2196 + }, + { + "path": "DragonUI/Textures/Editmode/editmodeuivertical.blp", + "from": "DragonUI/Textures/Editmode/editmodeuivertical.blp", + "sha1": "e673d634781bcc51d8e632d59e15141d9304814e", + "size": 9364 + }, + { + "path": "DragonUI/Textures/EncounterJournal/423808-squarebuttontextures.blp", + "from": "DragonUI/Textures/EncounterJournal/423808-squarebuttontextures.blp", + "sha1": "af75193378accd10ad4abef17a98d74e84cb2d27", + "size": 6660 + }, + { + "path": "DragonUI/Textures/EncounterJournal/516763-cs-helptextures.blp", + "from": "DragonUI/Textures/EncounterJournal/516763-cs-helptextures.blp", + "sha1": "43b9577650522039c19064d2b24581bd814fca52", + "size": 350704 + }, + { + "path": "DragonUI/Textures/EncounterJournal/516764-cs-helptextures-tile.blp", + "from": "DragonUI/Textures/EncounterJournal/516764-cs-helptextures-tile.blp", + "sha1": "e7fdd07d9406cf7f3dc126791fb0d6732a424bc8", + "size": 88612 + }, + { + "path": "DragonUI/Textures/ForeverUI/chrome-buttons.tga", + "from": "DragonUI/Textures/ForeverUI/chrome-buttons.tga", + "sha1": "b98c3203209ca11ddc5c3c3a3823804a637759c0", + "size": 304303 + }, + { + "path": "DragonUI/Textures/ForeverUI/chrome-dialog.tga", + "from": "DragonUI/Textures/ForeverUI/chrome-dialog.tga", + "sha1": "4df9567022162b6147f789e36b2d6a4e7ab4c267", + "size": 201569 + }, + { + "path": "DragonUI/Textures/ForeverUI/chrome-frame.tga", + "from": "DragonUI/Textures/ForeverUI/chrome-frame.tga", + "sha1": "4684d7725f1e50f5a76158e27481216fd52ebcfd", + "size": 273866 + }, + { + "path": "DragonUI/Textures/ForeverUI/chrome-options.tga", + "from": "DragonUI/Textures/ForeverUI/chrome-options.tga", + "sha1": "e1af4829b5b92f17351d7f11cb3121d805a44388", + "size": 209226 + }, + { + "path": "DragonUI/Textures/ForeverUI/controls-basic.tga", + "from": "DragonUI/Textures/ForeverUI/controls-basic.tga", + "sha1": "bbe539bf6285aedbbc63c1948b4c2a44a8f1cd69", + "size": 44483 + }, + { + "path": "DragonUI/Textures/ForeverUI/controls-dropdown.tga", + "from": "DragonUI/Textures/ForeverUI/controls-dropdown.tga", + "sha1": "499f83070c3f6ebc6abb7b51da3f83ef8c609c90", + "size": 300320 + }, + { + "path": "DragonUI/Textures/Mail/mail-icon.blp", + "from": "DragonUI/Textures/Mail/mail-icon.blp", + "sha1": "6b81a95681f29805b01ac91bf6cd498d1820257a", + "size": 88552 + }, + { + "path": "DragonUI/Textures/Mail/ui-mailframebg.blp", + "from": "DragonUI/Textures/Mail/ui-mailframebg.blp", + "sha1": "2e22f010c825664f04074025791904f43b4781d7", + "size": 175948 + }, + { + "path": "DragonUI/Textures/Mail/whiteiconframe.blp", + "from": "DragonUI/Textures/Mail/whiteiconframe.blp", + "sha1": "86e05bf596f12d0eae749cd947ec6890c87af188", + "size": 6632 + }, + { + "path": "DragonUI/Textures/Merchant/130757-ui-common-mousehilight-retail.blp", + "from": "DragonUI/Textures/Merchant/130757-ui-common-mousehilight-retail.blp", + "sha1": "cd36f50e9e28b30cdc008a3bc4ddf098aacb6268", + "size": 1868 + }, + { + "path": "DragonUI/Textures/Merchant/130822-ui-pagebutton-background-retail.blp", + "from": "DragonUI/Textures/Merchant/130822-ui-pagebutton-background-retail.blp", + "sha1": "b139c59a8cf5c79e7d16e40f2eb79b0ddf9cc954", + "size": 1868 + }, + { + "path": "DragonUI/Textures/Merchant/130864-ui-spellbookicon-nextpage-disabled-retail.blp", + "from": "DragonUI/Textures/Merchant/130864-ui-spellbookicon-nextpage-disabled-retail.blp", + "sha1": "7fbe5f251ec32c4a9ad7084beda880fda3ccdf47", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/130865-ui-spellbookicon-nextpage-down-retail.blp", + "from": "DragonUI/Textures/Merchant/130865-ui-spellbookicon-nextpage-down-retail.blp", + "sha1": "ab01eb4ca1aa81a17ecae9f4875cbd9cb0d1a5bc", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/130866-ui-spellbookicon-nextpage-up-retail.blp", + "from": "DragonUI/Textures/Merchant/130866-ui-spellbookicon-nextpage-up-retail.blp", + "sha1": "065e134de07addd8fdfe5dcb9de7e44ebc934454", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/130867-ui-spellbookicon-prevpage-disabled-retail.blp", + "from": "DragonUI/Textures/Merchant/130867-ui-spellbookicon-prevpage-disabled-retail.blp", + "sha1": "b378e441ead0a1aa9e853850130447ad358cff94", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/130868-ui-spellbookicon-prevpage-down-retail.blp", + "from": "DragonUI/Textures/Merchant/130868-ui-spellbookicon-prevpage-down-retail.blp", + "sha1": "9cb11a60095d26e2c74b66db09438b2969b49376", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/130869-ui-spellbookicon-prevpage-up-retail.blp", + "from": "DragonUI/Textures/Merchant/130869-ui-spellbookicon-prevpage-up-retail.blp", + "sha1": "0f1f6dd8449d838fee0be6cc73d5c1e9555e2ca5", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/136423-ui-merchant-labelslots-retail.blp", + "from": "DragonUI/Textures/Merchant/136423-ui-merchant-labelslots-retail.blp", + "sha1": "c040d2acffab09e67c70a28b3b2b0117223b6391", + "size": 12132 + }, + { + "path": "DragonUI/Textures/Merchant/5222222-merchant-pack.blp", + "from": "DragonUI/Textures/Merchant/5222222-merchant-pack.blp", + "sha1": "08c2bd0474337d6100e75b99ae2b2becab8afe79", + "size": 132244 + }, + { + "path": "DragonUI/Textures/Merchant/emptyslot.blp", + "from": "DragonUI/Textures/Merchant/emptyslot.blp", + "sha1": "165f31e484b379d1ba155b3286f4c0167ed9e16c", + "size": 6660 + }, + { + "path": "DragonUI/Textures/Merchant/labelslots.blp", + "from": "DragonUI/Textures/Merchant/labelslots.blp", + "sha1": "c040d2acffab09e67c70a28b3b2b0117223b6391", + "size": 12132 + }, + { + "path": "DragonUI/Textures/Merchant/merchant-pack.blp", + "from": "DragonUI/Textures/Merchant/merchant-pack.blp", + "sha1": "08c2bd0474337d6100e75b99ae2b2becab8afe79", + "size": 132244 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-background.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-background.blp", + "sha1": "b139c59a8cf5c79e7d16e40f2eb79b0ddf9cc954", + "size": 1868 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-hover.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-hover.blp", + "sha1": "cd36f50e9e28b30cdc008a3bc4ddf098aacb6268", + "size": 1868 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-next-disabled.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-next-disabled.blp", + "sha1": "7fbe5f251ec32c4a9ad7084beda880fda3ccdf47", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-next-normal.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-next-normal.blp", + "sha1": "065e134de07addd8fdfe5dcb9de7e44ebc934454", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-next-pressed.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-next-pressed.blp", + "sha1": "ab01eb4ca1aa81a17ecae9f4875cbd9cb0d1a5bc", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-prev-disabled.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-prev-disabled.blp", + "sha1": "b378e441ead0a1aa9e853850130447ad358cff94", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-prev-normal.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-prev-normal.blp", + "sha1": "0f1f6dd8449d838fee0be6cc73d5c1e9555e2ca5", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Merchant/pagebutton-prev-pressed.blp", + "from": "DragonUI/Textures/Merchant/pagebutton-prev-pressed.blp", + "sha1": "9cb11a60095d26e2c74b66db09438b2969b49376", + "size": 2564 + }, + { + "path": "DragonUI/Textures/Micromenu/Atlas/uimicromenu2x.blp", + "from": "DragonUI/Textures/Micromenu/Atlas/uimicromenu2x.blp", + "sha1": "cc22e2735bc58aaeabc04d6263cafa17b0256f2a", + "size": 525460 + }, + { + "path": "DragonUI/Textures/Micromenu/dragonbreath.tga", + "from": "DragonUI/Textures/Micromenu/dragonbreath.tga", + "sha1": "266e5e57d3b5b97dff97762462a54ea977460a82", + "size": 95457 + }, + { + "path": "DragonUI/Textures/Micromenu/micropvp.blp", + "from": "DragonUI/Textures/Micromenu/micropvp.blp", + "sha1": "cd53474cf1bd687495c2eba5c0da2db729766ae8", + "size": 88596 + }, + { + "path": "DragonUI/Textures/Micromenu/ui-mainmenubar-performancebar.blp", + "from": "DragonUI/Textures/Micromenu/ui-mainmenubar-performancebar.blp", + "sha1": "6a8c2aa097530b12703d9d50d04813af430e27a5", + "size": 2556 + }, + { + "path": "DragonUI/Textures/Micromenu/uibattlefieldicon.tga", + "from": "DragonUI/Textures/Micromenu/uibattlefieldicon.tga", + "sha1": "0f72a49316d58ba7648d989784838abc9e14ce29", + "size": 66075 + }, + { + "path": "DragonUI/Textures/Micromenu/uicollapsebutton.tga", + "from": "DragonUI/Textures/Micromenu/uicollapsebutton.tga", + "sha1": "1cc123fc12d6426024a835b4ae29f11fa27f91bb", + "size": 8731 + }, + { + "path": "DragonUI/Textures/Micromenu/uigroupfinderflipbookeye.tga", + "from": "DragonUI/Textures/Micromenu/uigroupfinderflipbookeye.tga", + "sha1": "19ac2a7944e800a9c40a0f04421daa867d972b15", + "size": 195809 + }, + { + "path": "DragonUI/Textures/Micromenu/uimicromenu2x.blp", + "from": "DragonUI/Textures/Micromenu/uimicromenu2x.blp", + "sha1": "8ac7d3bb47a2875ea99707be2e0a5f434c98030c", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/Minimap/Calendar.tga", + "from": "DragonUI/Textures/Minimap/Calendar.tga", + "sha1": "67bdc26a34c53b41dd4d2fbbe916b3c4da069e91", + "size": 597125 + }, + { + "path": "DragonUI/Textures/Minimap/GuildBanner.blp", + "from": "DragonUI/Textures/Minimap/GuildBanner.blp", + "sha1": "040217dc92ff0529b988bb52e6ae8ea3a63596cf", + "size": 88596 + }, + { + "path": "DragonUI/Textures/Minimap/MinimapBorder.blp", + "from": "DragonUI/Textures/Minimap/MinimapBorder.blp", + "sha1": "a9144107ac98508ac5550e15837d5c4c066bff1b", + "size": 88596 + }, + { + "path": "DragonUI/Textures/Minimap/Tracking.tga", + "from": "DragonUI/Textures/Minimap/Tracking.tga", + "sha1": "2bdeb24a92481f2f75772f0025a71f09ad30f62a", + "size": 34699 + }, + { + "path": "DragonUI/Textures/Minimap/blip_blank.tga", + "from": "DragonUI/Textures/Minimap/blip_blank.tga", + "sha1": "4e7901ebc6df9c05b746be82dd6a9fd51631281b", + "size": 262162 + }, + { + "path": "DragonUI/Textures/Minimap/border_buttons.tga", + "from": "DragonUI/Textures/Minimap/border_buttons.tga", + "sha1": "fab983ad2b6777fc12af63b8643ff83af0670c5d", + "size": 16923 + }, + { + "path": "DragonUI/Textures/Minimap/collector_toggle.tga", + "from": "DragonUI/Textures/Minimap/collector_toggle.tga", + "sha1": "08d5ab9a9ad383fea4ac71acb52b1f29ab90dc9b", + "size": 4140 + }, + { + "path": "DragonUI/Textures/Minimap/collector_toggle_square.tga", + "from": "DragonUI/Textures/Minimap/collector_toggle_square.tga", + "sha1": "746a607268b6a6634494d3eee1337cd200a1d8eb", + "size": 7125 + }, + { + "path": "DragonUI/Textures/Minimap/forever_circle.tga", + "from": "DragonUI/Textures/Minimap/forever_circle.tga", + "sha1": "0b195e1bf4a3fa7ba2bdd7d472051a009296cc72", + "size": 185352 + }, + { + "path": "DragonUI/Textures/Minimap/forever_diel.blp", + "from": "DragonUI/Textures/Minimap/forever_diel.blp", + "sha1": "db9e9cc3c3659609658732945f75c0cb473f5ae9", + "size": 175936 + }, + { + "path": "DragonUI/Textures/Minimap/forever_mask.tga", + "from": "DragonUI/Textures/Minimap/forever_mask.tga", + "sha1": "8af065cf96c50716dbacebeb6a0a49ec13aaa2d5", + "size": 262188 + }, + { + "path": "DragonUI/Textures/Minimap/forever_pointer.tga", + "from": "DragonUI/Textures/Minimap/forever_pointer.tga", + "sha1": "51a51781159948213671e7f173871dcee8a0c9b1", + "size": 39844 + }, + { + "path": "DragonUI/Textures/Minimap/forever_square_frame.tga", + "from": "DragonUI/Textures/Minimap/forever_square_frame.tga", + "sha1": "2b57e86247c3316569b5de9963e29744ee91d1b7", + "size": 178434 + }, + { + "path": "DragonUI/Textures/Minimap/forever_square_frame_rounded.tga", + "from": "DragonUI/Textures/Minimap/forever_square_frame_rounded.tga", + "sha1": "bff110062016a472e042e91cda61548bfdb5c117", + "size": 175182 + }, + { + "path": "DragonUI/Textures/Minimap/forever_square_pointer.tga", + "from": "DragonUI/Textures/Minimap/forever_square_pointer.tga", + "sha1": "42b12898f249886008b996167b40e89f1a3d5609", + "size": 40294 + }, + { + "path": "DragonUI/Textures/Minimap/objecticons.tga", + "from": "DragonUI/Textures/Minimap/objecticons.tga", + "sha1": "92201d1c7854902d07ee404961a4e3b3101c43a4", + "size": 262683 + }, + { + "path": "DragonUI/Textures/Minimap/poi-corpse.tga", + "from": "DragonUI/Textures/Minimap/poi-corpse.tga", + "sha1": "8b35a29714dbee4952a090a247ebbbd3e37dac53", + "size": 16923 + }, + { + "path": "DragonUI/Textures/Minimap/poi-guard.tga", + "from": "DragonUI/Textures/Minimap/poi-guard.tga", + "sha1": "95e257a50b554de7b063b21fdb4fc5024894c998", + "size": 16923 + }, + { + "path": "DragonUI/Textures/Minimap/poi-player.tga", + "from": "DragonUI/Textures/Minimap/poi-player.tga", + "sha1": "59d48b7cb0051e0652f6cb52e6f05926e24ffdb0", + "size": 16923 + }, + { + "path": "DragonUI/Textures/Minimap/poi-static.tga", + "from": "DragonUI/Textures/Minimap/poi-static.tga", + "sha1": "ca6aa9041bcec86e454fe11eb98b01c2776fa9e5", + "size": 16923 + }, + { + "path": "DragonUI/Textures/Minimap/uiminimapborder.tga", + "from": "DragonUI/Textures/Minimap/uiminimapborder.tga", + "sha1": "5ec0a39d1841a7b2ffc15f5a79d5a30743d22d14", + "size": 42955 + }, + { + "path": "DragonUI/Textures/Minimap/uiminimapmask.tga", + "from": "DragonUI/Textures/Minimap/uiminimapmask.tga", + "sha1": "035894dd8cbd7743162200f86a92f6a0d8bb8755", + "size": 262683 + }, + { + "path": "DragonUI/Textures/Minimap/uiminimapsquareborder.tga", + "from": "DragonUI/Textures/Minimap/uiminimapsquareborder.tga", + "sha1": "dc234512fe2d7b1d7ad578b2b00152a3bcc0e394", + "size": 124356 + }, + { + "path": "DragonUI/Textures/Nameplates/Quests/Kill/kill_elite.tga", + "from": "DragonUI/Textures/Nameplates/Quests/Kill/kill_elite.tga", + "sha1": "ef137218a0b02fc9ddbd245bd06ca71787faeceb", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Quests/Kill/kill_skull.tga", + "from": "DragonUI/Textures/Nameplates/Quests/Kill/kill_skull.tga", + "sha1": "33b48ef517b1c891812836c077ce9e643ed7d0b2", + "size": 4140 + }, + { + "path": "DragonUI/Textures/Nameplates/Quests/Kill/kill_sword.tga", + "from": "DragonUI/Textures/Nameplates/Quests/Kill/kill_sword.tga", + "sha1": "c6dbedaedc17f10064d10e443c5416825161c3d4", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/Quests/Loot/loot_bag.tga", + "from": "DragonUI/Textures/Nameplates/Quests/Loot/loot_bag.tga", + "sha1": "22c2c08484180affe3346192981bb5363ec37052", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/Quests/Loot/loot_chest.tga", + "from": "DragonUI/Textures/Nameplates/Quests/Loot/loot_chest.tga", + "sha1": "e34c2f6ee5e672ae0a8dede643b740695263ce60", + "size": 4140 + }, + { + "path": "DragonUI/Textures/Nameplates/Quests/quest_pointer.tga", + "from": "DragonUI/Textures/Nameplates/Quests/quest_pointer.tga", + "sha1": "fc22e3c64386436a2b9b79c8d7ac02be2e7bfd2d", + "size": 6686 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/aggro-flare.tga", + "from": "DragonUI/Textures/Nameplates/Retail/aggro-flare.tga", + "sha1": "73c3f0f234d44439c8df074b9507c72de3c4023f", + "size": 32812 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/cast-fill-channel.tga", + "from": "DragonUI/Textures/Nameplates/Retail/cast-fill-channel.tga", + "sha1": "4ef924d4b51cc3f85c9b53fcb375e06248aeb7c9", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/cast-fill-interrupted.tga", + "from": "DragonUI/Textures/Nameplates/Retail/cast-fill-interrupted.tga", + "sha1": "dce02ad43a474ba54dfcdb1b7070595ca215cda6", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/cast-fill-standard.tga", + "from": "DragonUI/Textures/Nameplates/Retail/cast-fill-standard.tga", + "sha1": "da267a9223ebeddbf96cf41ea1065ee868da4857", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/cast-fill-uninterruptible.tga", + "from": "DragonUI/Textures/Nameplates/Retail/cast-fill-uninterruptible.tga", + "sha1": "984ae6baecee928b8358be63584340345dd3b007", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/castbar-atlas.blp", + "from": "DragonUI/Textures/Nameplates/Retail/castbar-atlas.blp", + "sha1": "c438e331261f404ed9baf6eef4f6eee59f5f29a0", + "size": 525460 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/nameplate-atlas.blp", + "from": "DragonUI/Textures/Nameplates/Retail/nameplate-atlas.blp", + "sha1": "aca04acca13846eccf897e03af74ded60275bbcc", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/nameplate-bake.blp", + "from": "DragonUI/Textures/Nameplates/Retail/nameplate-bake.blp", + "sha1": "87d1e79e411ec4cfddedc108fc23e2a74b4bdcea", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Nameplates/Retail/nameplate-bar.blp", + "from": "DragonUI/Textures/Nameplates/Retail/nameplate-bar.blp", + "sha1": "e1064a19908c8cbc07f3f83bafc0eb18abad7f49", + "size": 132244 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Cleansing Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Cleansing Totem.tga", + "sha1": "d4bc692c7d887d974568869603e7f65439269c41", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Earth Elemental Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Earth Elemental Totem.tga", + "sha1": "eef171f299477e651f21e3b71569d20e6525ce01", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Earthbind Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Earthbind Totem.tga", + "sha1": "976595d71ac7bf3ee9d307d6116c50b78d1ecf97", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Fire Elemental Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Fire Elemental Totem.tga", + "sha1": "5b473c03328d6a963fbe8020970465627a4fbaf2", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Fire Nova Totem IX.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Fire Nova Totem IX.tga", + "sha1": "6678e6871a1e18cd96729d44d243d4560b1c071b", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Fire Resistance Totem VI.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Fire Resistance Totem VI.tga", + "sha1": "e79ca65e99e16b2fa5ae83f8d0528041bf1deb45", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Flametongue Totem VIII.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Flametongue Totem VIII.tga", + "sha1": "e17699cc3a080480457fd82694202747285d1034", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Frost Resistance Totem VI.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Frost Resistance Totem VI.tga", + "sha1": "d2fd846dad48794d1d1fba21da7a02f2149830a1", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Grounding Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Grounding Totem.tga", + "sha1": "3a938ab0e43dede44c7f8db394a07494f30e5c27", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Healing Stream Totem IX.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Healing Stream Totem IX.tga", + "sha1": "46d175753c1e2ee081d75944c4a7f7bc418208da", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Magma Totem VII.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Magma Totem VII.tga", + "sha1": "4d57192ecdd8c49766fcb8fc9099d8a024a5c51c", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Mana Spring Totem VIII.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Mana Spring Totem VIII.tga", + "sha1": "1a10ef8d269670920958dd2b011229a701be679f", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Mana Tide Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Mana Tide Totem.tga", + "sha1": "dd2c3c8c822694f9d833c4374b264dc8b91c7e14", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Nature Resistance Totem VI.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Nature Resistance Totem VI.tga", + "sha1": "c9e207d9fafe218f1181ebd91382d1f1eccee2b6", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Searing Totem X.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Searing Totem X.tga", + "sha1": "fb99e1f025f053590ed1e3ae3368b7dea2784c24", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Sentry Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Sentry Totem.tga", + "sha1": "1cb32d80fd922337cee1f05b761a2288461ac045", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Stoneclaw Totem X.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Stoneclaw Totem X.tga", + "sha1": "5cabc60dd14846e66a58a9ac49525f562c738757", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Stoneskin Totem X.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Stoneskin Totem X.tga", + "sha1": "50b10b0a34a4d14517fd9a0041fd8f0c081d6698", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Strength of Earth Totem VIII.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Strength of Earth Totem VIII.tga", + "sha1": "bd825dcc57d2e4b014b01f73367ec02bd380c755", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Totem of Wrath IV.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Totem of Wrath IV.tga", + "sha1": "f1cd21f64d28a419418b3024fba35518dbe837cd", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Tremor Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Tremor Totem.tga", + "sha1": "9da6281c34337f7bf1bfd117235f092dba0a4cb7", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Windfury Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Windfury Totem.tga", + "sha1": "ffbb0a819c159d19e680361f6afd2d281f7294c0", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/Totem/Wrath of Air Totem.tga", + "from": "DragonUI/Textures/Nameplates/Totem/Wrath of Air Totem.tga", + "sha1": "91ac87fb092f1d8dffd79a6789e97bcdb8ec10f8", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/arrowleft.tga", + "from": "DragonUI/Textures/Nameplates/arrowleft.tga", + "sha1": "2e3733a448bb6c0a373b6dfd93d6c48a611876b8", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/arrowright.tga", + "from": "DragonUI/Textures/Nameplates/arrowright.tga", + "sha1": "caf330e1aa6037771121d67aa816756f9420f9f0", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-bar.tga", + "from": "DragonUI/Textures/Nameplates/bar-bar.tga", + "sha1": "2bda94cc01e6872035173fb174ee3b5c698bc63a", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-bg-health.tga", + "from": "DragonUI/Textures/Nameplates/bar-bg-health.tga", + "sha1": "2752154efe50cc3619c9bff33d53365aa8320889", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-bg-power.tga", + "from": "DragonUI/Textures/Nameplates/bar-bg-power.tga", + "sha1": "2752154efe50cc3619c9bff33d53365aa8320889", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-bg.tga", + "from": "DragonUI/Textures/Nameplates/bar-bg.tga", + "sha1": "d016d01093b04c3ef0e43e56e2b880c4f3cf6e47", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-border.tga", + "from": "DragonUI/Textures/Nameplates/bar-border.tga", + "sha1": "3979e75610adf0d1451d42783238e3d4a5c94edb", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-fill.tga", + "from": "DragonUI/Textures/Nameplates/bar-fill.tga", + "sha1": "2c23c672e0dafdb55a62f5ad23a73fbcec68954f", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-mask.tga", + "from": "DragonUI/Textures/Nameplates/bar-mask.tga", + "sha1": "ce9e9cb857c64525b0eec797a008ea31cc8bfb1e", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/bar-target.tga", + "from": "DragonUI/Textures/Nameplates/bar-target.tga", + "sha1": "f6c84e4401856db26278d82dec6651ff1d025bdc", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/combat-glow.tga", + "from": "DragonUI/Textures/Nameplates/combat-glow.tga", + "sha1": "08f822959ce7254b927d28919f82dc42ceec2cc5", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Nameplates/combo-1.tga", + "from": "DragonUI/Textures/Nameplates/combo-1.tga", + "sha1": "604edd04b975c3f2736e76c92f63304f8a893b3c", + "size": 2987 + }, + { + "path": "DragonUI/Textures/Nameplates/combo-2.tga", + "from": "DragonUI/Textures/Nameplates/combo-2.tga", + "sha1": "6692fa6da8baa90f61b24c81f53055dce5edd31b", + "size": 3713 + }, + { + "path": "DragonUI/Textures/Nameplates/combo-3.tga", + "from": "DragonUI/Textures/Nameplates/combo-3.tga", + "sha1": "9af5c8679f3cde1a296459e77a73837a710f2d3d", + "size": 4453 + }, + { + "path": "DragonUI/Textures/Nameplates/combo-4.tga", + "from": "DragonUI/Textures/Nameplates/combo-4.tga", + "sha1": "2cbb2728e9b933e3198cbe07a0a6ea977cabcd09", + "size": 5192 + }, + { + "path": "DragonUI/Textures/Nameplates/combo-5.tga", + "from": "DragonUI/Textures/Nameplates/combo-5.tga", + "sha1": "e72325dffb0f4e0ae0731e5b8fd34d0ea155c9ad", + "size": 8236 + }, + { + "path": "DragonUI/Textures/Nameplates/cooldown-square-swirl-edge.tga", + "from": "DragonUI/Textures/Nameplates/cooldown-square-swirl-edge.tga", + "sha1": "7fc419baec4c8f80f36ae304709b99b81de6e2a6", + "size": 631191 + }, + { + "path": "DragonUI/Textures/Nameplates/elite-icon-old.tga", + "from": "DragonUI/Textures/Nameplates/elite-icon-old.tga", + "sha1": "d332c3bbce38b7fc7557c747b9f89421bf7449a3", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/elite-icon.tga", + "from": "DragonUI/Textures/Nameplates/elite-icon.tga", + "sha1": "4bd6a8751640e361a41253924b0af494667e7d0b", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/rare-icon-old.tga", + "from": "DragonUI/Textures/Nameplates/rare-icon-old.tga", + "sha1": "159dec76669d44012a91c12429ea17dcfcef2353", + "size": 16428 + }, + { + "path": "DragonUI/Textures/Nameplates/rare-icon.tga", + "from": "DragonUI/Textures/Nameplates/rare-icon.tga", + "sha1": "d1dec07d12268b17422d37bb16941edebef2cd14", + "size": 16428 + }, + { + "path": "DragonUI/Textures/NewLevelUp/levelup.blp", + "from": "DragonUI/Textures/NewLevelUp/levelup.blp", + "sha1": "49ccf62c3d2e1f58b42ddc91e18a756cb5832973", + "size": 350724 + }, + { + "path": "DragonUI/Textures/NewLevelUp/levelup_retail.tga", + "from": "DragonUI/Textures/NewLevelUp/levelup_retail.tga", + "sha1": "adf1c9234a45b156c87cfb5ac8bf5b8dd3389aad", + "size": 14861 + }, + { + "path": "DragonUI/Textures/PersonalResource/bar_bottom.blp", + "from": "DragonUI/Textures/PersonalResource/bar_bottom.blp", + "sha1": "5bcdb4030cfdb6f6daac5a8c165e5c662efdafff", + "size": 23184 + }, + { + "path": "DragonUI/Textures/PersonalResource/bar_middle.blp", + "from": "DragonUI/Textures/PersonalResource/bar_middle.blp", + "sha1": "3c791c76bd532ad9b2035fbd63cfa6ac5f322205", + "size": 23184 + }, + { + "path": "DragonUI/Textures/PersonalResource/bar_top.blp", + "from": "DragonUI/Textures/PersonalResource/bar_top.blp", + "sha1": "4ec36246c931f1f891cb1f58cb4bec5bf95d2e5d", + "size": 44944 + }, + { + "path": "DragonUI/Textures/PersonalResource/bg.blp", + "from": "DragonUI/Textures/PersonalResource/bg.blp", + "sha1": "4efd63989532845dac8513468477a226ce25859a", + "size": 175952 + }, + { + "path": "DragonUI/Textures/PersonalResource/fullalert.blp", + "from": "DragonUI/Textures/PersonalResource/fullalert.blp", + "sha1": "28d69f1c6c29cdb2130ebd25a9bbcdc8c7688414", + "size": 9364 + }, + { + "path": "DragonUI/Textures/PersonalResource/glow.blp", + "from": "DragonUI/Textures/PersonalResource/glow.blp", + "sha1": "3f10f280d9d849cc2f60403ed44dadd81fca04bb", + "size": 1564 + }, + { + "path": "DragonUI/Textures/PersonalResource/healfill.blp", + "from": "DragonUI/Textures/PersonalResource/healfill.blp", + "sha1": "f43f52a14b1c1f0b089ec3ce6210b049a022f4b6", + "size": 23036 + }, + { + "path": "DragonUI/Textures/PersonalResource/rim.blp", + "from": "DragonUI/Textures/PersonalResource/rim.blp", + "sha1": "1e09932875be020f2ae2132825dbc677eb578e9a", + "size": 175952 + }, + { + "path": "DragonUI/Textures/PersonalResource/statusbar.blp", + "from": "DragonUI/Textures/PersonalResource/statusbar.blp", + "sha1": "64092e715ea1b66dba6fadadd7e8c4b152957ede", + "size": 1532 + }, + { + "path": "DragonUI/Textures/Professions/Backdrop1.blp", + "from": "DragonUI/Textures/Professions/Backdrop1.blp", + "sha1": "2551fb86b894fc0de9face0940dd9e3c3daa7c35", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Backdrop2.blp", + "from": "DragonUI/Textures/Professions/Backdrop2.blp", + "sha1": "7e0d038c9929901761f7e0a67729551cf67baf90", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Banners.blp", + "from": "DragonUI/Textures/Professions/Banners.blp", + "sha1": "b315d2623ba31a98babe2c8d285cba58cdcb915c", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/CardBase.blp", + "from": "DragonUI/Textures/Professions/CardBase.blp", + "sha1": "46bf86a0c8eaab7d2aaac73627822c53aae667d0", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings1.blp", + "from": "DragonUI/Textures/Professions/Drawings1.blp", + "sha1": "74895012beecf2b2a396d922b06a1e04fd201e71", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings2.blp", + "from": "DragonUI/Textures/Professions/Drawings2.blp", + "sha1": "538cefaad8670efdaa4005070b051de2f19c970b", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings3.blp", + "from": "DragonUI/Textures/Professions/Drawings3.blp", + "sha1": "8622d74e85ec1f28d93e9dd53d648377eb67e598", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings4.blp", + "from": "DragonUI/Textures/Professions/Drawings4.blp", + "sha1": "5be558471c58ef4fbdff091618ca1a1c1637fd4b", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings5.blp", + "from": "DragonUI/Textures/Professions/Drawings5.blp", + "sha1": "6a9b3bb46a7c4910c37697c1f9f655f39cac8d57", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings6.blp", + "from": "DragonUI/Textures/Professions/Drawings6.blp", + "sha1": "7862f72455318aead1c9373e03a985ce9ffe6a3d", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings7.blp", + "from": "DragonUI/Textures/Professions/Drawings7.blp", + "sha1": "0fcad5fbcbd747beaffe3044cd972a4dcd499cd4", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Drawings8.blp", + "from": "DragonUI/Textures/Professions/Drawings8.blp", + "sha1": "6845059ab99950a955c5dc1ff3f71b0c067b6a53", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Professions/Fills.tga", + "from": "DragonUI/Textures/Professions/Fills.tga", + "sha1": "46aa46647e64fb988ee3792302b44356854d4598", + "size": 1669470 + }, + { + "path": "DragonUI/Textures/Professions/FxAddAlchemy.blp", + "from": "DragonUI/Textures/Professions/FxAddAlchemy.blp", + "sha1": "087dc30e545e136fe0efa0006a3be38da23cdfa4", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddAlchemy_r.blp", + "from": "DragonUI/Textures/Professions/FxAddAlchemy_r.blp", + "sha1": "f871f8f93d58e240982fb5198ccb2b7f630e8e24", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddBlacksmithing.blp", + "from": "DragonUI/Textures/Professions/FxAddBlacksmithing.blp", + "sha1": "944f6ee27bc4bf7146b0cae0b740d9a0a699367d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddBlacksmithing_r.blp", + "from": "DragonUI/Textures/Professions/FxAddBlacksmithing_r.blp", + "sha1": "d3f5647f062e2bce74673d3af55e122ceb13b903", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddCooking.blp", + "from": "DragonUI/Textures/Professions/FxAddCooking.blp", + "sha1": "6195e1736e3e95047146c9affdd36cdac15a9051", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddCooking_r.blp", + "from": "DragonUI/Textures/Professions/FxAddCooking_r.blp", + "sha1": "739d0a7b5b3e07d3e1edf04d0192a3ef211fbcc4", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddEnchanting.blp", + "from": "DragonUI/Textures/Professions/FxAddEnchanting.blp", + "sha1": "701b45be323ffdee2590d699d4de30e3428afe77", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddEnchanting2.blp", + "from": "DragonUI/Textures/Professions/FxAddEnchanting2.blp", + "sha1": "95a0607fd078374cee44135ff84e5e59aace86b3", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddEnchanting2_r.blp", + "from": "DragonUI/Textures/Professions/FxAddEnchanting2_r.blp", + "sha1": "d7bcd6551f2ec35921c37c8aec5f877139d0b310", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddEnchanting_r.blp", + "from": "DragonUI/Textures/Professions/FxAddEnchanting_r.blp", + "sha1": "e5a089e9418a6ba06f2e18e6b0d4c6724b517457", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddEngineering.blp", + "from": "DragonUI/Textures/Professions/FxAddEngineering.blp", + "sha1": "ffa775be7345e9c8f8741a7f6348d4938e5ef8d6", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddEngineering_r.blp", + "from": "DragonUI/Textures/Professions/FxAddEngineering_r.blp", + "sha1": "3be06aa47ec2b3b9a7170687cdd897bfb77f9ffd", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddFirstAid.blp", + "from": "DragonUI/Textures/Professions/FxAddFirstAid.blp", + "sha1": "35ee0d842350f2fc7cc408496687ee09642ed3b3", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddFirstAid_r.blp", + "from": "DragonUI/Textures/Professions/FxAddFirstAid_r.blp", + "sha1": "e1ffbcb960a99a7029a568ae08cbc645d2153269", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddFishing.blp", + "from": "DragonUI/Textures/Professions/FxAddFishing.blp", + "sha1": "79326426b967de16a3b1c23665bae963e552bc5e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddFishing_r.blp", + "from": "DragonUI/Textures/Professions/FxAddFishing_r.blp", + "sha1": "5c2de70bfff8145995b3ee562282a5fa4ceeb745", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddHerbalism.blp", + "from": "DragonUI/Textures/Professions/FxAddHerbalism.blp", + "sha1": "6c3d9cb36948b36f3e0631acb22122c5d9af1f3a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddHerbalism_r.blp", + "from": "DragonUI/Textures/Professions/FxAddHerbalism_r.blp", + "sha1": "758413736d7d7730c1c1315b7f94d13dfb3a65bf", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddInscription.blp", + "from": "DragonUI/Textures/Professions/FxAddInscription.blp", + "sha1": "e21e5f0845aac37d7d8661c7974704e47395c68e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddInscription_r.blp", + "from": "DragonUI/Textures/Professions/FxAddInscription_r.blp", + "sha1": "820681c8297ec7dd6d24e73ad027e04a4f3055ef", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddJewelcrafting.blp", + "from": "DragonUI/Textures/Professions/FxAddJewelcrafting.blp", + "sha1": "b7bfefc914f89cada84d756942d7139f4112105e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddJewelcrafting_r.blp", + "from": "DragonUI/Textures/Professions/FxAddJewelcrafting_r.blp", + "sha1": "2905f39a84e95285e6e9d49517b9c946593324c2", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddLeatherworking.blp", + "from": "DragonUI/Textures/Professions/FxAddLeatherworking.blp", + "sha1": "f9ead897df071604e9a607dbb1bb29ef94dd35d3", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddLeatherworking_r.blp", + "from": "DragonUI/Textures/Professions/FxAddLeatherworking_r.blp", + "sha1": "1b3a313296edc559a59a604aaa0726d2d1ef8b7a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddMining.blp", + "from": "DragonUI/Textures/Professions/FxAddMining.blp", + "sha1": "5dcc07ddc303a7877397a471b7e7391ca1229859", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddMining_r.blp", + "from": "DragonUI/Textures/Professions/FxAddMining_r.blp", + "sha1": "8540309acd314bd2645300630d25fef2b1c5e1ca", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddSkinning.blp", + "from": "DragonUI/Textures/Professions/FxAddSkinning.blp", + "sha1": "db079efd9e9312b0c172f22e7bd7f7c65281471c", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddSkinning_r.blp", + "from": "DragonUI/Textures/Professions/FxAddSkinning_r.blp", + "sha1": "8b7b517184b656b2bffa37d2c4858b92adac6665", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddTailoring.blp", + "from": "DragonUI/Textures/Professions/FxAddTailoring.blp", + "sha1": "e3c3033353b80b476188a32f442cef32dd56c460", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxAddTailoring_r.blp", + "from": "DragonUI/Textures/Professions/FxAddTailoring_r.blp", + "sha1": "8159e26c0810fa05110905029e9b0dfde2bba11c", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModAlchemy.blp", + "from": "DragonUI/Textures/Professions/FxModAlchemy.blp", + "sha1": "3f1c88eb693babee2630778470145d465264a580", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModAlchemy_r.blp", + "from": "DragonUI/Textures/Professions/FxModAlchemy_r.blp", + "sha1": "6ab5d763848308229dda6bc6f954f76d8d4092c6", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModBlacksmithing.blp", + "from": "DragonUI/Textures/Professions/FxModBlacksmithing.blp", + "sha1": "28c488e5d45feae2077ab450f4848eb1ef16c93a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModBlacksmithing_r.blp", + "from": "DragonUI/Textures/Professions/FxModBlacksmithing_r.blp", + "sha1": "af81870d54b3f5fe5f6308265087203375e83e12", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModCooking.blp", + "from": "DragonUI/Textures/Professions/FxModCooking.blp", + "sha1": "31a4c58afd6f8b6afe4a5b2cea71b0b98a59ef98", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModCooking_r.blp", + "from": "DragonUI/Textures/Professions/FxModCooking_r.blp", + "sha1": "5380a79baf469654f6a4553077e4bb380c251512", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModEnchanting.blp", + "from": "DragonUI/Textures/Professions/FxModEnchanting.blp", + "sha1": "b4e78c12f972a41e23779f88c7d59baf9383226f", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModEnchanting2.blp", + "from": "DragonUI/Textures/Professions/FxModEnchanting2.blp", + "sha1": "3b51293399093403bf3cf21f35e4a852adb05931", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModEnchanting2_r.blp", + "from": "DragonUI/Textures/Professions/FxModEnchanting2_r.blp", + "sha1": "34002450cd33f62f7fe6352b69a7ad39bc476083", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModEnchanting_r.blp", + "from": "DragonUI/Textures/Professions/FxModEnchanting_r.blp", + "sha1": "0aa96dda80eff74e53d7baf18b73df7036d9e786", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModEngineering.blp", + "from": "DragonUI/Textures/Professions/FxModEngineering.blp", + "sha1": "62e4d4fb7fbee02c1cbe008769ac9efde0d0c252", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModEngineering_r.blp", + "from": "DragonUI/Textures/Professions/FxModEngineering_r.blp", + "sha1": "7bcf642f3f8a5c91c7c3e8d1a1f7ca377ed78068", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModFirstAid.blp", + "from": "DragonUI/Textures/Professions/FxModFirstAid.blp", + "sha1": "5fddaf021d64595854331cb6e66bf3d19c9b73dc", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModFirstAid_r.blp", + "from": "DragonUI/Textures/Professions/FxModFirstAid_r.blp", + "sha1": "186db2e3eb923f34ae579820390ed3bd765b7cd5", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModFishing.blp", + "from": "DragonUI/Textures/Professions/FxModFishing.blp", + "sha1": "355dbc5ecec35a35f4524fc9c74a1c452dcdf13e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModFishing_r.blp", + "from": "DragonUI/Textures/Professions/FxModFishing_r.blp", + "sha1": "33ecece253c4977b45748441bc6c5f8da94c10f3", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModHerbalism.blp", + "from": "DragonUI/Textures/Professions/FxModHerbalism.blp", + "sha1": "79f2b5629fc64b37e54a24db962ca34564558506", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModHerbalism_r.blp", + "from": "DragonUI/Textures/Professions/FxModHerbalism_r.blp", + "sha1": "051f9f382e7395dd664057b7d05177ebd419a647", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModInscription.blp", + "from": "DragonUI/Textures/Professions/FxModInscription.blp", + "sha1": "20eced7a9c8028d696d408889324a8ac56c2b5e6", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModInscription_r.blp", + "from": "DragonUI/Textures/Professions/FxModInscription_r.blp", + "sha1": "b7db8d286d91ad22847d1382dbf2d111ba0fbbc5", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModJewelcrafting.blp", + "from": "DragonUI/Textures/Professions/FxModJewelcrafting.blp", + "sha1": "004981baa9422e03490390c606b034aac5b524c1", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModJewelcrafting_r.blp", + "from": "DragonUI/Textures/Professions/FxModJewelcrafting_r.blp", + "sha1": "93203808dd86252021523a2a442b6324792a0a6e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModLeatherworking.blp", + "from": "DragonUI/Textures/Professions/FxModLeatherworking.blp", + "sha1": "cf59229df287e10bd3b1a595268a41659bce4166", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModLeatherworking_r.blp", + "from": "DragonUI/Textures/Professions/FxModLeatherworking_r.blp", + "sha1": "61e5b6de9148d3c7f8cf510af038a0c12e91d227", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModMining.blp", + "from": "DragonUI/Textures/Professions/FxModMining.blp", + "sha1": "231b9292c4a1996f592a52332cf484f6ba93c1e2", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModMining_r.blp", + "from": "DragonUI/Textures/Professions/FxModMining_r.blp", + "sha1": "3d524df4250f53b3cb7beb529cbfaaa6e6b72cfb", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModSkinning.blp", + "from": "DragonUI/Textures/Professions/FxModSkinning.blp", + "sha1": "9248e1f64e790a045f3aa8114b4ed8f49618d83e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModSkinning_r.blp", + "from": "DragonUI/Textures/Professions/FxModSkinning_r.blp", + "sha1": "a2d4423c4c9fb85bd2e13464c588399d3c9eda51", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModTailoring.blp", + "from": "DragonUI/Textures/Professions/FxModTailoring.blp", + "sha1": "c3ccf9b0d59c00eb868847b96647bb7e16e7805e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/FxModTailoring_r.blp", + "from": "DragonUI/Textures/Professions/FxModTailoring_r.blp", + "sha1": "2f8d018edf62af51614e490dcc54edbf0d5ec173", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Professions/MicroButton.tga", + "from": "DragonUI/Textures/Professions/MicroButton.tga", + "sha1": "c461142e64c22a2cf7d4bf5e6e7244fca99e500e", + "size": 49540 + }, + { + "path": "DragonUI/Textures/Professions/OverviewIcon.blp", + "from": "DragonUI/Textures/Professions/OverviewIcon.blp", + "sha1": "42cc1bc5aabcb2c3c7b82da5e256cab163dc7965", + "size": 23016 + }, + { + "path": "DragonUI/Textures/Professions/ProfessionsUI.tga", + "from": "DragonUI/Textures/Professions/ProfessionsUI.tga", + "sha1": "77519d5d62d1b9a9132fa0960116f259efc86581", + "size": 477119 + }, + { + "path": "DragonUI/Textures/Professions/ProfessionsUI2.tga", + "from": "DragonUI/Textures/Professions/ProfessionsUI2.tga", + "sha1": "2f54db8911293bfd01bdebe37de982e547510bcf", + "size": 253102 + }, + { + "path": "DragonUI/Textures/Quest/activequesticon.blp", + "from": "DragonUI/Textures/Quest/activequesticon.blp", + "sha1": "f6f47aac2f5d4e8c7bab57dfcb42b09c22b21ac8", + "size": 1540 + }, + { + "path": "DragonUI/Textures/Quest/availablequesticon.blp", + "from": "DragonUI/Textures/Quest/availablequesticon.blp", + "sha1": "3d49ddb6997c17893b7b924f317eec59d18b683f", + "size": 1540 + }, + { + "path": "DragonUI/Textures/Quest/inprogressquesticons.blp", + "from": "DragonUI/Textures/Quest/inprogressquesticons.blp", + "sha1": "5cfb76d94b01829424e31b1c96f1048e3f5d2516", + "size": 17556 + }, + { + "path": "DragonUI/Textures/Quest/repeatablequesticon.blp", + "from": "DragonUI/Textures/Quest/repeatablequesticon.blp", + "sha1": "ca6fdb3d2116b990dfdfcc51357ecbcfcc951cc1", + "size": 1540 + }, + { + "path": "DragonUI/Textures/RacePortraits/BloodElf_Female.blp", + "from": "DragonUI/Textures/RacePortraits/BloodElf_Female.blp", + "sha1": "ef20eaad1e2d0c2a0d3db4686de927b7ab8f272b", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/BloodElf_Male.blp", + "from": "DragonUI/Textures/RacePortraits/BloodElf_Male.blp", + "sha1": "0bbd794675f70ca3595221198b29bfbaf82606df", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Draenei_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Draenei_Female.blp", + "sha1": "6d49b604d180039a187d1bcc700fa08b7d29b11c", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Draenei_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Draenei_Male.blp", + "sha1": "7dbbc0f03406d9ed1c1c78a4dbbd4cd76a82d26c", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Dwarf_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Dwarf_Female.blp", + "sha1": "f3262647a13a49ac38c8c8b6279c30ab4e5b1548", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Dwarf_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Dwarf_Male.blp", + "sha1": "6ee5ebe4ca4ebd6e828aea337d436106fbc7a510", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Gnome_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Gnome_Female.blp", + "sha1": "8d006ce634db5daa147338e5f08eccc439adc136", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Gnome_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Gnome_Male.blp", + "sha1": "ba4bab6fef33133b374ea044b51b5d38961f6e63", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Human_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Human_Female.blp", + "sha1": "0bf22502d2b262f6bd313aa5735e6973d27bb469", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Human_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Human_Male.blp", + "sha1": "f8d857ed652dd107bb6ba6a56324eb6d565f189d", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/NightElf_Female.blp", + "from": "DragonUI/Textures/RacePortraits/NightElf_Female.blp", + "sha1": "ec75aff8c94e98454e6cdd5ee5827ed677bc5d8c", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/NightElf_Male.blp", + "from": "DragonUI/Textures/RacePortraits/NightElf_Male.blp", + "sha1": "1ccedf39d9cd2e7820f7736d1f7e66fd851bb074", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Orc_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Orc_Female.blp", + "sha1": "cf38d6a4e6e30623decedc817fd7e697b03bec25", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Orc_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Orc_Male.blp", + "sha1": "a96aadb1cb9352ebaebb6f1a7e1c1d28655166e4", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Tauren_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Tauren_Female.blp", + "sha1": "c632856529d4914f66eac714764bd0b370d8ba39", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Tauren_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Tauren_Male.blp", + "sha1": "760f5c402dd1ea6a526722894cf7212edd59b3a7", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Troll_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Troll_Female.blp", + "sha1": "36580ddee301ff88bb6fc2d142ac81ffd4cca633", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Troll_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Troll_Male.blp", + "sha1": "71004b7beb96aa06b51fd7d6d9ffd74134bf23fd", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Undead_Female.blp", + "from": "DragonUI/Textures/RacePortraits/Undead_Female.blp", + "sha1": "f2b4b6ba6dec5906ea603ee9a1d1de4b1286ee8c", + "size": 88552 + }, + { + "path": "DragonUI/Textures/RacePortraits/Undead_Male.blp", + "from": "DragonUI/Textures/RacePortraits/Undead_Male.blp", + "sha1": "33c2a9b0ede3592081c5b4d4b0840164c80e1915", + "size": 88552 + }, + { + "path": "DragonUI/Textures/Reputation/Rep.tga", + "from": "DragonUI/Textures/Reputation/Rep.tga", + "sha1": "d586b3315ff9651fd3a851946d02266e88badda0", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Reputation/RepGreen.tga", + "from": "DragonUI/Textures/Reputation/RepGreen.tga", + "sha1": "619d2ebb68990bc48a8e32492048aab14fa0e900", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Reputation/RepOrange.tga", + "from": "DragonUI/Textures/Reputation/RepOrange.tga", + "sha1": "927fae27819a93c986f880aa0da031dc54dc1461", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Reputation/RepRed.tga", + "from": "DragonUI/Textures/Reputation/RepRed.tga", + "sha1": "3ecab26e0fc89c4611ace99680f75d34df7c1005", + "size": 65580 + }, + { + "path": "DragonUI/Textures/Reputation/RepYellow.tga", + "from": "DragonUI/Textures/Reputation/RepYellow.tga", + "sha1": "c762ec6d8f7885ece3f17f85584b048b9ef694f8", + "size": 131116 + }, + { + "path": "DragonUI/Textures/Spellbook/5684744-questlog.blp", + "from": "DragonUI/Textures/Spellbook/5684744-questlog.blp", + "sha1": "308b9990e39c9356b77140ce294179a27a7878df", + "size": 263316 + }, + { + "path": "DragonUI/Textures/Spellbook/spellbook-background.blp", + "from": "DragonUI/Textures/Spellbook/spellbook-background.blp", + "sha1": "16a32de79052b91e3a01de821846af2f8711e83e", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Spellbook/spellbook-background_r.blp", + "from": "DragonUI/Textures/Spellbook/spellbook-background_r.blp", + "sha1": "a0d381015f8682a419dca055ef969fb51c852316", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Spellbook/spellbook-ribbon.tga", + "from": "DragonUI/Textures/Spellbook/spellbook-ribbon.tga", + "sha1": "a3efd709d59e6bbb071be957918208ef25d1a6c5", + "size": 163008 + }, + { + "path": "DragonUI/Textures/Spellbook/spellbookelements.blp", + "from": "DragonUI/Textures/Spellbook/spellbookelements.blp", + "sha1": "9d89642fd9426087565eb7f047fa29a76e2b2298", + "size": 700260 + }, + { + "path": "DragonUI/Textures/SwingTimer/bg.blp", + "from": "DragonUI/Textures/SwingTimer/bg.blp", + "sha1": "27a1f19d305572139a27a6af2ec515bde38c5546", + "size": 88592 + }, + { + "path": "DragonUI/Textures/SwingTimer/frame.blp", + "from": "DragonUI/Textures/SwingTimer/frame.blp", + "sha1": "7bb8e78d88531424f6fc31f4f2714be9e88be649", + "size": 88592 + }, + { + "path": "DragonUI/Textures/SwingTimer/sheet.tga", + "from": "DragonUI/Textures/SwingTimer/sheet.tga", + "sha1": "00b7900f42d8358aa39a8ce6e772fb35bf1b2c6c", + "size": 135794 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/DeathKnight.blp", + "from": "DragonUI/Textures/Talents/Artifact/DeathKnight.blp", + "sha1": "07ded8880acdcdba396d42905b9753d0f642d428", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/DeathKnight_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/DeathKnight_r.blp", + "sha1": "41a4da813e1338aacd757d0a353d0cb644f71d0d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Druid.blp", + "from": "DragonUI/Textures/Talents/Artifact/Druid.blp", + "sha1": "c35876ad076cd455746913a67b31ed2350ab0482", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Druid_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Druid_r.blp", + "sha1": "7a73ffe962f0b43baa30a2cbd58fe5a75fd6bd6a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Hunter.blp", + "from": "DragonUI/Textures/Talents/Artifact/Hunter.blp", + "sha1": "2841b41a3296108886a1a5c374857e0691caed09", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Hunter_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Hunter_r.blp", + "sha1": "f418fe680e0648a49223b74c7584ab3a74646fe1", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Mage.blp", + "from": "DragonUI/Textures/Talents/Artifact/Mage.blp", + "sha1": "a4c5ab7525159781aa73427cc474925bc4e5fefb", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Mage_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Mage_r.blp", + "sha1": "6f920e71d16838b76cce970b98b1e0775e94d169", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Paladin.blp", + "from": "DragonUI/Textures/Talents/Artifact/Paladin.blp", + "sha1": "0b25294bf630cb57dc6639fcf3a7dec6859cc2db", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Paladin_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Paladin_r.blp", + "sha1": "4b799f26f0dac989413a55ed6f907b4c4c2bb02f", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Priest.blp", + "from": "DragonUI/Textures/Talents/Artifact/Priest.blp", + "sha1": "46488961015ef20d97e1ed25b77a777562489d2c", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Priest_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Priest_r.blp", + "sha1": "c97ff3a59c627cbfb4508808911e7754c19e9dec", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Rogue.blp", + "from": "DragonUI/Textures/Talents/Artifact/Rogue.blp", + "sha1": "7230f35738cb4174fd8281e936e7908b0b57d749", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Rogue_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Rogue_r.blp", + "sha1": "6f0f8373e2620b3cee08a1d5df440acb66f64a6f", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Shaman.blp", + "from": "DragonUI/Textures/Talents/Artifact/Shaman.blp", + "sha1": "5ce8d327abc2409c8a1a96ab52756958de252193", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Shaman_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Shaman_r.blp", + "sha1": "42fb32c7655cc3d4e27591f44ad833532b51e308", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Warlock.blp", + "from": "DragonUI/Textures/Talents/Artifact/Warlock.blp", + "sha1": "73c2daf66e44dd2760c7bc510c582939f0838b9a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Warlock_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Warlock_r.blp", + "sha1": "e94efd13044878981c83f1b45c34eecd6d95c42d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Warrior.blp", + "from": "DragonUI/Textures/Talents/Artifact/Warrior.blp", + "sha1": "c91115b6152d349f02e96aefae22de39db7bf49d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Artifact/Warrior_r.blp", + "from": "DragonUI/Textures/Talents/Artifact/Warrior_r.blp", + "sha1": "6b89d066c0df81724f633ed62556b1f262f86cd5", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/Pet_Cunning.blp", + "from": "DragonUI/Textures/Talents/Pet_Cunning.blp", + "sha1": "dc96bf929cbb8d2cd41c7cc195aee2cb9c9f93e1", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Talents/Pet_Cunning_r.blp", + "from": "DragonUI/Textures/Talents/Pet_Cunning_r.blp", + "sha1": "729c81e6a971d652e73db523a08c88e3ed053547", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Talents/Pet_Ferocity.blp", + "from": "DragonUI/Textures/Talents/Pet_Ferocity.blp", + "sha1": "31025d903c140e4e1b99df9aef70dc76725b8bb3", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Talents/Pet_Ferocity_r.blp", + "from": "DragonUI/Textures/Talents/Pet_Ferocity_r.blp", + "sha1": "3e86d1ba5fab8f89ad3e33c8e525df38b024fbc5", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Talents/Pet_Tenacity.blp", + "from": "DragonUI/Textures/Talents/Pet_Tenacity.blp", + "sha1": "03faff0935cd40e16aae5b29983a757132dff771", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Talents/Pet_Tenacity_r.blp", + "from": "DragonUI/Textures/Talents/Pet_Tenacity_r.blp", + "sha1": "015aa0c45d512ab5c352ada1e782bbf4c975a941", + "size": 1399300 + }, + { + "path": "DragonUI/Textures/Talents/glyph-effects-card.tga", + "from": "DragonUI/Textures/Talents/glyph-effects-card.tga", + "sha1": "033058284300f1e79a4beafc00863fd15272ff52", + "size": 154802 + }, + { + "path": "DragonUI/Textures/Talents/glyph-globe-health.tga", + "from": "DragonUI/Textures/Talents/glyph-globe-health.tga", + "sha1": "95f022af3eae332111c87200ef45d7ac841ded02", + "size": 1696271 + }, + { + "path": "DragonUI/Textures/Talents/glyph-globe-mana.tga", + "from": "DragonUI/Textures/Talents/glyph-globe-mana.tga", + "sha1": "106de6a331b8e520b5fe35eeae75c62d4ae2ae7c", + "size": 1706804 + }, + { + "path": "DragonUI/Textures/Talents/glyph-orbgloss.tga", + "from": "DragonUI/Textures/Talents/glyph-orbgloss.tga", + "sha1": "7f4ffa160bd0b76f588f8da7cf3bdcf177807c8b", + "size": 91853 + }, + { + "path": "DragonUI/Textures/Talents/glyph-ring-desat.tga", + "from": "DragonUI/Textures/Talents/glyph-ring-desat.tga", + "sha1": "c4755b41152021557ecf0d32710d3b215e20ee7a", + "size": 109350 + }, + { + "path": "DragonUI/Textures/Talents/glyph-ring-gold.tga", + "from": "DragonUI/Textures/Talents/glyph-ring-gold.tga", + "sha1": "4f182da5609735656452b7b290d61ea5801e5c59", + "size": 110125 + }, + { + "path": "DragonUI/Textures/Talents/talentframeatlas.blp", + "from": "DragonUI/Textures/Talents/talentframeatlas.blp", + "sha1": "684b56bc9dcf287f705a6bf47d88a82e9cb1d765", + "size": 350756 + }, + { + "path": "DragonUI/Textures/Talents/talents-animations-clouds.blp", + "from": "DragonUI/Textures/Talents/talents-animations-clouds.blp", + "sha1": "ad1b8da09bab0bffca272b5baa8164cb253fe213", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-animations-clouds_r.blp", + "from": "DragonUI/Textures/Talents/talents-animations-clouds_r.blp", + "sha1": "fec3bebf3fb990e8531deac6630d613f579c2a90", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-animations-particles.blp", + "from": "DragonUI/Textures/Talents/talents-animations-particles.blp", + "sha1": "bfd02e2a5a6926416df8d4a98646bb6b224e8b7c", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-animations-particles_r.blp", + "from": "DragonUI/Textures/Talents/talents-animations-particles_r.blp", + "sha1": "66b65339eb19f091305cf65d7a8bdd30c0f62b2e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-arrows.blp", + "from": "DragonUI/Textures/Talents/talents-arrows.blp", + "sha1": "c30f5c3170bef2e7355875fb3578bdbc7c5ef9b2", + "size": 44864 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-deathknight-frost.blp", + "from": "DragonUI/Textures/Talents/talents-bg-deathknight-frost.blp", + "sha1": "a9893a96f58db5c2f5a2290cc6cd2a804f562bcd", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-deathknight-frost_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-deathknight-frost_r.blp", + "sha1": "03216e590b73cdd5a8691a64ebe1746ce4ccc91b", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-deathknight-unholy.blp", + "from": "DragonUI/Textures/Talents/talents-bg-deathknight-unholy.blp", + "sha1": "85330aba9caab0b61ef0944fdb4451c7b516d0c7", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-deathknight-unholy_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-deathknight-unholy_r.blp", + "sha1": "18e53351b7c1487fdf6b1a903db6802803c8f979", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-deathknight.blp", + "from": "DragonUI/Textures/Talents/talents-bg-deathknight.blp", + "sha1": "f88a242ad13200f8e7d2024d0f38708f7be40202", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-deathknight_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-deathknight_r.blp", + "sha1": "20f30a9edfcaa6d54f33b8189ff028f16d2f94a8", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-druid-feral.blp", + "from": "DragonUI/Textures/Talents/talents-bg-druid-feral.blp", + "sha1": "ea19817330f0aa885e4918421fd98b113228e916", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-druid-feral_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-druid-feral_r.blp", + "sha1": "83e4f628cb46e69c5113ec48858377706682e1a3", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-druid-restoration.blp", + "from": "DragonUI/Textures/Talents/talents-bg-druid-restoration.blp", + "sha1": "388bd1cfbe917633346eef366291826e4171fe2e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-druid-restoration_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-druid-restoration_r.blp", + "sha1": "5962e58bab9ed63b39c12a0e2cb6928b252004f9", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-druid.blp", + "from": "DragonUI/Textures/Talents/talents-bg-druid.blp", + "sha1": "c3d2278bb3014181ed1af502ca8ecc3ea1f744c6", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-druid_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-druid_r.blp", + "sha1": "7ced8be2400bc7c86b6e54f838396f1946004a6a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-hunter-marksmanship.blp", + "from": "DragonUI/Textures/Talents/talents-bg-hunter-marksmanship.blp", + "sha1": "1c500ea5fdf6e0fc045a4eca2269d02a0c86c1c0", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-hunter-marksmanship_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-hunter-marksmanship_r.blp", + "sha1": "73f6dfaeedec7130879f2cd58832a3b97972c9a5", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-hunter-survival.blp", + "from": "DragonUI/Textures/Talents/talents-bg-hunter-survival.blp", + "sha1": "f504b41655a92100a5c4224e6d42f7a8a130fc7e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-hunter-survival_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-hunter-survival_r.blp", + "sha1": "4faf61247293cbd3abb1bb7096bc9a6fe1e94854", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-hunter.blp", + "from": "DragonUI/Textures/Talents/talents-bg-hunter.blp", + "sha1": "a87f818a805815a9e365f6302cbd82a4c2105c2b", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-hunter_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-hunter_r.blp", + "sha1": "8f5bd05cb7765bccaa476fee79607b44caa96f95", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-mage-fire.blp", + "from": "DragonUI/Textures/Talents/talents-bg-mage-fire.blp", + "sha1": "70d5554ac7810613eb02b293e766500fc9345c3a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-mage-fire_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-mage-fire_r.blp", + "sha1": "ccd10589bcb2f0067c5012643525f31711fe5923", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-mage-frost.blp", + "from": "DragonUI/Textures/Talents/talents-bg-mage-frost.blp", + "sha1": "9e19ae7579dc8c0ddff7c74b9c241c46743f806d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-mage-frost_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-mage-frost_r.blp", + "sha1": "a181e9641d0a50ce3db1bfb547fc214f4fb77354", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-mage.blp", + "from": "DragonUI/Textures/Talents/talents-bg-mage.blp", + "sha1": "e60c0f8ddda6b70d63814f1b9b29afc53b17473c", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-mage_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-mage_r.blp", + "sha1": "cf8d3453c5b97aac3a85a5dfed8affa8476e247f", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-paladin-protection.blp", + "from": "DragonUI/Textures/Talents/talents-bg-paladin-protection.blp", + "sha1": "53e44fa90d161b9a8b4312f049bb4aa104f6ec23", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-paladin-protection_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-paladin-protection_r.blp", + "sha1": "2a918ef02bffdfe42249c693b2a06fc1441fcdd1", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-paladin-retribution.blp", + "from": "DragonUI/Textures/Talents/talents-bg-paladin-retribution.blp", + "sha1": "96e7fbc060c525b4e62668134476190b1cc74fda", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-paladin-retribution_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-paladin-retribution_r.blp", + "sha1": "76f89d570d43c369800eecf4829ea9733a98366d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-paladin.blp", + "from": "DragonUI/Textures/Talents/talents-bg-paladin.blp", + "sha1": "2ed438c742e9ea336fb732df38cbbabe8d4edf8c", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-paladin_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-paladin_r.blp", + "sha1": "8b551148c61e2eb552bfbcf19c0732263d807292", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-priest-holy.blp", + "from": "DragonUI/Textures/Talents/talents-bg-priest-holy.blp", + "sha1": "388177d77487f7569f65e60d1294bef026a5704e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-priest-holy_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-priest-holy_r.blp", + "sha1": "21802f55d09f960d5f7c21b62b66581380fbe6e4", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-priest-shadow.blp", + "from": "DragonUI/Textures/Talents/talents-bg-priest-shadow.blp", + "sha1": "6d7a1010c78696154858a69d7ef9d42d53dd727d", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-priest-shadow_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-priest-shadow_r.blp", + "sha1": "29822349e8075f245d897d958887b1c8a2c3050a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-priest.blp", + "from": "DragonUI/Textures/Talents/talents-bg-priest.blp", + "sha1": "9c90a38bf68e5e02639b8a5c31b55f06c3c6b3cd", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-priest_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-priest_r.blp", + "sha1": "d032b027aaa624fbb347c0b0d0cced2132f98485", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-rogue-outlaw.blp", + "from": "DragonUI/Textures/Talents/talents-bg-rogue-outlaw.blp", + "sha1": "7feb7f249965e9f3816f8de439aa9b843d294e21", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-rogue-outlaw_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-rogue-outlaw_r.blp", + "sha1": "1713cd91f9e81c93e9cd6ae6b787250aa9862a1e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-rogue-subtlety.blp", + "from": "DragonUI/Textures/Talents/talents-bg-rogue-subtlety.blp", + "sha1": "c2c87ddc6f28985e13c57370975ab57aa437f721", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-rogue-subtlety_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-rogue-subtlety_r.blp", + "sha1": "25658325e87fe50cf9a740aeb65358608588ba6b", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-rogue.blp", + "from": "DragonUI/Textures/Talents/talents-bg-rogue.blp", + "sha1": "b94c25cd2af042375fe494773981a067ffff6e8f", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-rogue_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-rogue_r.blp", + "sha1": "3b2711cb5b8b8e7217789fedf424dd5d270f30b7", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-shaman-enhancement.blp", + "from": "DragonUI/Textures/Talents/talents-bg-shaman-enhancement.blp", + "sha1": "b283082bddc810b02f7216547c94f4b5f9a63ddc", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-shaman-enhancement_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-shaman-enhancement_r.blp", + "sha1": "ccc73e64637bd082e0e17a87ddec6d3b3e458547", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-shaman-restoration.blp", + "from": "DragonUI/Textures/Talents/talents-bg-shaman-restoration.blp", + "sha1": "783a55019444193c7ec6909561e7465dff9cb1ef", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-shaman-restoration_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-shaman-restoration_r.blp", + "sha1": "47e0c0cd7fc23b0a6a7a49e44c355bb8338b2f9a", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-shaman.blp", + "from": "DragonUI/Textures/Talents/talents-bg-shaman.blp", + "sha1": "5e666cf5a8065dd4555fea41a71f15c3ed36d1f7", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-shaman_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-shaman_r.blp", + "sha1": "30444ca0fc0341cc2c5e61fdb06b84f45de208dc", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warlock-demonology.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warlock-demonology.blp", + "sha1": "30ad7c3ef539af8bab423f96378d222529ebf011", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warlock-demonology_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warlock-demonology_r.blp", + "sha1": "ba24cf37b7db892b4578fc4a4a5f153715b718f0", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warlock-destruction.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warlock-destruction.blp", + "sha1": "c4f2c74434c5c8c51124b3547ed119781c3d1549", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warlock-destruction_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warlock-destruction_r.blp", + "sha1": "9a518e28c6f7e6893d23c8173b5f3dfe7a4578ae", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warlock.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warlock.blp", + "sha1": "d341b8804513fa509d7d228c47136602465d391e", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warlock_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warlock_r.blp", + "sha1": "010f5a11508ae8f2260913e3126185e5c2e526b8", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warrior-fury.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warrior-fury.blp", + "sha1": "69fa69a6442f4c39bf7914455cd08e2733412520", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warrior-fury_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warrior-fury_r.blp", + "sha1": "0c69a26a91f17362ea6ae522d96e86437a483202", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warrior-protection.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warrior-protection.blp", + "sha1": "08cef982c31c8a8bbab4ec89cb01ecfb42617e1b", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warrior-protection_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warrior-protection_r.blp", + "sha1": "92f7b0a20d851f3f1e87f72e5b85920af5532776", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warrior.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warrior.blp", + "sha1": "e1aeb62521200b8e82d46e79425641ef1c80b3db", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-bg-warrior_r.blp", + "from": "DragonUI/Textures/Talents/talents-bg-warrior_r.blp", + "sha1": "8b4de6d609699eaac8fef44b82f87c8484181f07", + "size": 700236 + }, + { + "path": "DragonUI/Textures/Talents/talents-edge-coarse.tga", + "from": "DragonUI/Textures/Talents/talents-edge-coarse.tga", + "sha1": "c295f58513478868d80f89ed4be051bb2d8084d3", + "size": 2066 + }, + { + "path": "DragonUI/Textures/Talents/talents-edge.tga", + "from": "DragonUI/Textures/Talents/talents-edge.tga", + "sha1": "600649109031781554f8a3a037be64f99e751f00", + "size": 4114 + }, + { + "path": "DragonUI/Textures/Talents/talents-line.blp", + "from": "DragonUI/Textures/Talents/talents-line.blp", + "sha1": "60f5553654e2bb8050e3b0bf0aa3ae0e8e49b9b2", + "size": 23016 + }, + { + "path": "DragonUI/Textures/Talents/talents-sheen-apex.blp", + "from": "DragonUI/Textures/Talents/talents-sheen-apex.blp", + "sha1": "ee64cb6d7f79ddf72f76b31212107b33d5d67213", + "size": 700260 + }, + { + "path": "DragonUI/Textures/Talents/talents-sheen-capstonesquare.blp", + "from": "DragonUI/Textures/Talents/talents-sheen-capstonesquare.blp", + "sha1": "6fe1c641acbc401055fdf05ae068d6e89a507381", + "size": 700260 + }, + { + "path": "DragonUI/Textures/Talents/talents-sheen-small.blp", + "from": "DragonUI/Textures/Talents/talents-sheen-small.blp", + "sha1": "e74551d6a750b7b2cd69b15a173aa006152e7a54", + "size": 350756 + }, + { + "path": "DragonUI/Textures/Talents/talents-sheet.tga", + "from": "DragonUI/Textures/Talents/talents-sheet.tga", + "sha1": "6785c5de6dae1912a3ab3ae1916dc2db71dc2897", + "size": 707694 + }, + { + "path": "DragonUI/Textures/Talents/talents-warmode-flame.tga", + "from": "DragonUI/Textures/Talents/talents-warmode-flame.tga", + "sha1": "f4be71f88991c40ff94240796f01897ec6e3407d", + "size": 1754315 + }, + { + "path": "DragonUI/Textures/Talents/talents-warmode-smoke.tga", + "from": "DragonUI/Textures/Talents/talents-warmode-smoke.tga", + "sha1": "b6376353b49759f14c2b313921d966ef814cfc9a", + "size": 466903 + }, + { + "path": "DragonUI/Textures/Taxi/Maps/taximap0.blp", + "from": "DragonUI/Textures/Taxi/Maps/taximap0.blp", + "sha1": "a610147affb7b836c9e39f44842f7cd69774eeb5", + "size": 175948 + }, + { + "path": "DragonUI/Textures/Taxi/Maps/taximap1.blp", + "from": "DragonUI/Textures/Taxi/Maps/taximap1.blp", + "sha1": "1089de1a9a962e8034df0826df2000b07e317a8a", + "size": 175948 + }, + { + "path": "DragonUI/Textures/Taxi/Maps/taximap530.blp", + "from": "DragonUI/Textures/Taxi/Maps/taximap530.blp", + "sha1": "f41e2a63335d91272ff0c76aaa7110a7edcc8969", + "size": 175948 + }, + { + "path": "DragonUI/Textures/Taxi/Maps/taximap571.blp", + "from": "DragonUI/Textures/Taxi/Maps/taximap571.blp", + "sha1": "e5af31a4c594176e255875b38140c08489b38248", + "size": 175948 + }, + { + "path": "DragonUI/Textures/Taxi/icon_petfamily_flying.blp", + "from": "DragonUI/Textures/Taxi/icon_petfamily_flying.blp", + "sha1": "ed12a6949389a79274381e1fee09e68b05a5018b", + "size": 23016 + }, + { + "path": "DragonUI/Textures/Taxi/taxiassets.tga", + "from": "DragonUI/Textures/Taxi/taxiassets.tga", + "sha1": "c0340f1d4a3c1c4cd7be653e0da2ec1050adc19c", + "size": 12285 + }, + { + "path": "DragonUI/Textures/UI-Frame-PortraitMetal-CornerTopLeft.blp", + "from": "DragonUI/Textures/UI-Frame-PortraitMetal-CornerTopLeft.blp", + "sha1": "7b7e7af5578a25a079290102178b06758e860d41", + "size": 88596 + }, + { + "path": "DragonUI/Textures/UI/BagSlotsKey.blp", + "from": "DragonUI/Textures/UI/BagSlotsKey.blp", + "sha1": "37ad6962a0917bb6ae9cca1514b5fb17a2a596d3", + "size": 23060 + }, + { + "path": "DragonUI/Textures/UI/BagSortBroom.tga", + "from": "DragonUI/Textures/UI/BagSortBroom.tga", + "sha1": "a097113b1c1a2fa0088853603218f7f7030a61cd", + "size": 10977 + }, + { + "path": "DragonUI/Textures/UI/BagSortLock.blp", + "from": "DragonUI/Textures/UI/BagSortLock.blp", + "sha1": "0291057936bb9d02168272e702280a2d3a6882f4", + "size": 6676 + }, + { + "path": "DragonUI/Textures/UI/CastingBar.blp", + "from": "DragonUI/Textures/UI/CastingBar.blp", + "sha1": "1e9f26e1ada47f4c72a18b947e1d843aa21ca071", + "size": 175972 + }, + { + "path": "DragonUI/Textures/UI/CollapseButton.blp", + "from": "DragonUI/Textures/UI/CollapseButton.blp", + "sha1": "3987c7335bfad8e390f57838a58d6339d2f2f6b5", + "size": 6676 + }, + { + "path": "DragonUI/Textures/UI/INV_Misc_Head_Dragon_01.blp", + "from": "DragonUI/Textures/UI/INV_Misc_Head_Dragon_01.blp", + "sha1": "1ffe44a210b951eb7be0f9c1a4f201daf2a111d5", + "size": 6660 + }, + { + "path": "DragonUI/Textures/UI/MicroMenu.blp", + "from": "DragonUI/Textures/UI/MicroMenu.blp", + "sha1": "42a2e8b2333c7c4576a375c1d364b2d40210a269", + "size": 350740 + }, + { + "path": "DragonUI/Textures/UI/Minimap.blp", + "from": "DragonUI/Textures/UI/Minimap.blp", + "sha1": "f553e751e657f3745dcdac7795be314861dbb590", + "size": 525460 + }, + { + "path": "DragonUI/Textures/UI/QuestTracker.BLP", + "from": "DragonUI/Textures/UI/QuestTracker.BLP", + "sha1": "54fe6c937420df11b6787d619b77e0c00c732687", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/UI/RarityGemAtlas.blp", + "from": "DragonUI/Textures/UI/RarityGemAtlas.blp", + "sha1": "8e5aac08b79530b944f28b5df00959597dfd52d5", + "size": 23060 + }, + { + "path": "DragonUI/Textures/UI/UnitFrame.blp", + "from": "DragonUI/Textures/UI/UnitFrame.blp", + "sha1": "31f35840a709591980b2cb0fd1f8113a3571d464", + "size": 700260 + }, + { + "path": "DragonUI/Textures/UI/bagster-newitem-flash.tga", + "from": "DragonUI/Textures/UI/bagster-newitem-flash.tga", + "sha1": "f409f9f7e465dd60203a62799d82e82b7a4883a7", + "size": 20766 + }, + { + "path": "DragonUI/Textures/UI/bagster-newitem-glow.tga", + "from": "DragonUI/Textures/UI/bagster-newitem-glow.tga", + "sha1": "bc6d107082161945cc64755ed45019168c947247", + "size": 36574 + }, + { + "path": "DragonUI/Textures/UI/buttonhilight-square.blp", + "from": "DragonUI/Textures/UI/buttonhilight-square.blp", + "sha1": "65cdaf372253f9e39f8a5958a429df88db9c60e6", + "size": 3916 + }, + { + "path": "DragonUI/Textures/UI/checkbox-minimal.blp", + "from": "DragonUI/Textures/UI/checkbox-minimal.blp", + "sha1": "ba0dae86147f25bce916a7d58b8ae4375a472523", + "size": 5268 + }, + { + "path": "DragonUI/Textures/UI/dropdownbutton.tga", + "from": "DragonUI/Textures/UI/dropdownbutton.tga", + "sha1": "a6cfc5528aef293c7051960c39d821b5eeca3205", + "size": 131090 + }, + { + "path": "DragonUI/Textures/UI/looting-itemcard.blp", + "from": "DragonUI/Textures/UI/looting-itemcard.blp", + "sha1": "8ee710d7e7c555263ae0508da53818271f25a4e3", + "size": 700224 + }, + { + "path": "DragonUI/Textures/UI/redbutton2x.blp", + "from": "DragonUI/Textures/UI/redbutton2x.blp", + "sha1": "21111c83467fd1c46567e9fe9a3eefb72205848a", + "size": 132244 + }, + { + "path": "DragonUI/Textures/UI/redbutton3slice.tga", + "from": "DragonUI/Textures/UI/redbutton3slice.tga", + "sha1": "1d0f9a25f3d758b1a6a9999bb3cd9a0281c6833f", + "size": 80538 + }, + { + "path": "DragonUI/Textures/UI/sidetab.blp", + "from": "DragonUI/Textures/UI/sidetab.blp", + "sha1": "4b7b5c47aadc1f83a01692e9e1274f6d3e800a92", + "size": 5268 + }, + { + "path": "DragonUI/Textures/UI/ui-background-marble.blp", + "from": "DragonUI/Textures/UI/ui-background-marble.blp", + "sha1": "9610174f9c308eaeb57f06cd257fe055ccbf4aef", + "size": 44876 + }, + { + "path": "DragonUI/Textures/UI/ui-background-rock.blp", + "from": "DragonUI/Textures/UI/ui-background-rock.blp", + "sha1": "7d953d8d5c8a559305fa5f5b4952c764f6a97238", + "size": 525460 + }, + { + "path": "DragonUI/Textures/UI/ui-quickslot-depress.blp", + "from": "DragonUI/Textures/UI/ui-quickslot-depress.blp", + "sha1": "351b50a5127c8437216c5e3afbbecac13ace40f6", + "size": 6660 + }, + { + "path": "DragonUI/Textures/UI/ui-quickslot2.blp", + "from": "DragonUI/Textures/UI/ui-quickslot2.blp", + "sha1": "3d13bbf51f3c7db93a8dd1cc10f142a637ee3837", + "size": 3916 + }, + { + "path": "DragonUI/Textures/UI/uidialog-divider.blp", + "from": "DragonUI/Textures/UI/uidialog-divider.blp", + "sha1": "68cb46385927eadb6809b30f372e1d7fefacef7b", + "size": 12132 + }, + { + "path": "DragonUI/Textures/UI/uiframe-diamondmetal-edges.blp", + "from": "DragonUI/Textures/UI/uiframe-diamondmetal-edges.blp", + "sha1": "0fde5d9afbe2af61885c53df76289917846fcf53", + "size": 263316 + }, + { + "path": "DragonUI/Textures/UI/uiframe-diamondmetal.blp", + "from": "DragonUI/Textures/UI/uiframe-diamondmetal.blp", + "sha1": "cb936a933038a24d092d91b2fa37d78e94985e2d", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/UI/uiframe-inner-vertical.blp", + "from": "DragonUI/Textures/UI/uiframe-inner-vertical.blp", + "sha1": "e67c9d92cd557709747da9112c7a43db63c5a2a4", + "size": 17556 + }, + { + "path": "DragonUI/Textures/UI/uiframe-inner.blp", + "from": "DragonUI/Textures/UI/uiframe-inner.blp", + "sha1": "e79ffd4534c3e39920d16a3ca590903a171fe920", + "size": 17556 + }, + { + "path": "DragonUI/Textures/UI/uiframeinner.blp", + "from": "DragonUI/Textures/UI/uiframeinner.blp", + "sha1": "8a26b1916bc01c79aeaf03e58997a40ef4cdceec", + "size": 33940 + }, + { + "path": "DragonUI/Textures/UI/uiframemetal2x.blp", + "from": "DragonUI/Textures/UI/uiframemetal2x.blp", + "sha1": "44c2f12581f2f4aca17a8d873896b10cd9551178", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/UI/uiframemetalhorizontal2x.blp", + "from": "DragonUI/Textures/UI/uiframemetalhorizontal2x.blp", + "sha1": "86d76fc7a05183602d84e1f28bce43d3302373d9", + "size": 66708 + }, + { + "path": "DragonUI/Textures/UI/uiframemetalvertical2x.blp", + "from": "DragonUI/Textures/UI/uiframemetalvertical2x.blp", + "sha1": "837ea8c1057d57cc1efae7ecaa2ee66eb34c302e", + "size": 66708 + }, + { + "path": "DragonUI/Textures/UI/uiframetabs.blp", + "from": "DragonUI/Textures/UI/uiframetabs.blp", + "sha1": "da20c7bb86e788d6f6149596a6883fda28fca473", + "size": 66708 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Energy.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Energy.tga", + "sha1": "07b1dbce243e9623c5a1f5a3f063871a73b0c5ca", + "size": 6162 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Focus.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Focus.tga", + "sha1": "c41d59f6795f56e6bfc1e229fe04e84188a14f0b", + "size": 6162 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Health-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Health-Status.tga", + "sha1": "2209d37f62c67f287645b09f030acc607ae328e3", + "size": 12306 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Health.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Health.tga", + "sha1": "39c32fd0d93e374c3d471a2e5062123e174a6d42", + "size": 12306 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Mana.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Mana.tga", + "sha1": "9ec188d3c4e171cd4c2f977ba9e0770b80113d66", + "size": 6162 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Rage.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-Rage.tga", + "sha1": "1ab34c419080fbb1e0f6138ab856ab8df96bbff9", + "size": 6162 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-RunicPower.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Player-PortraitOn-Bar-RunicPower.tga", + "sha1": "0aa4657a07e3d8e3df44b94532d764380fb3a568", + "size": 6162 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Energy.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Energy.tga", + "sha1": "300929501265cd803f173e8553d09a1fe1df9b1a", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Focus.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Focus.tga", + "sha1": "796c96d92377f85d444cff118c67e705b8778247", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Health-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Health-Status.tga", + "sha1": "01a739f61f85c09c50a7c4b743e72182abf953b1", + "size": 12306 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Health.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Health.tga", + "sha1": "a969431aa3a228966d08e4679e7effc1634eec4f", + "size": 12306 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Mana-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Mana-Status.tga", + "sha1": "afa8a8fbac0f539efad428f31d86cf26e67dd24b", + "size": 6162 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Mana.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Mana.tga", + "sha1": "69095c3428b4cec901dfc689f0f04f03acef5393", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Rage.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-Rage.tga", + "sha1": "307ac799b31e89214216abf38ce5a51d5618022b", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-RunicPower.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-Target-PortraitOn-Bar-RunicPower.tga", + "sha1": "661412de162d2c5959be5ad232619b54dc2f31c9", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Energy.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Energy.tga", + "sha1": "875c45ebf9a314fcd81c8b6c6bcf5d6a5c810f43", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Focus.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Focus.tga", + "sha1": "83faaebc7cc2c83647df2ac3c742d7260be30381", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Health-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Health-Status.tga", + "sha1": "2ba1348b5654d38745047cd032169bdc6546ba74", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Health.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Health.tga", + "sha1": "309351dd3aa94350b6fa96bc7f87ebb92e54fb10", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Mana-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Mana-Status.tga", + "sha1": "c7913636e72543591a652d7da4c85d942786bd27", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Mana.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Mana.tga", + "sha1": "91cb6f032094ae93e316595ce7e0c0426582a082", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Rage.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-Rage.tga", + "sha1": "1fe63b9d0f08c0de0b3129d895cc0f28c7cc67e1", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-RunicPower.tga", + "from": "DragonUI/Textures/UnitFrames/Bars/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-Bar-RunicPower.tga", + "sha1": "01c7183a2fef101a9bede42100b4ed28c1bff5f6", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/ComboPoints/Forever-Small.tga", + "from": "DragonUI/Textures/UnitFrames/ComboPoints/Forever-Small.tga", + "sha1": "172dd1cd2c01be5b63f752e504549114e6cb7a2a", + "size": 79243 + }, + { + "path": "DragonUI/Textures/UnitFrames/ComboPoints/Forever.tga", + "from": "DragonUI/Textures/UnitFrames/ComboPoints/Forever.tga", + "sha1": "405a4f76964e6278581b6681dfe7dcb9da59f0c2", + "size": 196790 + }, + { + "path": "DragonUI/Textures/UnitFrames/ComboPoints/Retail-Small.tga", + "from": "DragonUI/Textures/UnitFrames/ComboPoints/Retail-Small.tga", + "sha1": "70cf21942d9fbaa878463c45ade6f6a24764e628", + "size": 174461 + }, + { + "path": "DragonUI/Textures/UnitFrames/ComboPoints/Retail.tga", + "from": "DragonUI/Textures/UnitFrames/ComboPoints/Retail.tga", + "sha1": "529452f837f8d5e8220f8247bcb694bfa3df1e25", + "size": 417850 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Dragon-elite.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Dragon-elite.tga", + "sha1": "cc627dab754bbbe8c3320be7cf7d0c19a3e565a6", + "size": 30285 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Dragon-rare.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Dragon-rare.tga", + "sha1": "639c9b2d6c3a8dd5952e4afa3411ae957c3da8b5", + "size": 31619 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Dragon-rareelite.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Dragon-rareelite.tga", + "sha1": "75304f694c5ceb1883efbf97b097cff9d2999918", + "size": 42911 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-gold-Paw.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-gold-Paw.tga", + "sha1": "836a6553385b43c455354a8f90d84623dc25a30f", + "size": 5775 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-gold.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-gold.tga", + "sha1": "3d60fe022a991295b3530c21378616682673b881", + "size": 42462 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-goldWinged-Paw.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-goldWinged-Paw.tga", + "sha1": "a911171e6f19ddfb4aaaa59cd5d5767418969a79", + "size": 6992 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-goldWinged.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-goldWinged.tga", + "sha1": "0a543b9a098877b7744d87d49e1c1bb9e014cee9", + "size": 47988 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-silverWinged-Paw.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-silverWinged-Paw.tga", + "sha1": "7968f4bd58d1ddd04b40e0359ff6f489287e0e7e", + "size": 5906 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-silverWinged.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Dragon-silverWinged.tga", + "sha1": "5c7bfd828c7b4a5c902fad7162292c1da42a7852", + "size": 48556 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Player-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Player-BACKGROUND.tga", + "sha1": "473e88091369f05ee0e5dcc9caf148de9624cf13", + "size": 20145 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Player-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Player-BORDER.tga", + "sha1": "614ffd8f31b2a7944cb449291293bb0855a9fa69", + "size": 39506 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Target-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Target-BACKGROUND.tga", + "sha1": "7d094163b5efec8a2aa710b539d315033d154b40", + "size": 18285 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Target-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Target-BORDER.tga", + "sha1": "46feb03f2e41140fa7217444feca41c9fee7631f", + "size": 39382 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/Target-Type.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/Target-Type.tga", + "sha1": "7f0af0807f733f5417cd827af4cc03ee0befa66b", + "size": 75207 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/TargetofTarget-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/TargetofTarget-BACKGROUND.tga", + "sha1": "64e38e32d4f8237396fdeeefcc7458de3a9e8487", + "size": 12109 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Forever/TargetofTarget-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Forever/TargetofTarget-BORDER.tga", + "sha1": "2b16077755bf913d67dc5e8dbeee6a8e40fa4f52", + "size": 24270 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Player-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Player-BACKGROUND.tga", + "sha1": "a4d4ad57bf3cb2071230facb21c386d0f391a499", + "size": 15685 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Player-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Player-BORDER.tga", + "sha1": "ca72b67d78375edbde81df0ca85aa3820fcaec92", + "size": 35292 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Player-InCombat.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Player-InCombat.tga", + "sha1": "c2ff93b67e084ecec876f1224a399a18f5a8c4f8", + "size": 27038 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Player-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Player-Status.tga", + "sha1": "1be2f6cc0c761a20843828fbe94e9ba93a2432ee", + "size": 20631 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Target-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Target-BACKGROUND.tga", + "sha1": "3ad397751380f637453e6fd554dc307891eddc8e", + "size": 14076 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Target-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Target-BORDER.tga", + "sha1": "c2b10ba76a258e5f9a30ac2dda1444f4b89e4c3c", + "size": 36528 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Target-InCombat.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Target-InCombat.tga", + "sha1": "67ddfb202b097762d30c22beb971b11933c051c7", + "size": 23740 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/Target-NameStrip.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/Target-NameStrip.tga", + "sha1": "88b786e86796fca20138ceaa0e91cd8828eb1191", + "size": 54014 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/TargetofTarget-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/TargetofTarget-BACKGROUND.tga", + "sha1": "05c8c123e3d77f9a7a73a9bf13b067d030d471e9", + "size": 9002 + }, + { + "path": "DragonUI/Textures/UnitFrames/Compact/TargetofTarget-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Compact/TargetofTarget-BORDER.tga", + "sha1": "e51d325ba5e00ad53cba62668c4a14f7ae70d2e0", + "size": 20062 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Level.blp", + "from": "DragonUI/Textures/UnitFrames/Forever/Level.blp", + "sha1": "435fcb6d9fa3817e66f59c1bce19d0c68d118469", + "size": 88552 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Party-BACKGROUND.blp", + "from": "DragonUI/Textures/UnitFrames/Forever/Party-BACKGROUND.blp", + "sha1": "11ffc2e0329c864d6254791c6b08018e44461d37", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Party-BORDER.blp", + "from": "DragonUI/Textures/UnitFrames/Forever/Party-BORDER.blp", + "sha1": "fb6e0d0ee46f44a4a18adcd587fd2a68686408b3", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-BACKGROUND.tga", + "sha1": "85735d45e71cbe8bf018c8d1a3b8ba77f6f24dfc", + "size": 51188 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-BORDER.tga", + "sha1": "f2f4b09aff177c027b22c2d0c04cd937c0716e05", + "size": 73618 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-CombatIcon.blp", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-CombatIcon.blp", + "sha1": "2149c8828d802a3bc13624e6cb149ca52c6c097c", + "size": 6632 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-Fat-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-Fat-BACKGROUND.tga", + "sha1": "a50cfbf50b8fc0e9c0fadc7f10c1ab0c865c3de1", + "size": 49544 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-Fat-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-Fat-BORDER.tga", + "sha1": "f68907155a181acadc330f9523236ae031989776", + "size": 75585 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-InCombat-Fat.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-InCombat-Fat.tga", + "sha1": "f33142dbc4984ad4a978d06805485e58d4d9904c", + "size": 71723 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-InCombat.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-InCombat.tga", + "sha1": "9545bf955ec9198372362971389ee64a8479cbc6", + "size": 70921 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Player-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Player-Status.tga", + "sha1": "ae96accfa60a8a2db03755d76b9f1f1cec6086cf", + "size": 55357 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-BACKGROUND.tga", + "sha1": "3f63bce2bdcc0fc8a614b9a6fbb9764fca40a3e0", + "size": 46496 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-BORDER.tga", + "sha1": "bf0c2d2ae41a05eef49086cdb957521926247396", + "size": 69708 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-Fat-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-Fat-BACKGROUND.tga", + "sha1": "6d06618f9f5806f4987ee1b7858753b93e34075d", + "size": 45116 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-Fat-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-Fat-BORDER.tga", + "sha1": "39cdbc271f1b49c2cbf0356a20f12db8552cb151", + "size": 72011 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-InCombat-Fat.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-InCombat-Fat.tga", + "sha1": "f348e39c04274acd3612cef7ec9c21b7f48eea01", + "size": 62826 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-InCombat.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-InCombat.tga", + "sha1": "f4240a5d9b0f41f04efb46dcc4565848d2dddb7e", + "size": 61745 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/Target-Type.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/Target-Type.tga", + "sha1": "7aa8d86c1c5a941bf35edfe3b27b232a5565d81a", + "size": 86170 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/TargetofTarget-BACKGROUND.blp", + "from": "DragonUI/Textures/UnitFrames/Forever/TargetofTarget-BACKGROUND.blp", + "sha1": "1f6aa3240c3e04cafdee5753adc298fc83071a51", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/TargetofTarget-BORDER.blp", + "from": "DragonUI/Textures/UnitFrames/Forever/TargetofTarget-BORDER.blp", + "sha1": "f0f363ae411465934cd6a871c8024bbd60ee7084", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/Forever/uiunitframeboss2x.tga", + "from": "DragonUI/Textures/UnitFrames/Forever/uiunitframeboss2x.tga", + "sha1": "b98015ec8126344edba4caaa37d0ae1765fbce09", + "size": 338330 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Party-InCombat.blp", + "from": "DragonUI/Textures/UnitFrames/HD/Party-InCombat.blp", + "sha1": "43320d104ab11baecde640c72b66d84349c0650b", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Player-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Player-BACKGROUND.tga", + "sha1": "d4b4e971cd83c0a8ad81c7d96c6e19376f7228f2", + "size": 34835 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Player-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Player-BORDER.tga", + "sha1": "f3c8cc1e44b5ef17664bff6aa138f857b1171682", + "size": 61711 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Target-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Target-BACKGROUND.tga", + "sha1": "65ae115c78cf8014cbdb5eecd0b2a1ef9fb7bb3d", + "size": 37355 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Target-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Target-BORDER.tga", + "sha1": "4461c74acdcacf860f298beb3e1c9bb9ee913d60", + "size": 60487 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Target-Fat-BACKGROUND.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Target-Fat-BACKGROUND.tga", + "sha1": "d5b82b5acfb393be3442d5ef7c327eb726d010b9", + "size": 37181 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Target-Fat-BORDER.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Target-Fat-BORDER.tga", + "sha1": "76910e87c1c23f915b59e24f04325b71a0aacec7", + "size": 62584 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/Target-NameStrip.tga", + "from": "DragonUI/Textures/UnitFrames/HD/Target-NameStrip.tga", + "sha1": "29875475a893d1466f37517393feca0f8ebb3014", + "size": 61885 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/TargetofTarget-BACKGROUND.blp", + "from": "DragonUI/Textures/UnitFrames/HD/TargetofTarget-BACKGROUND.blp", + "sha1": "e21c57111734071fad88887f84b19dd0c2f84e3b", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/HD/TargetofTarget-BORDER.blp", + "from": "DragonUI/Textures/UnitFrames/HD/TargetofTarget-BORDER.blp", + "sha1": "a15d50721178981c39a48dd9d9d4eacba3992513", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/Icons/StatusIcons.blp", + "from": "DragonUI/Textures/UnitFrames/Icons/StatusIcons.blp", + "sha1": "1c1608285eda685c8e247425e0c0231fd60c7f9a", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/Layers/PlayerFrameFX.blp", + "from": "DragonUI/Textures/UnitFrames/Layers/PlayerFrameFX.blp", + "sha1": "055e71ac35b52b1ef10ab17f4de85ce157ecaeac", + "size": 12132 + }, + { + "path": "DragonUI/Textures/UnitFrames/Layers/Shield-Fill.blp", + "from": "DragonUI/Textures/UnitFrames/Layers/Shield-Fill.blp", + "sha1": "204cec60d28b5004ffd0b384bf4d417469e73b96", + "size": 2580 + }, + { + "path": "DragonUI/Textures/UnitFrames/Layers/Shield-Overlay.blp", + "from": "DragonUI/Textures/UnitFrames/Layers/Shield-Overlay.blp", + "sha1": "55c89be9f5e66b47f6d3ebf202cd39f032655724", + "size": 2580 + }, + { + "path": "DragonUI/Textures/UnitFrames/Layers/Shield-Overshield.blp", + "from": "DragonUI/Textures/UnitFrames/Layers/Shield-Overshield.blp", + "sha1": "9b0d7563cf0d6557185f9d321de29a3fcb41cd27", + "size": 1892 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Energy.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Energy.tga", + "sha1": "f0188a54c5b87c6e89d1e0ac81859252cb26b313", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Focus.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Focus.tga", + "sha1": "04e072dc00344a630e79e36b149d0b20eb726f2b", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Health-Status.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Health-Status.tga", + "sha1": "a09352a1525414da78f8bda2e2f33a796d0b57ca", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Health.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Health.tga", + "sha1": "a5f291fc3912783301255cd94b13e7d771601fe7", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Mana.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Mana.tga", + "sha1": "a076ad40486ac1e7f35a9d972b28391daacd6da0", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Rage.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-Rage.tga", + "sha1": "91c97578485405e98e79217c95dc86c4f02989e7", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-RunicPower.tga", + "from": "DragonUI/Textures/UnitFrames/Party/UI-HUD-UnitFrame-Party-PortraitOn-Bar-RunicPower.tga", + "sha1": "4b2bac5e01a9c552e5737e0073d215d8d9bc24d1", + "size": 4140 + }, + { + "path": "DragonUI/Textures/UnitFrames/Party/uipartyframe.blp", + "from": "DragonUI/Textures/UnitFrames/Party/uipartyframe.blp", + "sha1": "ee3a9fe9f9c87a61969c639770676d47fb44c5fe", + "size": 263316 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/ClassOverlayDeathKnightRunes.BLP", + "from": "DragonUI/Textures/UnitFrames/Player/ClassOverlayDeathKnightRunes.BLP", + "sha1": "a57c5d7be10d17c2c2fad598d4c974d361de4bc4", + "size": 17556 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/LFGRoleIcons.blp", + "from": "DragonUI/Textures/UnitFrames/Player/LFGRoleIcons.blp", + "sha1": "e53e31f75fafff082ac2beae6e2ee067acbb7ff1", + "size": 3220 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/PlayerRestFlipbook.blp", + "from": "DragonUI/Textures/UnitFrames/Player/PlayerRestFlipbook.blp", + "sha1": "cc7737b040dbf68be542cb4daec5687f1273712e", + "size": 350740 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/UI-HUD-UnitFrame-Player-PortraitOn-BORDER-Fat.blp", + "from": "DragonUI/Textures/UnitFrames/Player/UI-HUD-UnitFrame-Player-PortraitOn-BORDER-Fat.blp", + "sha1": "4105f20bb41dd429e50c630fa67edbff9db49181", + "size": 175972 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/UI-HUD-UnitFrame-Player-PortraitOn-BORDER.blp", + "from": "DragonUI/Textures/UnitFrames/Player/UI-HUD-UnitFrame-Player-PortraitOn-BORDER.blp", + "sha1": "dcbfc6b48ecd5fbc373f9253b1857a3f170d4105", + "size": 175972 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/ui-hud-unitframe-player-portraiton-cornerembellishment-2x.blp", + "from": "DragonUI/Textures/UnitFrames/Player/ui-hud-unitframe-player-portraiton-cornerembellishment-2x.blp", + "sha1": "e71781efb2a0d2e88514ada0bb6c84c00ce199af", + "size": 6676 + }, + { + "path": "DragonUI/Textures/UnitFrames/Player/uiunitframe2x_ptr_icons_crop.blp", + "from": "DragonUI/Textures/UnitFrames/Player/uiunitframe2x_ptr_icons_crop.blp", + "sha1": "5774f5ce374ad72709d05cb28b703119303c06b0", + "size": 88596 + }, + { + "path": "DragonUI/Textures/UnitFrames/PvP/Alliance.blp", + "from": "DragonUI/Textures/UnitFrames/PvP/Alliance.blp", + "sha1": "350bc9e895c655fa089cc3dae05c0ee6d7db40ed", + "size": 88552 + }, + { + "path": "DragonUI/Textures/UnitFrames/PvP/FFA.blp", + "from": "DragonUI/Textures/UnitFrames/PvP/FFA.blp", + "sha1": "c0f867c82075f4a44b89a84eea4ce55fd28a6009", + "size": 88552 + }, + { + "path": "DragonUI/Textures/UnitFrames/PvP/Group-Alliance.blp", + "from": "DragonUI/Textures/UnitFrames/PvP/Group-Alliance.blp", + "sha1": "39929b8f64ea1146cd1887da5182bb8235971c7d", + "size": 23016 + }, + { + "path": "DragonUI/Textures/UnitFrames/PvP/Group-Horde.blp", + "from": "DragonUI/Textures/UnitFrames/PvP/Group-Horde.blp", + "sha1": "56d27ff5e37248a09e6dbb381f1b5d9f8535f1a3", + "size": 23016 + }, + { + "path": "DragonUI/Textures/UnitFrames/PvP/Horde.blp", + "from": "DragonUI/Textures/UnitFrames/PvP/Horde.blp", + "sha1": "63edbc4ff17e19f97caedfcdc640ee7349558674", + "size": 88552 + }, + { + "path": "DragonUI/Textures/UnitFrames/Small/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-BACKGROUND.blp", + "from": "DragonUI/Textures/UnitFrames/Small/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-BACKGROUND.blp", + "sha1": "9523f755a322e14ccce0cf408d814e9310cfc02a", + "size": 12132 + }, + { + "path": "DragonUI/Textures/UnitFrames/Small/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-BORDER.blp", + "from": "DragonUI/Textures/UnitFrames/Small/UI-HUD-UnitFrame-TargetofTarget-PortraitOn-BORDER.blp", + "sha1": "7684b8d320e6c39d269774a43c7b4ba32022a84f", + "size": 12132 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/NameBackground.tga", + "from": "DragonUI/Textures/UnitFrames/Target/NameBackground.tga", + "sha1": "f2ef5372cd277edf13d4a63ae383560e1b7210f2", + "size": 8236 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BACKGROUND-Fat.blp", + "from": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BACKGROUND-Fat.blp", + "sha1": "045bc3ed0ebcdf032c0546494173268c567aeeab", + "size": 44900 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BACKGROUND.blp", + "from": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BACKGROUND.blp", + "sha1": "fcb7c34b09d65f1a9e8c98fd99b32b2739fe22e5", + "size": 44900 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BORDER-Fat.blp", + "from": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BORDER-Fat.blp", + "sha1": "fef6e24c318f55d7e3d21447f06794da04093ea7", + "size": 44900 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BORDER.blp", + "from": "DragonUI/Textures/UnitFrames/Target/UI-HUD-UnitFrame-Target-PortraitOn-BORDER.blp", + "sha1": "5827523c10750446db41ee8d3e35af8263624019", + "size": 44900 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/UIUnitFrame2x_PTR.blp", + "from": "DragonUI/Textures/UnitFrames/Target/UIUnitFrame2x_PTR.blp", + "sha1": "924c83bc0f5f2222303f437d5b5832058a7e7694", + "size": 700260 + }, + { + "path": "DragonUI/Textures/UnitFrames/Target/ui-hud-unitframe-target-portraiton-incombat-2x.blp", + "from": "DragonUI/Textures/UnitFrames/Target/ui-hud-unitframe-target-portraiton-incombat-2x.blp", + "sha1": "195eb356283dd81a8be6b24468ccc077b9637aed", + "size": 175972 + }, + { + "path": "DragonUI/Textures/UnitFrames/TotemRing.tga", + "from": "DragonUI/Textures/UnitFrames/TotemRing.tga", + "sha1": "29463821a894877a0ea026eb327a1472457d2a65", + "size": 19667 + }, + { + "path": "DragonUI/Textures/UnitFrames/pvpforever.blp", + "from": "DragonUI/Textures/UnitFrames/pvpforever.blp", + "sha1": "b0f37e7390ee8d321b2e3a592f1fb2542f07ac25", + "size": 175936 + }, + { + "path": "DragonUI/Textures/UnitFrames/uiunitframe-fat.blp", + "from": "DragonUI/Textures/UnitFrames/uiunitframe-fat.blp", + "sha1": "662d38b19d2deaca4e53b022a9b17ce7a104c188", + "size": 700260 + }, + { + "path": "DragonUI/Textures/UnitFrames/uiunitframe.blp", + "from": "DragonUI/Textures/UnitFrames/uiunitframe.blp", + "sha1": "e58bc43309f3e52cb9950ce00daf2bb9a9bd8829", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/UnitFrames/uiunitframeboss2x.blp", + "from": "DragonUI/Textures/UnitFrames/uiunitframeboss2x.blp", + "sha1": "e0873011c505439329e0a0479397e06512415aa0", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/WorldMap/1121272-objecticonsatlas.blp", + "from": "DragonUI/Textures/WorldMap/1121272-objecticonsatlas.blp", + "sha1": "a7d19417b6454587ed5219eef94e29c9d557162a", + "size": 4195476 + }, + { + "path": "DragonUI/Textures/WorldMap/136430-minimap-trackingborder.blp", + "from": "DragonUI/Textures/WorldMap/136430-minimap-trackingborder.blp", + "sha1": "b67eee8adca1d96c9a209c0d8b2dac5a9d755b1b", + "size": 5268 + }, + { + "path": "DragonUI/Textures/WorldMap/136467-ui-minimap-background.blp", + "from": "DragonUI/Textures/WorldMap/136467-ui-minimap-background.blp", + "sha1": "d5e238d2d05325d818e8e602c54fc4af5d0655df", + "size": 2564 + }, + { + "path": "DragonUI/Textures/WorldMap/136477-ui-minimap-zoombutton-highlight.blp", + "from": "DragonUI/Textures/WorldMap/136477-ui-minimap-zoombutton-highlight.blp", + "sha1": "4d65b2d6eb789042069a3d7c3c3e9d8489f46758", + "size": 1868 + }, + { + "path": "DragonUI/Textures/WorldMap/3500068-waypoinmappinui.blp", + "from": "DragonUI/Textures/WorldMap/3500068-waypoinmappinui.blp", + "sha1": "17596680ce1562a05746207ec11d3476f34afd90", + "size": 9364 + }, + { + "path": "DragonUI/Textures/WorldMap/3509691-ui-minimap-zoombutton-toggle.blp", + "from": "DragonUI/Textures/WorldMap/3509691-ui-minimap-zoombutton-toggle.blp", + "sha1": "4135662952b3c1985a3df85e6baf972d7b6a1d3f", + "size": 1684 + }, + { + "path": "DragonUI/Textures/WorldMap/5151356-questlogquesttypeicons.blp", + "from": "DragonUI/Textures/WorldMap/5151356-questlogquesttypeicons.blp", + "sha1": "cf2af933753b07be58eda27fd71d1ab51e9ec88b", + "size": 66708 + }, + { + "path": "DragonUI/Textures/WorldMap/5320914-questmapicons.blp", + "from": "DragonUI/Textures/WorldMap/5320914-questmapicons.blp", + "sha1": "1d90198341ab33775f72699f8f997b0dbbfde450", + "size": 132244 + }, + { + "path": "DragonUI/Textures/WorldMap/5684755-questlogbackground.blp", + "from": "DragonUI/Textures/WorldMap/5684755-questlogbackground.blp", + "sha1": "f3dbcf6a16a07a61132ba1d9510eed17eb386ad6", + "size": 2098324 + }, + { + "path": "DragonUI/Textures/WorldMap/5684767-questlogframe2x.blp", + "from": "DragonUI/Textures/WorldMap/5684767-questlogframe2x.blp", + "sha1": "4dcd06919196b182f04f2e1a7dd4e69eb8a3ab32", + "size": 4195476 + }, + { + "path": "DragonUI/Textures/WorldMap/5756295-minimapfilter.blp", + "from": "DragonUI/Textures/WorldMap/5756295-minimapfilter.blp", + "sha1": "0533aead7c93bcc9b39ce0ff54b88e4f9c91d92f", + "size": 33940 + }, + { + "path": "DragonUI/Textures/WorldMap/904010-questmaplogatlas.blp", + "from": "DragonUI/Textures/WorldMap/904010-questmaplogatlas.blp", + "sha1": "df470d8f13465c7906edb829d514a1fe93844d6c", + "size": 8389780 + }, + { + "path": "DragonUI/Textures/WorldMap/mapfilter.blp", + "from": "DragonUI/Textures/WorldMap/mapfilter.blp", + "sha1": "64dc1f5c6dd216f65a1f679315493b206076f3da", + "size": 44864 + }, + { + "path": "DragonUI/Textures/WorldMap/mappins.blp", + "from": "DragonUI/Textures/WorldMap/mappins.blp", + "sha1": "82fa01a9bd18075e09196e4f199c9719103ab6b2", + "size": 175936 + }, + { + "path": "DragonUI/Textures/WorldMap/navbar-tile.blp", + "from": "DragonUI/Textures/WorldMap/navbar-tile.blp", + "sha1": "2e6e725996838cb238cebac604188879dcc8d701", + "size": 350704 + }, + { + "path": "DragonUI/Textures/WorldMap/navbar.blp", + "from": "DragonUI/Textures/WorldMap/navbar.blp", + "sha1": "d0b1c71ffce8eff9b74c548ccc84172db8aa4f05", + "size": 350704 + }, + { + "path": "DragonUI/Textures/WorldMap/poiicons.blp", + "from": "DragonUI/Textures/WorldMap/poiicons.blp", + "sha1": "b80e6326b21e9b97e83aaa905aa459c7e3185b11", + "size": 700224 + }, + { + "path": "DragonUI/Textures/WorldMap/questbg-parchment.blp", + "from": "DragonUI/Textures/WorldMap/questbg-parchment.blp", + "sha1": "db6713fbdc440152f867486f035cf02e4c8d65f5", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/WorldMap/questcollapse.blp", + "from": "DragonUI/Textures/WorldMap/questcollapse.blp", + "sha1": "ddbe48d1c196e7e43fd054ff9781f952a274a834", + "size": 175936 + }, + { + "path": "DragonUI/Textures/WorldMap/questlog-background.blp", + "from": "DragonUI/Textures/WorldMap/questlog-background.blp", + "sha1": "736cbad728a53736487adad5946fed99903aaebf", + "size": 1399272 + }, + { + "path": "DragonUI/Textures/WorldMap/questlog.blp", + "from": "DragonUI/Textures/WorldMap/questlog.blp", + "sha1": "c352e9dc3d021918913cb6680aca900d268719f0", + "size": 1399272 + }, + { + "path": "DragonUI/Textures/WorldMap/questtypeicons.blp", + "from": "DragonUI/Textures/WorldMap/questtypeicons.blp", + "sha1": "828c753fcd5c93eb011dd7c7c0423b9539602944", + "size": 88552 + }, + { + "path": "DragonUI/Textures/WorldMap/squarebuttons.blp", + "from": "DragonUI/Textures/WorldMap/squarebuttons.blp", + "sha1": "5a95496215001883c0e4112d755e6e260c3d8951", + "size": 23016 + }, + { + "path": "DragonUI/Textures/WorldMap/trackingborder.blp", + "from": "DragonUI/Textures/WorldMap/trackingborder.blp", + "sha1": "aae43d2e60eb6e60be8e1eb359b29358d774f5b9", + "size": 23016 + }, + { + "path": "DragonUI/Textures/WorldMap/whitecircle-raidblips.tga", + "from": "DragonUI/Textures/WorldMap/whitecircle-raidblips.tga", + "sha1": "e85a1bb9659ca1d9857b547c7998bb901d772bcb", + "size": 11383 + }, + { + "path": "DragonUI/Textures/WorldMap/whitedotcircle-raidblips.tga", + "from": "DragonUI/Textures/WorldMap/whitedotcircle-raidblips.tga", + "sha1": "3a28b1a098a035d469a84850e2ae9669e3d78ad2", + "size": 13747 + }, + { + "path": "DragonUI/Textures/WorldMap/xp_icon.blp", + "from": "DragonUI/Textures/WorldMap/xp_icon.blp", + "sha1": "79740bac078eddf70bb2b948ab64a03398734fba", + "size": 6660 + }, + { + "path": "DragonUI/Textures/WorldMap/zoomhighlight.blp", + "from": "DragonUI/Textures/WorldMap/zoomhighlight.blp", + "sha1": "d92a65a967b2999091fa6b8592dea6be15a34a9a", + "size": 6632 + }, + { + "path": "DragonUI/Textures/XP/Background.tga", + "from": "DragonUI/Textures/XP/Background.tga", + "sha1": "09f64b35216f4fc542ad7d0030621d3255320ac5", + "size": 5248 + }, + { + "path": "DragonUI/Textures/XP/Background_r.tga", + "from": "DragonUI/Textures/XP/Background_r.tga", + "sha1": "1467f59bafc12b0ee7d5cb748eac2b4a0a882dc1", + "size": 1241 + }, + { + "path": "DragonUI/Textures/XP/Main.tga", + "from": "DragonUI/Textures/XP/Main.tga", + "sha1": "febd2199c2d013def6258c132f9dd4c846fd2394", + "size": 131116 + }, + { + "path": "DragonUI/Textures/XP/Overlay.tga", + "from": "DragonUI/Textures/XP/Overlay.tga", + "sha1": "f7bfebf9e59939b9a53d92cc7be3c1612881e84a", + "size": 8096 + }, + { + "path": "DragonUI/Textures/XP/Overlay_r.tga", + "from": "DragonUI/Textures/XP/Overlay_r.tga", + "sha1": "f32e6aa9cce51bbca2ab8e48b527895541094a0c", + "size": 2244 + }, + { + "path": "DragonUI/Textures/XP/Rested.tga", + "from": "DragonUI/Textures/XP/Rested.tga", + "sha1": "507e5293f33230b392b36a1ac0ff44202c471897", + "size": 131116 + }, + { + "path": "DragonUI/Textures/XP/RestedBackground.tga", + "from": "DragonUI/Textures/XP/RestedBackground.tga", + "sha1": "cdaffb6f8384f5fae12bea0009b7ade121a2b48c", + "size": 131116 + }, + { + "path": "DragonUI/Textures/XP/uiexperiencebar.blp", + "from": "DragonUI/Textures/XP/uiexperiencebar.blp", + "sha1": "2cbc85a2a6197a9dbf698f8470b924d5008396c7", + "size": 1049748 + }, + { + "path": "DragonUI/Textures/bagborderempty2.blp", + "from": "DragonUI/Textures/bagborderempty2.blp", + "sha1": "38039a1dce30d27407027edf3474072f4e389457", + "size": 6676 + }, + { + "path": "DragonUI/Textures/baghighlight2.blp", + "from": "DragonUI/Textures/baghighlight2.blp", + "sha1": "ee9b51a7ec240316cb62b36d347678a6a1be2303", + "size": 6676 + }, + { + "path": "DragonUI/Textures/bagmask.blp", + "from": "DragonUI/Textures/bagmask.blp", + "sha1": "2d7a0269c65fe14b91ab31cb6d17f45bc3db1e64", + "size": 6676 + }, + { + "path": "DragonUI/Textures/bigbag.blp", + "from": "DragonUI/Textures/bigbag.blp", + "sha1": "923892913cfe306ad68da6e5e55f304e61267c39", + "size": 23060 + }, + { + "path": "DragonUI/Textures/bigbagHighlight.blp", + "from": "DragonUI/Textures/bigbagHighlight.blp", + "sha1": "7f97bed37e7f1fd75f522719850cd5862e236030", + "size": 23060 + }, + { + "path": "DragonUI/Textures/newlevel_frame.blp", + "from": "DragonUI/Textures/newlevel_frame.blp", + "sha1": "42f183f4f4355341c661258d1c34024f63f50b65", + "size": 175972 + }, + { + "path": "DragonUI/Textures/ui-frame-portraitmetal-cornertopleftsmall.blp", + "from": "DragonUI/Textures/ui-frame-portraitmetal-cornertopleftsmall.blp", + "sha1": "baa918605b6a786cb473b5dcf1e4e7e933feec1b", + "size": 88596 + }, + { + "path": "DragonUI/config.lua", + "from": "DragonUI/config.lua", + "sha1": "164a62b00139a24f4217eceaf1e6940a9bf49aeb", + "size": 5458 + }, + { + "path": "DragonUI/core.lua", + "from": "DragonUI/core.lua", + "sha1": "355d4ba77b75d0ae01b4995a4e647d9fbaa19d21", + "size": 7576 + }, + { + "path": "DragonUI/core/api.lua", + "from": "DragonUI/core/api.lua", + "sha1": "aea62fcf0da871216a4891ea45e5c1131036df77", + "size": 62143 + }, + { + "path": "DragonUI/core/combatlog_fix.lua", + "from": "DragonUI/core/combatlog_fix.lua", + "sha1": "da8cc9aca9d872fdd259b63201eeda2e57c71eb2", + "size": 1541 + }, + { + "path": "DragonUI/core/commands.lua", + "from": "DragonUI/core/commands.lua", + "sha1": "3199a5b5e874989f160e5990258909aff8b19a36", + "size": 27886 + }, + { + "path": "DragonUI/core/core.xml", + "from": "DragonUI/core/core.xml", + "sha1": "984b7a10290d42b29357c7b519b4959d9e984ee6", + "size": 868 + }, + { + "path": "DragonUI/core/editor_panel.lua", + "from": "DragonUI/core/editor_panel.lua", + "sha1": "f0591c7da150b7daf8cb69c98a87d81b04394bd2", + "size": 56928 + }, + { + "path": "DragonUI/core/editor_settings.lua", + "from": "DragonUI/core/editor_settings.lua", + "sha1": "76b1a7febdcfaaad19699cc0292584014e1adc83", + "size": 85116 + }, + { + "path": "DragonUI/core/fonts.lua", + "from": "DragonUI/core/fonts.lua", + "sha1": "aeda8dcd04dc057f84068b73fc79d0db4a463331", + "size": 3869 + }, + { + "path": "DragonUI/core/modelview.lua", + "from": "DragonUI/core/modelview.lua", + "sha1": "d616b221b83b2e3be57ce4ebd6a0287fc0b24532", + "size": 9913 + }, + { + "path": "DragonUI/core/position_presets.lua", + "from": "DragonUI/core/position_presets.lua", + "sha1": "cfd48ce88df8c3899968051d2b629b61150f993e", + "size": 37156 + }, + { + "path": "DragonUI/core/reload.lua", + "from": "DragonUI/core/reload.lua", + "sha1": "0b1c0b19fcbab11782e3b261a7623f256a8885e2", + "size": 5748 + }, + { + "path": "DragonUI/core/texture_warmup.lua", + "from": "DragonUI/core/texture_warmup.lua", + "sha1": "728cb1e7488fc0552284550fa282073c565bb4ba", + "size": 4700 + }, + { + "path": "DragonUI/core/uiscale.lua", + "from": "DragonUI/core/uiscale.lua", + "sha1": "2ca0a60b8c837096bd8f84e98e8cd658ab89d9fc", + "size": 3047 + }, + { + "path": "DragonUI/core/visibility_fade.lua", + "from": "DragonUI/core/visibility_fade.lua", + "sha1": "ad48de931e18ff25452c1e50042eb3b2f8426bb8", + "size": 13704 + }, + { + "path": "DragonUI/data/aura_durations.lua", + "from": "DragonUI/data/aura_durations.lua", + "sha1": "c0fc0644ee022d03402a80bbc9d7cd49ddb4a3a3", + "size": 231902 + }, + { + "path": "DragonUI/data/companion_traits.lua", + "from": "DragonUI/data/companion_traits.lua", + "sha1": "3b631878439e14ec72d57972db1bdbf41f70c0cf", + "size": 11652 + }, + { + "path": "DragonUI/data/mount_speeds.lua", + "from": "DragonUI/data/mount_speeds.lua", + "sha1": "9403fd02cb743a891685b580d53a4473dbbe1568", + "size": 6546 + }, + { + "path": "DragonUI/data/npc_rare_ranks.lua", + "from": "DragonUI/data/npc_rare_ranks.lua", + "sha1": "fcd241d6695964e9b527f5765c9a32b5deec8ae0", + "size": 99549 + }, + { + "path": "DragonUI/database.lua", + "from": "DragonUI/database.lua", + "sha1": "e045582f49246c4462d18f8072bb55753ad284be", + "size": 81101 + }, + { + "path": "DragonUI/libs/AbsorbsMonitor-1.0/AbsorbsMonitor-1.0.lua", + "from": "DragonUI/libs/AbsorbsMonitor-1.0/AbsorbsMonitor-1.0.lua", + "sha1": "68b84b422c6cd0d2fa605997d10f3356b665902f", + "size": 74547 + }, + { + "path": "DragonUI/libs/AbsorbsMonitor-1.0/AbsorbsMonitor-1.0.xml", + "from": "DragonUI/libs/AbsorbsMonitor-1.0/AbsorbsMonitor-1.0.xml", + "sha1": "78209ae57fbe7d56969bac9b458143720fc24615", + "size": 218 + }, + { + "path": "DragonUI/libs/AbsorbsMonitor-1.0/GPL-2.0.txt", + "from": "DragonUI/libs/AbsorbsMonitor-1.0/GPL-2.0.txt", + "sha1": "9efa6fbc962836e243e20f7f23db062e2c077d28", + "size": 17984 + }, + { + "path": "DragonUI/libs/AceAddon-3.0/AceAddon-3.0.lua", + "from": "DragonUI/libs/AceAddon-3.0/AceAddon-3.0.lua", + "sha1": "6c89654b3750b59cb30b3671ad2e98994ed4b792", + "size": 24779 + }, + { + "path": "DragonUI/libs/AceAddon-3.0/AceAddon-3.0.xml", + "from": "DragonUI/libs/AceAddon-3.0/AceAddon-3.0.xml", + "sha1": "e6ad639f537bff85d4690611b9c5b37f644a35b8", + "size": 211 + }, + { + "path": "DragonUI/libs/AceComm-3.0/AceComm-3.0.lua", + "from": "DragonUI/libs/AceComm-3.0/AceComm-3.0.lua", + "sha1": "ad5268f57b5ad5e4ff52bf4803219a25464f1beb", + "size": 11438 + }, + { + "path": "DragonUI/libs/AceComm-3.0/AceComm-3.0.xml", + "from": "DragonUI/libs/AceComm-3.0/AceComm-3.0.xml", + "sha1": "09e8d874fb30060f612a930e781350c169ce4561", + "size": 248 + }, + { + "path": "DragonUI/libs/AceComm-3.0/ChatThrottleLib.lua", + "from": "DragonUI/libs/AceComm-3.0/ChatThrottleLib.lua", + "sha1": "b0afc92adbc5b146524919a69d97eb3e66a1fac4", + "size": 14434 + }, + { + "path": "DragonUI/libs/AceConsole-3.0/AceConsole-3.0.lua", + "from": "DragonUI/libs/AceConsole-3.0/AceConsole-3.0.lua", + "sha1": "c001123286ba12caf190212ab7f00a2648ba29aa", + "size": 8339 + }, + { + "path": "DragonUI/libs/AceConsole-3.0/AceConsole-3.0.xml", + "from": "DragonUI/libs/AceConsole-3.0/AceConsole-3.0.xml", + "sha1": "be9f47cef721251cc6eae37b23e38490cba21d88", + "size": 213 + }, + { + "path": "DragonUI/libs/AceDB-3.0/AceDB-3.0.lua", + "from": "DragonUI/libs/AceDB-3.0/AceDB-3.0.lua", + "sha1": "7a29450f648fae6421569858cc85a68cc07e95c4", + "size": 24116 + }, + { + "path": "DragonUI/libs/AceDB-3.0/AceDB-3.0.xml", + "from": "DragonUI/libs/AceDB-3.0/AceDB-3.0.xml", + "sha1": "46b20ba9d0ce6fb0ad461fe92ecb7052d0ec9d7c", + "size": 208 + }, + { + "path": "DragonUI/libs/AceEvent-3.0/AceEvent-3.0.lua", + "from": "DragonUI/libs/AceEvent-3.0/AceEvent-3.0.lua", + "sha1": "e9b18b14269666629a1be63d862f162f410fb185", + "size": 4698 + }, + { + "path": "DragonUI/libs/AceEvent-3.0/AceEvent-3.0.xml", + "from": "DragonUI/libs/AceEvent-3.0/AceEvent-3.0.xml", + "sha1": "313ef4dfdfc533447fde1ba4172abe99557bd791", + "size": 211 + }, + { + "path": "DragonUI/libs/AceLocale-3.0/AceLocale-3.0-DragonUI.lua", + "from": "DragonUI/libs/AceLocale-3.0/AceLocale-3.0-DragonUI.lua", + "sha1": "7480da4c78ac98311a346c8985d5735430e165c4", + "size": 7425 + }, + { + "path": "DragonUI/libs/AceLocale-3.0/AceLocale-3.0.lua", + "from": "DragonUI/libs/AceLocale-3.0/AceLocale-3.0.lua", + "sha1": "0f7c8fd6d646d0d8112639df3f99ae0e26047305", + "size": 5757 + }, + { + "path": "DragonUI/libs/AceLocale-3.0/AceLocale-3.0.xml", + "from": "DragonUI/libs/AceLocale-3.0/AceLocale-3.0.xml", + "sha1": "e017af0cce55540da442429711e16b0659e7d838", + "size": 212 + }, + { + "path": "DragonUI/libs/AceSerializer-3.0/AceSerializer-3.0.lua", + "from": "DragonUI/libs/AceSerializer-3.0/AceSerializer-3.0.lua", + "sha1": "b072a2b32f27b2ccb81336907ebfd18e7930ac47", + "size": 8786 + }, + { + "path": "DragonUI/libs/AceSerializer-3.0/AceSerializer-3.0.xml", + "from": "DragonUI/libs/AceSerializer-3.0/AceSerializer-3.0.xml", + "sha1": "94924af9155b573eeab8c7e190440d65a3841818", + "size": 216 + }, + { + "path": "DragonUI/libs/AceTimer-3.0/AceTimer-3.0.lua", + "from": "DragonUI/libs/AceTimer-3.0/AceTimer-3.0.lua", + "sha1": "fdb2cff861cd0f90db3a64056047553bff67b2f7", + "size": 17508 + }, + { + "path": "DragonUI/libs/AceTimer-3.0/AceTimer-3.0.xml", + "from": "DragonUI/libs/AceTimer-3.0/AceTimer-3.0.xml", + "sha1": "38e90216f8bfbf026c7f4a3cb96ecf78a3d51fcf", + "size": 211 + }, + { + "path": "DragonUI/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua", + "from": "DragonUI/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua", + "sha1": "712bf7ee3e17ad9857a5e8add20fa197882d0e92", + "size": 8961 + }, + { + "path": "DragonUI/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml", + "from": "DragonUI/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml", + "sha1": "876df83ab65120f6f1d43f6a36d5523de434bfad", + "size": 218 + }, + { + "path": "DragonUI/libs/LibDeflate/LibDeflate.lua", + "from": "DragonUI/libs/LibDeflate/LibDeflate.lua", + "sha1": "cc00b096d4c8ba9ccb238144898614ecd464cfc1", + "size": 120221 + }, + { + "path": "DragonUI/libs/LibHealComm-4.0/ChatThrottleLib.lua", + "from": "DragonUI/libs/LibHealComm-4.0/ChatThrottleLib.lua", + "sha1": "b0afc92adbc5b146524919a69d97eb3e66a1fac4", + "size": 14434 + }, + { + "path": "DragonUI/libs/LibHealComm-4.0/LibHealComm-4.0.lua", + "from": "DragonUI/libs/LibHealComm-4.0/LibHealComm-4.0.lua", + "sha1": "ba92569e88c75563e6de2e2fde0e6c6c78c6a58b", + "size": 112611 + }, + { + "path": "DragonUI/libs/LibHealComm-4.0/LibHealComm-4.0.xml", + "from": "DragonUI/libs/LibHealComm-4.0/LibHealComm-4.0.xml", + "sha1": "730fcb30d398c9bab3090498158632ae26e8f04f", + "size": 252 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/LibKeyBound-1.0.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/LibKeyBound-1.0.lua", + "sha1": "885b4f7b31d993e3ff3645432872fb2b3d303f47", + "size": 19049 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-deDE.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-deDE.lua", + "sha1": "9ae3e97200798406d39ef43511649dbcafcf2d60", + "size": 2405 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-enUS.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-enUS.lua", + "sha1": "0447641d6fc2ee9d1b15ea6e90eaf69f94fd4309", + "size": 4423 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-esES.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-esES.lua", + "sha1": "845a46b35a89cb5b8e475929ae67f71c2d7c215f", + "size": 2701 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-esMX.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-esMX.lua", + "sha1": "8eadc8032801f7c264e8c3bfe4fdbc430f16765e", + "size": 2368 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-frFR.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-frFR.lua", + "sha1": "4b7d88024df05efb03133eb05eb4aae32baac4d1", + "size": 2371 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-koKR.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-koKR.lua", + "sha1": "cedcd158d43121e52de32d9bd9e35bc1948d45b5", + "size": 2526 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-ruRU.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-ruRU.lua", + "sha1": "a54d72d3d06c224d99c48ca573bb634e87f05cc9", + "size": 2725 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-zhCN.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-zhCN.lua", + "sha1": "e6e6b48b587b40602fcbdd2fa21bc7e06a116dff", + "size": 2383 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/Locale-zhTW.lua", + "from": "DragonUI/libs/LibKeyBound-1.0/Locale-zhTW.lua", + "sha1": "6b5ccc2978fed44d014113250405f44f3958dfb3", + "size": 2395 + }, + { + "path": "DragonUI/libs/LibKeyBound-1.0/lib.xml", + "from": "DragonUI/libs/LibKeyBound-1.0/lib.xml", + "sha1": "3177892bac78d95fa599a9a552324489a954868a", + "size": 520 + }, + { + "path": "DragonUI/libs/LibStub/LibStub.lua", + "from": "DragonUI/libs/LibStub/LibStub.lua", + "sha1": "0a41ac04d56ccc96491989dc71d9875cd804fc6b", + "size": 1367 + }, + { + "path": "DragonUI/libs/LibSwingTimer-1.0/LICENSE.txt", + "from": "DragonUI/libs/LibSwingTimer-1.0/LICENSE.txt", + "sha1": "fd1d381bc4849f7d1f0018a3e3f4c1ade7e3c501", + "size": 1066 + }, + { + "path": "DragonUI/libs/LibSwingTimer-1.0/LibSwingTimer-1.0.lua", + "from": "DragonUI/libs/LibSwingTimer-1.0/LibSwingTimer-1.0.lua", + "sha1": "779487a9cec5bba805837a332c77d2bc14e5b194", + "size": 19406 + }, + { + "path": "DragonUI/modules/BNetToast.lua", + "from": "DragonUI/modules/BNetToast.lua", + "sha1": "e9a6c562eb065dff4d0ca1464b12706a08bb607e", + "size": 26314 + }, + { + "path": "DragonUI/modules/actionbars/actionbars.xml", + "from": "DragonUI/modules/actionbars/actionbars.xml", + "sha1": "4381c260139f0d56be5cb1a53b28c58c223f64d0", + "size": 697 + }, + { + "path": "DragonUI/modules/actionbars/checkedstate.lua", + "from": "DragonUI/modules/actionbars/checkedstate.lua", + "sha1": "c5aa6ef0e0413c193c03d2d8e86c930216e2f2c8", + "size": 381 + }, + { + "path": "DragonUI/modules/actionbars/extrabar.lua", + "from": "DragonUI/modules/actionbars/extrabar.lua", + "sha1": "5223b8cd528a2474d30c686c505840118926d134", + "size": 76230 + }, + { + "path": "DragonUI/modules/actionbars/multicast.lua", + "from": "DragonUI/modules/actionbars/multicast.lua", + "sha1": "0dabb120fcc74303c15452384597901f46bebca4", + "size": 30653 + }, + { + "path": "DragonUI/modules/actionbars/petbar.lua", + "from": "DragonUI/modules/actionbars/petbar.lua", + "sha1": "a28797d3209296e3da788930a7834dae9ddb942a", + "size": 31907 + }, + { + "path": "DragonUI/modules/actionbars/stance.lua", + "from": "DragonUI/modules/actionbars/stance.lua", + "sha1": "14813da12dfa2eea96009c77a777902c68d5f17a", + "size": 28238 + }, + { + "path": "DragonUI/modules/actionbars/vehicle.lua", + "from": "DragonUI/modules/actionbars/vehicle.lua", + "sha1": "2cb9e96910fa54c1c766d654a8818b14e5b4fc9d", + "size": 54416 + }, + { + "path": "DragonUI/modules/addonmanager.lua", + "from": "DragonUI/modules/addonmanager.lua", + "sha1": "247719e7013821d11a839d6fe314909e6bdaa016", + "size": 39234 + }, + { + "path": "DragonUI/modules/addonmanager_icons.lua", + "from": "DragonUI/modules/addonmanager_icons.lua", + "sha1": "74802f89d869f9bda5e9a71ec652b40fd9066ef0", + "size": 2941 + }, + { + "path": "DragonUI/modules/altmoney.lua", + "from": "DragonUI/modules/altmoney.lua", + "sha1": "dec1bd0e0b035952438613c149f78b92cbc4f4ea", + "size": 11059 + }, + { + "path": "DragonUI/modules/auraborders.lua", + "from": "DragonUI/modules/auraborders.lua", + "sha1": "97bfd0645576000d09d4e132791f3469326453b1", + "size": 25727 + }, + { + "path": "DragonUI/modules/auracooldowns.lua", + "from": "DragonUI/modules/auracooldowns.lua", + "sha1": "8f516c2a4efef2e33a3bc30b5c96940b920d1fac", + "size": 17812 + }, + { + "path": "DragonUI/modules/autoaccept.lua", + "from": "DragonUI/modules/autoaccept.lua", + "sha1": "52a9e35ed5ba4c182e1fb7d93e4ff85d2c5b32ad", + "size": 2184 + }, + { + "path": "DragonUI/modules/bags_newitems.lua", + "from": "DragonUI/modules/bags_newitems.lua", + "sha1": "2829f98515677acbab5e3c8bc536c544e046c351", + "size": 17618 + }, + { + "path": "DragonUI/modules/bags_skin.lua", + "from": "DragonUI/modules/bags_skin.lua", + "sha1": "903c2bfe0e05a0b2b3bd59d19f25e4fc45228881", + "size": 26510 + }, + { + "path": "DragonUI/modules/bags_usability.lua", + "from": "DragonUI/modules/bags_usability.lua", + "sha1": "ab8d554257c463c177d221a0e04227593cde6307", + "size": 11869 + }, + { + "path": "DragonUI/modules/bagsort.lua", + "from": "DragonUI/modules/bagsort.lua", + "sha1": "e5e6784ad16fda35360de82ab9f0b48d584d2062", + "size": 88582 + }, + { + "path": "DragonUI/modules/bagster/bagster.lua", + "from": "DragonUI/modules/bagster/bagster.lua", + "sha1": "58ba5f8af321d43b8500256a39d022cc1c1ea4aa", + "size": 17490 + }, + { + "path": "DragonUI/modules/bagster/bagster.xml", + "from": "DragonUI/modules/bagster/bagster.xml", + "sha1": "5ef87c56cc52a0a894fcd979e76007c427556acd", + "size": 361 + }, + { + "path": "DragonUI/modules/bagster/bagster_classes.lua", + "from": "DragonUI/modules/bagster/bagster_classes.lua", + "sha1": "90fe5dc9591514303abef4278a418274ca9006c7", + "size": 75017 + }, + { + "path": "DragonUI/modules/bagster/bagster_data.lua", + "from": "DragonUI/modules/bagster/bagster_data.lua", + "sha1": "acdad20e43696bbed2eee3d70bb15c8c9493e938", + "size": 24486 + }, + { + "path": "DragonUI/modules/bagster/bagster_frame.lua", + "from": "DragonUI/modules/bagster/bagster_frame.lua", + "sha1": "3f007b18894f9d4691f705c36c548dc4d14c82a3", + "size": 35275 + }, + { + "path": "DragonUI/modules/bagster/bagster_guild.lua", + "from": "DragonUI/modules/bagster/bagster_guild.lua", + "sha1": "c41d277f7cd3787671cf801ffd435c04ed8d3cc8", + "size": 39205 + }, + { + "path": "DragonUI/modules/bagster/bagster_search.lua", + "from": "DragonUI/modules/bagster/bagster_search.lua", + "sha1": "ed57dcd8da765c138ed108cc63f9961351d4c2ad", + "size": 10070 + }, + { + "path": "DragonUI/modules/bagster/bagster_sets.lua", + "from": "DragonUI/modules/bagster/bagster_sets.lua", + "sha1": "effec72eeb37e66192213013206d034174ef19f6", + "size": 6722 + }, + { + "path": "DragonUI/modules/bagster/bagster_system.lua", + "from": "DragonUI/modules/bagster/bagster_system.lua", + "sha1": "65a883733726a6fcedb2c61a56eee0b573b07b05", + "size": 15778 + }, + { + "path": "DragonUI/modules/buff_frame.lua", + "from": "DragonUI/modules/buff_frame.lua", + "sha1": "a5e5523193d52995dd8cbc2c66aa260a1db67359", + "size": 96271 + }, + { + "path": "DragonUI/modules/buttons.lua", + "from": "DragonUI/modules/buttons.lua", + "sha1": "e892a2d01d4bdb945ed693d3423c4420f942902f", + "size": 52645 + }, + { + "path": "DragonUI/modules/camera.lua", + "from": "DragonUI/modules/camera.lua", + "sha1": "2b40cbbee61f05b8b55ce640ca26903927b6f179", + "size": 1039 + }, + { + "path": "DragonUI/modules/castbar.lua", + "from": "DragonUI/modules/castbar.lua", + "sha1": "6f985001a5880099bf3ffebcf3376f56aaadef8a", + "size": 113004 + }, + { + "path": "DragonUI/modules/characterpanel/characterpanel.xml", + "from": "DragonUI/modules/characterpanel/characterpanel.xml", + "sha1": "ffe47a3ab46ace632ef21191aba14ebffe77f936", + "size": 2495 + }, + { + "path": "DragonUI/modules/characterpanel/chrome.lua", + "from": "DragonUI/modules/characterpanel/chrome.lua", + "sha1": "f9027deca6a9d4395ffe27eb632eb918a3d53232", + "size": 15902 + }, + { + "path": "DragonUI/modules/characterpanel/compat_hd.lua", + "from": "DragonUI/modules/characterpanel/compat_hd.lua", + "sha1": "7d0d53abf9c04857e5c753fa12647298621c7a62", + "size": 11083 + }, + { + "path": "DragonUI/modules/characterpanel/conquest.lua", + "from": "DragonUI/modules/characterpanel/conquest.lua", + "sha1": "6a2fd52b24821b592562bd99b748cc42fd94d14e", + "size": 57633 + }, + { + "path": "DragonUI/modules/characterpanel/core.lua", + "from": "DragonUI/modules/characterpanel/core.lua", + "sha1": "c56682ec354565fca557cbd845ecf78f9f8763ea", + "size": 4897 + }, + { + "path": "DragonUI/modules/characterpanel/currencypane.lua", + "from": "DragonUI/modules/characterpanel/currencypane.lua", + "sha1": "da3b284d5491ebb061ad4d4ac7314037bb381cdd", + "size": 11645 + }, + { + "path": "DragonUI/modules/characterpanel/diagnostics.lua", + "from": "DragonUI/modules/characterpanel/diagnostics.lua", + "sha1": "190d4dbe22f362bedbdbedcaa7fb182ccaeb2624", + "size": 12044 + }, + { + "path": "DragonUI/modules/characterpanel/equipment.lua", + "from": "DragonUI/modules/characterpanel/equipment.lua", + "sha1": "a5be21023df2cda3d22cf5cb42fc486316a93aa9", + "size": 2073 + }, + { + "path": "DragonUI/modules/characterpanel/equipmentpane.lua", + "from": "DragonUI/modules/characterpanel/equipmentpane.lua", + "sha1": "976cc90d9cf35cacdd86d47d8232ca6486014d74", + "size": 34274 + }, + { + "path": "DragonUI/modules/characterpanel/gearscore.lua", + "from": "DragonUI/modules/characterpanel/gearscore.lua", + "sha1": "1c8454cbef20b7514c7ebaaf087bc0bb02a4fa04", + "size": 4126 + }, + { + "path": "DragonUI/modules/characterpanel/honorpane.lua", + "from": "DragonUI/modules/characterpanel/honorpane.lua", + "sha1": "953ad29d5bf951ea296f149a811046f71614782d", + "size": 12454 + }, + { + "path": "DragonUI/modules/characterpanel/innerborder.lua", + "from": "DragonUI/modules/characterpanel/innerborder.lua", + "sha1": "af7f9a27f0719d7d6495d98cfd43d7853d657eae", + "size": 3183 + }, + { + "path": "DragonUI/modules/characterpanel/insets.lua", + "from": "DragonUI/modules/characterpanel/insets.lua", + "sha1": "e9f528a186002878e1e281712e6732a6d9a0876a", + "size": 3997 + }, + { + "path": "DragonUI/modules/characterpanel/leveltext.lua", + "from": "DragonUI/modules/characterpanel/leveltext.lua", + "sha1": "925161d50d8aebe554660db4de62e9fe014254f7", + "size": 4441 + }, + { + "path": "DragonUI/modules/characterpanel/listpane.lua", + "from": "DragonUI/modules/characterpanel/listpane.lua", + "sha1": "c2538b4f27739c328ba07580e672fbd14697ca0e", + "size": 22916 + }, + { + "path": "DragonUI/modules/characterpanel/model.lua", + "from": "DragonUI/modules/characterpanel/model.lua", + "sha1": "5ee3d8b6d1cdb7c20c18839aba2a3497ccaa8f25", + "size": 13283 + }, + { + "path": "DragonUI/modules/characterpanel/modelcontrols.lua", + "from": "DragonUI/modules/characterpanel/modelcontrols.lua", + "sha1": "8d12a2c3d534d8e13114c1f010e12553614b4742", + "size": 11190 + }, + { + "path": "DragonUI/modules/characterpanel/paneborder.lua", + "from": "DragonUI/modules/characterpanel/paneborder.lua", + "sha1": "6378d8e7d4a0a7bef1d6e6fc3b7afcc1eddd803b", + "size": 2596 + }, + { + "path": "DragonUI/modules/characterpanel/panes.lua", + "from": "DragonUI/modules/characterpanel/panes.lua", + "sha1": "d0fdf2b36033b68d8b97b0e606d27d9bf7cb31ba", + "size": 2000 + }, + { + "path": "DragonUI/modules/characterpanel/petpane.lua", + "from": "DragonUI/modules/characterpanel/petpane.lua", + "sha1": "26f5decfb86edc81afffd46017f6f9a0fbf4101f", + "size": 25452 + }, + { + "path": "DragonUI/modules/characterpanel/portrait.lua", + "from": "DragonUI/modules/characterpanel/portrait.lua", + "sha1": "0efba363f18f3b8a7d38ebb417cf6966e4c82844", + "size": 7638 + }, + { + "path": "DragonUI/modules/characterpanel/reputationdetail.lua", + "from": "DragonUI/modules/characterpanel/reputationdetail.lua", + "sha1": "fb4444fa3603f1db3615f0ac49dbd1133b965689", + "size": 11354 + }, + { + "path": "DragonUI/modules/characterpanel/reputationpane.lua", + "from": "DragonUI/modules/characterpanel/reputationpane.lua", + "sha1": "3d4fd961d9a8de48e01ba6bfdd04c05f6391b64d", + "size": 17211 + }, + { + "path": "DragonUI/modules/characterpanel/reveal.lua", + "from": "DragonUI/modules/characterpanel/reveal.lua", + "sha1": "6fdb17b0a11595731e08ba46926985a86307c6ba", + "size": 4281 + }, + { + "path": "DragonUI/modules/characterpanel/scrollbar.lua", + "from": "DragonUI/modules/characterpanel/scrollbar.lua", + "sha1": "327ddee0b4dedb4a749df0e3c1b865d283351f3f", + "size": 13259 + }, + { + "path": "DragonUI/modules/characterpanel/settingscog.lua", + "from": "DragonUI/modules/characterpanel/settingscog.lua", + "sha1": "bd6169314fdc3b6acb9d94f5a3cc1e9b257cc149", + "size": 5627 + }, + { + "path": "DragonUI/modules/characterpanel/sidebar.lua", + "from": "DragonUI/modules/characterpanel/sidebar.lua", + "sha1": "44204432206f24798081d40cbf43b7c8289b0232", + "size": 41640 + }, + { + "path": "DragonUI/modules/characterpanel/sidebartabs.lua", + "from": "DragonUI/modules/characterpanel/sidebartabs.lua", + "sha1": "7736042e2aee659c6e178f248063b2161634e1b9", + "size": 9061 + }, + { + "path": "DragonUI/modules/characterpanel/skillspane.lua", + "from": "DragonUI/modules/characterpanel/skillspane.lua", + "sha1": "baccd6adf75da5537446a680ff194061dfb11c3b", + "size": 12143 + }, + { + "path": "DragonUI/modules/characterpanel/slots.lua", + "from": "DragonUI/modules/characterpanel/slots.lua", + "sha1": "20a021f1ba3887ede4f2b4e59e95c9f21d579e99", + "size": 4471 + }, + { + "path": "DragonUI/modules/characterpanel/tabs.lua", + "from": "DragonUI/modules/characterpanel/tabs.lua", + "sha1": "3bb40a1b0eb306eb7332e199de5893b956a28876", + "size": 13601 + }, + { + "path": "DragonUI/modules/characterpanel/titles.lua", + "from": "DragonUI/modules/characterpanel/titles.lua", + "sha1": "bb7fef7b54b6f3c750e541a6eb1415b1d58bd8bb", + "size": 764 + }, + { + "path": "DragonUI/modules/characterpanel/titlespane.lua", + "from": "DragonUI/modules/characterpanel/titlespane.lua", + "sha1": "6517faa7aa6bdbc0d16f0c8c7694fe26640e8dc3", + "size": 4471 + }, + { + "path": "DragonUI/modules/chatmods.lua", + "from": "DragonUI/modules/chatmods.lua", + "sha1": "483a0b671adec419838896d0e82b957902a27064", + "size": 59342 + }, + { + "path": "DragonUI/modules/collections/collections.xml", + "from": "DragonUI/modules/collections/collections.xml", + "sha1": "e776735868bbaff6dbce4485aea8a6aa70d90269", + "size": 276 + }, + { + "path": "DragonUI/modules/collections/core.lua", + "from": "DragonUI/modules/collections/core.lua", + "sha1": "8a3c59051b7ef9ea8033d82da8789111d1cb89bd", + "size": 20706 + }, + { + "path": "DragonUI/modules/collections/journal.lua", + "from": "DragonUI/modules/collections/journal.lua", + "sha1": "71b1e765331a31258201014317edbc776381be7f", + "size": 32573 + }, + { + "path": "DragonUI/modules/collections/microbutton.lua", + "from": "DragonUI/modules/collections/microbutton.lua", + "sha1": "3f004ec5faf2fc9b8073541525f7dbcec8e9c14a", + "size": 1788 + }, + { + "path": "DragonUI/modules/collections/window.lua", + "from": "DragonUI/modules/collections/window.lua", + "sha1": "6f246a31b85c0bc1be22b1f0a15d2fa9e08e9226", + "size": 11414 + }, + { + "path": "DragonUI/modules/compactframes.lua", + "from": "DragonUI/modules/compactframes.lua", + "sha1": "1db5ff817f3022ff19c27b5d887583d6b131d16d", + "size": 18176 + }, + { + "path": "DragonUI/modules/compatibility.lua", + "from": "DragonUI/modules/compatibility.lua", + "sha1": "5736e26382bff6331264a096af50ef6f702c77fe", + "size": 51199 + }, + { + "path": "DragonUI/modules/cooldowns.lua", + "from": "DragonUI/modules/cooldowns.lua", + "sha1": "72969e7468cee4c11efdc63978f438b8496ae114", + "size": 11251 + }, + { + "path": "DragonUI/modules/darkmode.lua", + "from": "DragonUI/modules/darkmode.lua", + "sha1": "3db1de9b0d8c8a09bd4c52a044e6ed3a623ff42e", + "size": 64210 + }, + { + "path": "DragonUI/modules/dressupframe.lua", + "from": "DragonUI/modules/dressupframe.lua", + "sha1": "219a6d3e3948a5f94d6505d7537f49f6b3e89aaa", + "size": 8795 + }, + { + "path": "DragonUI/modules/editor_mode.lua", + "from": "DragonUI/modules/editor_mode.lua", + "sha1": "bfcefc3660d9ad64bbe5db3d9c0c59a98dd593b0", + "size": 30886 + }, + { + "path": "DragonUI/modules/equipmentcompare.lua", + "from": "DragonUI/modules/equipmentcompare.lua", + "sha1": "a79d4eea9d96355f34c42bd46888d03269a72504", + "size": 6412 + }, + { + "path": "DragonUI/modules/extra_action_button.lua", + "from": "DragonUI/modules/extra_action_button.lua", + "sha1": "64588d8c88faaeaff5d643e355a5776128319481", + "size": 8802 + }, + { + "path": "DragonUI/modules/gamemenu.lua", + "from": "DragonUI/modules/gamemenu.lua", + "sha1": "7282b27043224264615d5a9af2fd49bfeddbe7ef", + "size": 11955 + }, + { + "path": "DragonUI/modules/gamemenu_dragons.lua", + "from": "DragonUI/modules/gamemenu_dragons.lua", + "sha1": "6ee88db05be2fb9c5cb69b79e658c397e4c8590c", + "size": 7708 + }, + { + "path": "DragonUI/modules/gcd.lua", + "from": "DragonUI/modules/gcd.lua", + "sha1": "3bbdaece4d7ec8bfd08cc93c64e2e15a1ddbd85a", + "size": 11580 + }, + { + "path": "DragonUI/modules/hp_low_alert.lua", + "from": "DragonUI/modules/hp_low_alert.lua", + "sha1": "712c847cf17e8628cb69750822e154acdca1d109", + "size": 6523 + }, + { + "path": "DragonUI/modules/inspectframe.lua", + "from": "DragonUI/modules/inspectframe.lua", + "sha1": "465d2d8d05d845752845bcb02d5057af37884b46", + "size": 12716 + }, + { + "path": "DragonUI/modules/inspector.lua", + "from": "DragonUI/modules/inspector.lua", + "sha1": "e12b4208adba7fc297a9e593c2c2290cb6c7e160", + "size": 68012 + }, + { + "path": "DragonUI/modules/itemlevel.lua", + "from": "DragonUI/modules/itemlevel.lua", + "sha1": "3fb8a419ac5ba236390a6e5e6c3e38676b353a13", + "size": 54332 + }, + { + "path": "DragonUI/modules/itemownership.lua", + "from": "DragonUI/modules/itemownership.lua", + "sha1": "d1184b173e487bd83d782754dc38a7e0801c3391", + "size": 11712 + }, + { + "path": "DragonUI/modules/itemquality.lua", + "from": "DragonUI/modules/itemquality.lua", + "sha1": "f568b0dcfdde5efca797c36614f30d6cc09771a0", + "size": 28503 + }, + { + "path": "DragonUI/modules/keybinding.lua", + "from": "DragonUI/modules/keybinding.lua", + "sha1": "e3425cbfafd9a90ecf48acb162cceb919d9b55f0", + "size": 12869 + }, + { + "path": "DragonUI/modules/keypress.lua", + "from": "DragonUI/modules/keypress.lua", + "sha1": "a18d6871555050ed37174e2ba82acbc2c6d03c88", + "size": 13680 + }, + { + "path": "DragonUI/modules/levelupenhance/levelupdata.lua", + "from": "DragonUI/modules/levelupenhance/levelupdata.lua", + "sha1": "aa5bacac196447ac0ceb788b5c937ecb0a9930ff", + "size": 5582 + }, + { + "path": "DragonUI/modules/levelupenhance/levelupenhance.lua", + "from": "DragonUI/modules/levelupenhance/levelupenhance.lua", + "sha1": "a5fb5280b75339d2d27b64e72371a9f8a37102b5", + "size": 45177 + }, + { + "path": "DragonUI/modules/levelupenhance/levelupenhance.xml", + "from": "DragonUI/modules/levelupenhance/levelupenhance.xml", + "sha1": "6272c88137da8b762bbcb9896c0c2ab0d78e04f2", + "size": 254 + }, + { + "path": "DragonUI/modules/loot_skin.lua", + "from": "DragonUI/modules/loot_skin.lua", + "sha1": "726056074e64be9b83c46f1a558fd53c1390dac7", + "size": 47443 + }, + { + "path": "DragonUI/modules/lootroll.lua", + "from": "DragonUI/modules/lootroll.lua", + "sha1": "9594b30766c4525fc1f830be83c2009a293aaa95", + "size": 14115 + }, + { + "path": "DragonUI/modules/mail.lua", + "from": "DragonUI/modules/mail.lua", + "sha1": "97470f8c2959a07b9736451c56739651a1ba0e67", + "size": 45987 + }, + { + "path": "DragonUI/modules/mainbars.lua", + "from": "DragonUI/modules/mainbars.lua", + "sha1": "ec5fd92ea9ca614f26d6e882c10fe832c4629459", + "size": 159205 + }, + { + "path": "DragonUI/modules/memoryusage/AddonUsage.lua", + "from": "DragonUI/modules/memoryusage/AddonUsage.lua", + "sha1": "b040eee15578240d2550747864d675fbbec5f449", + "size": 5984 + }, + { + "path": "DragonUI/modules/memoryusage/AddonUsage.xml", + "from": "DragonUI/modules/memoryusage/AddonUsage.xml", + "sha1": "128889fa1026c766f83935e324b24e2ac547caa8", + "size": 9154 + }, + { + "path": "DragonUI/modules/merchant/auto_services.lua", + "from": "DragonUI/modules/merchant/auto_services.lua", + "sha1": "c536a8ef86525df263a9272085577ecd21b65731", + "size": 3402 + }, + { + "path": "DragonUI/modules/merchant/buyback_undo.lua", + "from": "DragonUI/modules/merchant/buyback_undo.lua", + "sha1": "bd30990bb5aedbe96c06aae14fad3c6a95ede550", + "size": 1031 + }, + { + "path": "DragonUI/modules/merchant/merchant.xml", + "from": "DragonUI/modules/merchant/merchant.xml", + "sha1": "7a6eaff6e447ff85df41e2d52d7ff135fadc2e43", + "size": 203 + }, + { + "path": "DragonUI/modules/merchant/merchant_frame.lua", + "from": "DragonUI/modules/merchant/merchant_frame.lua", + "sha1": "9d7ba72d8508a5cd574d1567ef128060e5648673", + "size": 27730 + }, + { + "path": "DragonUI/modules/merchant/sell_junk.lua", + "from": "DragonUI/modules/merchant/sell_junk.lua", + "sha1": "27adb551d501f7c2dd21d1ea3624d5fdcd023b89", + "size": 4608 + }, + { + "path": "DragonUI/modules/micromenu.lua", + "from": "DragonUI/modules/micromenu.lua", + "sha1": "c01cecd9f042479ef4cd357a2815dbf2719d8c88", + "size": 111857 + }, + { + "path": "DragonUI/modules/minimap.lua", + "from": "DragonUI/modules/minimap.lua", + "sha1": "0e81037a62310c0b37d6630339075c5ddf0b559d", + "size": 148613 + }, + { + "path": "DragonUI/modules/minimap_collector.lua", + "from": "DragonUI/modules/minimap_collector.lua", + "sha1": "1a63907d893c90542da2b8e21221606115ecc101", + "size": 48206 + }, + { + "path": "DragonUI/modules/minimap_decorations.lua", + "from": "DragonUI/modules/minimap_decorations.lua", + "sha1": "e504e309bc98b46ffb54095c107ae793b3507750", + "size": 39077 + }, + { + "path": "DragonUI/modules/minimap_ping.lua", + "from": "DragonUI/modules/minimap_ping.lua", + "sha1": "f333912d619a8abab409b50ee61cf6d11399831e", + "size": 1022 + }, + { + "path": "DragonUI/modules/modules.xml", + "from": "DragonUI/modules/modules.xml", + "sha1": "15b1b8f66b120685c236a84b161b9d498cc33c6e", + "size": 6893 + }, + { + "path": "DragonUI/modules/nameplates/core/atlas.lua", + "from": "DragonUI/modules/nameplates/core/atlas.lua", + "sha1": "033e97967e16451b0f3f54f538576a43a787d1f4", + "size": 10051 + }, + { + "path": "DragonUI/modules/nameplates/core/config.lua", + "from": "DragonUI/modules/nameplates/core/config.lua", + "sha1": "d932a7b337b2b580ade182369ef833e46439e88d", + "size": 5889 + }, + { + "path": "DragonUI/modules/nameplates/core/constants.lua", + "from": "DragonUI/modules/nameplates/core/constants.lua", + "sha1": "39a6d81aee9083cef80126d6c1728a7c7b176ecc", + "size": 15166 + }, + { + "path": "DragonUI/modules/nameplates/core/init.lua", + "from": "DragonUI/modules/nameplates/core/init.lua", + "sha1": "43ed5aeede08eb03ecc3df163378cffc706f2725", + "size": 943 + }, + { + "path": "DragonUI/modules/nameplates/core/state.lua", + "from": "DragonUI/modules/nameplates/core/state.lua", + "sha1": "a4aebd5c3982d9ec23c8aec81ca2d509f90b1a23", + "size": 6990 + }, + { + "path": "DragonUI/modules/nameplates/core/unitcache.lua", + "from": "DragonUI/modules/nameplates/core/unitcache.lua", + "sha1": "7a3374810c432f9eb316bdfee4525591b91ab653", + "size": 21173 + }, + { + "path": "DragonUI/modules/nameplates/features/auras.lua", + "from": "DragonUI/modules/nameplates/features/auras.lua", + "sha1": "6ce6706b3147e572d718b50760096b46442273d9", + "size": 65314 + }, + { + "path": "DragonUI/modules/nameplates/features/castbar.lua", + "from": "DragonUI/modules/nameplates/features/castbar.lua", + "sha1": "9b6fa612c5b56ca0e919682902ba90569a825302", + "size": 158233 + }, + { + "path": "DragonUI/modules/nameplates/features/clickbox.lua", + "from": "DragonUI/modules/nameplates/features/clickbox.lua", + "sha1": "2bb8c2a184208e8569276c0b667dda92705260bd", + "size": 13209 + }, + { + "path": "DragonUI/modules/nameplates/features/combo.lua", + "from": "DragonUI/modules/nameplates/features/combo.lua", + "sha1": "27115c99c0e1295d4e9181e33c1cb9d28750b165", + "size": 23474 + }, + { + "path": "DragonUI/modules/nameplates/features/elite.lua", + "from": "DragonUI/modules/nameplates/features/elite.lua", + "sha1": "aa0e63b8d089e585dab2d3985fab3b30018b083a", + "size": 4091 + }, + { + "path": "DragonUI/modules/nameplates/features/quest.lua", + "from": "DragonUI/modules/nameplates/features/quest.lua", + "sha1": "eb353a9ae548cd446463102f11c6280cd750a3df", + "size": 23748 + }, + { + "path": "DragonUI/modules/nameplates/features/quest_coexist.lua", + "from": "DragonUI/modules/nameplates/features/quest_coexist.lua", + "sha1": "6dae0480038b47d346e006e19c21006c227e3e01", + "size": 12512 + }, + { + "path": "DragonUI/modules/nameplates/features/quest_providers.lua", + "from": "DragonUI/modules/nameplates/features/quest_providers.lua", + "sha1": "50f2443ccb05c729b4368df1584012df18b31962", + "size": 4723 + }, + { + "path": "DragonUI/modules/nameplates/features/raid_marker.lua", + "from": "DragonUI/modules/nameplates/features/raid_marker.lua", + "sha1": "d703d4cd7164fe0542866456213a26fd266e5fe0", + "size": 7048 + }, + { + "path": "DragonUI/modules/nameplates/features/retail_chrome.lua", + "from": "DragonUI/modules/nameplates/features/retail_chrome.lua", + "sha1": "5870d7322098043045eccc35ea0876db9001cae3", + "size": 23410 + }, + { + "path": "DragonUI/modules/nameplates/features/tap.lua", + "from": "DragonUI/modules/nameplates/features/tap.lua", + "sha1": "fee152b98d4488223bdc7fe412b5b6bf0b35e7cf", + "size": 2889 + }, + { + "path": "DragonUI/modules/nameplates/features/threat.lua", + "from": "DragonUI/modules/nameplates/features/threat.lua", + "sha1": "23bb6d967ea253618831675e82a827c37efee11e", + "size": 6523 + }, + { + "path": "DragonUI/modules/nameplates/features/totem.lua", + "from": "DragonUI/modules/nameplates/features/totem.lua", + "sha1": "b823478f38f4947684b7ff0e2ce22bc197efaf98", + "size": 10450 + }, + { + "path": "DragonUI/modules/nameplates/features/widgets.lua", + "from": "DragonUI/modules/nameplates/features/widgets.lua", + "sha1": "ee03e3ddbf30d9a21e10193f9585e39f3ff596e7", + "size": 1992 + }, + { + "path": "DragonUI/modules/nameplates/nameplates.xml", + "from": "DragonUI/modules/nameplates/nameplates.xml", + "sha1": "ac8d9225924c06e6db8e5e70e437c4cb31f12616", + "size": 1174 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/discovery.lua", + "from": "DragonUI/modules/nameplates/pipeline/discovery.lua", + "sha1": "88ec4257653fd813ae96073606d08cae07b74d02", + "size": 18772 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/engine.lua", + "from": "DragonUI/modules/nameplates/pipeline/engine.lua", + "sha1": "b990bc051a9dfc0bbaef4d6d37e533487b33140e", + "size": 45595 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/gather.lua", + "from": "DragonUI/modules/nameplates/pipeline/gather.lua", + "sha1": "adb02b2c3d9cab9d4efa1dddb077a933024e21a5", + "size": 52750 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/identity.lua", + "from": "DragonUI/modules/nameplates/pipeline/identity.lua", + "sha1": "b8bea8c7a5207c5cd033eb721add378daba78ece", + "size": 39285 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/layout.lua", + "from": "DragonUI/modules/nameplates/pipeline/layout.lua", + "sha1": "017d65a55934d6353f489b01f796c485b04111ce", + "size": 61685 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/lifecycle.lua", + "from": "DragonUI/modules/nameplates/pipeline/lifecycle.lua", + "sha1": "de18144763c94b98ea2e1e2e4ab688db9ce8fa5a", + "size": 13607 + }, + { + "path": "DragonUI/modules/nameplates/pipeline/native_style.lua", + "from": "DragonUI/modules/nameplates/pipeline/native_style.lua", + "sha1": "c9f2eda3153faa12e1938dbf9c5df776104b00cf", + "size": 14551 + }, + { + "path": "DragonUI/modules/noop.lua", + "from": "DragonUI/modules/noop.lua", + "sha1": "3f4e264475aa443c57e18ff34211bfff1b067103", + "size": 7127 + }, + { + "path": "DragonUI/modules/objectivetracker.lua", + "from": "DragonUI/modules/objectivetracker.lua", + "sha1": "56f63d7123d2318b4e9f66f44d540ffa9bc2e38d", + "size": 47479 + }, + { + "path": "DragonUI/modules/performance_warmup.lua", + "from": "DragonUI/modules/performance_warmup.lua", + "sha1": "b92c2690b24a5374fb24131af2627dcd3797fe34", + "size": 2572 + }, + { + "path": "DragonUI/modules/personalresource.lua", + "from": "DragonUI/modules/personalresource.lua", + "sha1": "9be42d870af8de386c32d08ddb8a7bf4921240e8", + "size": 39131 + }, + { + "path": "DragonUI/modules/player_primary_stat.lua", + "from": "DragonUI/modules/player_primary_stat.lua", + "sha1": "392dd2596137a26e5d4f679ddcf47732f22a2ec9", + "size": 11813 + }, + { + "path": "DragonUI/modules/professions/prof_art.lua", + "from": "DragonUI/modules/professions/prof_art.lua", + "sha1": "ffdfcbaeed5b8050bbd5cf41d03a16f876e9b752", + "size": 7145 + }, + { + "path": "DragonUI/modules/professions/prof_atlas.lua", + "from": "DragonUI/modules/professions/prof_atlas.lua", + "sha1": "a968ef4e49168d67cfd515af6b91215e48b7b56e", + "size": 12968 + }, + { + "path": "DragonUI/modules/professions/prof_core.lua", + "from": "DragonUI/modules/professions/prof_core.lua", + "sha1": "e247c708aaa95161fc33c78a4feadc45b3fb3588", + "size": 3655 + }, + { + "path": "DragonUI/modules/professions/prof_details.lua", + "from": "DragonUI/modules/professions/prof_details.lua", + "sha1": "ef493a98e982fdefb8faa7ebe5913d2b02acb8b9", + "size": 16499 + }, + { + "path": "DragonUI/modules/professions/prof_fill.lua", + "from": "DragonUI/modules/professions/prof_fill.lua", + "sha1": "b85a696b02f1980a2bca6cef58a5cf37f20b6b20", + "size": 6075 + }, + { + "path": "DragonUI/modules/professions/prof_filters.lua", + "from": "DragonUI/modules/professions/prof_filters.lua", + "sha1": "cb9dffa98bee236b66c0a90ae409eb4513c61837", + "size": 4423 + }, + { + "path": "DragonUI/modules/professions/prof_frame.lua", + "from": "DragonUI/modules/professions/prof_frame.lua", + "sha1": "a1dbb35b5c0b781fd93093d618e8e7f93cd11427", + "size": 10673 + }, + { + "path": "DragonUI/modules/professions/prof_list.lua", + "from": "DragonUI/modules/professions/prof_list.lua", + "sha1": "205a27381b38c04bf80b1f47ba04a12fdff71390", + "size": 19558 + }, + { + "path": "DragonUI/modules/professions/prof_microbutton.lua", + "from": "DragonUI/modules/professions/prof_microbutton.lua", + "sha1": "8069658f4c2020b48d05d701ebbaeabd759e67da", + "size": 2439 + }, + { + "path": "DragonUI/modules/professions/prof_model.lua", + "from": "DragonUI/modules/professions/prof_model.lua", + "sha1": "941daba4c7872b943df9a145a1a3d1539ed69a5b", + "size": 5081 + }, + { + "path": "DragonUI/modules/professions/prof_overview.lua", + "from": "DragonUI/modules/professions/prof_overview.lua", + "sha1": "6e786253949dca46959b871b4f53f5d986cdbf00", + "size": 20216 + }, + { + "path": "DragonUI/modules/professions/prof_professions.lua", + "from": "DragonUI/modules/professions/prof_professions.lua", + "sha1": "1f1e511e4d03f3a4b6daf5d0e476b1fae6dad625", + "size": 12062 + }, + { + "path": "DragonUI/modules/professions/prof_tabs.lua", + "from": "DragonUI/modules/professions/prof_tabs.lua", + "sha1": "f981ad27eba54471a8a41f097be37288f02bae84", + "size": 7163 + }, + { + "path": "DragonUI/modules/professions/prof_track.lua", + "from": "DragonUI/modules/professions/prof_track.lua", + "sha1": "916fa81820db5a949b116abbce8df72c91382ff1", + "size": 8554 + }, + { + "path": "DragonUI/modules/professions/professions.xml", + "from": "DragonUI/modules/professions/professions.xml", + "sha1": "251b480b081a4eee73652443db9a2de023c8d803", + "size": 655 + }, + { + "path": "DragonUI/modules/profilesync.lua", + "from": "DragonUI/modules/profilesync.lua", + "sha1": "9fe9a972d766b40c8bfac2302845d4bad38389e3", + "size": 9985 + }, + { + "path": "DragonUI/modules/questdialog.lua", + "from": "DragonUI/modules/questdialog.lua", + "sha1": "9e2cdd70e0668a713a2a149b28747e9940ede236", + "size": 14706 + }, + { + "path": "DragonUI/modules/rage_indicator.lua", + "from": "DragonUI/modules/rage_indicator.lua", + "sha1": "1c0b8b1022a079a07a69230b4f233054ab12bb49", + "size": 9241 + }, + { + "path": "DragonUI/modules/spellbook/book_access.lua", + "from": "DragonUI/modules/spellbook/book_access.lua", + "sha1": "95500b1598404cdd123451362b4a766963d3d01f", + "size": 7654 + }, + { + "path": "DragonUI/modules/spellbook/book_bars.lua", + "from": "DragonUI/modules/spellbook/book_bars.lua", + "sha1": "6e4a5f7806a0a59462c2b8a54b490c955bdb0730", + "size": 13317 + }, + { + "path": "DragonUI/modules/spellbook/book_catalog.lua", + "from": "DragonUI/modules/spellbook/book_catalog.lua", + "sha1": "31051b435d392fc9140f5eddb378b212376e6237", + "size": 20131 + }, + { + "path": "DragonUI/modules/spellbook/book_clique.lua", + "from": "DragonUI/modules/spellbook/book_clique.lua", + "sha1": "7503396b1d93f3d1598759cb54c46b3fc11d6d6f", + "size": 7566 + }, + { + "path": "DragonUI/modules/spellbook/book_controls.lua", + "from": "DragonUI/modules/spellbook/book_controls.lua", + "sha1": "74d5a2cdeb68a4ca19f465ba0ef4c5149f799f5b", + "size": 19715 + }, + { + "path": "DragonUI/modules/spellbook/book_core.lua", + "from": "DragonUI/modules/spellbook/book_core.lua", + "sha1": "0410f324bd269b3598ec5af1a797eb0ac704c955", + "size": 11315 + }, + { + "path": "DragonUI/modules/spellbook/book_flyout.lua", + "from": "DragonUI/modules/spellbook/book_flyout.lua", + "sha1": "a89dd574103307e2b62141534a57d42c5d5a45f7", + "size": 15370 + }, + { + "path": "DragonUI/modules/spellbook/book_frame.lua", + "from": "DragonUI/modules/spellbook/book_frame.lua", + "sha1": "3bcbaaa53858c2cc785688590c6015c3da171587", + "size": 10038 + }, + { + "path": "DragonUI/modules/spellbook/book_layout.lua", + "from": "DragonUI/modules/spellbook/book_layout.lua", + "sha1": "6c4a3ce96a29cb9fe3be50899d2630db78c2c868", + "size": 5068 + }, + { + "path": "DragonUI/modules/spellbook/book_profession.lua", + "from": "DragonUI/modules/spellbook/book_profession.lua", + "sha1": "ee97ee4feb0ff685d0d397a7e8fd3a626f76773b", + "size": 6336 + }, + { + "path": "DragonUI/modules/spellbook/book_ranks.lua", + "from": "DragonUI/modules/spellbook/book_ranks.lua", + "sha1": "4b77b843fb997481dbc210c08df1c02e134a7c7c", + "size": 6654 + }, + { + "path": "DragonUI/modules/spellbook/book_secure.lua", + "from": "DragonUI/modules/spellbook/book_secure.lua", + "sha1": "fd0fae69ecf0b7bc5c20939be30be0456942597b", + "size": 12085 + }, + { + "path": "DragonUI/modules/spellbook/book_slots.lua", + "from": "DragonUI/modules/spellbook/book_slots.lua", + "sha1": "7e4b8be199e17d4d7a8e6dced8234b925b586d81", + "size": 23088 + }, + { + "path": "DragonUI/modules/spellbook/spellbook.xml", + "from": "DragonUI/modules/spellbook/spellbook.xml", + "sha1": "bef2c19206a811c11ac0ba367e023c82563ced4b", + "size": 695 + }, + { + "path": "DragonUI/modules/spellbook/trainerdata.lua", + "from": "DragonUI/modules/spellbook/trainerdata.lua", + "sha1": "a9657bb30d311bac9a99213e1525326a362b6946", + "size": 60944 + }, + { + "path": "DragonUI/modules/swingtimer.lua", + "from": "DragonUI/modules/swingtimer.lua", + "sha1": "ebea6b011eeb28fb9cca2797033e6bfa6eeefe6f", + "size": 18591 + }, + { + "path": "DragonUI/modules/talents/build_code.lua", + "from": "DragonUI/modules/talents/build_code.lua", + "sha1": "e5490b55478c96cf156d56b8b4530f635c383eed", + "size": 5105 + }, + { + "path": "DragonUI/modules/talents/build_editor.lua", + "from": "DragonUI/modules/talents/build_editor.lua", + "sha1": "f2b9a28e0ca991941f0549799d1d9c31a4d4ee86", + "size": 16168 + }, + { + "path": "DragonUI/modules/talents/build_menu.lua", + "from": "DragonUI/modules/talents/build_menu.lua", + "sha1": "7162aacb7a6a344e97404b4cc55bbbc33c5734cd", + "size": 9905 + }, + { + "path": "DragonUI/modules/talents/build_model.lua", + "from": "DragonUI/modules/talents/build_model.lua", + "sha1": "595d1c7e0126ad0119ccbe6d910eeec5690ce4d8", + "size": 7997 + }, + { + "path": "DragonUI/modules/talents/build_sharing.lua", + "from": "DragonUI/modules/talents/build_sharing.lua", + "sha1": "c13126fb7ea8324ed61f56827ca6282c4a4de1cd", + "size": 6647 + }, + { + "path": "DragonUI/modules/talents/entry_points.lua", + "from": "DragonUI/modules/talents/entry_points.lua", + "sha1": "45ffc2b0df28e460ffcc4f8048e6cfd5db87f80d", + "size": 7137 + }, + { + "path": "DragonUI/modules/talents/footer_bar.lua", + "from": "DragonUI/modules/talents/footer_bar.lua", + "sha1": "0224867cec10507367d71d043c52b0ef0676a241", + "size": 8826 + }, + { + "path": "DragonUI/modules/talents/glyph_page.lua", + "from": "DragonUI/modules/talents/glyph_page.lua", + "sha1": "6575700beb541afae56e605e0b9522fe21e89566", + "size": 24509 + }, + { + "path": "DragonUI/modules/talents/live_view.lua", + "from": "DragonUI/modules/talents/live_view.lua", + "sha1": "57ee0f53ede0ab8b5dcf28f7037140e5665a5db6", + "size": 10266 + }, + { + "path": "DragonUI/modules/talents/namespace.lua", + "from": "DragonUI/modules/talents/namespace.lua", + "sha1": "f6ea9c12edfbef8751e8609a24e99db19dd0cd73", + "size": 6446 + }, + { + "path": "DragonUI/modules/talents/pvp_orb.lua", + "from": "DragonUI/modules/talents/pvp_orb.lua", + "sha1": "533b9ec78946dfb6899db1133f557d3ae3187068", + "size": 8494 + }, + { + "path": "DragonUI/modules/talents/tab_strip.lua", + "from": "DragonUI/modules/talents/tab_strip.lua", + "sha1": "7895a6b5de37c62e890cf78b366461361ede0ab2", + "size": 6010 + }, + { + "path": "DragonUI/modules/talents/talents.xml", + "from": "DragonUI/modules/talents/talents.xml", + "sha1": "77687491953d949da24f0bc49960cd4d9f757811", + "size": 686 + }, + { + "path": "DragonUI/modules/talents/tree_canvas.lua", + "from": "DragonUI/modules/talents/tree_canvas.lua", + "sha1": "bccbe2fb786321989512355b7dd0c32bf29dc105", + "size": 19987 + }, + { + "path": "DragonUI/modules/talents/window_shell.lua", + "from": "DragonUI/modules/talents/window_shell.lua", + "sha1": "d773db43901ea6ffa955b41e425158242c358f2a", + "size": 17782 + }, + { + "path": "DragonUI/modules/taxiframe.lua", + "from": "DragonUI/modules/taxiframe.lua", + "sha1": "f8fb2dbce864ef1855d8429c962ad2a562350072", + "size": 13297 + }, + { + "path": "DragonUI/modules/tooltip.lua", + "from": "DragonUI/modules/tooltip.lua", + "sha1": "202372c4409141d154a48ffa8ed3c9624601b146", + "size": 36574 + }, + { + "path": "DragonUI/modules/transmog_collector.lua", + "from": "DragonUI/modules/transmog_collector.lua", + "sha1": "b291f0847d00d596577d12968ebb165db973d5cc", + "size": 8674 + }, + { + "path": "DragonUI/modules/unitframes/boss.lua", + "from": "DragonUI/modules/unitframes/boss.lua", + "sha1": "fdeb277242cca1974e0e266b75b9b1b99ce3fb07", + "size": 53110 + }, + { + "path": "DragonUI/modules/unitframes/combopoints.lua", + "from": "DragonUI/modules/unitframes/combopoints.lua", + "sha1": "12174d20eb5de89f34ccc79e4a1c5041d941e624", + "size": 34422 + }, + { + "path": "DragonUI/modules/unitframes/energy_bar.lua", + "from": "DragonUI/modules/unitframes/energy_bar.lua", + "sha1": "5b35fd1a2dad2534d6240331d70e17bee2c46954", + "size": 8122 + }, + { + "path": "DragonUI/modules/unitframes/focus.lua", + "from": "DragonUI/modules/unitframes/focus.lua", + "sha1": "b5e7595cec9a23f5a4d4a5d2e79c0850459ece0e", + "size": 7490 + }, + { + "path": "DragonUI/modules/unitframes/party.lua", + "from": "DragonUI/modules/unitframes/party.lua", + "sha1": "55375c57920ccea2c519f9feda6dab4016c2f3ea", + "size": 96911 + }, + { + "path": "DragonUI/modules/unitframes/pet.lua", + "from": "DragonUI/modules/unitframes/pet.lua", + "sha1": "758646723280310036a3384ec367e094245077e5", + "size": 27759 + }, + { + "path": "DragonUI/modules/unitframes/player.lua", + "from": "DragonUI/modules/unitframes/player.lua", + "sha1": "253822f045d1960fc47968c01ecd86fc907bf1d2", + "size": 171594 + }, + { + "path": "DragonUI/modules/unitframes/small_frame.lua", + "from": "DragonUI/modules/unitframes/small_frame.lua", + "sha1": "b469dd89c775019de73bc9ad012a2c010d2811db", + "size": 43173 + }, + { + "path": "DragonUI/modules/unitframes/target.lua", + "from": "DragonUI/modules/unitframes/target.lua", + "sha1": "7dfcd2f1a322a7da7d90c7c70ff33eb459951243", + "size": 25061 + }, + { + "path": "DragonUI/modules/unitframes/target_style.lua", + "from": "DragonUI/modules/unitframes/target_style.lua", + "sha1": "c656b5d7a9748f169c06a218a07e45616a858b29", + "size": 75043 + }, + { + "path": "DragonUI/modules/unitframes/text_system.lua", + "from": "DragonUI/modules/unitframes/text_system.lua", + "sha1": "bd15924169c04138472e2869c8a6dbbd5ccc0456", + "size": 19647 + }, + { + "path": "DragonUI/modules/unitframes/tof.lua", + "from": "DragonUI/modules/unitframes/tof.lua", + "sha1": "26f9fcadb0e8169812e8b06b5163d5778db265c3", + "size": 1662 + }, + { + "path": "DragonUI/modules/unitframes/tot.lua", + "from": "DragonUI/modules/unitframes/tot.lua", + "sha1": "f5122cd3b31f344d3cc753ab3eb7ebcb08ce8416", + "size": 1671 + }, + { + "path": "DragonUI/modules/unitframes/totemframe.lua", + "from": "DragonUI/modules/unitframes/totemframe.lua", + "sha1": "3cc4839017c43532128f49904b4b340cd406c051", + "size": 11914 + }, + { + "path": "DragonUI/modules/unitframes/uf_compact.lua", + "from": "DragonUI/modules/unitframes/uf_compact.lua", + "sha1": "cb6b2fd618f7e68d7434a3e5c92e26b44c46e7b2", + "size": 18619 + }, + { + "path": "DragonUI/modules/unitframes/uf_core.lua", + "from": "DragonUI/modules/unitframes/uf_core.lua", + "sha1": "75d996643199c50a4274aee9a6ed897122e01c1d", + "size": 23903 + }, + { + "path": "DragonUI/modules/unitframes/uf_layers_deps.lua", + "from": "DragonUI/modules/unitframes/uf_layers_deps.lua", + "sha1": "abe55471d78dbb3b7297b8aec3a1db1254461c65", + "size": 19846 + }, + { + "path": "DragonUI/modules/unitframes/uf_skins.lua", + "from": "DragonUI/modules/unitframes/uf_skins.lua", + "sha1": "9ebad38d44980e863dccf933c4be7ae0e463137d", + "size": 27992 + }, + { + "path": "DragonUI/modules/unitframes/unitframe_layers.lua", + "from": "DragonUI/modules/unitframes/unitframe_layers.lua", + "sha1": "a5edd839c4e8d3d65936f0b702ef38c00d30c275", + "size": 28207 + }, + { + "path": "DragonUI/modules/unitframes/unitframes.xml", + "from": "DragonUI/modules/unitframes/unitframes.xml", + "sha1": "f0dd783759a475ec6247c878318e582ec7394da5", + "size": 1312 + }, + { + "path": "DragonUI/modules/versioncheck.lua", + "from": "DragonUI/modules/versioncheck.lua", + "sha1": "ec78ddc68747a8b5e886a8aa6aba1f31d666c803", + "size": 23671 + }, + { + "path": "DragonUI/modules/versioncheck_signature.lua", + "from": "DragonUI/modules/versioncheck_signature.lua", + "sha1": "3838e2211a74e7787c039bd88447f814d59ad9f9", + "size": 13593 + }, + { + "path": "DragonUI/modules/wildcarddice.lua", + "from": "DragonUI/modules/wildcarddice.lua", + "sha1": "157c0169d72ef0d259132a0fa9ae1880eb0f010f", + "size": 7841 + }, + { + "path": "DragonUI/modules/worldmap/coords.lua", + "from": "DragonUI/modules/worldmap/coords.lua", + "sha1": "99891c664f4bfcb6766158cdd1ee180b17c7b4de", + "size": 2767 + }, + { + "path": "DragonUI/modules/worldmap/core.lua", + "from": "DragonUI/modules/worldmap/core.lua", + "sha1": "8fcf9a2985ca02e13ebfca2eff9de4081c422c8d", + "size": 24806 + }, + { + "path": "DragonUI/modules/worldmap/entrancedata.lua", + "from": "DragonUI/modules/worldmap/entrancedata.lua", + "sha1": "7fb500292e477210d5f04bae78cfda87a594b2f5", + "size": 27690 + }, + { + "path": "DragonUI/modules/worldmap/fade.lua", + "from": "DragonUI/modules/worldmap/fade.lua", + "sha1": "c9913051bce09638d97411a61322884e06151eb7", + "size": 2617 + }, + { + "path": "DragonUI/modules/worldmap/flightpointdata.lua", + "from": "DragonUI/modules/worldmap/flightpointdata.lua", + "sha1": "db215eee9df77f8bf24854a625737fa3b7185b4a", + "size": 86482 + }, + { + "path": "DragonUI/modules/worldmap/fog.lua", + "from": "DragonUI/modules/worldmap/fog.lua", + "sha1": "48e80b8cb03c3ddf3fd76745444ecdc5b9060552", + "size": 2705 + }, + { + "path": "DragonUI/modules/worldmap/fogdata.lua", + "from": "DragonUI/modules/worldmap/fogdata.lua", + "sha1": "569cd23ff3a1f98bfd3d9359ab2c46083472d5e6", + "size": 35463 + }, + { + "path": "DragonUI/modules/worldmap/graveyarddata.lua", + "from": "DragonUI/modules/worldmap/graveyarddata.lua", + "sha1": "8649987a46c185923f15b5e366bc8ec3defea5c9", + "size": 7859 + }, + { + "path": "DragonUI/modules/worldmap/grouppins.lua", + "from": "DragonUI/modules/worldmap/grouppins.lua", + "sha1": "e8f75d61de4079ee1531a4309545b2f03b960ea6", + "size": 8436 + }, + { + "path": "DragonUI/modules/worldmap/inndata.lua", + "from": "DragonUI/modules/worldmap/inndata.lua", + "sha1": "1a852bdb81298dfa585806df99ca0131631020f2", + "size": 32242 + }, + { + "path": "DragonUI/modules/worldmap/mappins.lua", + "from": "DragonUI/modules/worldmap/mappins.lua", + "sha1": "8e5e2e267870b6ebd12d5bedd19808d71e8b3af1", + "size": 13800 + }, + { + "path": "DragonUI/modules/worldmap/navbar.lua", + "from": "DragonUI/modules/worldmap/navbar.lua", + "sha1": "22ececee5147bcc6cd215331c0a7238b4b18d0ca", + "size": 13281 + }, + { + "path": "DragonUI/modules/worldmap/pins.lua", + "from": "DragonUI/modules/worldmap/pins.lua", + "sha1": "33141f39f5cd8492ef0c93b12977eb31851ee4c7", + "size": 24589 + }, + { + "path": "DragonUI/modules/worldmap/playerarrow.lua", + "from": "DragonUI/modules/worldmap/playerarrow.lua", + "sha1": "cd7c1fd7abed5a243f5c6ad455c83e7bffa5b9c2", + "size": 2691 + }, + { + "path": "DragonUI/modules/worldmap/questdetail.lua", + "from": "DragonUI/modules/worldmap/questdetail.lua", + "sha1": "7bd0b3fa2cea21582c30455f779106c45e20ddf3", + "size": 19629 + }, + { + "path": "DragonUI/modules/worldmap/questlog.lua", + "from": "DragonUI/modules/worldmap/questlog.lua", + "sha1": "99f6e3b16cdfad7920d2e6c1b293661492d5bd24", + "size": 44281 + }, + { + "path": "DragonUI/modules/worldmap/worldmap.xml", + "from": "DragonUI/modules/worldmap/worldmap.xml", + "sha1": "b39dc7130e0b0b1a36f7a1a4b1a36df0ee93134b", + "size": 786 + }, + { + "path": "DragonUI/modules/worldmap/zonelevels.lua", + "from": "DragonUI/modules/worldmap/zonelevels.lua", + "sha1": "979b9b51e926fdd5a88a899a1c03b43c127ebd59", + "size": 3896 + }, + { + "path": "DragonUI/modules/worldmap/zoom.lua", + "from": "DragonUI/modules/worldmap/zoom.lua", + "sha1": "78e00beebc99676dce7b9ccecdf1400185d59343", + "size": 7396 + }, + { + "path": "DragonUI/utils/atlas.lua", + "from": "DragonUI/utils/atlas.lua", + "sha1": "f7fce3246be93829dfca406f04b5791bd2b94e19", + "size": 71913 + }, + { + "path": "DragonUI/utils/core.lua", + "from": "DragonUI/utils/core.lua", + "sha1": "a8cf514f286369d29e426d0c940bed4f7418d145", + "size": 5754 + }, + { + "path": "DragonUI/utils/events.lua", + "from": "DragonUI/utils/events.lua", + "sha1": "e2e7e4a1a9bb5ffc5915b063cc01eb8c099bb944", + "size": 1604 + }, + { + "path": "DragonUI/utils/forever_atlas_chrome.lua", + "from": "DragonUI/utils/forever_atlas_chrome.lua", + "sha1": "f3e11b85b03262a8e5164f47cd94cfd1b9740280", + "size": 12722 + }, + { + "path": "DragonUI/utils/forever_atlas_controls.lua", + "from": "DragonUI/utils/forever_atlas_controls.lua", + "sha1": "766fd3214b84c90600cff27b2d3b172572926b48", + "size": 10120 + }, + { + "path": "DragonUI/utils/forever_ui_base.lua", + "from": "DragonUI/utils/forever_ui_base.lua", + "sha1": "513aa5e656e600b15df29df1feefd06d9990d069", + "size": 938 + }, + { + "path": "DragonUI/utils/forever_ui_chrome.lua", + "from": "DragonUI/utils/forever_ui_chrome.lua", + "sha1": "388159318865ed0f554e629c575dc23b3e1c64aa", + "size": 32290 + }, + { + "path": "DragonUI/utils/forever_ui_controls.lua", + "from": "DragonUI/utils/forever_ui_controls.lua", + "sha1": "a3aa3761597960c40f9f434a0be12d9bdde23a69", + "size": 74998 + }, + { + "path": "DragonUI/utils/iconframe.lua", + "from": "DragonUI/utils/iconframe.lua", + "sha1": "8eb5d8027f4cb40c10c069b930eb9e1a78d4b4f2", + "size": 2132 + }, + { + "path": "DragonUI/utils/menu.lua", + "from": "DragonUI/utils/menu.lua", + "sha1": "480c9c3f7ab2d139d13cb7b2500731e3476c717e", + "size": 19612 + }, + { + "path": "DragonUI/utils/nineslice.lua", + "from": "DragonUI/utils/nineslice.lua", + "sha1": "7311287ee91f54aa91c5aa47497c6286e5499dbf", + "size": 11120 + }, + { + "path": "DragonUI/utils/questpoi.lua", + "from": "DragonUI/utils/questpoi.lua", + "sha1": "dd40c8e9d1b20a5238959a40d9e5008bb3b33f2f", + "size": 6275 + }, + { + "path": "DragonUI/utils/redbutton.lua", + "from": "DragonUI/utils/redbutton.lua", + "sha1": "bde5ca76460c30dff55affaf785c529fce13ded7", + "size": 5623 + }, + { + "path": "DragonUI/utils/utils.xml", + "from": "DragonUI/utils/utils.xml", + "sha1": "b0e2471e752994e9a7053666f932d3fca4a15c06", + "size": 3089 + }, + { + "path": "DragonUI/utils/vehicleart.lua", + "from": "DragonUI/utils/vehicleart.lua", + "sha1": "b15de19fd4020c37f388f8d4f7de1b82022e4fc7", + "size": 4262 + }, + { + "path": "DragonUI_Options/DragonUI.blp", + "from": "DragonUI_Options/DragonUI.blp", + "sha1": "cfc1d4ecd1b9fae78f359b0fe90af2292b1ef675", + "size": 525460 + }, + { + "path": "DragonUI_Options/DragonUI_Options.toc", + "from": "DragonUI_Options/DragonUI_Options.toc", + "sha1": "b90e28af413ce3cfb8f9cb159d5eb7460b65694e", + "size": 1351 + }, + { + "path": "DragonUI_Options/LICENSE.txt", + "from": "DragonUI_Options/LICENSE.txt", + "sha1": "521a2aa73f96a1d2891ffcac170ccea79010aba5", + "size": 1911 + }, + { + "path": "DragonUI_Options/LICENSES/Ace3.txt", + "from": "DragonUI_Options/LICENSES/Ace3.txt", + "sha1": "e4c383e10782f09406f29f7e7389a4a679128a60", + "size": 1698 + }, + { + "path": "DragonUI_Options/LICENSES/MIT-NotPlater.txt", + "from": "DragonUI_Options/LICENSES/MIT-NotPlater.txt", + "sha1": "4400346084614d654a2702b9629591b9ec63ad79", + "size": 1067 + }, + { + "path": "DragonUI_Options/LICENSES/OFL-1.1.txt", + "from": "DragonUI_Options/LICENSES/OFL-1.1.txt", + "sha1": "3e42bd984d6112ae12da18d8fcf3f408f052cf98", + "size": 4433 + }, + { + "path": "DragonUI_Options/Locales/Load_Locales.xml", + "from": "DragonUI_Options/Locales/Load_Locales.xml", + "sha1": "b4df8b35cbe0f99c9247f17f19d79df15d4fba27", + "size": 476 + }, + { + "path": "DragonUI_Options/Locales/deDE.lua", + "from": "DragonUI_Options/Locales/deDE.lua", + "sha1": "6423876c1e4dd77aae333f5c918c88b5f52cf46d", + "size": 161767 + }, + { + "path": "DragonUI_Options/Locales/enUS.lua", + "from": "DragonUI_Options/Locales/enUS.lua", + "sha1": "783c26982d18ae701a3adc98ad3624703c7f0f62", + "size": 87938 + }, + { + "path": "DragonUI_Options/Locales/esES.lua", + "from": "DragonUI_Options/Locales/esES.lua", + "sha1": "6a4c807e6e45c929bfbd3de27517e2578f86d923", + "size": 167809 + }, + { + "path": "DragonUI_Options/Locales/esMX.lua", + "from": "DragonUI_Options/Locales/esMX.lua", + "sha1": "6aad656ee73353de20da1bb61e208d574c0d4eb8", + "size": 165106 + }, + { + "path": "DragonUI_Options/Locales/frFR.lua", + "from": "DragonUI_Options/Locales/frFR.lua", + "sha1": "bf66c4576568639ac2de17e8e71a94dde53d675e", + "size": 219914 + }, + { + "path": "DragonUI_Options/Locales/koKR.lua", + "from": "DragonUI_Options/Locales/koKR.lua", + "sha1": "a6a3acb85a113c33835e124cdcc60ad4339f9bb8", + "size": 165104 + }, + { + "path": "DragonUI_Options/Locales/ptBR.lua", + "from": "DragonUI_Options/Locales/ptBR.lua", + "sha1": "e055fc98ae14842d5662cdd7ec33094475d99295", + "size": 212741 + }, + { + "path": "DragonUI_Options/Locales/ruRU.lua", + "from": "DragonUI_Options/Locales/ruRU.lua", + "sha1": "deec0b08de28097f98a448d570cf0306c8588b0f", + "size": 212796 + }, + { + "path": "DragonUI_Options/Locales/zhCN.lua", + "from": "DragonUI_Options/Locales/zhCN.lua", + "sha1": "6ea04df5c72d48c7772202de2a6ed719cc8eee3f", + "size": 147690 + }, + { + "path": "DragonUI_Options/Locales/zhTW.lua", + "from": "DragonUI_Options/Locales/zhTW.lua", + "sha1": "f3968a0b69e1a8ceb97cfaf17564949e91db7192", + "size": 148010 + }, + { + "path": "DragonUI_Options/Textures/search_icon.blp", + "from": "DragonUI_Options/Textures/search_icon.blp", + "sha1": "21e2e8c44b1980b0bcd3764783df5cca13615316", + "size": 6636 + }, + { + "path": "DragonUI_Options/Textures/search_icon_highlight.blp", + "from": "DragonUI_Options/Textures/search_icon_highlight.blp", + "sha1": "875412ed6be9d770817674cb2c24ceb4165f5775", + "size": 6636 + }, + { + "path": "DragonUI_Options/core.lua", + "from": "DragonUI_Options/core.lua", + "sha1": "820f5e01d9e96a37238ea89c46310ce079dae578", + "size": 4124 + }, + { + "path": "DragonUI_Options/fonts/PTSansNarrow.ttf", + "from": "DragonUI_Options/fonts/PTSansNarrow.ttf", + "sha1": "30a67b82421518c91dc2f1dbc0f2fbd95019d50a", + "size": 316044 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfig-3.0.lua", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfig-3.0.lua", + "sha1": "059c08db07ad30f2a0a493780477f291f06d5a60", + "size": 2094 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfig-3.0.xml", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfig-3.0.xml", + "sha1": "87972add47d83b8fc81b13ef5157730ddbdba4e3", + "size": 473 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua", + "sha1": "e764a99c6b8bb4f31ecce4dddd5a3065e02869b6", + "size": 23282 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml", + "sha1": "188d354e3f8b7504956f654c935b2bf8100cb5a0", + "size": 215 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua", + "sha1": "b57ac890b308d9b93b953a5698fd63444d229ce4", + "size": 54836 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml", + "sha1": "86ce057977d92a599d51ca2f8e5490ccea3cee21", + "size": 218 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua", + "sha1": "d98c020429d942522661b3a0d10d39014b9ae072", + "size": 11810 + }, + { + "path": "DragonUI_Options/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml", + "from": "DragonUI_Options/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml", + "sha1": "101bfda13f8083e490e2e3cfbfed455446c63a9d", + "size": 220 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/AceGUI-3.0.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/AceGUI-3.0.lua", + "sha1": "53295bbaacd6f958cde377a9d3b66f5a36c9e6b9", + "size": 23422 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/AceGUI-3.0.xml", + "from": "DragonUI_Options/libs/AceGUI-3.0/AceGUI-3.0.xml", + "sha1": "b515077a29f53e9389d64114bb953ec9797024bb", + "size": 1451 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua", + "sha1": "7f92d828bf4d90198d2ad1de82353cfcfa654d95", + "size": 3491 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua", + "sha1": "083a9f7c074191ac2cc62320fa918698a451ea6a", + "size": 4503 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua", + "sha1": "b35797b4347b69636b07c6cc1111af76dee449b7", + "size": 8824 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua", + "sha1": "9413611c376cb0d2acd5e188d36d93f6ac9b6e58", + "size": 2946 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua", + "sha1": "97e3b5fed40cbf8783c9125e7f16dc276ace48d2", + "size": 6337 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua", + "sha1": "57512c38fdf262ffa3868b7946c8c7f9a1bc2b4c", + "size": 1890 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua", + "sha1": "828769621497fb7dbb0cd69c7dd60dde32a391ba", + "size": 10062 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua", + "sha1": "a5b7916b23da60abb5afa0bd68644d803a09bdcc", + "size": 18764 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua", + "sha1": "bb0a2a284c752afe1fa7aec88e1dec53fd6ccae2", + "size": 9726 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua", + "sha1": "2f49a013ac80cfc6a08cf519ca113757ba85271c", + "size": 2460 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua", + "sha1": "34a25916377ae565e64516ed7973e4285d0bd026", + "size": 7799 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua", + "sha1": "ba026152e23d005ba746b36f6215e42aab153fb4", + "size": 5327 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua", + "sha1": "37baf044a3feaf719a8029bb0e572af9e9946673", + "size": 10360 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua", + "sha1": "cbbba1a2e5111a45c872da1719dc39e32f31fdc6", + "size": 17544 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua", + "sha1": "17e22fc81e27bf92052768635b4669d045a313f4", + "size": 6444 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua", + "sha1": "1aaf3f50c6238940e5f5a4f8a471501f1c869dae", + "size": 2216 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua", + "sha1": "f25b586936851bd4339b461986da5fa192171e05", + "size": 3992 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua", + "sha1": "9e06049a7ff5156b4e0d4b9a337e17c7ad5bb92c", + "size": 2814 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua", + "sha1": "f3043ff200f48e71a0d2152479551339062a5366", + "size": 6285 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua", + "sha1": "7f5f1c59513ed53bb39d261467b1a2bdcc4f088c", + "size": 4327 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua", + "sha1": "90e2fd8c9d5370a7e713830d11246e0b73818747", + "size": 8697 + }, + { + "path": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua", + "from": "DragonUI_Options/libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua", + "sha1": "7f0bd5fb800d6da46cd04a593cd7ad6c5642f0df", + "size": 7974 + }, + { + "path": "DragonUI_Options/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua", + "from": "DragonUI_Options/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua", + "sha1": "712bf7ee3e17ad9857a5e8add20fa197882d0e92", + "size": 8961 + }, + { + "path": "DragonUI_Options/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml", + "from": "DragonUI_Options/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml", + "sha1": "876df83ab65120f6f1d43f6a36d5523de434bfad", + "size": 218 + }, + { + "path": "DragonUI_Options/libs/LibStub/LibStub.lua", + "from": "DragonUI_Options/libs/LibStub/LibStub.lua", + "sha1": "0a41ac04d56ccc96491989dc71d9875cd804fc6b", + "size": 1367 + }, + { + "path": "DragonUI_Options/panel/controls.lua", + "from": "DragonUI_Options/panel/controls.lua", + "sha1": "aa608fc560514261343eb12d6be4ba9314a32d2b", + "size": 63567 + }, + { + "path": "DragonUI_Options/panel/panel.lua", + "from": "DragonUI_Options/panel/panel.lua", + "sha1": "dcf167bb8d2fd72defdecf304180ca51482da3ef", + "size": 25240 + }, + { + "path": "DragonUI_Options/panel/search.lua", + "from": "DragonUI_Options/panel/search.lua", + "sha1": "d115e4d6b71f4643a6669a691ccecbfb199b49b9", + "size": 20755 + }, + { + "path": "DragonUI_Options/panel/tab_actionbars.lua", + "from": "DragonUI_Options/panel/tab_actionbars.lua", + "sha1": "eaa9743fef700f1c002b89db5530fe9ad948c395", + "size": 35657 + }, + { + "path": "DragonUI_Options/panel/tab_additionalbars.lua", + "from": "DragonUI_Options/panel/tab_additionalbars.lua", + "sha1": "9b34466d1a517607efe2d14c77f1cb702501e408", + "size": 10212 + }, + { + "path": "DragonUI_Options/panel/tab_auras.lua", + "from": "DragonUI_Options/panel/tab_auras.lua", + "sha1": "525dd567e2d6817a5f5943043e5ef6b335bcda6b", + "size": 40721 + }, + { + "path": "DragonUI_Options/panel/tab_bags.lua", + "from": "DragonUI_Options/panel/tab_bags.lua", + "sha1": "1601d08adc5f216c217277480730019c8d22f159", + "size": 42498 + }, + { + "path": "DragonUI_Options/panel/tab_bnettoast.lua", + "from": "DragonUI_Options/panel/tab_bnettoast.lua", + "sha1": "a5ec2188519884b37bace6e7a926948abdd22a16", + "size": 6907 + }, + { + "path": "DragonUI_Options/panel/tab_castbars.lua", + "from": "DragonUI_Options/panel/tab_castbars.lua", + "sha1": "4ea124ac07b182ad8da6f3e73c5f26fa5bf1e6f1", + "size": 14745 + }, + { + "path": "DragonUI_Options/panel/tab_chat.lua", + "from": "DragonUI_Options/panel/tab_chat.lua", + "sha1": "01d069c659347fd62f1fd4a01ad77898f3a20d77", + "size": 7222 + }, + { + "path": "DragonUI_Options/panel/tab_enhancements.lua", + "from": "DragonUI_Options/panel/tab_enhancements.lua", + "sha1": "f5d08a79d2fb7cca0f72e13e4bb887cf1921e1e6", + "size": 47777 + }, + { + "path": "DragonUI_Options/panel/tab_general.lua", + "from": "DragonUI_Options/panel/tab_general.lua", + "sha1": "a4d85b1a3bdb443712e89e5de00bcab9d67e8c33", + "size": 26504 + }, + { + "path": "DragonUI_Options/panel/tab_micromenu.lua", + "from": "DragonUI_Options/panel/tab_micromenu.lua", + "sha1": "a66d83b36e4256987a71a467648b4ba16a4d165f", + "size": 7588 + }, + { + "path": "DragonUI_Options/panel/tab_minimap.lua", + "from": "DragonUI_Options/panel/tab_minimap.lua", + "sha1": "453c045f45b113fa2ad373117c5e9baad263153c", + "size": 22092 + }, + { + "path": "DragonUI_Options/panel/tab_modules.lua", + "from": "DragonUI_Options/panel/tab_modules.lua", + "sha1": "df2d0f048014bfeefcda24817c7f93396217fe06", + "size": 13962 + }, + { + "path": "DragonUI_Options/panel/tab_nameplates.lua", + "from": "DragonUI_Options/panel/tab_nameplates.lua", + "sha1": "2e67f341c78789ff731a2a5379a213aa5c7a61fb", + "size": 91654 + }, + { + "path": "DragonUI_Options/panel/tab_panels.lua", + "from": "DragonUI_Options/panel/tab_panels.lua", + "sha1": "ec5c5474216e646642f2fec77cc68421198f3719", + "size": 33462 + }, + { + "path": "DragonUI_Options/panel/tab_profiles.lua", + "from": "DragonUI_Options/panel/tab_profiles.lua", + "sha1": "bf2bc1687f8773fdd1232a69cb5d8b1a503339ed", + "size": 39491 + }, + { + "path": "DragonUI_Options/panel/tab_questtracker.lua", + "from": "DragonUI_Options/panel/tab_questtracker.lua", + "sha1": "141915f6366e50668813a32030102bfed0966b88", + "size": 3310 + }, + { + "path": "DragonUI_Options/panel/tab_unitframes.lua", + "from": "DragonUI_Options/panel/tab_unitframes.lua", + "sha1": "67c819337d6d9327edb9e02f3ac75b2dc426cdd9", + "size": 38148 + }, + { + "path": "DragonUI_Options/panel/tab_worldmap.lua", + "from": "DragonUI_Options/panel/tab_worldmap.lua", + "sha1": "630eb003a0c689a82569202af8d4384fa2d196fa", + "size": 2706 + }, + { + "path": "DragonUI_Options/panel/tab_xprepbars.lua", + "from": "DragonUI_Options/panel/tab_xprepbars.lua", + "sha1": "e33ff0481e86bbdeaa3f5b145e05f65015a5d5df", + "size": 5567 + }, + { + "path": "DragonUI_Options/panel/widget_rowlist.lua", + "from": "DragonUI_Options/panel/widget_rowlist.lua", + "sha1": "69c51828a16bee2727bfe496327a5dea0986e8f1", + "size": 7173 + } + ] + }, + { + "id": "incahoots", + "name": "IncahootsCoA", + "description": { + "en": "Tracks your own buffs and casts them with one click, with a full spellbook browser (/ich).", + "ru": "Следит за вашими баффами и накладывает их одним щелчком; полный обзор книги заклинаний (/ich).", + "de": "Überwacht deine eigenen Buffs und wirkt sie mit einem Klick, mit vollständigem Zauberbuch-Browser (/ich).", + "fr": "Suit vos propres améliorations et les lance d'un clic, avec un navigateur de grimoire complet (/ich).", + "es": "Sigue tus propios beneficios y los lanza con un clic, con un explorador completo del libro de hechizos (/ich).", + "zh": "跟踪你自己的增益效果并一键施放,附带完整的法术书浏览器(/ich)。" + }, + "author": "devnullio", + "license": "see repository", + "repo": "https://github.com/devnullio/IncahootsCoA", + "commit": "fcd4e98b91f0b4ed525a2109bb40778651b45b68", + "archive": "https://codeload.github.com/devnullio/IncahootsCoA/zip/fcd4e98b91f0b4ed525a2109bb40778651b45b68", + "folders": [ + "IncahootsCoA" + ], + "files": [ + { + "path": "IncahootsCoA/Bindings.xml", + "from": "Bindings.xml", + "sha1": "30b2c3e1f4ba3441bb2925341cc2eb81b6efce9d", + "size": 193 + }, + { + "path": "IncahootsCoA/Buffs/Display.lua", + "from": "Buffs/Display.lua", + "sha1": "8ac74d044b6c31d697c02a230005990df0e7645f", + "size": 13641 + }, + { + "path": "IncahootsCoA/Buffs/Rules.lua", + "from": "Buffs/Rules.lua", + "sha1": "4d9a16f3738b1c03699a76ecb9cd53d4f7832aa4", + "size": 6300 + }, + { + "path": "IncahootsCoA/Buffs/Tracker.lua", + "from": "Buffs/Tracker.lua", + "sha1": "c2f26fe3a5c89ece3614d019f2a25fa837900bb1", + "size": 5827 + }, + { + "path": "IncahootsCoA/Core/Commands.lua", + "from": "Core/Commands.lua", + "sha1": "e530755dcd774fd56c8f66f1aa3b1a760e0a2424", + "size": 2234 + }, + { + "path": "IncahootsCoA/Core/Database.lua", + "from": "Core/Database.lua", + "sha1": "e8664c421ed009a8325a839b2b56850ba9a3129d", + "size": 3592 + }, + { + "path": "IncahootsCoA/Core/Init.lua", + "from": "Core/Init.lua", + "sha1": "9a8685cc58eb8a13c4f685e293e34f3c58e9fe27", + "size": 9560 + }, + { + "path": "IncahootsCoA/IncahootsCoA.toc", + "from": "IncahootsCoA.toc", + "sha1": "59265d92e9b318e4bb960ffe1bb8e908e8decb49", + "size": 556 + }, + { + "path": "IncahootsCoA/Spells/BuffLearner.lua", + "from": "Spells/BuffLearner.lua", + "sha1": "95f720e220100d7ed99b6aa18574a8eae110e34d", + "size": 3954 + }, + { + "path": "IncahootsCoA/Spells/SpellBook.lua", + "from": "Spells/SpellBook.lua", + "sha1": "d0f2a227a8faefea55c76bc31d4d93467a9a0b2d", + "size": 11684 + }, + { + "path": "IncahootsCoA/UI/MainFrame.lua", + "from": "UI/MainFrame.lua", + "sha1": "35d0e043e5d8505fc2d66edb23f90a54e31ef920", + "size": 5706 + }, + { + "path": "IncahootsCoA/UI/Minimap.lua", + "from": "UI/Minimap.lua", + "sha1": "7291423fa82fb9080d5b0507aac7275bdce09647", + "size": 3315 + }, + { + "path": "IncahootsCoA/UI/Pages/ActiveBuffs.lua", + "from": "UI/Pages/ActiveBuffs.lua", + "sha1": "46cb45331c6a9c881ea6439fcce29d835fa47e5d", + "size": 5642 + }, + { + "path": "IncahootsCoA/UI/Pages/Display.lua", + "from": "UI/Pages/Display.lua", + "sha1": "42d0e797dd6e58d664c252aff0ebdab9bf6d03f3", + "size": 4660 + }, + { + "path": "IncahootsCoA/UI/Pages/General.lua", + "from": "UI/Pages/General.lua", + "sha1": "129e9034a4599673ca1e43e7704deb4545a168db", + "size": 3546 + }, + { + "path": "IncahootsCoA/UI/Pages/MyBuffs.lua", + "from": "UI/Pages/MyBuffs.lua", + "sha1": "dd76534a491a10c50314a0fba460603fcc8c404f", + "size": 15806 + }, + { + "path": "IncahootsCoA/UI/Pages/Spellbook.lua", + "from": "UI/Pages/Spellbook.lua", + "sha1": "861a46c5652f8c74595b8e8d0068f967d5fd9d82", + "size": 12797 + }, + { + "path": "IncahootsCoA/UI/Widgets.lua", + "from": "UI/Widgets.lua", + "sha1": "25fef47599f64d0a22db6e2727cb940efe4210a5", + "size": 21540 + } + ] + }, + { + "id": "coacombat", + "name": "CoACombat", + "description": { + "en": "Action camera: persistent mouselook, an RPG camera, centre reticles and combat mouse bindings.", + "ru": "Камера в стиле экшена: постоянный обзор мышью, RPG-камера, прицел по центру и боевые привязки мыши.", + "de": "Action-Kamera: dauerhafte Maussteuerung, RPG-Kamera, Fadenkreuz in der Mitte und Kampf-Mausbelegung.", + "fr": "Caméra d'action : vue souris permanente, caméra RPG, réticule central et raccourcis souris de combat.", + "es": "Cámara de acción: vista con ratón permanente, cámara RPG, retícula central y atajos de ratón de combate.", + "zh": "动作视角:常驻鼠标视角、RPG 镜头、屏幕中心准星和战斗鼠标绑定。" + }, + "author": "HighOnGames", + "license": "see repository", + "repo": "https://github.com/HighOnGames/CoACombat", + "commit": "a858e4d20c062bd14c99294a82ed10eafd70ade2", + "archive": "https://codeload.github.com/HighOnGames/CoACombat/zip/a858e4d20c062bd14c99294a82ed10eafd70ade2", + "folders": [ + "CoACombat" + ], + "files": [ + { + "path": "CoACombat/Bindings.lua", + "from": "CoACombat/Bindings.lua", + "sha1": "207da9c9c6b898eef9e24fd3168e64f7f3251f94", + "size": 3389 + }, + { + "path": "CoACombat/Bindings.xml", + "from": "CoACombat/Bindings.xml", + "sha1": "474decbb727ce0b0ae944dcad4cfab9b93c825ef", + "size": 603 + }, + { + "path": "CoACombat/Camera.lua", + "from": "CoACombat/Camera.lua", + "sha1": "36a4438f7aed2c336b19921231a49f142630875f", + "size": 8057 + }, + { + "path": "CoACombat/CameraOptions.lua", + "from": "CoACombat/CameraOptions.lua", + "sha1": "f3b9acd68be6d0f7c69887472239ffba11ff60c5", + "size": 4241 + }, + { + "path": "CoACombat/CoACombat.toc", + "from": "CoACombat/CoACombat.toc", + "sha1": "10ee672f69e128aa2a3efc72c35b769854638b76", + "size": 543 + }, + { + "path": "CoACombat/Core.lua", + "from": "CoACombat/Core.lua", + "sha1": "bba925bd38267d37f35b7f23562e0896a2b271ac", + "size": 15753 + }, + { + "path": "CoACombat/CrosshairOptions.lua", + "from": "CoACombat/CrosshairOptions.lua", + "sha1": "4ce35a715baa38ee24f8a3b495b597e1bc05b526", + "size": 5664 + }, + { + "path": "CoACombat/Interact.lua", + "from": "CoACombat/Interact.lua", + "sha1": "ac917a88c24fdd5c4a89f1d8261b8b8215daa737", + "size": 456 + }, + { + "path": "CoACombat/Locale.lua", + "from": "CoACombat/Locale.lua", + "sha1": "996ab903466863d1ca9784962c6762d833ea3131", + "size": 11428 + }, + { + "path": "CoACombat/Macros.lua", + "from": "CoACombat/Macros.lua", + "sha1": "2847dc35d49aae1ceb960eff2ec240cf03bf4e08", + "size": 690 + }, + { + "path": "CoACombat/MouseLook.lua", + "from": "CoACombat/MouseLook.lua", + "sha1": "c36b7aa633ea3bea19fd9092a62793aad85fb00e", + "size": 6159 + }, + { + "path": "CoACombat/Options.lua", + "from": "CoACombat/Options.lua", + "sha1": "13738cddc7f1fa285ca0aa6ce0fdb221af86591e", + "size": 5112 + }, + { + "path": "CoACombat/Presets.lua", + "from": "CoACombat/Presets.lua", + "sha1": "c047e235e7d7950fdbd871555e3a410322a53903", + "size": 2265 + }, + { + "path": "CoACombat/README.md", + "from": "CoACombat/README.md", + "sha1": "6f4c5a55effc53e71a8752988ba454658744f128", + "size": 19415 + }, + { + "path": "CoACombat/Reticle.lua", + "from": "CoACombat/Reticle.lua", + "sha1": "2cec65458b8dc7448e39f0bd0bc7a6b6f1dafb7f", + "size": 6219 + }, + { + "path": "CoACombat/Targeting.lua", + "from": "CoACombat/Targeting.lua", + "sha1": "214180b3c7fed31e55b87230d0ce4fd40b91851a", + "size": 2845 + }, + { + "path": "CoACombat/Textures/Curved.tga", + "from": "CoACombat/Textures/Curved.tga", + "sha1": "6af6bc0089e82ab1077543073c1c195f9acba1cc", + "size": 65580 + }, + { + "path": "CoACombat/Textures/Diagonal.tga", + "from": "CoACombat/Textures/Diagonal.tga", + "sha1": "8e285ccbbd99c12c85d09e9e95a8b0a97fbb0ecd", + "size": 65580 + }, + { + "path": "CoACombat/Textures/Plus.tga", + "from": "CoACombat/Textures/Plus.tga", + "sha1": "41ab20ada46874c5d22f7a20e696c6c6195db274", + "size": 65580 + }, + { + "path": "CoACombat/Textures/Stacked.tga", + "from": "CoACombat/Textures/Stacked.tga", + "sha1": "66179f0d28375783f3c44f3cf93b77dac6b41b8e", + "size": 65580 + }, + { + "path": "CoACombat/Textures/TBar.tga", + "from": "CoACombat/Textures/TBar.tga", + "sha1": "9356a772ec34d31597d5d48affbf246738d3d2e5", + "size": 65580 + }, + { + "path": "CoACombat/Textures/Triad.tga", + "from": "CoACombat/Textures/Triad.tga", + "sha1": "5b9739494dd7ee84247076f3a40d2b1f93fc363b", + "size": 16428 + } + ] + } + ] +} diff --git a/changelog.d/20261115-addon-catalog.md b/changelog.d/20261115-addon-catalog.md new file mode 100644 index 0000000..4208b91 --- /dev/null +++ b/changelog.d/20261115-addon-catalog.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: players +title: Install community addons from the Manager +--- +The game client card lists SquidBots Lite, DragonUI, IncahootsCoA and CoACombat. Each comes from its author's GitHub at a pinned version, every file is checked before it goes into Interface/AddOns, and the Manager updates or removes only what it installed. diff --git a/crates/coa-core/src/addons.rs b/crates/coa-core/src/addons.rs new file mode 100644 index 0000000..1a266f6 --- /dev/null +++ b/crates/coa-core/src/addons.rs @@ -0,0 +1,459 @@ +//! A catalog of game addons the Manager can install into a client's `Interface/AddOns`. +//! +//! Every addon is pinned to a commit of its GitHub repository; the catalog lists each file it installs with its +//! git blob SHA-1 and size, which are checked after download (GitHub's archives are not byte-stable, their +//! contents are). The Manager records what it installed in `Interface/AddOns/.coa-addons.json` and only ever +//! removes or replaces those folders; a folder of the same name that someone else put there is moved to +//! `Interface/AddOns/.coa-addons-backup` first. + +use std::collections::BTreeMap; +use std::fs; +use std::io::{Read, Write}; +use std::path::{Path, PathBuf}; + +use serde::{Deserialize, Serialize}; +use sha1::{Digest, Sha1}; + +use crate::download::{Cancel, Transport}; +use crate::error::{Error, Result}; +use crate::fsx; + +static CATALOG: &str = include_str!("../../../addons/catalog.json"); +const STATE: &str = ".coa-addons.json"; +const BACKUP: &str = ".coa-addons-backup"; +/// No addon archive is anywhere near this; a larger answer is not what the catalog describes. +const MAX_ARCHIVE: u64 = 1 << 30; + +#[derive(Debug, Clone, Deserialize)] +struct AddonFile { + path: String, + from: String, + sha1: String, + size: u64, +} + +#[derive(Debug, Clone, Deserialize)] +struct Entry { + id: String, + name: String, + description: BTreeMap<String, String>, + author: String, + license: String, + #[serde(default)] + needs: Option<String>, + repo: String, + commit: String, + archive: String, + folders: Vec<String>, + files: Vec<AddonFile>, +} + +#[derive(Deserialize)] +struct Catalog { + addons: Vec<Entry>, +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +struct Installed { + commit: String, + folders: Vec<String>, +} + +/// One addon of the catalog as the Manager shows it for a client. +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct AddonView { + pub id: String, + pub name: String, + pub description: BTreeMap<String, String>, + pub author: String, + pub license: String, + /// A server module the addon is made for (`playerbots`), shown as a hint. + pub needs: Option<String>, + pub repo: String, + pub size: u64, + pub installed: bool, + pub update_available: bool, + /// Folders of this addon that are in the client but were not installed by the Manager. + pub foreign_folders: Vec<String>, +} + +fn catalog() -> Result<Vec<Entry>> { + let catalog: Catalog = serde_json::from_str(CATALOG)?; + for entry in &catalog.addons { + for folder in &entry.folders { + if folder.is_empty() || folder.contains(['/', '\\']) || folder.starts_with('.') { + return Err(Error::Invalid(format!("Invalid addon folder in the catalog: {folder}"))); + } + } + } + Ok(catalog.addons) +} + +fn addons_dir(client: &Path) -> PathBuf { + client.join("Interface").join("AddOns") +} + +fn read_state(client: &Path) -> BTreeMap<String, Installed> { + fsx::read_json(&addons_dir(client).join(STATE)).unwrap_or_default() +} + +fn write_state(client: &Path, state: &BTreeMap<String, Installed>) -> Result<()> { + fsx::atomic_write_json(&addons_dir(client).join(STATE), state) +} + +/// The catalog with what is installed in `client`. +pub fn list(client: &Path) -> Result<Vec<AddonView>> { + let state = read_state(client); + let dir = addons_dir(client); + let owned: Vec<&String> = state.values().flat_map(|i| i.folders.iter()).collect(); + Ok(catalog()? + .into_iter() + .map(|entry| { + let installed = state.get(&entry.id); + AddonView { + foreign_folders: entry + .folders + .iter() + .filter(|f| dir.join(f).exists() && !owned.contains(f)) + .cloned() + .collect(), + size: entry.files.iter().map(|f| f.size).sum(), + installed: installed.is_some(), + update_available: installed.is_some_and(|i| i.commit != entry.commit), + id: entry.id, + name: entry.name, + description: entry.description, + author: entry.author, + license: entry.license, + needs: entry.needs, + repo: entry.repo, + } + }) + .collect()) +} + +/// The git blob id of `bytes` (what the catalog records for each file). +fn git_blob_sha1(bytes: &[u8]) -> String { + let mut hasher = Sha1::new(); + hasher.update(format!("blob {}\0", bytes.len()).as_bytes()); + hasher.update(bytes); + hex::encode(hasher.finalize()) +} + +fn download(transport: &dyn Transport, url: &str, dest: &Path, cancel: &Cancel) -> Result<()> { + crate::download::check_url(url)?; + let reply = transport.get(url, 0).map_err(Error::Invalid)?; + if reply.status != 200 { + return Err(Error::Invalid(format!("The addon download answered HTTP {}.", reply.status))); + } + let mut body = reply.body.take(MAX_ARCHIVE + 1); + let mut file = fs::File::create(dest)?; + let mut buf = vec![0u8; 1 << 20]; + let mut total = 0u64; + loop { + if cancel.is_set() { + return Err(Error::Invalid("Operation cancelled.".into())); + } + let n = body.read(&mut buf)?; + if n == 0 { + break; + } + total += n as u64; + if total > MAX_ARCHIVE { + return Err(Error::Invalid("The addon download is larger than any catalog addon.".into())); + } + file.write_all(&buf[..n])?; + } + file.sync_all()?; + Ok(()) +} + +/// Unpack the catalog's files of `entry` from `archive` into `staging`, checking every one. +fn unpack(entry: &Entry, archive: &Path, staging: &Path) -> Result<()> { + let mut zip = zip::ZipArchive::new(fs::File::open(archive)?) + .map_err(|e| Error::Invalid(format!("The addon download is not a zip archive: {e}")))?; + // GitHub archives hold everything under one top folder (`<repo>-<commit>/`). + let mut by_path = BTreeMap::new(); + for index in 0..zip.len() { + let name = zip + .by_index(index) + .map_err(|e| Error::Invalid(e.to_string()))? + .name() + .replace('\\', "/"); + if let Some((_, inner)) = name.split_once('/') { + by_path.insert(inner.to_string(), index); + } + } + for file in &entry.files { + let index = *by_path + .get(&file.from) + .ok_or_else(|| Error::Invalid(format!("The addon download lacks {}.", file.from)))?; + let mut zipped = zip.by_index(index).map_err(|e| Error::Invalid(e.to_string()))?; + let mut bytes = Vec::with_capacity(file.size as usize); + zipped.by_ref().take(file.size + 1).read_to_end(&mut bytes)?; + if bytes.len() as u64 != file.size || git_blob_sha1(&bytes) != file.sha1 { + return Err(Error::Invalid(format!("{} failed verification.", file.from))); + } + let target = fsx::safe_join(staging, &file.path)?; + if let Some(parent) = target.parent() { + fs::create_dir_all(parent)?; + } + fs::write(target, bytes)?; + } + Ok(()) +} + +fn stamp() -> String { + chrono::Local::now().format("%Y%m%d-%H%M%S").to_string() +} + +/// Install or update `id` in `client` from `transport`. +pub fn install_with(transport: &dyn Transport, client: &Path, id: &str, cancel: &Cancel) -> Result<Vec<AddonView>> { + if crate::client::is_running(client) { + return Err(Error::Invalid("Close the game before installing addons.".into())); + } + let entry = catalog()? + .into_iter() + .find(|e| e.id == id) + .ok_or_else(|| Error::Invalid(format!("Unknown addon {id}.")))?; + install_entry(transport, client, &entry, cancel)?; + list(client) +} + +fn install_entry(transport: &dyn Transport, client: &Path, entry: &Entry, cancel: &Cancel) -> Result<()> { + let dir = addons_dir(client); + fs::create_dir_all(&dir)?; + // Staged next to AddOns' own folders, so the final moves stay on one volume even for a linked AddOns. + let staging = tempfile::Builder::new().prefix(".coa-addon-").tempdir_in(&dir)?; + let archive = staging.path().join("archive.zip"); + download(transport, &entry.archive, &archive, cancel)?; + let unpacked = staging.path().join("files"); + unpack(entry, &archive, &unpacked)?; + if cancel.is_set() { + return Err(Error::Invalid("Operation cancelled.".into())); + } + let mut state = read_state(client); + let ours: Vec<String> = state.values().flat_map(|i| i.folders.clone()).collect(); + // Move what is in the way out first, so a failed move leaves the client as it was. + let mut moved: Vec<(PathBuf, PathBuf)> = Vec::new(); + let undo = |moved: &[(PathBuf, PathBuf)]| { + for (from, to) in moved.iter().rev() { + let _ = fs::rename(to, from); + } + }; + for folder in &entry.folders { + let target = dir.join(folder); + if !target.exists() { + continue; + } + let aside = if ours.contains(folder) { + staging.path().join("old").join(folder) + } else { + dir.join(BACKUP).join(format!("{folder}-{}", stamp())) + }; + if let Some(parent) = aside.parent() { + fs::create_dir_all(parent)?; + } + if let Err(e) = fs::rename(&target, &aside) { + undo(&moved); + return Err(Error::Invalid(format!("{folder} is in use and could not be replaced: {e}"))); + } + moved.push((target, aside)); + } + let mut placed: Vec<PathBuf> = Vec::new(); + for folder in &entry.folders { + let target = dir.join(folder); + if let Err(e) = fs::rename(unpacked.join(folder), &target) { + for p in &placed { + let _ = fs::remove_dir_all(p); + } + undo(&moved); + return Err(Error::Invalid(format!("{folder} could not be installed: {e}"))); + } + placed.push(target); + } + state.insert( + entry.id.clone(), + Installed { + commit: entry.commit.clone(), + folders: entry.folders.clone(), + }, + ); + write_state(client, &state)?; + tracing::info!(addon = %entry.id, commit = %entry.commit, "addon installed"); + Ok(()) +} + +pub fn install(client: &Path, id: &str, cancel: &Cancel) -> Result<Vec<AddonView>> { + install_with(&crate::download::HttpTransport::with_total_timeout(1800)?, client, id, cancel) +} + +/// Remove an addon the Manager installed (only its recorded folders). +pub fn remove(client: &Path, id: &str) -> Result<Vec<AddonView>> { + if crate::client::is_running(client) { + return Err(Error::Invalid("Close the game before removing addons.".into())); + } + let mut state = read_state(client); + let Some(installed) = state.remove(id) else { + return list(client); + }; + let dir = addons_dir(client); + for folder in &installed.folders { + if folder.is_empty() || folder.contains(['/', '\\']) || folder.starts_with('.') { + continue; + } + let target = dir.join(folder); + if target.exists() { + fs::remove_dir_all(&target)?; + } + } + write_state(client, &state)?; + list(client) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::download::Reply; + + struct Serve(Vec<u8>); + impl Transport for Serve { + fn get(&self, _: &str, _: u64) -> std::result::Result<Reply, String> { + Ok(Reply { status: 200, content_range: None, body: Box::new(std::io::Cursor::new(self.0.clone())) }) + } + } + + /// A GitHub-like archive of the catalog entry `id` with the given file bodies (path in repo -> bytes). + fn archive(entry: &Entry, body: &dyn Fn(&AddonFile) -> Vec<u8>) -> Vec<u8> { + let mut out = std::io::Cursor::new(Vec::new()); + let mut zip = zip::ZipWriter::new(&mut out); + for file in &entry.files { + zip.start_file(format!("repo-{}/{}", entry.commit, file.from), zip::write::SimpleFileOptions::default()) + .unwrap(); + zip.write_all(&body(file)).unwrap(); + } + zip.finish().unwrap(); + out.into_inner() + } + + /// A small catalog entry whose files hash to what the archive will hold. + fn small_entry() -> Entry { + let bytes = b"## Interface: 30300\n".to_vec(); + Entry { + id: "t".into(), + name: "T".into(), + description: BTreeMap::new(), + author: "a".into(), + license: "x".into(), + needs: None, + repo: "r".into(), + commit: "c1".into(), + archive: "https://example.invalid/a.zip".into(), + folders: vec!["TestAddon".into()], + files: vec![AddonFile { + path: "TestAddon/TestAddon.toc".into(), + from: "TestAddon/TestAddon.toc".into(), + sha1: git_blob_sha1(&bytes), + size: bytes.len() as u64, + }], + } + } + + #[test] + fn the_catalog_is_valid_and_pins_every_addon() { + let entries = catalog().unwrap(); + assert!(entries.len() >= 4); + for e in &entries { + assert_eq!(e.commit.len(), 40, "{}", e.id); + assert!(e.archive.starts_with("https://codeload.github.com/") && e.archive.ends_with(&e.commit)); + assert!(e.description.contains_key("en") && e.description.contains_key("ru")); + for folder in &e.folders { + assert!(e.files.iter().any(|f| f.path.eq_ignore_ascii_case(&format!("{folder}/{folder}.toc")) + || f.path.starts_with(&format!("{folder}/")) && f.path.ends_with(".toc")), "{folder} has no toc"); + } + for f in &e.files { + fsx::safe_join(Path::new("C:/x"), &f.path).unwrap(); + assert!(e.folders.iter().any(|folder| f.path.starts_with(&format!("{folder}/")))); + } + } + } + + #[test] + #[ignore = "Downloads the catalog's small addons from GitHub"] + fn the_real_catalog_installs_from_github() { + let client = tempfile::tempdir().unwrap(); + for id in ["incahoots", "coacombat", "squidbots-lite"] { + let views = install(client.path(), id, &Cancel::default()).unwrap(); + let view = views.iter().find(|v| v.id == id).unwrap(); + assert!(view.installed && !view.update_available, "{id}"); + } + assert!(addons_dir(client.path()).join("IncahootsCoA/IncahootsCoA.toc").is_file()); + assert!(addons_dir(client.path()).join("SquidBotsLite/SquidBotsLite.toc").is_file()); + } + + #[test] + fn git_blob_ids_match_git() { + // `printf 'hello\n' | git hash-object --stdin` + assert_eq!(git_blob_sha1(b"hello\n"), "ce013625030ba8dba906f756967f9e9ca394464a"); + } + + fn unpack_and_place(entry: &Entry, client: &Path, bytes: Vec<u8>) -> Result<()> { + let dir = addons_dir(client); + fs::create_dir_all(&dir)?; + let staging = tempfile::tempdir_in(&dir)?; + let archive = staging.path().join("a.zip"); + download(&Serve(bytes), &entry.archive, &archive, &Cancel::default())?; + unpack(entry, &archive, &staging.path().join("files")) + } + + #[test] + fn a_tampered_or_incomplete_download_is_refused() { + let client = tempfile::tempdir().unwrap(); + let entry = small_entry(); + let good = archive(&entry, &|_| b"## Interface: 30300\n".to_vec()); + unpack_and_place(&entry, client.path(), good).unwrap(); + let bad = archive(&entry, &|_| b"## Interface: 30300 evil\n".to_vec()); + assert!(unpack_and_place(&entry, client.path(), bad).unwrap_err().to_string().contains("verification")); + let empty = { + let mut out = std::io::Cursor::new(Vec::new()); + zip::ZipWriter::new(&mut out).finish().unwrap(); + out.into_inner() + }; + assert!(unpack_and_place(&entry, client.path(), empty).unwrap_err().to_string().contains("lacks")); + } + + #[test] + fn install_update_and_remove_keep_other_folders() { + let client = tempfile::tempdir().unwrap(); + let mut entry = small_entry(); + let dir = addons_dir(client.path()); + fs::create_dir_all(dir.join("TestAddon")).unwrap(); + fs::write(dir.join("TestAddon/mine.lua"), b"player's own").unwrap(); + fs::create_dir_all(dir.join("Other")).unwrap(); + let serve = Serve(archive(&entry, &|_| b"## Interface: 30300 +".to_vec())); + install_entry(&serve, client.path(), &entry, &Cancel::default()).unwrap(); + assert!(dir.join("TestAddon/TestAddon.toc").is_file()); + assert!(!dir.join("TestAddon/mine.lua").exists(), "the player's folder was set aside"); + let backups: Vec<_> = fs::read_dir(dir.join(BACKUP)).unwrap().flatten().collect(); + assert_eq!(backups.len(), 1); + assert!(backups[0].path().join("mine.lua").is_file()); + assert_eq!(read_state(client.path())["t"].commit, "c1"); + // An update replaces the Manager's own folder without another backup. + entry.commit = "c2".into(); + install_entry(&serve, client.path(), &entry, &Cancel::default()).unwrap(); + assert_eq!(read_state(client.path())["t"].commit, "c2"); + assert_eq!(fs::read_dir(dir.join(BACKUP)).unwrap().count(), 1); + // A failed download changes nothing. + let broken = Serve(archive(&entry, &|_| b"tampered".to_vec())); + assert!(install_entry(&broken, client.path(), &entry, &Cancel::default()).is_err()); + assert!(dir.join("TestAddon/TestAddon.toc").is_file()); + remove(client.path(), "t").unwrap(); + assert!(!dir.join("TestAddon").exists()); + assert!(dir.join("Other").is_dir()); + assert!(!read_state(client.path()).contains_key("t")); + // No leftover staging folders. + assert!(fs::read_dir(&dir).unwrap().flatten().all(|e| !e.file_name().to_string_lossy().starts_with(".coa-addon-"))); + } +} diff --git a/crates/coa-core/src/lib.rs b/crates/coa-core/src/lib.rs index 53f1b71..dfc7522 100644 --- a/crates/coa-core/src/lib.rs +++ b/crates/coa-core/src/lib.rs @@ -9,6 +9,7 @@ pub mod accounts; pub mod allsettings; +pub mod addons; pub mod backup; pub mod channels; pub mod character_start_check; diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 9f740c0..8552c36 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1479,6 +1479,41 @@ async fn custom_races_install( result } +#[tauri::command] +async fn addons_list( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<Vec<coa_core::addons::AddonView>, UiError> { + let ctx = client_context(&state, &id)?; + blocking(move || coa_core::addons::list(&ctx.require()?)).await +} + +/// Install or update a catalog addon in the linked game client (pinned commit, every file checked). +#[tauri::command] +async fn addons_install( + state: State<'_, AppState>, + id: String, + addon: String, +) -> std::result::Result<Vec<coa_core::addons::AddonView>, UiError> { + let ctx = client_context(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + let cancel = begin_client_job(&state)?; + let result = blocking(move || coa_core::addons::install(&ctx.require()?, &addon, &cancel)).await; + end_client_job(&state); + result +} + +#[tauri::command] +async fn addons_remove( + state: State<'_, AppState>, + id: String, + addon: String, +) -> std::result::Result<Vec<coa_core::addons::AddonView>, UiError> { + let ctx = client_context(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || coa_core::addons::remove(&ctx.require()?, &addon)).await +} + #[tauri::command] async fn custom_races_uninstall( state: State<'_, AppState>, @@ -3117,6 +3152,9 @@ pub fn run() { restart_schedule_save, clear_game_cache_on_play, set_clear_game_cache_on_play, + addons_list, + addons_install, + addons_remove, check_database, repair_server, module_set_enabled, diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 6c2afd3..746e740 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -1,6 +1,7 @@ // Dev-only: lets the UI run in a plain browser for visual review. Never bundled in production builds. import { auctionCategories, auctionQualities } from "../lib/moduleSettings"; import moduleCatalog from "../../modules/catalog.json"; +import addonCatalog from "../../addons/catalog.json"; import botsSchema from "../../schemas/bots.json"; import serverSchema from "../../schemas/server.json"; import botsPresets from "../../schemas/presets/bots.json"; @@ -41,6 +42,7 @@ export {}; if(cmd==="pending_update") return null; if(cmd==="plugin:app|version") return "0.8.2"; if(cmd==="release_history") throw new Error("Offline demo: using bundled notes"); + if(cmd==="addons_list"||cmd==="addons_install"||cmd==="addons_remove"){const w=window as any;w.__addons=w.__addons??{dragonui:"old"};if(cmd==="addons_install"){await new Promise(r=>setTimeout(r,700));w.__addons[args.addon]="new";}if(cmd==="addons_remove")delete w.__addons[args.addon];return addonCatalog.addons.map((a:any)=>({id:a.id,name:a.name,description:a.description,author:a.author,license:a.license,needs:a.needs??null,repo:a.repo,size:a.files.reduce((s:number,f:any)=>s+f.size,0),installed:a.id in w.__addons,updateAvailable:w.__addons[a.id]==="old",foreignFolders:a.id==="coacombat"&&!(a.id in w.__addons)?["CoACombat"]:[]}));} if(cmd==="restart_schedule"||cmd==="restart_schedule_save"){const w=window as any;w.__sched=w.__sched??{enabled:false,time:"05:00",warningMinutes:5};if(cmd==="restart_schedule_save"){const s=args.schedule;if(s.enabled&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(s.time))throw new Error("The restart time must be HH:MM, for example 05:00.");w.__sched={...s};}return {schedule:w.__sched,supported:true};} if(cmd==="mysql_custom"||cmd==="mysql_custom_save"){const w=window as any;if(cmd==="mysql_custom_save")w.__my=args.text;const text:string=w.__my??"";const applied=text.split("\n").map((l:string)=>l.trim()).filter((l:string)=>l&&!l.startsWith("#")&&!/^(port|datadir|basedir|bind[-_]address)\b/i.test(l)).map((l:string)=>l+"\n").join("");return {text,applied};} if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));} diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index bf8554e..7af3c5b 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -788,6 +788,16 @@ const de: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Dieser Server kann das noch nicht: Aktualisiere ihn auf einen Build mit dem neuen Launcher.", "client.clearCache": "Spiel-Cache vor jedem Start leeren", "client.clearCacheHint": "Das Spiel merkt sich Kreaturen, Gegenstände und Quests vom Server (Cache/WDB). Nach einem Server-Update zeigen sie sonst alte Namen und Werte; der Cache füllt sich in Sekunden wieder.", + "addons.title": "Addons", + "addons.hint": "Community-Addons für Conquest of Azeroth. Jedes kommt in einer geprüften Version vom GitHub seines Autors; jede Datei wird vor der Installation in Interface/AddOns geprüft. Schließe zuerst das Spiel.", + "addons.by": "von {author}", + "addons.installed": "Installiert", + "addons.update": "Update verfügbar", + "addons.needsSquid": "Für SQUID's Playerbots.", + "addons.foreign": "Ein Ordner {folders} ist schon da; er wird nach AddOns/.coa-addons-backup verschoben.", + "addons.doInstall": "Installieren", + "addons.doUpdate": "Aktualisieren", + "addons.doRemove": "Entfernen", "realm.namesTitle": "Realmnamen", "realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.", "realm.nameSave": "Speichern", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 506a0ba..8d2cbd2 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -72,6 +72,16 @@ const en = { "sched.unsupported": "This server cannot do it yet: update the server to a build with the new launcher.", "client.clearCache": "Clear the game cache before every Play", "client.clearCacheHint": "The game remembers creatures, items and quests it got from a server (Cache/WDB). After a server update they can show old names and stats; the cache fills again within seconds.", + "addons.title": "Addons", + "addons.hint": "Community addons for Conquest of Azeroth. Each comes from its author's GitHub at a checked version; every file is verified before it is installed into Interface/AddOns. Close the game first.", + "addons.by": "by {author}", + "addons.installed": "Installed", + "addons.update": "Update available", + "addons.needsSquid": "For SQUID's Playerbots.", + "addons.foreign": "A folder named {folders} is already there; it will be moved to AddOns/.coa-addons-backup.", + "addons.doInstall": "Install", + "addons.doUpdate": "Update", + "addons.doRemove": "Remove", "realm.namesTitle": "Realm names", "realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.", "realm.nameSave": "Save", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index ff61aac..42e30bd 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -788,6 +788,16 @@ const es: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Este servidor aún no puede hacerlo: actualízalo a una versión con el nuevo lanzador.", "client.clearCache": "Vaciar la caché del juego antes de cada inicio", "client.clearCacheHint": "El juego recuerda criaturas, objetos y misiones recibidos del servidor (Cache/WDB). Tras actualizar el servidor pueden mostrar nombres y estadísticas antiguos; la caché se llena de nuevo en segundos.", + "addons.title": "Addons", + "addons.hint": "Addons de la comunidad para Conquest of Azeroth. Cada uno viene del GitHub de su autor en una versión comprobada; cada archivo se verifica antes de instalarlo en Interface/AddOns. Cierra antes el juego.", + "addons.by": "de {author}", + "addons.installed": "Instalado", + "addons.update": "Actualización disponible", + "addons.needsSquid": "Para SQUID's Playerbots.", + "addons.foreign": "Ya hay una carpeta {folders}; se moverá a AddOns/.coa-addons-backup.", + "addons.doInstall": "Instalar", + "addons.doUpdate": "Actualizar", + "addons.doRemove": "Quitar", "realm.namesTitle": "Nombres de los reinos", "realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.", "realm.nameSave": "Guardar", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 305b4d5..15df480 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -788,6 +788,16 @@ const fr: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Ce serveur ne le permet pas encore : mettez-le à jour vers une version avec le nouveau lanceur.", "client.clearCache": "Vider le cache du jeu avant chaque lancement", "client.clearCacheHint": "Le jeu garde les créatures, objets et quêtes reçus du serveur (Cache/WDB). Après une mise à jour du serveur, ils peuvent montrer d'anciens noms et statistiques ; le cache se remplit en quelques secondes.", + "addons.title": "Addons", + "addons.hint": "Addons de la communauté pour Conquest of Azeroth. Chacun vient du GitHub de son auteur dans une version vérifiée ; chaque fichier est contrôlé avant l'installation dans Interface/AddOns. Fermez d'abord le jeu.", + "addons.by": "par {author}", + "addons.installed": "Installé", + "addons.update": "Mise à jour disponible", + "addons.needsSquid": "Pour SQUID's Playerbots.", + "addons.foreign": "Un dossier {folders} existe déjà ; il sera déplacé vers AddOns/.coa-addons-backup.", + "addons.doInstall": "Installer", + "addons.doUpdate": "Mettre à jour", + "addons.doRemove": "Supprimer", "realm.namesTitle": "Noms des royaumes", "realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.", "realm.nameSave": "Enregistrer", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 0758ac1..128306d 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -75,6 +75,16 @@ const ru: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Этот сервер пока так не умеет: обновите его до сборки с новым лаунчером.", "client.clearCache": "Очищать кэш игры перед каждым запуском", "client.clearCacheHint": "Игра запоминает существ, предметы и задания, полученные от сервера (Cache/WDB). После обновления сервера там остаются старые названия и характеристики; кэш снова заполняется за секунды.", + "addons.title": "Аддоны", + "addons.hint": "Аддоны сообщества для Conquest of Azeroth. Каждый берётся с GitHub автора в проверенной версии; перед установкой в Interface/AddOns проверяется каждый файл. Сначала закройте игру.", + "addons.by": "автор: {author}", + "addons.installed": "Установлен", + "addons.update": "Есть обновление", + "addons.needsSquid": "Для SQUID's Playerbots.", + "addons.foreign": "Папка {folders} уже есть; она будет перенесена в AddOns/.coa-addons-backup.", + "addons.doInstall": "Установить", + "addons.doUpdate": "Обновить", + "addons.doRemove": "Удалить", "realm.namesTitle": "Названия реалмов", "realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.", "realm.nameSave": "Сохранить", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index cd3758a..73767a6 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -73,6 +73,16 @@ const zh = { "sched.unsupported": "此服务器暂不支持:请将服务器更新到带有新启动器的版本。", "client.clearCache": "每次启动前清空游戏缓存", "client.clearCacheHint": "游戏会保存从服务器获得的生物、物品和任务(Cache/WDB)。服务器更新后,这些缓存可能显示旧的名称和属性;缓存会在几秒内重新生成。", + "addons.title": "插件", + "addons.hint": "Conquest of Azeroth 的社区插件。每个插件都来自作者的 GitHub 的已核验版本;安装到 Interface/AddOns 前会逐个校验文件。请先关闭游戏。", + "addons.by": "作者:{author}", + "addons.installed": "已安装", + "addons.update": "有可用更新", + "addons.needsSquid": "用于 SQUID's Playerbots。", + "addons.foreign": "已存在名为 {folders} 的文件夹;它会被移到 AddOns/.coa-addons-backup。", + "addons.doInstall": "安装", + "addons.doUpdate": "更新", + "addons.doRemove": "移除", "realm.namesTitle": "服务器名称", "realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。", "realm.nameSave": "保存", diff --git a/src/lib/api.ts b/src/lib/api.ts index 8fe2890..86e9da6 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -58,6 +58,7 @@ export interface StatusView { } export type RealmMode = "coa" | "wildcard" | "reborn"; +export interface AddonView { id: string; name: string; description: Record<string, string>; author: string; license: string; needs: string | null; repo: string; size: number; installed: boolean; updateAvailable: boolean; foreignFolders: string[] } export interface RestartSchedule { enabled: boolean; time: string; warningMinutes: number } export interface RestartScheduleView { schedule: RestartSchedule; supported: boolean } export interface CustomMysql { text: string; applied: string } @@ -491,6 +492,9 @@ export const api = { realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }), realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }), realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }), + addonsList: (id: string) => invoke<AddonView[]>("addons_list", { id }), + addonsInstall: (id: string, addon: string) => invoke<AddonView[]>("addons_install", { id, addon }), + addonsRemove: (id: string, addon: string) => invoke<AddonView[]>("addons_remove", { id, addon }), clearGameCacheOnPlay: () => invoke<boolean>("clear_game_cache_on_play"), setClearGameCacheOnPlay: (enabled: boolean) => invoke<void>("set_clear_game_cache_on_play", { enabled }), restartSchedule: (id: string) => invoke<RestartScheduleView>("restart_schedule", { id }), diff --git a/src/screens/AddonCatalog.tsx b/src/screens/AddonCatalog.tsx new file mode 100644 index 0000000..b9dd648 --- /dev/null +++ b/src/screens/AddonCatalog.tsx @@ -0,0 +1,57 @@ +import { useEffect, useState } from "react"; +import { ExternalLink, Loader2 } from "lucide-react"; +import { api, asUiError, type AddonView } from "@/lib/api"; +import { Button } from "@/components/ui/button"; +import { useI18n } from "@/i18n"; + +function megabytes(bytes: number): string { + return (bytes / 1024 / 1024).toFixed(bytes < 10 * 1024 * 1024 ? 1 : 0); +} + +/** Addons from the Manager's catalog: each pinned to a commit of its author's repository and checked file by file. */ +export function AddonCatalog({ serverId }: { serverId: string }) { + const { t, locale } = useI18n(); + const [addons, setAddons] = useState<AddonView[] | null>(null); + const [working, setWorking] = useState<string | null>(null); + const [error, setError] = useState<string | null>(null); + + useEffect(() => { + let alive = true; + void api.addonsList(serverId).then(list => { if (alive) setAddons(list); }).catch(e => { if (alive) setError(asUiError(e).technical); }); + return () => { alive = false; }; + }, [serverId]); + + async function run(id: string, action: "install" | "remove") { + setWorking(id); setError(null); + try { setAddons(await (action === "install" ? api.addonsInstall : api.addonsRemove)(serverId, id)); } + catch (e) { setError(asUiError(e).technical); } + finally { setWorking(null); } + } + + return <div className="mt-5 border-t border-line pt-4"> + <h3 className="text-sm font-semibold">{t("addons.title")}</h3> + <p className="mt-1 text-xs text-muted">{t("addons.hint")}</p> + <ul className="mt-3 space-y-3"> + {addons?.map(a => <li key={a.id} className="rounded-md border border-line p-3"> + <div className="flex flex-wrap items-center gap-2"> + <span className="font-medium">{a.name}</span> + <span className="text-xs text-muted">{t("addons.by", { author: a.author })} · {megabytes(a.size)} MB</span> + {a.installed && !a.updateAvailable && <span className="text-xs text-ok">{t("addons.installed")}</span>} + {a.updateAvailable && <span className="text-xs text-warn">{t("addons.update")}</span>} + <button type="button" className="ml-auto text-muted hover:text-ink" title={a.repo} aria-label={`GitHub: ${a.name}`} onClick={() => void api.openLink(a.repo)}><ExternalLink className="h-4 w-4" aria-hidden /></button> + </div> + <p className="mt-1 text-sm text-muted">{a.description[locale] ?? a.description.en}</p> + {a.needs === "playerbots" && <p className="mt-1 text-xs text-muted">{t("addons.needsSquid")}</p>} + {a.foreignFolders.length > 0 && !a.installed && <p className="mt-1 text-xs text-warn">{t("addons.foreign", { folders: a.foreignFolders.join(", ") })}</p>} + <div className="mt-2 flex gap-2"> + {(!a.installed || a.updateAvailable) && <Button size="sm" disabled={working !== null} onClick={() => void run(a.id, "install")}> + {working === a.id && <Loader2 className="h-4 w-4 animate-spin" aria-hidden />} + {a.updateAvailable ? t("addons.doUpdate") : t("addons.doInstall")} + </Button>} + {a.installed && <Button size="sm" variant="ghost" disabled={working !== null} onClick={() => void run(a.id, "remove")}>{t("addons.doRemove")}</Button>} + </div> + </li>)} + </ul> + {error && <p className="mt-2 text-sm text-bad" role="alert">{error}</p>} + </div>; +} diff --git a/src/screens/ClientCard.tsx b/src/screens/ClientCard.tsx index 50164db..d8705c1 100644 --- a/src/screens/ClientCard.tsx +++ b/src/screens/ClientCard.tsx @@ -4,6 +4,7 @@ import { open } from "@tauri-apps/plugin-dialog"; import { api, asUiError, type ClientInfo, type ClientStatus, type UiError } from "@/lib/api"; import { checkClient } from "@/lib/clientUpdate"; import { ClientGraphics } from "./ClientGraphics"; +import { AddonCatalog } from "./AddonCatalog"; import { ClientDialog, type ClientDialogMode } from "@/screens/ClientDialog"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; @@ -97,6 +98,7 @@ export function ClientCard({ serverId, remote = false }: { serverId: string; rem <dd>{t("client.leftAsIs", { n: info.other_addons })}</dd> </dl> <ClientGraphics key={info.path} serverId={serverId} /> + <AddonCatalog key={"addons-" + info.path} serverId={serverId} /> {!remote && ( <label className="mt-4 flex cursor-pointer items-center gap-2 text-sm"> <input type="checkbox" checked={playAfter} onChange={(e) => setPlayAfter(e.target.checked)} className="h-4 w-4 accent-[#c9a24a]" /> From 2fd42f2acd5581107215579e55e1b5d9ead6acda 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?= <corfirean@gmail.com> Date: Mon, 16 Nov 2026 00:07:54 +0500 Subject: [PATCH 20/29] Custom races hold their V2 parts; the addon list shows every addon - Subclasses/Hero Races and the /dev menu are parts of Custom Races (catalog part_of, hidden from the grid): their switch and settings sit inside the Custom Races settings. - The companion bots addon (CoABotUI) moves from the client facts into the addon list, with install/update from the server package; the /dev menu addon of the V2 patch is listed as installed by the patch, without its own buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-v2-feature-switches.md | 2 +- crates/coa-core/src/addons.rs | 35 +++++++++++++++++++++ crates/coa-core/src/modules.rs | 8 +++++ modules/catalog.json | 8 +++-- src/dev/mock.ts | 4 +-- src/i18n/locales/de.ts | 3 ++ src/i18n/locales/en.ts | 3 ++ src/i18n/locales/es.ts | 3 ++ src/i18n/locales/fr.ts | 3 ++ src/i18n/locales/ru.ts | 3 ++ src/i18n/locales/zh.ts | 3 ++ src/lib/api.ts | 3 +- src/screens/AddonCatalog.tsx | 31 +++++++++++++++--- src/screens/ClientCard.tsx | 10 +----- src/screens/ModulesPage.tsx | 27 +++++++++++++++- 15 files changed, 125 insertions(+), 21 deletions(-) diff --git a/changelog.d/20261115-v2-feature-switches.md b/changelog.d/20261115-v2-feature-switches.md index 421ee37..b6b3c3e 100644 --- a/changelog.d/20261115-v2-feature-switches.md +++ b/changelog.d/20261115-v2-feature-switches.md @@ -4,4 +4,4 @@ type: added audience: admins title: Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu --- -Modules now has Subclasses and Hero Races (turn off subclasses, the Thin Twins or the Two-Headed Ogre, two players per character) and Dev Menu (the GM /dev editor). Servers without them show them as not part of the server. +The Custom Races settings now hold Subclasses and Hero Races (subclasses, the Thin Twins, the Two-Headed Ogre, two players per character) and the GM /dev menu, each with its own switch. diff --git a/crates/coa-core/src/addons.rs b/crates/coa-core/src/addons.rs index 1a266f6..ab0ca57 100644 --- a/crates/coa-core/src/addons.rs +++ b/crates/coa-core/src/addons.rs @@ -76,6 +76,8 @@ pub struct AddonView { pub update_available: bool, /// Folders of this addon that are in the client but were not installed by the Manager. pub foreign_folders: Vec<String>, + /// Installed by something else, shown so nobody looks for it twice: `custom-races` (the client patch). + pub bundled: Option<String>, } fn catalog() -> Result<Vec<Entry>> { @@ -128,11 +130,42 @@ pub fn list(client: &Path) -> Result<Vec<AddonView>> { license: entry.license, needs: entry.needs, repo: entry.repo, + bundled: None, } }) + .chain(std::iter::once(dev_menu(&dir))) .collect()) } +/// The /dev menu addon of Custom Races V2: the client patch installs it and switches it with the patch. +fn dev_menu(dir: &Path) -> AddonView { + let mut description = BTreeMap::new(); + for (lang, text) in [ + ("en", "The in-game /dev editor for game masters. It comes with the Custom Races V2 client patch and is switched with it."), + ("ru", "Внутриигровой редактор /dev для гейм-мастеров. Ставится вместе с клиентским патчем Custom Races V2 и включается вместе с ним."), + ("de", "Der /dev-Editor im Spiel für Spielleiter. Er kommt mit dem Client-Patch Custom Races V2 und wird mit ihm geschaltet."), + ("fr", "L'éditeur /dev en jeu pour les maîtres du jeu. Il vient avec le patch client Custom Races V2 et s'active avec lui."), + ("es", "El editor /dev del juego para los máster. Viene con el parche de cliente Custom Races V2 y se activa con él."), + ("zh", "供游戏管理员使用的游戏内 /dev 编辑器。随 Custom Races V2 客户端补丁安装,并随补丁一起开关。"), + ] { + description.insert(lang.to_string(), text.to_string()); + } + AddonView { + id: "coa-dev-menu".into(), + name: "CoA Dev Menu".into(), + description, + author: "ilusixn".into(), + license: "see repository".into(), + needs: None, + repo: "https://github.com/ilusixn/ilusixn-dev-menu".into(), + size: 0, + installed: dir.join("CoA_DevMenu/CoA_DevMenu.toc").is_file(), + update_available: false, + foreign_folders: Vec::new(), + bundled: Some("custom-races".into()), + } +} + /// The git blob id of `bytes` (what the catalog records for each file). fn git_blob_sha1(bytes: &[u8]) -> String { let mut hasher = Sha1::new(); @@ -364,6 +397,8 @@ mod tests { fn the_catalog_is_valid_and_pins_every_addon() { let entries = catalog().unwrap(); assert!(entries.len() >= 4); + let views = list(Path::new("C:/no-such-client")).unwrap(); + assert_eq!(views.iter().filter(|v| v.bundled.is_some()).count(), 1, "the dev menu is shown, not installable"); for e in &entries { assert_eq!(e.commit.len(), 40, "{}", e.id); assert!(e.archive.starts_with("https://codeload.github.com/") && e.archive.ends_with(&e.commit)); diff --git a/crates/coa-core/src/modules.rs b/crates/coa-core/src/modules.rs index 058a396..6bf02bd 100644 --- a/crates/coa-core/src/modules.rs +++ b/crates/coa-core/src/modules.rs @@ -48,6 +48,10 @@ pub struct Entry { /// Not shown on the Modules page; its settings are offered elsewhere (a server setting card). #[serde(default)] pub hidden: bool, + /// A part of another module, switched and set up inside that module's settings (Custom Races V2 brings + /// subclasses and the /dev menu). + #[serde(default)] + pub part_of: Option<String>, } fn yes() -> bool { @@ -111,6 +115,7 @@ pub struct ModuleView { pub page: Option<String>, pub hidden: bool, pub compatibility: String, + pub part_of: Option<String>, } pub fn list(root: &Path) -> Vec<ModuleView> { @@ -256,6 +261,7 @@ fn list_in(cat: &[Entry], root: &Path) -> Vec<ModuleView> { icon: e.icon, page: e.page, hidden: e.hidden, + part_of: e.part_of, } }) .collect() @@ -734,6 +740,7 @@ mod tests { icon: String::new(), page: None, hidden: false, + part_of: None, }; vec![ one( @@ -1379,6 +1386,7 @@ mod tests { icon: String::new(), page: None, hidden: false, + part_of: None, }; let cat = vec![compat]; let v = list_in(&cat, &root).remove(0); diff --git a/modules/catalog.json b/modules/catalog.json index 6874527..81a4b9a 100644 --- a/modules/catalog.json +++ b/modules/catalog.json @@ -182,7 +182,9 @@ "status": "early", "icon": "races", "enable_key": "Subclass.Enable", - "default_on": true + "default_on": true, + "part_of": "custom-races", + "hidden": true }, { "id": "dev-menu", @@ -201,7 +203,9 @@ "status": "early", "icon": "sparkles", "enable_key": "DevMenu.Enable", - "default_on": true + "default_on": true, + "part_of": "custom-races", + "hidden": true }, { "id": "time-is-time", diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 746e740..522d171 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -42,7 +42,7 @@ export {}; if(cmd==="pending_update") return null; if(cmd==="plugin:app|version") return "0.8.2"; if(cmd==="release_history") throw new Error("Offline demo: using bundled notes"); - if(cmd==="addons_list"||cmd==="addons_install"||cmd==="addons_remove"){const w=window as any;w.__addons=w.__addons??{dragonui:"old"};if(cmd==="addons_install"){await new Promise(r=>setTimeout(r,700));w.__addons[args.addon]="new";}if(cmd==="addons_remove")delete w.__addons[args.addon];return addonCatalog.addons.map((a:any)=>({id:a.id,name:a.name,description:a.description,author:a.author,license:a.license,needs:a.needs??null,repo:a.repo,size:a.files.reduce((s:number,f:any)=>s+f.size,0),installed:a.id in w.__addons,updateAvailable:w.__addons[a.id]==="old",foreignFolders:a.id==="coacombat"&&!(a.id in w.__addons)?["CoACombat"]:[]}));} + if(cmd==="addons_list"||cmd==="addons_install"||cmd==="addons_remove"){const w=window as any;w.__addons=w.__addons??{dragonui:"old"};if(cmd==="addons_install"){await new Promise(r=>setTimeout(r,700));w.__addons[args.addon]="new";}if(cmd==="addons_remove")delete w.__addons[args.addon];return addonCatalog.addons.map((a:any)=>({id:a.id,name:a.name,description:a.description,author:a.author,license:a.license,needs:a.needs??null,repo:a.repo,size:a.files.reduce((s:number,f:any)=>s+f.size,0),installed:a.id in w.__addons,updateAvailable:w.__addons[a.id]==="old",foreignFolders:a.id==="coacombat"&&!(a.id in w.__addons)?["CoACombat"]:[],bundled:null as string|null})).concat([{id:"coa-dev-menu",name:"CoA Dev Menu",description:{en:"The in-game /dev editor for game masters.",ru:"Внутриигровой редактор /dev для гейм-мастеров. Ставится вместе с клиентским патчем Custom Races V2 и включается вместе с ним."},author:"ilusixn",license:"see repository",needs:null,repo:"https://github.com/ilusixn/ilusixn-dev-menu",size:0,installed:true,updateAvailable:false,foreignFolders:[],bundled:"custom-races"}]);} if(cmd==="restart_schedule"||cmd==="restart_schedule_save"){const w=window as any;w.__sched=w.__sched??{enabled:false,time:"05:00",warningMinutes:5};if(cmd==="restart_schedule_save"){const s=args.schedule;if(s.enabled&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(s.time))throw new Error("The restart time must be HH:MM, for example 05:00.");w.__sched={...s};}return {schedule:w.__sched,supported:true};} if(cmd==="mysql_custom"||cmd==="mysql_custom_save"){const w=window as any;if(cmd==="mysql_custom_save")w.__my=args.text;const text:string=w.__my??"";const applied=text.split("\n").map((l:string)=>l.trim()).filter((l:string)=>l&&!l.startsWith("#")&&!/^(port|datadir|basedir|bind[-_]address)\b/i.test(l)).map((l:string)=>l+"\n").join("");return {text,applied};} if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));} @@ -91,7 +91,7 @@ export {}; if(cmd==="realmlist_save"){const w=window as any;const rl=w.__rl;if(args.profileId){const p=rl.profiles.find((x: any)=>x.id===args.profileId);p.name=args.name;p.data=args.data;return p;}if(rl.profiles.some((x: any)=>x.name.toLowerCase()===String(args.name).toLowerCase()))throw {human:{code:"unknown",title:"",message:"",actions:[]},technical:"A realmlist with that name already exists."};const p={id:String(args.name).toLowerCase().replace(/[^a-z0-9]+/g,"-"),name:args.name,data:(/\s/.test(args.data.trim())?args.data.trim():"set realmlist "+args.data.trim())+"\r\n"};rl.profiles.push(p);return p;} if(cmd==="realmlist_delete"){const rl=(window as any).__rl;rl.profiles=rl.profiles.filter((x: any)=>x.id!==args.profileId);return null;} if(cmd==="account_delete") return null; - if(cmd==="modules_list") return [{id:"companions",name:"CoA Companions",description:{en:"Companion bots for groups, dungeons and your guild.",ru:"Боты-компаньоны для групп, подземелий и гильдии."},repo:"https://github.com/Corfirean/mod-coa-playerbots",installed:true,enabled:modState["companions"],switchable:true,status:"beta",icon:"bot",page:"bots"},{id:"content-scaling",name:"Content Scaling",description:{en:"Scales dungeons and raids to your group, with solo modes.",ru:"Подстраивает подземелья и рейды под вашу группу, есть соло-режимы."},repo:"https://github.com/Corfirean/mod-coa-content-scaling",installed:true,enabled:modState["content-scaling"],switchable:true,status:"early",icon:"scaling",page:null},{id:"tbc-content",name:"TBC Content",description:{en:"Outland dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Запределья, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-tbc-content",installed:true,enabled:modState["tbc-content"],switchable:true,status:"early",icon:"tbc",page:null},{id:"wotlk-content",name:"WotLK Content",description:{en:"Northrend dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Нордскола, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-wotlk-content",installed:true,enabled:modState["wotlk-content"],switchable:true,status:"early",icon:"wotlk",page:null},{id:"ah-bot",name:"Auction House Bot",description:{en:"Fills the auction house with realistic, adjustable listings.",ru:"Наполняет аукцион реалистичными настраиваемыми лотами."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["ah-bot"] ?? false,switchable:true,status:"early",icon:"gavel",page:null,hidden:false},{id:"npc-enchanter",name:"NPC Enchanter",description:{en:"An NPC that enchants your gear for you.",ru:"НПС, который зачаровывает ваше снаряжение."},repo:"https://github.com/azerothcore/mod-npc-enchanter",installed:true,enabled:modState["npc-enchanter"],switchable:true,status:"early",icon:"sparkles",page:null,hidden:false},{id:"playerbots",name:"SQUID's Playerbots",description:{en:"An alternative bot system with random bots and full AI.",ru:"Альтернативная система ботов со случайными ботами и полным ИИ."},repo:"https://github.com/Zyth45/mod-playerbots",installed:true,enabled:modState["playerbots"] ?? false,switchable:true,status:"early",icon:"swords",page:"bots",hidden:false},{id:"client-compat",name:"Client compatibility",description:{en:"Client-server link and appearance unlocks.",ru:"Связь клиента с сервером и разблокировка внешних видов."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["client-compat"],switchable:false,status:"release",icon:"plug",page:null,hidden:true}, ...moduleCatalog.modules.filter(m => ["time-is-time", "custom-races", "subclass", "dev-menu"].includes(m.id)).map(m => ({...m, installed:true, enabled:modState[m.id] ?? true, switchable:true, page:null, hidden:false}))].map(m => ({...m, has_settings: !["tbc-content", "wotlk-content"].includes(m.id), compatibility: realm !== "coa" ? (["companions", "playerbots"].includes(m.id) ? "unsupported" : m.id === "client-compat" ? "compatible" : "experimental") : "compatible", switchable: realm !== "coa" && ["companions", "playerbots"].includes(m.id) ? false : m.switchable})); + if(cmd==="modules_list") return [{id:"companions",name:"CoA Companions",description:{en:"Companion bots for groups, dungeons and your guild.",ru:"Боты-компаньоны для групп, подземелий и гильдии."},repo:"https://github.com/Corfirean/mod-coa-playerbots",installed:true,enabled:modState["companions"],switchable:true,status:"beta",icon:"bot",page:"bots"},{id:"content-scaling",name:"Content Scaling",description:{en:"Scales dungeons and raids to your group, with solo modes.",ru:"Подстраивает подземелья и рейды под вашу группу, есть соло-режимы."},repo:"https://github.com/Corfirean/mod-coa-content-scaling",installed:true,enabled:modState["content-scaling"],switchable:true,status:"early",icon:"scaling",page:null},{id:"tbc-content",name:"TBC Content",description:{en:"Outland dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Запределья, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-tbc-content",installed:true,enabled:modState["tbc-content"],switchable:true,status:"early",icon:"tbc",page:null},{id:"wotlk-content",name:"WotLK Content",description:{en:"Northrend dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Нордскола, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-wotlk-content",installed:true,enabled:modState["wotlk-content"],switchable:true,status:"early",icon:"wotlk",page:null},{id:"ah-bot",name:"Auction House Bot",description:{en:"Fills the auction house with realistic, adjustable listings.",ru:"Наполняет аукцион реалистичными настраиваемыми лотами."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["ah-bot"] ?? false,switchable:true,status:"early",icon:"gavel",page:null,hidden:false},{id:"npc-enchanter",name:"NPC Enchanter",description:{en:"An NPC that enchants your gear for you.",ru:"НПС, который зачаровывает ваше снаряжение."},repo:"https://github.com/azerothcore/mod-npc-enchanter",installed:true,enabled:modState["npc-enchanter"],switchable:true,status:"early",icon:"sparkles",page:null,hidden:false},{id:"playerbots",name:"SQUID's Playerbots",description:{en:"An alternative bot system with random bots and full AI.",ru:"Альтернативная система ботов со случайными ботами и полным ИИ."},repo:"https://github.com/Zyth45/mod-playerbots",installed:true,enabled:modState["playerbots"] ?? false,switchable:true,status:"early",icon:"swords",page:"bots",hidden:false},{id:"client-compat",name:"Client compatibility",description:{en:"Client-server link and appearance unlocks.",ru:"Связь клиента с сервером и разблокировка внешних видов."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["client-compat"],switchable:false,status:"release",icon:"plug",page:null,hidden:true}, ...moduleCatalog.modules.filter(m => ["time-is-time", "custom-races", "subclass", "dev-menu"].includes(m.id)).map(m => ({...m, installed:true, enabled:modState[m.id] ?? true, switchable:true, page:null, hidden:(m as any).hidden ?? false}))].map(m => ({...m, has_settings: !["tbc-content", "wotlk-content"].includes(m.id), compatibility: realm !== "coa" ? (["companions", "playerbots"].includes(m.id) ? "unsupported" : m.id === "client-compat" ? "compatible" : "experimental") : "compatible", switchable: realm !== "coa" && ["companions", "playerbots"].includes(m.id) ? false : m.switchable})); if(cmd==="module_set_enabled"){ if(args.enabled && ["companions","playerbots"].includes(args.module) && modState[args.module === "companions" ? "playerbots" : "companions"]) throw {human:{code:"bot_modules_conflict",title:"",message:"",actions:[]},technical:"Only one bot system may be enabled."}; modState[args.module]=args.enabled; return null; } if(cmd==="all_settings") return [{key:"Visibility.Distance.Continents",value:"100",default:"90",doc:"Description: Visibility distance on continents. Range: 45-250 Default: 90",changed:true},{key:"Death.SicknessLevel",value:"11",default:"11",doc:"Description: Character level up to which characters get resurrection sickness. Default: 11",changed:false},{key:"Rate.Drop.Item.Epic",value:"3",default:"1",doc:"Description: Drop rates for money and items based on quality. Default: 1",changed:true},{key:"Instance.ResetTimeHour",value:"4",default:"4",doc:"Description: Hour of the day when the global instance reset occurs. Range: 0-23 Default: 4 - (04:00 AM)",changed:false},{key:"PlayerLimit",value:"1000",default:"1000",doc:"Description: Maximum number of players in the world.",changed:false}]; if(cmd==="all_settings_save") return Object.keys(args&&args.changes||{}); diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 7af3c5b..5ef7bf5 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -788,6 +788,9 @@ const de: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Dieser Server kann das noch nicht: Aktualisiere ihn auf einen Build mit dem neuen Launcher.", "client.clearCache": "Spiel-Cache vor jedem Start leeren", "client.clearCacheHint": "Das Spiel merkt sich Kreaturen, Gegenstände und Quests vom Server (Cache/WDB). Nach einem Server-Update zeigen sie sonst alte Namen und Werte; der Cache füllt sich in Sekunden wieder.", + "addons.withServer": "Kommt mit dem Server und wird mit ihm aktualisiert.", + "addons.withRaces": "Mit dem Client-Patch Custom Races V2 installiert und mit ihm geschaltet; der Manager installiert ihn nicht separat.", + "addons.withRacesMissing": "Kommt mit dem Client-Patch Custom Races V2 (Module, Custom Races); installiere den Patch, um ihn zu bekommen.", "addons.title": "Addons", "addons.hint": "Community-Addons für Conquest of Azeroth. Jedes kommt in einer geprüften Version vom GitHub seines Autors; jede Datei wird vor der Installation in Interface/AddOns geprüft. Schließe zuerst das Spiel.", "addons.by": "von {author}", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 8d2cbd2..59371c1 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -72,6 +72,9 @@ const en = { "sched.unsupported": "This server cannot do it yet: update the server to a build with the new launcher.", "client.clearCache": "Clear the game cache before every Play", "client.clearCacheHint": "The game remembers creatures, items and quests it got from a server (Cache/WDB). After a server update they can show old names and stats; the cache fills again within seconds.", + "addons.withServer": "Comes with the server and is updated with it.", + "addons.withRaces": "Installed with the Custom Races V2 client patch and switched with it; the Manager does not install it separately.", + "addons.withRacesMissing": "Comes with the Custom Races V2 client patch (Modules, Custom Races); install the patch to get it.", "addons.title": "Addons", "addons.hint": "Community addons for Conquest of Azeroth. Each comes from its author's GitHub at a checked version; every file is verified before it is installed into Interface/AddOns. Close the game first.", "addons.by": "by {author}", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 42e30bd..c8127c9 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -788,6 +788,9 @@ const es: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Este servidor aún no puede hacerlo: actualízalo a una versión con el nuevo lanzador.", "client.clearCache": "Vaciar la caché del juego antes de cada inicio", "client.clearCacheHint": "El juego recuerda criaturas, objetos y misiones recibidos del servidor (Cache/WDB). Tras actualizar el servidor pueden mostrar nombres y estadísticas antiguos; la caché se llena de nuevo en segundos.", + "addons.withServer": "Viene con el servidor y se actualiza con él.", + "addons.withRaces": "Instalado con el parche de cliente Custom Races V2 y activado con él; el Manager no lo instala por separado.", + "addons.withRacesMissing": "Viene con el parche de cliente Custom Races V2 (Módulos, Custom Races); instala el parche para tenerlo.", "addons.title": "Addons", "addons.hint": "Addons de la comunidad para Conquest of Azeroth. Cada uno viene del GitHub de su autor en una versión comprobada; cada archivo se verifica antes de instalarlo en Interface/AddOns. Cierra antes el juego.", "addons.by": "de {author}", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 15df480..e8384bd 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -788,6 +788,9 @@ const fr: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Ce serveur ne le permet pas encore : mettez-le à jour vers une version avec le nouveau lanceur.", "client.clearCache": "Vider le cache du jeu avant chaque lancement", "client.clearCacheHint": "Le jeu garde les créatures, objets et quêtes reçus du serveur (Cache/WDB). Après une mise à jour du serveur, ils peuvent montrer d'anciens noms et statistiques ; le cache se remplit en quelques secondes.", + "addons.withServer": "Fourni avec le serveur et mis à jour avec lui.", + "addons.withRaces": "Installé avec le patch client Custom Races V2 et activé avec lui ; le Manager ne l'installe pas séparément.", + "addons.withRacesMissing": "Fourni avec le patch client Custom Races V2 (Modules, Custom Races) ; installez le patch pour l'obtenir.", "addons.title": "Addons", "addons.hint": "Addons de la communauté pour Conquest of Azeroth. Chacun vient du GitHub de son auteur dans une version vérifiée ; chaque fichier est contrôlé avant l'installation dans Interface/AddOns. Fermez d'abord le jeu.", "addons.by": "par {author}", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 128306d..a4958ff 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -75,6 +75,9 @@ const ru: Partial<Record<keyof typeof en, string>> = { "sched.unsupported": "Этот сервер пока так не умеет: обновите его до сборки с новым лаунчером.", "client.clearCache": "Очищать кэш игры перед каждым запуском", "client.clearCacheHint": "Игра запоминает существ, предметы и задания, полученные от сервера (Cache/WDB). После обновления сервера там остаются старые названия и характеристики; кэш снова заполняется за секунды.", + "addons.withServer": "Поставляется вместе с сервером и обновляется вместе с ним.", + "addons.withRaces": "Установлен вместе с клиентским патчем Custom Races V2 и включается вместе с ним; отдельно Manager его не ставит.", + "addons.withRacesMissing": "Поставляется с клиентским патчем Custom Races V2 (Модули → Custom Races); установите патч, чтобы он появился.", "addons.title": "Аддоны", "addons.hint": "Аддоны сообщества для Conquest of Azeroth. Каждый берётся с GitHub автора в проверенной версии; перед установкой в Interface/AddOns проверяется каждый файл. Сначала закройте игру.", "addons.by": "автор: {author}", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 73767a6..332fce4 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -73,6 +73,9 @@ const zh = { "sched.unsupported": "此服务器暂不支持:请将服务器更新到带有新启动器的版本。", "client.clearCache": "每次启动前清空游戏缓存", "client.clearCacheHint": "游戏会保存从服务器获得的生物、物品和任务(Cache/WDB)。服务器更新后,这些缓存可能显示旧的名称和属性;缓存会在几秒内重新生成。", + "addons.withServer": "随服务器提供,并随服务器一起更新。", + "addons.withRaces": "随 Custom Races V2 客户端补丁安装并一起开关;Manager 不会单独安装它。", + "addons.withRacesMissing": "随 Custom Races V2 客户端补丁提供(模块 → Custom Races);安装补丁后即可获得。", "addons.title": "插件", "addons.hint": "Conquest of Azeroth 的社区插件。每个插件都来自作者的 GitHub 的已核验版本;安装到 Interface/AddOns 前会逐个校验文件。请先关闭游戏。", "addons.by": "作者:{author}", diff --git a/src/lib/api.ts b/src/lib/api.ts index 86e9da6..29d87f5 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -58,7 +58,7 @@ export interface StatusView { } export type RealmMode = "coa" | "wildcard" | "reborn"; -export interface AddonView { id: string; name: string; description: Record<string, string>; author: string; license: string; needs: string | null; repo: string; size: number; installed: boolean; updateAvailable: boolean; foreignFolders: string[] } +export interface AddonView { id: string; name: string; description: Record<string, string>; author: string; license: string; needs: string | null; repo: string; size: number; installed: boolean; updateAvailable: boolean; foreignFolders: string[]; bundled?: string | null } export interface RestartSchedule { enabled: boolean; time: string; warningMinutes: number } export interface RestartScheduleView { schedule: RestartSchedule; supported: boolean } export interface CustomMysql { text: string; applied: string } @@ -236,6 +236,7 @@ export interface ModuleView { /** not shown on the Modules page */ hidden: boolean; compatibility?: "compatible" | "experimental" | "unsupported" | "requires-squid"; + part_of?: string | null; } export interface ModuleSetting { diff --git a/src/screens/AddonCatalog.tsx b/src/screens/AddonCatalog.tsx index b9dd648..02234ac 100644 --- a/src/screens/AddonCatalog.tsx +++ b/src/screens/AddonCatalog.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; import { ExternalLink, Loader2 } from "lucide-react"; -import { api, asUiError, type AddonView } from "@/lib/api"; +import { api, asUiError, type AddonView, type ClientInfo } from "@/lib/api"; import { Button } from "@/components/ui/button"; import { useI18n } from "@/i18n"; @@ -9,7 +9,7 @@ function megabytes(bytes: number): string { } /** Addons from the Manager's catalog: each pinned to a commit of its author's repository and checked file by file. */ -export function AddonCatalog({ serverId }: { serverId: string }) { +export function AddonCatalog({ serverId, companions, onCompanionsInstalled }: { serverId: string; companions?: ClientInfo["addon"] | null; onCompanionsInstalled?: () => void }) { const { t, locale } = useI18n(); const [addons, setAddons] = useState<AddonView[] | null>(null); const [working, setWorking] = useState<string | null>(null); @@ -28,28 +28,49 @@ export function AddonCatalog({ serverId }: { serverId: string }) { finally { setWorking(null); } } + async function installCompanions() { + setWorking("coa-companions"); setError(null); + try { await api.installAddon(serverId); onCompanionsInstalled?.(); } + catch (e) { setError(asUiError(e).technical); } + finally { setWorking(null); } + } + return <div className="mt-5 border-t border-line pt-4"> <h3 className="text-sm font-semibold">{t("addons.title")}</h3> <p className="mt-1 text-xs text-muted">{t("addons.hint")}</p> <ul className="mt-3 space-y-3"> + {companions && <li className="rounded-md border border-line p-3"> + <div className="flex flex-wrap items-center gap-2"> + <span className="font-medium">CoA Companions (CoABotUI)</span> + {companions.installed && companions.up_to_date !== false && <span className="text-xs text-ok">{companions.version ? t("client.installedVersion", { v: companions.version }) : t("addons.installed")}</span>} + {companions.up_to_date === false && <span className="text-xs text-warn">{t("addons.update")}</span>} + </div> + <p className="mt-1 text-sm text-muted">{t("client.addonWhat")}</p> + <p className="mt-1 text-xs text-muted">{t("addons.withServer")}</p> + {(!companions.installed || companions.up_to_date === false) && <div className="mt-2"><Button size="sm" disabled={working !== null} onClick={() => void installCompanions()}> + {working === "coa-companions" && <Loader2 className="h-4 w-4 animate-spin" aria-hidden />} + {companions.installed ? t("addons.doUpdate") : t("addons.doInstall")} + </Button></div>} + </li>} {addons?.map(a => <li key={a.id} className="rounded-md border border-line p-3"> <div className="flex flex-wrap items-center gap-2"> <span className="font-medium">{a.name}</span> - <span className="text-xs text-muted">{t("addons.by", { author: a.author })} · {megabytes(a.size)} MB</span> + <span className="text-xs text-muted">{t("addons.by", { author: a.author })}{a.size > 0 ? ` · ${megabytes(a.size)} MB` : ""}</span> {a.installed && !a.updateAvailable && <span className="text-xs text-ok">{t("addons.installed")}</span>} {a.updateAvailable && <span className="text-xs text-warn">{t("addons.update")}</span>} <button type="button" className="ml-auto text-muted hover:text-ink" title={a.repo} aria-label={`GitHub: ${a.name}`} onClick={() => void api.openLink(a.repo)}><ExternalLink className="h-4 w-4" aria-hidden /></button> </div> <p className="mt-1 text-sm text-muted">{a.description[locale] ?? a.description.en}</p> {a.needs === "playerbots" && <p className="mt-1 text-xs text-muted">{t("addons.needsSquid")}</p>} + {a.bundled === "custom-races" && <p className="mt-1 text-xs text-muted">{a.installed ? t("addons.withRaces") : t("addons.withRacesMissing")}</p>} {a.foreignFolders.length > 0 && !a.installed && <p className="mt-1 text-xs text-warn">{t("addons.foreign", { folders: a.foreignFolders.join(", ") })}</p>} - <div className="mt-2 flex gap-2"> + {!a.bundled && <div className="mt-2 flex gap-2"> {(!a.installed || a.updateAvailable) && <Button size="sm" disabled={working !== null} onClick={() => void run(a.id, "install")}> {working === a.id && <Loader2 className="h-4 w-4 animate-spin" aria-hidden />} {a.updateAvailable ? t("addons.doUpdate") : t("addons.doInstall")} </Button>} {a.installed && <Button size="sm" variant="ghost" disabled={working !== null} onClick={() => void run(a.id, "remove")}>{t("addons.doRemove")}</Button>} - </div> + </div>} </li>)} </ul> {error && <p className="mt-2 text-sm text-bad" role="alert">{error}</p>} diff --git a/src/screens/ClientCard.tsx b/src/screens/ClientCard.tsx index d8705c1..3cd77f8 100644 --- a/src/screens/ClientCard.tsx +++ b/src/screens/ClientCard.tsx @@ -86,19 +86,11 @@ export function ClientCard({ serverId, remote = false }: { serverId: string; rem : t("client.versionUntracked")} {status?.update_available && <span className="ml-2 text-warn">{t("client.updateAvailable")}</span>} </dd> - {!remote && <> - <dt className="text-muted">{t("client.addon")}</dt> - <dd> - {info.addon.installed ? (info.addon.version ? t("client.installedVersion", { v: info.addon.version }) : t("client.installed")) : t("client.addonNotInstalled")} - {info.addon.up_to_date === false && <span className="ml-2 text-warn">{t("client.updateAvailable")}</span>} - <span className="mt-1 block text-xs text-muted">{t("client.addonWhat")}</span> - </dd> - </>} <dt className="text-muted">{t("client.otherAddons")}</dt> <dd>{t("client.leftAsIs", { n: info.other_addons })}</dd> </dl> <ClientGraphics key={info.path} serverId={serverId} /> - <AddonCatalog key={"addons-" + info.path} serverId={serverId} /> + <AddonCatalog key={"addons-" + info.path} serverId={serverId} companions={remote ? null : info.addon} onCompanionsInstalled={() => void refresh()} /> {!remote && ( <label className="mt-4 flex cursor-pointer items-center gap-2 text-sm"> <input type="checkbox" checked={playAfter} onChange={(e) => setPlayAfter(e.target.checked)} className="h-4 w-4 accent-[#c9a24a]" /> diff --git a/src/screens/ModulesPage.tsx b/src/screens/ModulesPage.tsx index ebc2fb6..710d797 100644 --- a/src/screens/ModulesPage.tsx +++ b/src/screens/ModulesPage.tsx @@ -87,6 +87,7 @@ export function ModulesPage({ serverId, onChanged, onRegisterGuard }: { serverId const { t, locale } = useI18n(); const human = useHuman(); const [modules, setModules] = useState<ModuleView[] | null>(null); + const [parts, setParts] = useState<ModuleView[]>([]); const [open, setOpen] = useState<string | null>(null); const [error, setError] = useState<UiError | null>(null); const toggleLock = useRef(false); @@ -119,7 +120,9 @@ export function ModulesPage({ serverId, onChanged, onRegisterGuard }: { serverId const load = useCallback(async () => { try { - setModules((await api.modulesList(serverId)).filter((m) => !m.hidden)); + const all = await api.modulesList(serverId); + setModules(all.filter((m) => !m.hidden)); + setParts(all.filter((m) => m.part_of)); await loadRacesStatus(); } catch (e) { setError(asUiError(e)); @@ -328,6 +331,28 @@ export function ModulesPage({ serverId, onChanged, onRegisterGuard }: { serverId {selected.id === "custom-races" && <RaceAvailabilitySettings serverId={serverId} blocked={racesInstalling || toggling !== null} onSaved={() => setChanged(true)} onRegisterGuard={setRacesGuard} />} + {parts.filter(p => p.part_of === selected.id && p.installed).map(p => ( + <section key={p.id} className="mt-6 border-t border-line pt-5" aria-label={p.name}> + <div className="flex items-start justify-between gap-4"> + <div> + <h3 className="font-semibold">{p.name}</h3> + <p className="mt-1 text-sm text-muted">{p.description[locale] ?? p.description.en}</p> + </div> + {p.switchable && <button + role="switch" + aria-checked={p.enabled} + aria-label={t("mod.switch", { name: p.name })} + aria-busy={toggling === p.id} + disabled={toggling !== null || racesInstalling} + onClick={() => void toggle(p)} + className={cn("relative mt-1 h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors", p.enabled ? "bg-gold" : "bg-white/15")} + > + <span className={cn("absolute top-0.5 h-5 w-5 rounded-full bg-white transition-all", p.enabled ? "left-[22px]" : "left-0.5")} /> + </button>} + </div> + {p.enabled && p.has_settings && <ModuleSettings serverId={serverId} module={p} onSaved={() => setChanged(true)} />} + </section> + ))} </SettingsPanel> )} </Fragment> From 69c9938aba2479e60bbae1ad547e2f01840d131c 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?= <corfirean@gmail.com> Date: Fri, 6 Nov 2026 19:33:41 +0500 Subject: [PATCH 21/29] feat(manager): enable multi-realm playerbots support across CoA, Wildcard, and Reborn --- crates/coa-core/src/multiworld.rs | 6 +++ crates/coa-core/src/realms.rs | 63 ++++++++++--------------------- src/screens/CompanionsCard.tsx | 14 ++++++- 3 files changed, 39 insertions(+), 44 deletions(-) diff --git a/crates/coa-core/src/multiworld.rs b/crates/coa-core/src/multiworld.rs index 96df9bb..f7bb17c 100644 --- a/crates/coa-core/src/multiworld.rs +++ b/crates/coa-core/src/multiworld.rs @@ -261,6 +261,12 @@ fn prepare(main: &Path, tree: Tree) -> Result<PathBuf> { &fsx::ensure_within(&second, &second.join("Core/reference"))?, )?; } + if main.join("Core/plugins").is_dir() { + copy_tree( + &main.join("Core/plugins"), + &fsx::ensure_within(&second, &second.join("Core/plugins"))?, + )?; + } for entry in fs::read_dir(main.join("Core"))? { let entry = entry?; if entry.file_type()?.is_file() diff --git a/crates/coa-core/src/realms.rs b/crates/coa-core/src/realms.rs index 96532d3..ab4c156 100644 --- a/crates/coa-core/src/realms.rs +++ b/crates/coa-core/src/realms.rs @@ -185,9 +185,8 @@ pub fn view(root: &Path) -> Result<View> { } pub fn guard_module(root: &Path, id: &str) -> Result<()> { - if state(root)?.active != Mode::Coa && matches!(id, "companions" | "playerbots") { - return Err(Error::Invalid("Bot class mechanics have not been validated for this realm. This module is unavailable on this realm.".into())); - } + // Multi-realm Playerbots 1.0 supports all realms (CoA, Wildcard, Reborn). + let _ = (root, id); Ok(()) } @@ -296,14 +295,12 @@ fn wildcard_configs(mut files: Files) -> Result<Files> { } } } - for (key, value) in [("CoaBots.Enable", "0"), ("CoaBots.AutoLoginOnStartup", "0")] { - set( - &mut files, - "Core/configs/modules/mod_coa_playerbots.conf", - key, - value, - )?; - } + set( + &mut files, + "Core/configs/modules/mod_coa_playerbots.conf", + "CoaBots.Enable", + "1", + )?; set( &mut files, "Core/configs/modules/playerbots.conf", @@ -337,14 +334,12 @@ fn reborn_configs(mut files: Files) -> Result<Files> { set(&mut files, path, "RealmID", "3")?; } } - for (key, value) in [("CoaBots.Enable", "0"), ("CoaBots.AutoLoginOnStartup", "0")] { - set( - &mut files, - "Core/configs/modules/mod_coa_playerbots.conf", - key, - value, - )?; - } + set( + &mut files, + "Core/configs/modules/mod_coa_playerbots.conf", + "CoaBots.Enable", + "1", + )?; set( &mut files, "Core/configs/modules/playerbots.conf", @@ -681,19 +676,7 @@ pub fn before_start(root: &Path) -> Result<()> { "The installed server build does not support Wildcard.".into(), )); } - let path = root.join("Core/configs/modules/mod_coa_playerbots.conf"); - let mut conf = ConfFile::parse_bytes(&fs::read(&path)?)?; - conf.set("CoaBots.Enable", "0", &[]); - fsx::atomic_write(&path, conf.to_text().as_bytes())?; - let path = root.join("Core/configs/modules/playerbots.conf"); - let bytes = if path.exists() { - fs::read(&path)? - } else { - b"[worldserver]\n".to_vec() - }; - let mut conf = ConfFile::parse_bytes(&bytes)?; - conf.set("AiPlayerbot.Enabled", "0", &[]); - fsx::atomic_write(&path, conf.to_text().as_bytes())?; + // Multi-realm Playerbots 1.0: bots are supported and enabled on all realms } Ok(()) } @@ -831,8 +814,8 @@ mod tests { }, ) .unwrap(); - assert!(guard_module(t.path(), "companions").is_err()); - assert!(guard_module(t.path(), "playerbots").is_err()); + assert!(guard_module(t.path(), "companions").is_ok()); + assert!(guard_module(t.path(), "playerbots").is_ok()); assert!(guard_module(t.path(), "content-scaling").is_ok()); } @@ -1030,7 +1013,7 @@ CoA.GameModeMask = 0 f["Core/configs/modules/mod-coa-content-scaling.conf"] ); let c = ConfFile::parse_bytes(&w["Core/configs/modules/mod_coa_playerbots.conf"]).unwrap(); - assert_eq!(c.get("CoaBots.Enable"), Some("0")); + assert_eq!(c.get("CoaBots.Enable"), Some("1")); assert_eq!( ConfFile::parse_bytes(&w["Settings/worldserver.conf.template"]) .unwrap() @@ -1102,14 +1085,8 @@ CoA.GameModeMask = 0 }, ) .unwrap(); - assert!(crate::modules::set_enabled(t.path(), t.path(), "companions", true).is_err()); - assert!(crate::config::save( - t.path(), - t.path(), - crate::config::Scope::Bots, - &BTreeMap::new() - ) - .is_err()); + assert!(guard_module(t.path(), "companions").is_ok()); + assert!(guard_module(t.path(), "playerbots").is_ok()); assert!(guard_module(t.path(), "content-scaling").is_ok()); } } diff --git a/src/screens/CompanionsCard.tsx b/src/screens/CompanionsCard.tsx index 09870c9..a3f9307 100644 --- a/src/screens/CompanionsCard.tsx +++ b/src/screens/CompanionsCard.tsx @@ -9,6 +9,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const t = useT(); const human = useHuman(); const [sizes, setSizes] = useState<CompanionSizes | null>(null); + const [realmMode, setRealmMode] = useState<string | null>(null); const [pop, setPop] = useState<Population | null>(null); const [running, setRunning] = useState(false); const [choice, setChoice] = useState<string>("small"); @@ -25,6 +26,10 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const [startBusy, setStartBusy] = useState(false); const [despawnN, setDespawnN] = useState("10"); + useEffect(() => { + void api.realmProfiles(serverId).then((r) => setRealmMode(r.active)).catch(() => {}); + }, [serverId]); + useEffect(() => { void api .settings(serverId, "bots") @@ -156,7 +161,14 @@ export function CompanionsCard({ serverId }: { serverId: string }) { return ( <Card className="mt-6 p-6"> - <h2 className="font-semibold">{t("comp.title")}</h2> + <div className="flex items-center justify-between"> + <h2 className="font-semibold">{t("comp.title")}</h2> + {realmMode && ( + <span className="rounded bg-gold/15 px-2 py-0.5 text-xs font-medium text-gold uppercase tracking-wider"> + {realmMode === "coa" ? "Conquest of Azeroth" : realmMode === "wildcard" ? "Wildcard" : "Warcraft Reborn"} + </span> + )} + </div> <p className="mt-1 text-sm text-muted"> {pop ? t("comp.population", { online: pop.bots_online, total: pop.bots_total }) From ca2514c790d972894f83def9ae58f500f7483f7c 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?= <corfirean@gmail.com> Date: Fri, 6 Nov 2026 22:20:54 +0500 Subject: [PATCH 22/29] feat(manager): expand multi-realm bot fleet controls, DB routing, and compatibility guards --- crates/coa-core/src/companions.rs | 23 +- crates/coa-core/src/population.rs | 37 +- crates/coa-core/src/ra.rs | 12 + crates/coa-core/src/realms.rs | 64 ++- src-tauri/src/lib.rs | 70 ++- src/lib/api.ts | 7 +- src/screens/CompanionsCard.tsx | 808 ++++++++++++++++++++++++------ 7 files changed, 799 insertions(+), 222 deletions(-) diff --git a/crates/coa-core/src/companions.rs b/crates/coa-core/src/companions.rs index 3dab4e0..63d2721 100644 --- a/crates/coa-core/src/companions.rs +++ b/crates/coa-core/src/companions.rs @@ -19,37 +19,46 @@ pub fn seed_sql(base_guid: &str) -> String { format!("SET @G = {base_guid}; SET @ACC = {TEMPLATE_ACCOUNT};\n{SQL}") } -/// Number of characters the bot module could use as templates (level 80, a CoA class, not account 1). +/// Number of characters the bot module could use as templates. pub fn template_count(db: &Db) -> Result<u32> { - let n = db.query("SELECT COUNT(*) FROM acore_characters.characters WHERE account<>1 AND level>=80 AND class BETWEEN 12 AND 32;")?; + template_count_for_schema(db, "acore_characters") +} + +pub fn template_count_for_schema(db: &Db, chars_db: &str) -> Result<u32> { + let n = db.query(&format!("SELECT COUNT(*) FROM {chars_db}.characters WHERE account<>1 AND level>=80;"))?; Ok(n.trim().parse().unwrap_or(0)) } -fn run_seed(db: &Db, base_guid: &str) -> Result<()> { +fn run_seed(db: &Db, chars_db: &str, base_guid: &str) -> Result<()> { let file = std::env::temp_dir().join(format!( "coa-companion-templates-{}.sql", std::process::id() )); fs::write(&file, seed_sql(base_guid))?; - let r = db.run_sql_file("acore_characters", &file); + let r = db.run_sql_file(chars_db, &file); let _ = fs::remove_file(&file); r } /// Fresh databases (release tooling): the original guids. pub fn seed_fresh(db: &Db) -> Result<()> { - run_seed(db, "0") + run_seed(db, "acore_characters", "0") } /// An existing server without templates: add them far above the highest guid in use, so a running world can never /// hand a new character one of their guids. Returns whether anything was added. pub fn ensure_templates(db: &Db) -> Result<bool> { - if template_count(db)? > 0 { + ensure_templates_for_schema(db, "acore_characters") +} + +pub fn ensure_templates_for_schema(db: &Db, chars_db: &str) -> Result<bool> { + if template_count_for_schema(db, chars_db)? > 0 { return Ok(false); } run_seed( db, - "(SELECT IFNULL(MAX(guid),0) FROM acore_characters.characters) + 100000", + chars_db, + &format!("(SELECT IFNULL(MAX(guid),0) FROM {chars_db}.characters) + 100000"), )?; Ok(true) } diff --git a/crates/coa-core/src/population.rs b/crates/coa-core/src/population.rs index f228e4b..133f447 100644 --- a/crates/coa-core/src/population.rs +++ b/crates/coa-core/src/population.rs @@ -49,17 +49,19 @@ fn parse_counts(out: &str) -> Result<Population> { }) } -/// Read-only query with the game's own database account. Requires the database to be running. +/// Read-only query with the game's own database account. Routes automatically to the active realm's characters database. pub fn query(root: &Path) -> Result<Population> { - let db = Db::from_repack(root, Account::App)?; - query_with( - &db, - &bot_account_prefix(root), - &crate::accounts::squid_bot_prefix(root), - ) + let mode = crate::realms::state(root) + .map(|s| s.active) + .unwrap_or(crate::realms::Mode::Coa); + query_for_realm(root, mode) } fn counts_sql(prefix: &str, squid_prefix: &str) -> Result<String> { + counts_sql_for_db("acore_characters", prefix, squid_prefix) +} + +pub fn counts_sql_for_db(chars_db: &str, prefix: &str, squid_prefix: &str) -> Result<String> { if [prefix, squid_prefix] .iter() .any(|prefix| prefix.is_empty() || !prefix.chars().all(|c| c.is_ascii_alphanumeric())) @@ -74,9 +76,9 @@ fn counts_sql(prefix: &str, squid_prefix: &str) -> Result<String> { let bots = format!("(UPPER(a.username) LIKE '{prefix}%' OR UPPER(a.username) LIKE '{squid_prefix}%')"); Ok(format!( - "SELECT (SELECT COUNT(*) FROM acore_characters.characters WHERE online=1), \ - (SELECT COUNT(*) FROM acore_characters.characters c JOIN acore_auth.account a ON a.id=c.account WHERE c.online=1 AND {bots}), \ - (SELECT COUNT(*) FROM acore_characters.characters c JOIN acore_auth.account a ON a.id=c.account WHERE {bots});" + "SELECT (SELECT COUNT(*) FROM {chars_db}.characters WHERE online=1), \ + (SELECT COUNT(*) FROM {chars_db}.characters c JOIN acore_auth.account a ON a.id=c.account WHERE c.online=1 AND {bots}), \ + (SELECT COUNT(*) FROM {chars_db}.characters c JOIN acore_auth.account a ON a.id=c.account WHERE {bots});" )) } @@ -85,6 +87,21 @@ pub fn query_with(db: &Db, prefix: &str, squid_prefix: &str) -> Result<Populatio parse_counts(&db.query(&counts_sql(prefix, squid_prefix)?)?) } +pub fn query_for_schema(db: &Db, chars_db: &str, prefix: &str, squid_prefix: &str) -> Result<Population> { + parse_counts(&db.query(&counts_sql_for_db(chars_db, prefix, squid_prefix)?)?) +} + +pub fn query_for_realm(root: &Path, mode: crate::realms::Mode) -> Result<Population> { + let db = Db::from_repack(root, Account::App)?; + let schema = mode.schema("characters")?; + query_for_schema( + &db, + schema, + &bot_account_prefix(root), + &crate::accounts::squid_bot_prefix(root), + ) +} + #[derive(Debug, Clone, Serialize)] pub struct Hardware { pub cores: u32, diff --git a/crates/coa-core/src/ra.rs b/crates/coa-core/src/ra.rs index cad0bcd..c63a52e 100644 --- a/crates/coa-core/src/ra.rs +++ b/crates/coa-core/src/ra.rs @@ -272,6 +272,18 @@ impl Ra { Ok(out.lines().last().unwrap_or("").to_string()) } + /// Ask the bot module to spawn a fleet of bots of specific race and level (.botcmd spawnfleet <race> <level>). + pub fn spawn_fleet(&mut self, race: u8, level: u8) -> Result<String> { + let out = self.bot_command(&format!("botcmd spawnfleet {race} {level}"))?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + + /// Bring all offline bots online gradually (.botcmd loginall). + pub fn login_all(&mut self) -> Result<String> { + let out = self.bot_command("botcmd loginall")?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + /// Set a new password for an existing account. pub fn set_account_password(&mut self, name: &str, password: &str) -> Result<()> { validate_account(name, password)?; diff --git a/crates/coa-core/src/realms.rs b/crates/coa-core/src/realms.rs index ab4c156..ec2deb9 100644 --- a/crates/coa-core/src/realms.rs +++ b/crates/coa-core/src/realms.rs @@ -185,8 +185,21 @@ pub fn view(root: &Path) -> Result<View> { } pub fn guard_module(root: &Path, id: &str) -> Result<()> { - // Multi-realm Playerbots 1.0 supports all realms (CoA, Wildcard, Reborn). - let _ = (root, id); + let s = state(root)?; + if matches!(id, "companions" | "playerbots") { + if let Ok(v) = view(root) { + if s.active == Mode::Wildcard && !v.supported { + return Err(Error::Invalid( + "The installed server binary does not support Wildcard mode.".into(), + )); + } + if s.active == Mode::Reborn && !v.reborn_supported { + return Err(Error::Invalid( + "The installed server binary does not support Warcraft Reborn mode.".into(), + )); + } + } + } Ok(()) } @@ -295,18 +308,14 @@ fn wildcard_configs(mut files: Files) -> Result<Files> { } } } - set( - &mut files, - "Core/configs/modules/mod_coa_playerbots.conf", - "CoaBots.Enable", - "1", - )?; - set( - &mut files, - "Core/configs/modules/playerbots.conf", - "AiPlayerbot.Enabled", - "0", - )?; + // Preserve existing CoaBots.Enable if present; do not force enable or alter alternative bot systems + if let Some(bytes) = files.get("Core/configs/modules/mod_coa_playerbots.conf") { + if let Ok(conf) = ConfFile::parse_bytes(bytes) { + if conf.get("CoaBots.Enable") == Some("1") { + set(&mut files, "Core/configs/modules/mod_coa_playerbots.conf", "CoaBots.Enable", "1")?; + } + } + } Ok(files) } @@ -334,18 +343,14 @@ fn reborn_configs(mut files: Files) -> Result<Files> { set(&mut files, path, "RealmID", "3")?; } } - set( - &mut files, - "Core/configs/modules/mod_coa_playerbots.conf", - "CoaBots.Enable", - "1", - )?; - set( - &mut files, - "Core/configs/modules/playerbots.conf", - "AiPlayerbot.Enabled", - "0", - )?; + // Preserve existing CoaBots.Enable if present; do not force enable or alter alternative bot systems + if let Some(bytes) = files.get("Core/configs/modules/mod_coa_playerbots.conf") { + if let Ok(conf) = ConfFile::parse_bytes(bytes) { + if conf.get("CoaBots.Enable") == Some("1") { + set(&mut files, "Core/configs/modules/mod_coa_playerbots.conf", "CoaBots.Enable", "1")?; + } + } + } Ok(files) } @@ -796,11 +801,12 @@ mod tests { .get("RealmID"), Some("3") ); + // Requirement 6: Never alter alternative bot system settings (AiPlayerbot.Enabled) without explicit user choice assert_eq!( ConfFile::parse_bytes(&reborn["Core/configs/modules/playerbots.conf"]) .unwrap() .get("AiPlayerbot.Enabled"), - Some("0") + Some("1") ); write_configs(t.path(), &reborn).unwrap(); write_configs(t.path(), &coa).unwrap(); @@ -1003,6 +1009,10 @@ CoA.GameModeMask = 0 "Core/configs/modules/mod-coa-content-scaling.conf".into(), b"[worldserver]\nCoAContentScaling.Enable = 1\n".to_vec(), ); + f.insert( + "Core/configs/modules/mod_coa_playerbots.conf".into(), + b"[worldserver]\nCoaBots.Enable = 1\n".to_vec(), + ); f.insert( "Settings/worldserver.conf.template".into(), b"[worldserver]\nRealmID = 1\n".to_vec(), diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8552c36..fb6f2f0 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1827,6 +1827,7 @@ async fn retry_update_validation( async fn get_population( state: State<'_, AppState>, id: String, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<Option<coa_core::population::Population>, UiError> { let root = path_of(&state, &id)?; Ok(tauri::async_runtime::spawn_blocking(move || { @@ -1834,12 +1835,46 @@ async fn get_population( if o.mysql.state != coa_core::process::ServiceState::Running { return None; } - coa_core::population::query(&root).ok() + if let Some(mode) = realm { + coa_core::population::query_for_realm(&root, mode).ok() + } else { + coa_core::population::query(&root).ok() + } }) .await .unwrap_or(None)) } +#[tauri::command] +async fn companions_login_all( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<String, UiError> { + let root = path_of(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || { + let mut ra = Ra::connect(&root)?; + ra.login_all() + }) + .await +} + +#[tauri::command] +async fn companions_spawn_fleet( + state: State<'_, AppState>, + id: String, + race: u8, + level: u8, +) -> std::result::Result<String, UiError> { + let root = path_of(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || { + let mut ra = Ra::connect(&root)?; + ra.spawn_fleet(race, level) + }) + .await +} + #[derive(Serialize)] struct CompanionAction { /// Bots affected (cancelled from the queue, or logged out). @@ -1990,6 +2025,7 @@ async fn add_companions( state: State<'_, AppState>, id: String, count: u32, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<CompanionsResult, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; @@ -1999,6 +2035,14 @@ async fn add_companions( "Choose between 1 and 2000 companions.".into(), )); } + let mode = realm.unwrap_or_else(|| { + coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default() + }); + let chars_db = match mode { + coa_core::realms::Mode::Coa => "acore_characters", + coa_core::realms::Mode::Wildcard => "acore_characters_wildcard", + coa_core::realms::Mode::Reborn => "acore_characters_reborn", + }; let meta = meta_dir(&root)?; let mut changes = BTreeMap::new(); changes.insert("CoaBots.AutoLoginOnStartup".to_string(), Value::Bool(true)); @@ -2012,7 +2056,7 @@ async fn add_companions( .and_then(|s| s.value.as_u64()) }) .unwrap_or(0) as u32; - let already = coa_core::population::query(&root) + let already = coa_core::population::query_for_realm(&root, mode) .map(|p| p.bots_total) .unwrap_or(0); changes.insert( @@ -2021,10 +2065,11 @@ async fn add_companions( ); config::save(&root, &meta, Scope::Bots, &changes)?; let o = coa_core::process::observe(&root, &layout::read_ports(&root)); - // Large batches while the server is stopped: create them in the database right now, fully equipped. + // Large batches while the server is stopped: create them in the database right now, fully equipped (CoA schema only). if o.world.state == coa_core::process::ServiceState::Stopped && o.auth.state == coa_core::process::ServiceState::Stopped && count >= coa_core::companions::OFFLINE_MIN + && mode == coa_core::realms::Mode::Coa && coa_core::companions::offline_factory(&root).is_some() { let started_db = o.mysql.state != coa_core::process::ServiceState::Running; @@ -2035,10 +2080,10 @@ async fn add_companions( } } let made = (|| -> Result<()> { - coa_core::companions::ensure_templates(&coa_core::db::Db::from_repack( - &root, - coa_core::db::Account::Admin, - )?)?; + coa_core::companions::ensure_templates_for_schema( + &coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin)?, + chars_db, + )?; coa_core::companions::offline_create( &root, &meta.join("logs").join("companions-offline.log"), @@ -2060,11 +2105,10 @@ async fn add_companions( let mut baseline = None; let spawned = if o.world.state == coa_core::process::ServiceState::Running { // Older servers have no template characters to copy bots from: add them first. - coa_core::companions::ensure_templates(&coa_core::db::Db::from_repack( - &root, - coa_core::db::Account::Admin, - )?)?; - baseline = coa_core::population::query(&root) + if let Ok(admin_db) = coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin) { + let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, chars_db); + } + baseline = coa_core::population::query_for_realm(&root, mode) .ok() .map(|p| p.bots_total); Some(Ra::connect(&root)?.spawn_bots(count)?) @@ -3180,6 +3224,8 @@ pub fn run() { companions_take_offline, companions_delete_all, companions_despawn_some, + companions_login_all, + companions_spawn_fleet, open_link, report_targets, companion_sizes, diff --git a/src/lib/api.ts b/src/lib/api.ts index 29d87f5..4ac05c1 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -571,15 +571,18 @@ export const api = { invoke<{ txn: UpdateTxn; preexisting_character_count?: number }>("apply_update", { id, source: source ?? null, resolutions }), rollbackUpdate: (id: string, txn: string) => invoke<UpdateTxn>("rollback_update", { id, txn }), retryUpdateValidation: (id: string, txn: string) => invoke<UpdateTxn>("retry_update_validation", { id, txn }), - population: (id: string) => invoke<Population | null>("get_population", { id }), + population: (id: string, realm?: RealmMode) => invoke<Population | null>("get_population", { id, realm: realm ?? null }), stopSpawning: (id: string) => invoke<{ count: number }>("companions_stop_spawning", { id }), takeOffline: (id: string) => invoke<{ count: number }>("companions_take_offline", { id }), despawnSome: (id: string, count: number) => invoke<{ count: number }>("companions_despawn_some", { id, count }), deleteAllCompanions: (id: string) => invoke<{ count: number }>("companions_delete_all", { id }), + loginAllCompanions: (id: string) => invoke<string>("companions_login_all", { id }), + spawnBotFleet: (id: string, race: number, level: number) => invoke<string>("companions_spawn_fleet", { id, race, level }), openLink: (url: string) => invoke<void>("open_link", { url }), performance: (id: string) => invoke<Performance | null>("get_performance", { id }), companionSizes: () => invoke<CompanionSizes>("companion_sizes"), - addCompanions: (id: string, count: number) => invoke<{ spawned: string | null; created: number | null; baseline: number | null }>("add_companions", { id, count }), + addCompanions: (id: string, count: number, realm?: RealmMode) => + invoke<{ spawned: string | null; created: number | null; baseline: number | null }>("add_companions", { id, count, realm: realm ?? null }), clientGraphics: (id: string) => invoke<{ dxvk_disabled: boolean; enhancements_disabled: boolean }>("client_graphics", { id }), clientSetGraphics: (id: string, name: string, disabled: boolean) => invoke<{ dxvk_disabled: boolean; enhancements_disabled: boolean }>("client_set_graphics", { id, name, disabled }), clientInfo: (id: string) => invoke<ClientInfo | null>("client_info", { id }), diff --git a/src/screens/CompanionsCard.tsx b/src/screens/CompanionsCard.tsx index a3f9307..3ca88ac 100644 --- a/src/screens/CompanionsCard.tsx +++ b/src/screens/CompanionsCard.tsx @@ -1,35 +1,88 @@ import { useEffect, useState } from "react"; -import { Loader2 } from "lucide-react"; -import { api, asUiError, type CompanionSizes, type Population, type UiError } from "@/lib/api"; +import { + Loader2, + Bot, + CheckCircle2, + AlertCircle, + RefreshCw, + Power, + Users, + Database, +} from "lucide-react"; +import { + api, + asUiError, + type Population, + type RealmMode, + type RealmProfiles, + type UiError, +} from "@/lib/api"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; -import { hasKey, useHuman, useT, type Key } from "@/i18n"; +import { useHuman, useT } from "@/i18n"; export function CompanionsCard({ serverId }: { serverId: string }) { const t = useT(); const human = useHuman(); - const [sizes, setSizes] = useState<CompanionSizes | null>(null); - const [realmMode, setRealmMode] = useState<string | null>(null); + + // Realm & Environment state + const [profiles, setProfiles] = useState<RealmProfiles | null>(null); + const [selectedRealm, setSelectedRealm] = useState<RealmMode>("coa"); const [pop, setPop] = useState<Population | null>(null); const [running, setRunning] = useState(false); - const [choice, setChoice] = useState<string>("small"); - const [custom, setCustom] = useState("100"); + + // Fleet Configuration state + const [spawnMode, setSpawnMode] = useState<"population" | "fleet">("population"); + const [countChoice, setCountChoice] = useState<string>("50"); + const [customCount, setCustomCount] = useState<string>("50"); + const [targetLevel, setTargetLevel] = useState<number>(80); + const [selectedClass, setSelectedClass] = useState<string>("all"); + const [selectedRole, setSelectedRole] = useState<string>("all"); + const [selectedArchetype, setSelectedArchetype] = useState<string>("all"); + + // Operational state const [busy, setBusy] = useState(false); const [error, setError] = useState<UiError | null>(null); const [note, setNote] = useState<string | null>(null); - // Start-up login: how many existing bots the server brings online by itself every time it starts. + const [job, setJob] = useState<{ baseline: number; target: number; since: number } | null>(null); + + // Startup Auto-Login settings const [autoOn, setAutoOn] = useState(true); const [autoMax, setAutoMax] = useState(""); - // A creation that is still in progress on the running server: how many existed before and how many were asked for. - const [job, setJob] = useState<{ baseline: number; target: number; since: number } | null>(null); const [startNote, setStartNote] = useState<string | null>(null); const [startBusy, setStartBusy] = useState(false); const [despawnN, setDespawnN] = useState("10"); + const activeServerRealm = profiles?.active ?? "coa"; + const isViewingActiveRealm = selectedRealm === activeServerRealm; + + const maxLevelForRealm = selectedRealm === "reborn" ? 60 : 80; + + // Load realm profiles + const loadProfiles = async () => { + try { + const r = await api.realmProfiles(serverId); + setProfiles(r); + if (!selectedRealm) { + setSelectedRealm(r.active); + } + } catch { + // ignore + } + }; + useEffect(() => { - void api.realmProfiles(serverId).then((r) => setRealmMode(r.active)).catch(() => {}); + void loadProfiles(); }, [serverId]); + // Adjust target level if realm changed + useEffect(() => { + if (targetLevel > maxLevelForRealm) { + setTargetLevel(maxLevelForRealm); + } + }, [selectedRealm, maxLevelForRealm, targetLevel]); + + // Load startup settings useEffect(() => { void api .settings(serverId, "bots") @@ -45,6 +98,46 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const maxNum = Number(autoMax); const maxValid = autoMax.trim() !== "" && Number.isInteger(maxNum) && maxNum >= 0 && maxNum <= 5000; + // Polling population + const fetchPopulation = async () => { + const s = await api.status(serverId).catch(() => null); + if (!s) return; + const up = s.observed.world.state === "running"; + setRunning(up); + if (up) { + const p = await api.population(serverId, selectedRealm).catch(() => null); + setPop(p); + } else { + setPop(null); + } + }; + + useEffect(() => { + let alive = true; + const poll = async () => { + if (!alive) return; + await fetchPopulation(); + }; + void poll(); + const interval = setInterval(poll, job ? 1500 : 4000); + return () => { + alive = false; + clearInterval(interval); + }; + }, [serverId, selectedRealm, job !== null]); // eslint-disable-line react-hooks/exhaustive-deps + + const done = job && pop ? Math.max(0, Math.min(job.target, pop.bots_total - job.baseline)) : 0; + useEffect(() => { + if (!job) return; + if ((pop && done >= job.target) || !running) { + if (pop && done >= job.target) setNote(t("comp.progressDone", { n: job.target })); + setJob(null); + } + }, [done, running]); // eslint-disable-line react-hooks/exhaustive-deps + + const count = countChoice === "custom" ? Number(customCount) : Number(countChoice); + const valid = Number.isInteger(count) && count >= 1 && count <= 2000; + async function act(fn: () => Promise<string>) { setBusy(true); setError(null); @@ -57,45 +150,113 @@ export function CompanionsCard({ serverId }: { serverId: string }) { } } + // Primary action: Spawn bots / fleet + const handleSpawn = async () => { + if (!valid) return; + setBusy(true); + setError(null); + setNote(null); + try { + if (spawnMode === "fleet") { + // Fleet spawn: race 1 (Human) or 2 (Orc) + const race = 1; + const out = await api.spawnBotFleet(serverId, race, targetLevel); + setNote(out || `Spawned level ${targetLevel} fleet`); + } else { + const r = await api.addCompanions(serverId, count, selectedRealm); + if (r.spawned && r.baseline !== null) { + setJob({ baseline: r.baseline, target: count, since: Date.now() }); + } + setNote( + r.created + ? t("comp.offlineDone", { n: r.created }) + : r.spawned + ? t("comp.spawned", { n: count }) + : t("comp.saved", { n: count }) + ); + } + await fetchPopulation(); + } catch (e) { + setError(asUiError(e)); + } finally { + setBusy(false); + } + }; + + // Bring offline bots online + const handleLoginAll = () => + act(async () => { + const out = await api.loginAllCompanions(serverId); + await fetchPopulation(); + return out || "All available offline bots queued for login."; + }); + + // Stop queued creations const stopCreating = () => act(async () => { const r = await api.stopSpawning(serverId); setJob(null); + await fetchPopulation(); return t("comp.stopped", { n: r.count }); }); + // Take online bots offline const takeOffline = () => { if (!window.confirm(t("comp.offlineConfirm"))) return; void act(async () => { const r = await api.takeOffline(serverId); setJob(null); + await fetchPopulation(); return t("comp.offlineDone2", { n: r.count }); }); }; + // Despawn batch const dn = Number(despawnN); const dnValid = Number.isInteger(dn) && dn >= 1 && dn <= 5000; const despawnSome = () => act(async () => { const r = await api.despawnSome(serverId, dn); + await fetchPopulation(); return t("comp.despawnSomeDone", { n: r.count }); }); + // Delete all bots in realm const deleteAll = () => { if (!window.confirm(t("comp.deleteConfirm", { n: pop?.bots_total ?? 0 }))) return; void act(async () => { await api.deleteAllCompanions(serverId); setJob(null); + await fetchPopulation(); return t("comp.deleteDone"); }); }; + // Switch server realm + const switchServerRealm = async (mode: RealmMode) => { + if (!window.confirm(`Switch server active realm to ${mode.toUpperCase()} and restart?`)) return; + setBusy(true); + try { + await api.realmSelect(serverId, mode, true); + await loadProfiles(); + setSelectedRealm(mode); + } catch (e) { + setError(asUiError(e)); + } finally { + setBusy(false); + } + }; + + // Save auto startup settings async function saveStart() { setStartBusy(true); setError(null); setStartNote(null); try { - await api.save(serverId, "bots", { "CoaBots.AutoLoginOnStartup": autoOn, "CoaBots.AutoLogin.MaxCount": maxNum }); + await api.save(serverId, "bots", { + "CoaBots.AutoLoginOnStartup": autoOn, + "CoaBots.AutoLogin.MaxCount": maxNum, + }); setStartNote(t("comp.startSaved")); } catch (e) { setError(asUiError(e)); @@ -104,188 +265,507 @@ export function CompanionsCard({ serverId }: { serverId: string }) { } } - useEffect(() => { - void api.companionSizes().then(setSizes); - let alive = true; - const poll = async () => { - const s = await api.status(serverId).catch(() => null); - if (!alive || !s) return; - const up = s.observed.world.state === "running"; - setRunning(up); - setPop(up ? await api.population(serverId).catch(() => null) : null); - }; - void poll(); - // Faster while companions are being created, so the progress bar moves. - const t = setInterval(poll, job ? 1500 : 4000); - return () => { - alive = false; - clearInterval(t); - }; - }, [serverId, job !== null]); // eslint-disable-line react-hooks/exhaustive-deps + // Database schema name for selected realm + const dbSchema = + selectedRealm === "coa" + ? "acore_characters" + : selectedRealm === "wildcard" + ? "acore_characters_wildcard" + : "acore_characters_reborn"; - const done = job && pop ? Math.max(0, Math.min(job.target, pop.bots_total - job.baseline)) : 0; - useEffect(() => { - if (!job) return; - // Finished, or the server went away, or nothing new appeared for two minutes. - if ((pop && done >= job.target) || !running) { - if (pop && done >= job.target) setNote(t("comp.progressDone", { n: job.target })); - setJob(null); - } - }, [done, running]); // eslint-disable-line react-hooks/exhaustive-deps - - // The backend describes a size's warning in English; show the translated text for the two known kinds. - const warningFor = (size?: { bots: number; warning: string | null }) => { - if (!size?.warning) return null; - return size.warning.startsWith(`${size.bots} companions`) - ? t("comp.warnHardware", { n: size.bots, cores: sizes?.hardware.cores ?? "?", ram: sizes ? sizes.hardware.ram_gb.toFixed(0) : "?" }) - : t("comp.warnMemory"); - }; - const count = choice === "custom" ? Number(custom) : (sizes?.sizes.find((s) => s.id === choice)?.bots ?? 0); - const warning = choice === "custom" ? (count > 500 ? t("comp.largeWarning") : null) : (warningFor(sizes?.sizes.find((s) => s.id === choice))); - const valid = Number.isInteger(count) && count >= 1 && count <= 2000; - - async function add() { - setBusy(true); - setError(null); - setNote(null); - try { - const r = await api.addCompanions(serverId, count); - if (r.spawned && r.baseline !== null) setJob({ baseline: r.baseline, target: count, since: Date.now() }); - setNote(r.created ? t("comp.offlineDone", { n: r.created }) : r.spawned ? t("comp.spawned", { n: count }) : t("comp.saved", { n: count })); - } catch (e) { - setError(asUiError(e)); - } finally { - setBusy(false); - } - } + // Binary compatibility check + const isBinaryCompatible = + selectedRealm === "coa" || + (selectedRealm === "wildcard" && (profiles?.supported ?? true)) || + (selectedRealm === "reborn" && (profiles?.reborn_supported ?? true)); return ( - <Card className="mt-6 p-6"> - <div className="flex items-center justify-between"> - <h2 className="font-semibold">{t("comp.title")}</h2> - {realmMode && ( - <span className="rounded bg-gold/15 px-2 py-0.5 text-xs font-medium text-gold uppercase tracking-wider"> - {realmMode === "coa" ? "Conquest of Azeroth" : realmMode === "wildcard" ? "Wildcard" : "Warcraft Reborn"} - </span> - )} - </div> - <p className="mt-1 text-sm text-muted"> - {pop - ? t("comp.population", { online: pop.bots_online, total: pop.bots_total }) - : running - ? t("comp.reading") - : t("comp.startToSee")} - </p> - - <fieldset className="mt-4"> - <legend className="text-sm text-muted">{t("comp.wantMore")}</legend> - <div className="mt-2 flex flex-wrap gap-2"> - {sizes?.sizes.map((s) => ( - <label key={s.id} className={`cursor-pointer rounded-md border px-3 py-2 text-sm ${choice === s.id ? "border-gold bg-gold/10" : "border-line hover:bg-white/5"}`}> - <input type="radio" name="size" className="sr-only" checked={choice === s.id} onChange={() => setChoice(s.id)} /> - {hasKey(`comp.size.${s.id}`) ? t(`comp.size.${s.id}` as Key) : s.title} <span className="text-muted">· {s.bots}</span> - </label> - ))} - <label className={`cursor-pointer rounded-md border px-3 py-2 text-sm ${choice === "custom" ? "border-gold bg-gold/10" : "border-line hover:bg-white/5"}`}> - <input type="radio" name="size" className="sr-only" checked={choice === "custom"} onChange={() => setChoice("custom")} /> - {t("comp.custom")} - </label> - {choice === "custom" && ( - <input aria-label={t("comp.numberLabel")} value={custom} onChange={(e) => setCustom(e.target.value)} inputMode="numeric" className="w-24 rounded-md border border-line bg-bg px-3 py-2 text-right text-sm outline-none focus:border-gold" /> - )} + <Card className="mt-6 p-6 space-y-6"> + {/* Header & Realm Switcher */} + <div> + <div className="flex flex-wrap items-center justify-between gap-3"> + <div className="flex items-center gap-2"> + <Bot className="h-6 w-6 text-gold" /> + <h2 className="text-xl font-bold tracking-tight">{t("comp.title")}</h2> + </div> + <div className="flex items-center gap-2"> + <span className="text-xs text-muted flex items-center gap-1"> + <Database className="h-3.5 w-3.5" /> + DB: <code className="text-gold">{dbSchema}</code> + </span> + </div> </div> - </fieldset> - {warning && <p className="mt-3 text-sm text-warn" role="status">{warning}</p>} - {sizes && <p className="mt-2 text-xs text-muted">{t("comp.hardware", { cores: sizes.hardware.cores, ram: sizes.hardware.ram_gb.toFixed(0) })}</p>} - - <div className="mt-4 flex items-center gap-3"> - <Button variant="primary" disabled={busy || !valid || job !== null} onClick={() => void add()}> - {busy && <Loader2 className="h-4 w-4 animate-spin" aria-hidden />} - {valid ? t("comp.add", { n: count }) : t("comp.addPlain")} - </Button> - {!running && <span className="text-xs text-muted">{t("comp.stoppedHint")}</span>} + {/* Realm Navigation Tabs */} + <div className="mt-4 flex flex-wrap gap-2 border-b border-line pb-3"> + {(["coa", "wildcard", "reborn"] as RealmMode[]).map((mode) => { + const isSelected = selectedRealm === mode; + const isActive = activeServerRealm === mode; + const label = + mode === "coa" + ? "Conquest of Azeroth" + : mode === "wildcard" + ? "Wildcard (Hero)" + : "Warcraft Reborn"; + return ( + <button + key={mode} + type="button" + onClick={() => setSelectedRealm(mode)} + className={`flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors ${ + isSelected + ? "bg-gold/20 text-gold border border-gold/40 shadow-sm" + : "border border-line hover:bg-white/5 text-muted hover:text-white" + }`} + > + <span>{label}</span> + {isActive && ( + <span className="rounded bg-ok/20 px-1.5 py-0.5 text-[10px] font-semibold text-ok uppercase"> + Active Server + </span> + )} + </button> + ); + })} + </div> </div> - {busy && !running && count >= 100 && ( - <div className="mt-3"> - <p className="text-sm text-muted" role="status">{t("comp.progressOffline", { n: count })}</p> - <div className="mt-2 h-2 overflow-hidden rounded-full bg-white/10" role="progressbar" aria-busy="true"> - <div className="h-full w-full animate-pulse rounded-full bg-gold/70" /> + + {/* Binary Compatibility & Realm Mode Warning */} + {!isBinaryCompatible && ( + <div className="rounded-lg border border-bad/40 bg-bad/10 p-4 text-sm text-bad flex items-start gap-3"> + <AlertCircle className="h-5 w-5 shrink-0 mt-0.5" /> + <div> + <div className="font-semibold">Binary Compatibility Warning</div> + <p className="mt-1 text-xs text-bad/90"> + The currently running server core binary does not have full multi-realm support enabled + for <strong>{selectedRealm.toUpperCase()}</strong>. Automated bot features may be restricted. + </p> </div> </div> )} - {job && ( - <div className="mt-3"> - <div className="flex justify-between text-sm"> - <span role="status">{t("comp.progress", { done, target: job.target })}</span> - <span className="text-muted">{Math.round((done / job.target) * 100)}%</span> - </div> - <div className="mt-2 h-2 overflow-hidden rounded-full bg-white/10" role="progressbar" aria-valuenow={done} aria-valuemin={0} aria-valuemax={job.target}> - <div className="h-full rounded-full bg-gold transition-[width] duration-500" style={{ width: `${(done / job.target) * 100}%` }} /> - </div> - {done === 0 && Date.now() - job.since > 20000 && <p className="mt-1 text-xs text-muted">{t("comp.progressStalled")}</p>} - <Button className="mt-2" size="sm" variant="ghost" disabled={busy} onClick={() => void stopCreating()}> - {t("comp.stop")} + + {/* Active Realm Switch Helper */} + {!isViewingActiveRealm && ( + <div className="rounded-lg border border-warn/40 bg-warn/10 p-3 text-sm flex items-center justify-between gap-3"> + <span className="text-warn text-xs"> + Viewing <strong>{selectedRealm.toUpperCase()}</strong> bots, but the worldserver is currently running in{" "} + <strong>{activeServerRealm.toUpperCase()}</strong> mode. + </span> + <Button + size="sm" + variant="secondary" + disabled={busy} + onClick={() => void switchServerRealm(selectedRealm)} + > + Switch Server to {selectedRealm.toUpperCase()} </Button> </div> )} - {note && !job && <p className="mt-3 text-sm text-ok" role="status">{note}</p>} - {running && pop && pop.bots_total > 0 && ( - <div className="mt-5 border-t border-line pt-4"> - <h3 className="text-sm font-semibold">{t("comp.manageTitle")}</h3> - <div className="mt-2 flex flex-wrap items-center gap-2 text-sm"> - <label htmlFor="despawn-n" className="text-muted">{t("comp.despawnCount")}</label> + {/* Realm Population Dashboard */} + <div className="grid grid-cols-2 sm:grid-cols-4 gap-3"> + <div className="rounded-lg border border-line bg-bg/50 p-3"> + <div className="text-xs text-muted flex items-center gap-1.5"> + <Bot className="h-3.5 w-3.5 text-gold" /> + Bots Online + </div> + <div className="mt-1 text-2xl font-bold text-white"> + {running && pop ? pop.bots_online : "—"} + </div> + </div> + <div className="rounded-lg border border-line bg-bg/50 p-3"> + <div className="text-xs text-muted flex items-center gap-1.5"> + <Users className="h-3.5 w-3.5 text-gold" /> + Total Fleet + </div> + <div className="mt-1 text-2xl font-bold text-white"> + {pop ? pop.bots_total : "—"} + </div> + </div> + <div className="rounded-lg border border-line bg-bg/50 p-3"> + <div className="text-xs text-muted flex items-center gap-1.5"> + <CheckCircle2 className="h-3.5 w-3.5 text-ok" /> + Players Online + </div> + <div className="mt-1 text-2xl font-bold text-white"> + {running && pop ? pop.players_online : "—"} + </div> + </div> + <div className="rounded-lg border border-line bg-bg/50 p-3 flex flex-col justify-between"> + <div className="text-xs text-muted flex items-center justify-between"> + <span>Status</span> + <button + onClick={() => void fetchPopulation()} + title="Refresh" + className="text-muted hover:text-white" + > + <RefreshCw className="h-3 w-3" /> + </button> + </div> + <div className="text-sm font-medium"> + {running ? ( + <span className="text-ok flex items-center gap-1"> + <span className="h-2 w-2 rounded-full bg-ok animate-pulse" /> Running + </span> + ) : ( + <span className="text-muted">Offline</span> + )} + </div> + </div> + </div> + + {/* Fleet Configuration & Spawning Section */} + <div className="border-t border-line pt-5 space-y-4"> + <div className="flex items-center justify-between"> + <h3 className="font-semibold text-sm tracking-wide uppercase text-muted"> + Fleet Deployment Controls + </h3> + <div className="flex rounded-md border border-line p-0.5 text-xs"> + <button + type="button" + onClick={() => setSpawnMode("population")} + className={`px-2.5 py-1 rounded transition-colors ${ + spawnMode === "population" ? "bg-gold/20 text-gold font-medium" : "text-muted hover:text-white" + }`} + > + Batch Population + </button> + <button + type="button" + onClick={() => setSpawnMode("fleet")} + className={`px-2.5 py-1 rounded transition-colors ${ + spawnMode === "fleet" ? "bg-gold/20 text-gold font-medium" : "text-muted hover:text-white" + }`} + > + Synchronous Fleet + </button> + </div> + </div> + + {/* Count Selector */} + {spawnMode === "population" && ( + <div> + <label className="text-xs text-muted">Fleet Size (Number of Bots)</label> + <div className="mt-2 flex flex-wrap gap-2"> + {["10", "25", "50", "100", "250", "500"].map((n) => ( + <button + key={n} + type="button" + onClick={() => setCountChoice(n)} + className={`rounded-md border px-3 py-1.5 text-sm transition-colors ${ + countChoice === n + ? "border-gold bg-gold/15 text-gold font-medium" + : "border-line hover:bg-white/5 text-muted" + }`} + > + {n} + </button> + ))} + <button + type="button" + onClick={() => setCountChoice("custom")} + className={`rounded-md border px-3 py-1.5 text-sm transition-colors ${ + countChoice === "custom" + ? "border-gold bg-gold/15 text-gold font-medium" + : "border-line hover:bg-white/5 text-muted" + }`} + > + Custom + </button> + {countChoice === "custom" && ( + <input + type="number" + min="1" + max="2000" + value={customCount} + onChange={(e) => setCustomCount(e.target.value)} + className="w-24 rounded-md border border-line bg-bg px-3 py-1.5 text-right text-sm outline-none focus:border-gold" + /> + )} + </div> + </div> + )} + + {/* Fleet Specific Settings: Level, Class, Role, Archetype */} + <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3"> + {/* Target Level */} + <div> + <label className="text-xs text-muted"> + {spawnMode === "fleet" ? "Fleet Level" : "Max Level Cap"} (1 - {maxLevelForRealm}) + </label> + <input + type="number" + min="1" + max={maxLevelForRealm} + value={targetLevel} + onChange={(e) => setTargetLevel(Math.max(1, Math.min(maxLevelForRealm, Number(e.target.value))))} + className="mt-1.5 w-full rounded-md border border-line bg-bg px-3 py-1.5 text-sm outline-none focus:border-gold" + /> + </div> + + {/* Class Filter */} + <div> + <label className="text-xs text-muted">Class Focus</label> + <select + value={selectedClass} + onChange={(e) => setSelectedClass(e.target.value)} + className="mt-1.5 w-full rounded-md border border-line bg-bg px-3 py-1.5 text-sm outline-none focus:border-gold" + > + <option value="all">All Realm Classes</option> + {selectedRealm === "coa" && ( + <> + <option value="12">Guardian</option> + <option value="13">Starcaller</option> + <option value="14">Demon Hunter</option> + <option value="15">Necromancer</option> + <option value="16">Monk</option> + <option value="17">Pyromancer</option> + <option value="18">Chronomancer</option> + <option value="19">Cultist</option> + <option value="20">Runemaster</option> + <option value="21">Primalist</option> + <option value="22">Tinker</option> + </> + )} + {selectedRealm === "wildcard" && ( + <option value="10">Hero (Freepick)</option> + )} + {selectedRealm === "reborn" && ( + <> + <option value="1">Warrior</option> + <option value="2">Paladin</option> + <option value="3">Hunter</option> + <option value="4">Rogue</option> + <option value="5">Priest</option> + <option value="6">Death Knight</option> + <option value="7">Shaman</option> + <option value="8">Mage</option> + <option value="9">Warlock</option> + <option value="11">Druid</option> + </> + )} + </select> + </div> + + {/* Role Filter */} + <div> + <label className="text-xs text-muted">Combat Role</label> + <select + value={selectedRole} + onChange={(e) => setSelectedRole(e.target.value)} + className="mt-1.5 w-full rounded-md border border-line bg-bg px-3 py-1.5 text-sm outline-none focus:border-gold" + > + <option value="all">All Roles</option> + <option value="tank">Tank</option> + <option value="healer">Healer</option> + <option value="melee">Melee DPS</option> + <option value="ranged">Ranged Physical DPS</option> + <option value="caster">Caster DPS</option> + </select> + </div> + + {/* Archetype Filter */} + <div> + <label className="text-xs text-muted">Archetype / Build</label> + <select + value={selectedArchetype} + onChange={(e) => setSelectedArchetype(e.target.value)} + className="mt-1.5 w-full rounded-md border border-line bg-bg px-3 py-1.5 text-sm outline-none focus:border-gold" + > + <option value="all">Auto / Integral Archetype</option> + {selectedRealm === "wildcard" && ( + <> + <option value="bear">Bear Tank (Guardian)</option> + <option value="murlock">Mur-Lock (Unholy/Frost)</option> + <option value="firesage">Fire Sage (Fire/Ele)</option> + <option value="forestwarden">Forest Warden (Nature/Feral)</option> + <option value="bleedrogue">Bleed Rogue / Berserker</option> + <option value="holypal">Holy Paladin / Healer</option> + </> + )} + {selectedRealm === "reborn" && ( + <> + <option value="spiritguard">Spirit Guard Shaman (Tank)</option> + <option value="darkapoth">Dark Apotheosis Warlock (Tank)</option> + <option value="guardianbear">Guardian Bear Druid (Tank)</option> + <option value="protpal">Protection Paladin (Tank)</option> + <option value="protwar">Protection Warrior (Tank)</option> + <option value="holypriest">Holy Priest (Healer)</option> + <option value="restodruid">Restoration Druid / Shaman</option> + </> + )} + {selectedRealm === "coa" && ( + <option value="class_spec">Class Mastery Specialization</option> + )} + </select> + </div> + </div> + + {/* Deployment Actions */} + <div className="flex flex-wrap items-center gap-3 pt-2"> + <Button + variant="primary" + disabled={busy || !valid || job !== null || !isViewingActiveRealm} + onClick={() => void handleSpawn()} + > + {busy && <Loader2 className="h-4 w-4 animate-spin mr-2" />} + {spawnMode === "fleet" + ? `Spawn Level ${targetLevel} Fleet` + : `Deploy ${valid ? count : ""} Bots`} + </Button> + + {running && pop && pop.bots_total > pop.bots_online && ( + <Button + variant="secondary" + disabled={busy || job !== null || !isViewingActiveRealm} + onClick={() => void handleLoginAll()} + title="Bring all created bots online" + > + <Power className="h-4 w-4 mr-1.5 text-ok" /> + Bring All Online ({pop.bots_total - pop.bots_online} idle) + </Button> + )} + + {!running && ( + <span className="text-xs text-muted"> + Server stopped: bots will be created directly in DB or queued for startup. + </span> + )} + </div> + + {/* Progress Bar during active spawn */} + {job && ( + <div className="rounded-lg border border-line bg-bg/40 p-4 space-y-2"> + <div className="flex justify-between text-sm"> + <span className="font-medium"> + Creating bots: {done} / {job.target} + </span> + <span className="text-gold font-bold"> + {Math.round((done / job.target) * 100)}% + </span> + </div> + <div className="h-2 overflow-hidden rounded-full bg-white/10"> + <div + className="h-full rounded-full bg-gold transition-[width] duration-300" + style={{ width: `${(done / job.target) * 100}%` }} + /> + </div> + <div className="flex justify-between items-center pt-1"> + <span className="text-xs text-muted"> + Paced creation prevents server stalls and guarantees full talent/gear setup. + </span> + <Button size="sm" variant="ghost" disabled={busy} onClick={() => void stopCreating()}> + Cancel Queue + </Button> + </div> + </div> + )} + + {note && !job && ( + <p className="text-sm text-ok flex items-center gap-1.5"> + <CheckCircle2 className="h-4 w-4 shrink-0" /> + {note} + </p> + )} + </div> + + {/* Online Fleet Management (Despawn, Purge) */} + {running && pop && pop.bots_total > 0 && isViewingActiveRealm && ( + <div className="border-t border-line pt-5 space-y-3"> + <h3 className="font-semibold text-sm tracking-wide uppercase text-muted"> + Online Fleet Management + </h3> + + <div className="flex flex-wrap items-center gap-3 text-sm"> + <label htmlFor="despawn-n" className="text-muted text-xs"> + Despawn Batch: + </label> <input id="despawn-n" value={despawnN} onChange={(e) => setDespawnN(e.target.value)} inputMode="numeric" aria-invalid={!dnValid} - className="w-20 rounded-md border border-line bg-bg px-3 py-1.5 text-right outline-none focus:border-gold" + className="w-20 rounded-md border border-line bg-bg px-2.5 py-1 text-right text-sm outline-none focus:border-gold" /> - <Button size="sm" variant="secondary" disabled={busy || !dnValid} onClick={() => void despawnSome()}> - {t("comp.despawnSome", { n: dnValid ? dn : "…" })} + <Button + size="sm" + variant="secondary" + disabled={busy || !dnValid} + onClick={() => void despawnSome()} + > + Despawn {dnValid ? dn : "…"} Bots </Button> - </div> - <p className="mt-1 text-xs text-muted">{t("comp.despawnHint")}</p> - <div className="mt-3 flex flex-wrap gap-2"> + <Button size="sm" variant="secondary" disabled={busy} onClick={takeOffline}> - {t("comp.offline")} + Take All Offline </Button> - <Button size="sm" variant="ghost" className="text-bad hover:text-bad" disabled={busy} onClick={deleteAll}> - {t("comp.delete")} + + <Button + size="sm" + variant="ghost" + className="text-bad hover:text-bad ml-auto" + disabled={busy} + onClick={deleteAll} + > + Purge Entire Fleet ({pop.bots_total}) </Button> </div> </div> )} - <div className="mt-5 border-t border-line pt-4"> - <h3 className="text-sm font-semibold">{t("comp.startTitle")}</h3> - <label className="mt-2 flex cursor-pointer items-center gap-2 text-sm"> - <input type="checkbox" checked={autoOn} onChange={(e) => setAutoOn(e.target.checked)} /> - {t("comp.startAuto")} - </label> - <div className="mt-2 flex flex-wrap items-center gap-2 text-sm"> - <label htmlFor="start-max" className="text-muted">{t("comp.startCount")}</label> - <input - id="start-max" - value={autoMax} - onChange={(e) => setAutoMax(e.target.value)} - inputMode="numeric" - disabled={!autoOn} - aria-invalid={!maxValid} - className="w-24 rounded-md border border-line bg-bg px-3 py-1.5 text-right outline-none focus:border-gold disabled:opacity-40" - /> - <Button size="sm" variant="secondary" disabled={startBusy || (autoOn && !maxValid)} onClick={() => void saveStart()}> - {t("comp.startSave")} - </Button> + {/* Startup Auto-Login Configuration */} + <div className="border-t border-line pt-5 space-y-3"> + <h3 className="font-semibold text-sm tracking-wide uppercase text-muted"> + Persistent Startup Fleet + </h3> + <p className="text-xs text-muted"> + Configure how many bots automatically log into the world whenever the server launches. + </p> + + <div className="flex flex-wrap items-center gap-4 text-sm"> + <label className="flex cursor-pointer items-center gap-2"> + <input + type="checkbox" + checked={autoOn} + onChange={(e) => setAutoOn(e.target.checked)} + className="rounded border-line text-gold focus:ring-gold" + /> + <span>Enable Auto-Login on Server Startup</span> + </label> + + <div className="flex items-center gap-2"> + <label htmlFor="start-max" className="text-xs text-muted"> + Startup Limit: + </label> + <input + id="start-max" + value={autoMax} + onChange={(e) => setAutoMax(e.target.value)} + inputMode="numeric" + disabled={!autoOn} + aria-invalid={!maxValid} + className="w-24 rounded-md border border-line bg-bg px-2.5 py-1 text-right text-sm outline-none focus:border-gold disabled:opacity-40" + /> + <Button + size="sm" + variant="secondary" + disabled={startBusy || (autoOn && !maxValid)} + onClick={() => void saveStart()} + > + Save Setting + </Button> + </div> </div> - {autoOn && !maxValid && autoMax !== "" && <p className="mt-1 text-xs text-warn">{t("comp.startInvalid")}</p>} - <p className="mt-1 text-xs text-muted">{t("comp.startHint")}</p> - {startNote && <p className="mt-2 text-sm text-ok" role="status">{startNote}</p>} + {startNote && <p className="text-xs text-ok">{startNote}</p>} </div> - {error && <p className="mt-3 text-sm text-bad" role="alert">{error.human.code === "unknown" ? error.technical : human(error.human).message}</p>} + + {error && ( + <div className="rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad flex items-center gap-2"> + <AlertCircle className="h-4 w-4 shrink-0" /> + <span>{error.human.code === "unknown" ? error.technical : human(error.human).message}</span> + </div> + )} </Card> ); } From e4edb7cbdd0ca2f783bc0fb1121a76b816c5b857 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?= <corfirean@gmail.com> Date: Sat, 7 Nov 2026 10:19:13 +0500 Subject: [PATCH 23/29] feat(manager): multi-realm character database routing, RA dispatch & extended bot manager UI --- crates/coa-core/src/multiworld.rs | 52 ++++++++++++++++ crates/coa-core/src/ra.rs | 41 ++++++++++++ src-tauri/src/lib.rs | 100 ++++++++++++------------------ src/lib/api.ts | 32 +++++++--- src/screens/CompanionsCard.tsx | 70 ++++++++++++++------- 5 files changed, 203 insertions(+), 92 deletions(-) diff --git a/crates/coa-core/src/multiworld.rs b/crates/coa-core/src/multiworld.rs index f7bb17c..7e42d2c 100644 --- a/crates/coa-core/src/multiworld.rs +++ b/crates/coa-core/src/multiworld.rs @@ -97,6 +97,58 @@ pub fn world_root(main: &Path, mode: Mode) -> PathBuf { .map_or_else(|| main.to_path_buf(), |t| tree_root(main, t)) } +#[derive(Debug, Clone)] +pub struct BotOperationTarget { + pub world_root: PathBuf, + pub chars_db: &'static str, + pub ra_port: u16, + pub running: bool, + pub realm: Mode, +} + +pub fn resolve_bot_operation_target(main: &Path, realm: Mode) -> Result<BotOperationTarget> { + let state = realms::state(main)?; + let chars_db = realm.schema("characters")?; + + if realm == state.active { + let ports = crate::layout::read_ports(main); + let ra_port = ports.ra; + let status = process::observe(main, &ports); + let running = status.world.state != ServiceState::Stopped; + return Ok(BotOperationTarget { + world_root: main.to_path_buf(), + chars_db, + ra_port, + running, + realm, + }); + } + + let tree = Tree::ALL + .into_iter() + .find(|t| t.enabled(&state) && t.mode(state.active) == realm) + .ok_or_else(|| Error::Invalid(format!("Realm {} is not enabled in multiworld configuration.", realm.label())))?; + + let root = tree_root(main, tree); + if !root.exists() { + return Err(Error::Invalid(format!("Multiworld directory for {} does not exist: {}", realm.label(), root.display()))); + } + + let ports = crate::layout::read_ports(&root); + let (_, default_ra) = tree.ports(&state); + let ra_port = if ports.ra != 0 { ports.ra } else { default_ra.unwrap_or(3444) }; + let status = process::observe(&root, &ports); + let running = status.world.state != ServiceState::Stopped; + + Ok(BotOperationTarget { + world_root: root, + chars_db, + ra_port, + running, + realm, + }) +} + /// Any of the extra worlds is running or still stopping. pub fn is_running(main: &Path) -> bool { Tree::ALL.into_iter().any(|t| tree_running(main, t)) diff --git a/crates/coa-core/src/ra.rs b/crates/coa-core/src/ra.rs index c63a52e..37dcb5e 100644 --- a/crates/coa-core/src/ra.rs +++ b/crates/coa-core/src/ra.rs @@ -58,6 +58,23 @@ impl Ra { Self::connect_to(read_ports(root).ra, &cfg.ra_username, &cfg.ra_password) } + /// Connect to the loopback RA port of the target realm world server. + pub fn connect_target(main: &Path, realm: Option<crate::realms::Mode>) -> Result<Ra> { + let mode = realm.unwrap_or_else(|| { + crate::realms::view(main).map(|v| v.active).unwrap_or_default() + }); + let target = crate::multiworld::resolve_bot_operation_target(main, mode)?; + if !target.running { + return Err(Error::Invalid(format!( + "Realm {} worldserver is stopped; cannot execute online bot operation.", + target.realm.label() + ))); + } + let cfg: RaSettings = fsx::read_json(&main.join("Settings/repack.json")) + .map_err(|_| Error::Invalid("The server console settings could not be read.".into()))?; + Self::connect_to(target.ra_port, &cfg.ra_username, &cfg.ra_password) + } + pub fn connect_to(port: u16, user: &str, password: &str) -> Result<Ra> { let addr: SocketAddr = ([127, 0, 0, 1], port).into(); let mut stream = @@ -278,6 +295,30 @@ impl Ra { Ok(out.lines().last().unwrap_or("").to_string()) } + pub fn spawn_custom( + &mut self, + count: u32, + level: u8, + class_id: Option<u8>, + spec_id: Option<u32>, + archetype: Option<&str>, + ) -> Result<String> { + let mut cmd = format!("botcmd spawncustom {count} {level}"); + if let Some(c) = class_id { + cmd.push_str(&format!(" {c}")); + if let Some(s) = spec_id { + cmd.push_str(&format!(" {s}")); + if let Some(a) = archetype { + if !a.is_empty() { + cmd.push_str(&format!(" {a}")); + } + } + } + } + let out = self.bot_command(&cmd)?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + /// Bring all offline bots online gradually (.botcmd loginall). pub fn login_all(&mut self) -> Result<String> { let out = self.bot_command("botcmd loginall")?; diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index fb6f2f0..dfcf788 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1849,11 +1849,12 @@ async fn get_population( async fn companions_login_all( state: State<'_, AppState>, id: String, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<String, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; blocking(move || { - let mut ra = Ra::connect(&root)?; + let mut ra = Ra::connect_target(&root, realm)?; ra.login_all() }) .await @@ -1865,11 +1866,12 @@ async fn companions_spawn_fleet( id: String, race: u8, level: u8, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<String, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; blocking(move || { - let mut ra = Ra::connect(&root)?; + let mut ra = Ra::connect_target(&root, realm)?; ra.spawn_fleet(race, level) }) .await @@ -1885,11 +1887,12 @@ struct CompanionAction { async fn companions_stop_spawning( state: State<'_, AppState>, id: String, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<CompanionAction, UiError> { let root = path_of(&state, &id)?; blocking(move || { Ok(CompanionAction { - count: Ra::connect(&root)?.cancel_spawning()?, + count: Ra::connect_target(&root, realm)?.cancel_spawning()?, }) }) .await @@ -1899,12 +1902,12 @@ async fn companions_stop_spawning( async fn companions_take_offline( state: State<'_, AppState>, id: String, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<CompanionAction, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; blocking(move || { - let mut ra = Ra::connect(&root)?; - // Anything still waiting to be created must not come back right after. + let mut ra = Ra::connect_target(&root, realm)?; let _ = ra.cancel_spawning(); Ok(CompanionAction { count: ra.despawn_all()?, @@ -1913,13 +1916,12 @@ async fn companions_take_offline( .await } -/// Log `count` randomly chosen online companions out to lower the load. Uses the per-bot command that every server -/// build has, so it works on older builds too. #[tauri::command] async fn companions_despawn_some( state: State<'_, AppState>, id: String, count: u32, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<CompanionAction, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; @@ -1927,13 +1929,18 @@ async fn companions_despawn_some( if !(1..=5000).contains(&count) { return Err(Error::Invalid("Choose a number between 1 and 5000.".into())); } + let mode = realm.unwrap_or_else(|| { + coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default() + }); + let target = coa_core::multiworld::resolve_bot_operation_target(&root, mode)?; let prefix = coa_core::population::bot_account_prefix(&root).to_uppercase(); let db = coa_core::db::Db::from_repack(&root, coa_core::db::Account::App)?; let rows = db.query(&format!( - "SELECT c.guid FROM acore_characters.characters c JOIN acore_auth.account a ON a.id=c.account WHERE c.online=1 AND UPPER(a.username) LIKE '{prefix}%' ORDER BY RAND() LIMIT {count};" + "SELECT c.guid FROM {}.characters c JOIN acore_auth.account a ON a.id=c.account WHERE c.online=1 AND UPPER(a.username) LIKE '{prefix}%' ORDER BY RAND() LIMIT {count};", + target.chars_db ))?; let guids: Vec<u64> = rows.lines().filter_map(|l| l.trim().parse().ok()).collect(); - let mut ra = Ra::connect(&root)?; + let mut ra = Ra::connect_target(&root, Some(mode))?; let mut done = 0; for g in guids { if ra.despawn_bot(g).unwrap_or(false) { @@ -1945,31 +1952,35 @@ async fn companions_despawn_some( .await } -/// Delete every companion for good. A recovery point of the characters and accounts is saved first. #[tauri::command] async fn companions_delete_all( app: AppHandle, state: State<'_, AppState>, id: String, + realm: Option<coa_core::realms::Mode>, ) -> std::result::Result<CompanionAction, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; blocking(move || { + let mode = realm.unwrap_or_else(|| { + coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default() + }); + let target = coa_core::multiworld::resolve_bot_operation_target(&root, mode)?; let meta = meta_dir(&root)?; backup::create( &root, &meta, Kind::Quick, Trigger::BeforeDangerousChange, - Some("before deleting all companions".into()), + Some(format!("before deleting all {} companions", target.realm.label())), &|step| { let _ = app.emit("backup-progress", step); }, )?; - let before = coa_core::population::query(&root) + let before = coa_core::population::query_for_realm(&root, mode) .map(|p| p.bots_total) .unwrap_or(0); - let mut ra = Ra::connect(&root)?; + let mut ra = Ra::connect_target(&root, Some(mode))?; let _ = ra.cancel_spawning(); ra.purge_all()?; Ok(CompanionAction { count: before }) @@ -2026,6 +2037,10 @@ async fn add_companions( id: String, count: u32, realm: Option<coa_core::realms::Mode>, + level: Option<u8>, + class_id: Option<u8>, + spec_id: Option<u32>, + archetype: Option<String>, ) -> std::result::Result<CompanionsResult, UiError> { let root = path_of(&state, &id)?; let _guard = BusyGuard::acquire(&state, &id)?; @@ -2038,15 +2053,10 @@ async fn add_companions( let mode = realm.unwrap_or_else(|| { coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default() }); - let chars_db = match mode { - coa_core::realms::Mode::Coa => "acore_characters", - coa_core::realms::Mode::Wildcard => "acore_characters_wildcard", - coa_core::realms::Mode::Reborn => "acore_characters_reborn", - }; + let target = coa_core::multiworld::resolve_bot_operation_target(&root, mode)?; let meta = meta_dir(&root)?; let mut changes = BTreeMap::new(); changes.insert("CoaBots.AutoLoginOnStartup".to_string(), Value::Bool(true)); - // Every companion, old and new, should come back at the next start, so the start-up limit only ever grows here. let existing_max = config::load(&root, Scope::Bots) .ok() .and_then(|v| { @@ -2064,56 +2074,22 @@ async fn add_companions( Value::from(existing_max.max(already + count).min(5000)), ); config::save(&root, &meta, Scope::Bots, &changes)?; - let o = coa_core::process::observe(&root, &layout::read_ports(&root)); - // Large batches while the server is stopped: create them in the database right now, fully equipped (CoA schema only). - if o.world.state == coa_core::process::ServiceState::Stopped - && o.auth.state == coa_core::process::ServiceState::Stopped - && count >= coa_core::companions::OFFLINE_MIN - && mode == coa_core::realms::Mode::Coa - && coa_core::companions::offline_factory(&root).is_some() - { - let started_db = o.mysql.state != coa_core::process::ServiceState::Running; - if started_db { - let out = driver::run(&root, Verb::StartMysql)?; - if !out.ok { - return Err(Error::Invalid("The database could not be started.".into())); - } - } - let made = (|| -> Result<()> { - coa_core::companions::ensure_templates_for_schema( - &coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin)?, - chars_db, - )?; - coa_core::companions::offline_create( - &root, - &meta.join("logs").join("companions-offline.log"), - count, - )?; - Ok(()) - })(); - if started_db { - let _ = driver::run(&root, Verb::StopAll); - } - made?; - tracing::info!(count, "companions created offline"); - return Ok(CompanionsResult { - spawned: None, - created: Some(count), - baseline: None, - }); - } + let mut baseline = None; - let spawned = if o.world.state == coa_core::process::ServiceState::Running { - // Older servers have no template characters to copy bots from: add them first. + let spawned = if target.running { if let Ok(admin_db) = coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin) { - let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, chars_db); + let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, target.chars_db); } baseline = coa_core::population::query_for_realm(&root, mode) .ok() .map(|p| p.bots_total); - Some(Ra::connect(&root)?.spawn_bots(count)?) + let mut ra = Ra::connect_target(&root, Some(mode))?; + if let Some(lvl) = level { + Some(ra.spawn_custom(count, lvl, class_id, spec_id, archetype.as_deref())?) + } else { + Some(ra.spawn_bots(count)?) + } } else { - // The server is stopped: creating bots needs it running, so remember the request and do it after the next start. coa_core::fsx::atomic_write_json( &meta.join("companions.pending.json"), &serde_json::json!({ "count": count }), diff --git a/src/lib/api.ts b/src/lib/api.ts index 4ac05c1..8af8dac 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -572,17 +572,33 @@ export const api = { rollbackUpdate: (id: string, txn: string) => invoke<UpdateTxn>("rollback_update", { id, txn }), retryUpdateValidation: (id: string, txn: string) => invoke<UpdateTxn>("retry_update_validation", { id, txn }), population: (id: string, realm?: RealmMode) => invoke<Population | null>("get_population", { id, realm: realm ?? null }), - stopSpawning: (id: string) => invoke<{ count: number }>("companions_stop_spawning", { id }), - takeOffline: (id: string) => invoke<{ count: number }>("companions_take_offline", { id }), - despawnSome: (id: string, count: number) => invoke<{ count: number }>("companions_despawn_some", { id, count }), - deleteAllCompanions: (id: string) => invoke<{ count: number }>("companions_delete_all", { id }), - loginAllCompanions: (id: string) => invoke<string>("companions_login_all", { id }), - spawnBotFleet: (id: string, race: number, level: number) => invoke<string>("companions_spawn_fleet", { id, race, level }), + stopSpawning: (id: string, realm?: RealmMode) => invoke<{ count: number }>("companions_stop_spawning", { id, realm: realm ?? null }), + takeOffline: (id: string, realm?: RealmMode) => invoke<{ count: number }>("companions_take_offline", { id, realm: realm ?? null }), + despawnSome: (id: string, count: number, realm?: RealmMode) => invoke<{ count: number }>("companions_despawn_some", { id, count, realm: realm ?? null }), + deleteAllCompanions: (id: string, realm?: RealmMode) => invoke<{ count: number }>("companions_delete_all", { id, realm: realm ?? null }), + loginAllCompanions: (id: string, realm?: RealmMode) => invoke<string>("companions_login_all", { id, realm: realm ?? null }), + spawnBotFleet: (id: string, race: number, level: number, realm?: RealmMode) => invoke<string>("companions_spawn_fleet", { id, race, level, realm: realm ?? null }), openLink: (url: string) => invoke<void>("open_link", { url }), performance: (id: string) => invoke<Performance | null>("get_performance", { id }), companionSizes: () => invoke<CompanionSizes>("companion_sizes"), - addCompanions: (id: string, count: number, realm?: RealmMode) => - invoke<{ spawned: string | null; created: number | null; baseline: number | null }>("add_companions", { id, count, realm: realm ?? null }), + addCompanions: ( + id: string, + count: number, + realm?: RealmMode, + level?: number, + classId?: number, + specId?: number, + archetype?: string + ) => + invoke<{ spawned: string | null; created: number | null; baseline: number | null }>("add_companions", { + id, + count, + realm: realm ?? null, + level: level ?? null, + class_id: classId ?? null, + spec_id: specId ?? null, + archetype: archetype ?? null, + }), clientGraphics: (id: string) => invoke<{ dxvk_disabled: boolean; enhancements_disabled: boolean }>("client_graphics", { id }), clientSetGraphics: (id: string, name: string, disabled: boolean) => invoke<{ dxvk_disabled: boolean; enhancements_disabled: boolean }>("client_set_graphics", { id, name, disabled }), clientInfo: (id: string) => invoke<ClientInfo | null>("client_info", { id }), diff --git a/src/screens/CompanionsCard.tsx b/src/screens/CompanionsCard.tsx index 3ca88ac..c4dd45a 100644 --- a/src/screens/CompanionsCard.tsx +++ b/src/screens/CompanionsCard.tsx @@ -55,8 +55,9 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const activeServerRealm = profiles?.active ?? "coa"; const isViewingActiveRealm = selectedRealm === activeServerRealm; + const isRealmOperational = isViewingActiveRealm || running; - const maxLevelForRealm = selectedRealm === "reborn" ? 60 : 80; + const maxLevelForRealm = 60; // Load realm profiles const loadProfiles = async () => { @@ -158,12 +159,27 @@ export function CompanionsCard({ serverId }: { serverId: string }) { setNote(null); try { if (spawnMode === "fleet") { - // Fleet spawn: race 1 (Human) or 2 (Orc) const race = 1; - const out = await api.spawnBotFleet(serverId, race, targetLevel); + const out = await api.spawnBotFleet(serverId, race, targetLevel, selectedRealm); setNote(out || `Spawned level ${targetLevel} fleet`); } else { - const r = await api.addCompanions(serverId, count, selectedRealm); + const classNum = selectedClass !== "all" ? parseInt(selectedClass, 10) : undefined; + let specNum: number | undefined = undefined; + if (selectedRole === "tank") { + if (selectedRealm === "reborn") { + specNum = (classNum === 7 || classNum === 9 || classNum === 11) ? 4 : (classNum === 2 ? 2 : classNum === 1 ? 3 : 1); + } else if (selectedRealm === "wildcard") { + specNum = 1; + } + } else if (selectedRole === "healer") { + if (selectedRealm === "reborn") { + specNum = (classNum === 2 || classNum === 5) ? 1 : (classNum === 7 || classNum === 11 ? 3 : 1); + } else if (selectedRealm === "wildcard") { + specNum = 2; + } + } + const archStr = selectedArchetype !== "all" ? selectedArchetype : undefined; + const r = await api.addCompanions(serverId, count, selectedRealm, targetLevel, classNum, specNum, archStr); if (r.spawned && r.baseline !== null) { setJob({ baseline: r.baseline, target: count, since: Date.now() }); } @@ -186,7 +202,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { // Bring offline bots online const handleLoginAll = () => act(async () => { - const out = await api.loginAllCompanions(serverId); + const out = await api.loginAllCompanions(serverId, selectedRealm); await fetchPopulation(); return out || "All available offline bots queued for login."; }); @@ -194,7 +210,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { // Stop queued creations const stopCreating = () => act(async () => { - const r = await api.stopSpawning(serverId); + const r = await api.stopSpawning(serverId, selectedRealm); setJob(null); await fetchPopulation(); return t("comp.stopped", { n: r.count }); @@ -204,7 +220,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const takeOffline = () => { if (!window.confirm(t("comp.offlineConfirm"))) return; void act(async () => { - const r = await api.takeOffline(serverId); + const r = await api.takeOffline(serverId, selectedRealm); setJob(null); await fetchPopulation(); return t("comp.offlineDone2", { n: r.count }); @@ -216,7 +232,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const dnValid = Number.isInteger(dn) && dn >= 1 && dn <= 5000; const despawnSome = () => act(async () => { - const r = await api.despawnSome(serverId, dn); + const r = await api.despawnSome(serverId, dn, selectedRealm); await fetchPopulation(); return t("comp.despawnSomeDone", { n: r.count }); }); @@ -225,7 +241,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const deleteAll = () => { if (!window.confirm(t("comp.deleteConfirm", { n: pop?.bots_total ?? 0 }))) return; void act(async () => { - await api.deleteAllCompanions(serverId); + await api.deleteAllCompanions(serverId, selectedRealm); setJob(null); await fetchPopulation(); return t("comp.deleteDone"); @@ -514,17 +530,27 @@ export function CompanionsCard({ serverId }: { serverId: string }) { <option value="all">All Realm Classes</option> {selectedRealm === "coa" && ( <> - <option value="12">Guardian</option> - <option value="13">Starcaller</option> - <option value="14">Demon Hunter</option> - <option value="15">Necromancer</option> - <option value="16">Monk</option> - <option value="17">Pyromancer</option> - <option value="18">Chronomancer</option> - <option value="19">Cultist</option> - <option value="20">Runemaster</option> - <option value="21">Primalist</option> - <option value="22">Tinker</option> + <option value="12">Barbarian</option> + <option value="13">Witch Doctor</option> + <option value="14">Felsworn</option> + <option value="15">Witch Hunter</option> + <option value="16">Stormbringer</option> + <option value="17">Knight of Xoroth</option> + <option value="18">Guardian</option> + <option value="19">Templar</option> + <option value="20">Bloodmage</option> + <option value="21">Ranger</option> + <option value="22">Chronomancer</option> + <option value="23">Necromancer</option> + <option value="24">Pyromancer</option> + <option value="25">Cultist</option> + <option value="26">Starcaller</option> + <option value="27">Tinker</option> + <option value="28">Venomancer</option> + <option value="29">Reaper</option> + <option value="30">Sun Cleric</option> + <option value="31">Runemaster</option> + <option value="32">Primalist</option> </> )} {selectedRealm === "wildcard" && ( @@ -605,7 +631,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { <div className="flex flex-wrap items-center gap-3 pt-2"> <Button variant="primary" - disabled={busy || !valid || job !== null || !isViewingActiveRealm} + disabled={busy || !valid || job !== null || !isRealmOperational} onClick={() => void handleSpawn()} > {busy && <Loader2 className="h-4 w-4 animate-spin mr-2" />} @@ -617,7 +643,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { {running && pop && pop.bots_total > pop.bots_online && ( <Button variant="secondary" - disabled={busy || job !== null || !isViewingActiveRealm} + disabled={busy || job !== null || !isRealmOperational} onClick={() => void handleLoginAll()} title="Bring all created bots online" > From 07e9bc497d12fd5a23b272566f64e4578ffb4a65 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?= <corfirean@gmail.com> Date: Sat, 7 Nov 2026 11:38:07 +0500 Subject: [PATCH 24/29] feat(manager): dynamic wildcard archetypes, realm-isolated pending jobs, and hardened bot deployment --- crates/coa-core/src/companions.rs | 226 ++++++++++- crates/coa-core/src/ra.rs | 634 +++++++++++++++++++++++++++++- src-tauri/Cargo.toml | 1 + src-tauri/src/lib.rs | 88 ++++- src/lib/api.ts | 11 + src/screens/CompanionsCard.tsx | 49 ++- 6 files changed, 985 insertions(+), 24 deletions(-) diff --git a/crates/coa-core/src/companions.rs b/crates/coa-core/src/companions.rs index 63d2721..b1db98e 100644 --- a/crates/coa-core/src/companions.rs +++ b/crates/coa-core/src/companions.rs @@ -3,10 +3,13 @@ //! small set (one per CoA class); older or imported servers can have it added on request. use std::fs; -use std::path::Path; +use std::path::{Path, PathBuf}; + +use serde::{Deserialize, Serialize}; use crate::db::Db; use crate::error::Result; +use crate::fsx; /// Owner of the template characters. Not account 1 (the bot module skips it) and not a bot-host account; no such /// account exists in the login database, so nobody can ever log in to these characters. @@ -134,6 +137,168 @@ pub fn offline_create(root: &Path, log: &Path, count: u32) -> Result<String> { } } +/// Real runtime wildcard archetype metadata directly from coa_build_creator. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct WildcardArchetypeDto { + pub id: String, + pub name: String, + pub roles: u32, + pub primary_stat: u32, + pub author: String, + pub difficulty: u32, + pub category: u32, +} + +/// Query coa_build_creator in the target characters DB for curated and player-authored archetypes. +pub fn list_wildcard_archetypes(db: &Db, chars_db: &str) -> Result<Vec<WildcardArchetypeDto>> { + let sql = format!( + "SELECT id, name, roles, primary_stat, author, difficulty, category \ + FROM {chars_db}.coa_build_creator \ + WHERE needs_repairs = 0 \ + ORDER BY upvotes DESC, name ASC \ + LIMIT 100;" + ); + + let mut archetypes = Vec::new(); + if let Ok(out) = db.query(&sql) { + for line in out.lines() { + let parts: Vec<&str> = line.split('\t').collect(); + if parts.len() >= 7 { + archetypes.push(WildcardArchetypeDto { + id: parts[0].trim().to_string(), + name: parts[1].trim().to_string(), + roles: parts[2].trim().parse().unwrap_or(8), + primary_stat: parts[3].trim().parse().unwrap_or(0), + author: parts[4].trim().to_string(), + difficulty: parts[5].trim().parse().unwrap_or(0), + category: parts[6].trim().parse().unwrap_or(0), + }); + } + } + } + + // Curated fallback if DB query returned zero rows (e.g. initial setup) + if archetypes.is_empty() { + archetypes = vec![ + WildcardArchetypeDto { + id: "b9bc2e11-cd62-4d37-b05a-fff2a2ada475".into(), + name: "Kinyaz Druid Tank Bear".into(), + roles: 2, + primary_stat: 0, // Strength + author: "Official".into(), + difficulty: 1, + category: 1, + }, + WildcardArchetypeDto { + id: "c556625e-b5f1-40a9-b545-2bcaef883350".into(), + name: "Holy Paladin".into(), + roles: 4, + primary_stat: 3, // Intellect + author: "Official".into(), + difficulty: 1, + category: 1, + }, + WildcardArchetypeDto { + id: "05add9af-94ee-4094-b091-f9afcb79c102".into(), + name: "Idum's Fire Sage".into(), + roles: 4, + primary_stat: 4, // Spirit + author: "Idum".into(), + difficulty: 2, + category: 1, + }, + WildcardArchetypeDto { + id: "aaf370e5-fa02-4a02-abee-01cc4058aace".into(), + name: "Idum's Forest Warden".into(), + roles: 4, + primary_stat: 4, // Spirit + author: "Idum".into(), + difficulty: 2, + category: 1, + }, + WildcardArchetypeDto { + id: "20f08cc1-b2c4-47ca-b5b1-d5cbcbd3d2f8".into(), + name: "Blood DK DPS".into(), + roles: 8, + primary_stat: 0, // Strength + author: "Official".into(), + difficulty: 1, + category: 1, + }, + WildcardArchetypeDto { + id: "8f1df486-d97f-4424-9b2f-8a032d88bbd6".into(), + name: "Bleed Berserker".into(), + roles: 8, + primary_stat: 1, // Agility + author: "Official".into(), + difficulty: 2, + category: 1, + }, + WildcardArchetypeDto { + id: "45fbe2e6-231a-4a25-827a-8d7b3da4501a".into(), + name: "Mur-Lock".into(), + roles: 8, + primary_stat: 3, // Intellect + author: "Official".into(), + difficulty: 2, + category: 1, + }, + ]; + } + + Ok(archetypes) +} + +/// Realm-aware pending companion deployment job. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct CompanionsPendingJob { + pub job_id: String, + pub server_instance_id: String, + pub realm: String, + pub count: u32, + pub level: Option<u8>, + pub class_id: Option<u8>, + pub spec_id: Option<u32>, + pub build_id: Option<String>, + pub requested_operation: String, + pub created_at: u64, + pub state: String, // "pending", "in_progress", "completed", "failed" + pub completed_count: u32, + pub failed_count: u32, + pub last_error: Option<String>, + pub schema_version: u32, +} + +pub fn pending_job_path(meta_dir: &Path, realm: &str) -> PathBuf { + meta_dir.join(format!("companions.pending.{realm}.json")) +} + +pub fn save_pending_job(meta_dir: &Path, realm: &str, job: &CompanionsPendingJob) -> Result<()> { + fsx::atomic_write_json(&pending_job_path(meta_dir, realm), job) +} + +pub fn load_pending_job(meta_dir: &Path, realm: &str) -> Result<Option<CompanionsPendingJob>> { + let p = pending_job_path(meta_dir, realm); + if !p.exists() { + return Ok(None); + } + match fsx::read_json::<CompanionsPendingJob>(&p) { + Ok(job) => Ok(Some(job)), + Err(e) => { + tracing::warn!("Corrupted pending job file {:?}: {e}", p); + Ok(None) + } + } +} + +pub fn clear_pending_job(meta_dir: &Path, realm: &str) -> Result<()> { + let p = pending_job_path(meta_dir, realm); + if p.exists() { + let _ = std::fs::remove_file(p); + } + Ok(()) +} + #[cfg(test)] mod tests { use super::*; @@ -152,4 +317,63 @@ mod tests { assert!(s.contains("@ACC")); assert!(!s.contains("INSERT INTO "), "rows that exist are kept"); } + + #[test] + fn pending_jobs_roundtrip_and_are_isolated_by_realm() { + let temp = std::env::temp_dir().join(format!("coa-test-jobs-{}", uuid::Uuid::new_v4().simple())); + std::fs::create_dir_all(&temp).unwrap(); + + let job_wc = CompanionsPendingJob { + job_id: "test-wc-1".into(), + server_instance_id: "inst-1".into(), + realm: "wildcard".into(), + count: 50, + level: Some(60), + class_id: Some(10), + spec_id: Some(1), + build_id: Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475".into()), + requested_operation: "spawn".into(), + created_at: 1000, + state: "pending".into(), + completed_count: 0, + failed_count: 0, + last_error: None, + schema_version: 1, + }; + + let job_wcr = CompanionsPendingJob { + job_id: "test-wcr-1".into(), + server_instance_id: "inst-1".into(), + realm: "reborn".into(), + count: 10, + level: Some(60), + class_id: Some(7), + spec_id: Some(4), + build_id: None, + requested_operation: "spawn".into(), + created_at: 1001, + state: "pending".into(), + completed_count: 0, + failed_count: 0, + last_error: None, + schema_version: 1, + }; + + save_pending_job(&temp, "wildcard", &job_wc).unwrap(); + save_pending_job(&temp, "reborn", &job_wcr).unwrap(); + + let loaded_wc = load_pending_job(&temp, "wildcard").unwrap().expect("wc job missing"); + let loaded_wcr = load_pending_job(&temp, "reborn").unwrap().expect("wcr job missing"); + let loaded_coa = load_pending_job(&temp, "coa").unwrap(); + + assert_eq!(loaded_wc, job_wc); + assert_eq!(loaded_wcr, job_wcr); + assert!(loaded_coa.is_none()); + + clear_pending_job(&temp, "wildcard").unwrap(); + assert!(load_pending_job(&temp, "wildcard").unwrap().is_none()); + assert!(load_pending_job(&temp, "reborn").unwrap().is_some()); + + let _ = std::fs::remove_dir_all(temp); + } } diff --git a/crates/coa-core/src/ra.rs b/crates/coa-core/src/ra.rs index 37dcb5e..95a92e2 100644 --- a/crates/coa-core/src/ra.rs +++ b/crates/coa-core/src/ra.rs @@ -1,108 +1,213 @@ //! Minimal Remote Access (RA) console client for the worldserver, local only. + //! Only a fixed set of typed operations is exposed; free-form commands are not accepted here. + + use std::io::{Read, Write}; + use std::net::{SocketAddr, TcpStream}; + use std::path::Path; + use std::time::Duration; + + use serde::{Deserialize, Serialize}; + + use crate::error::{Error, Result}; + use crate::fsx; + use crate::layout::read_ports; + + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + struct RaSettings { + ra_username: String, + ra_password: String, + } + + #[derive(Debug)] + pub struct Ra { + stream: TcpStream, + } + + fn read_until(stream: &mut TcpStream, marker: &[u8]) -> Result<String> { + let mut data = Vec::new(); + let mut byte = [0u8; 1]; + while !data.ends_with(marker) { + match stream.read(&mut byte) { + Ok(0) => { + return Err(Error::Invalid( + "The world console closed the connection.".into(), + )) + } + Ok(_) => data.push(byte[0]), + Err(e) => { + return Err(Error::Invalid(format!( + "The world console did not answer: {e}" + ))) + } + } + if data.len() > 256 * 1024 { + return Err(Error::Invalid( + "The world console sent too much data.".into(), + )); + } + } + Ok(String::from_utf8_lossy(&data).into_owned()) + } + + impl Ra { + /// Connect to the loopback RA port of the server in `root`, using the credentials from its `repack.json`. + pub fn connect(root: &Path) -> Result<Ra> { + let cfg: RaSettings = fsx::read_json(&root.join("Settings/repack.json")) + .map_err(|_| Error::Invalid("The server console settings could not be read.".into()))?; + Self::connect_to(read_ports(root).ra, &cfg.ra_username, &cfg.ra_password) + } + + /// Connect to the loopback RA port of the target realm world server. + pub fn connect_target(main: &Path, realm: Option<crate::realms::Mode>) -> Result<Ra> { + let mode = realm.unwrap_or_else(|| { + crate::realms::view(main).map(|v| v.active).unwrap_or_default() + }); + let target = crate::multiworld::resolve_bot_operation_target(main, mode)?; + if !target.running { + return Err(Error::Invalid(format!( + "Realm {} worldserver is stopped; cannot execute online bot operation.", + target.realm.label() + ))); + } + let cfg: RaSettings = fsx::read_json(&main.join("Settings/repack.json")) + .map_err(|_| Error::Invalid("The server console settings could not be read.".into()))?; + Self::connect_to(target.ra_port, &cfg.ra_username, &cfg.ra_password) + } + + pub fn connect_to(port: u16, user: &str, password: &str) -> Result<Ra> { + let addr: SocketAddr = ([127, 0, 0, 1], port).into(); + let mut stream = + TcpStream::connect_timeout(&addr, Duration::from_secs(5)).map_err(|_| { + Error::Invalid( + "The world server is not running (its console is not reachable).".into(), + ) + })?; + stream.set_read_timeout(Some(Duration::from_secs(15)))?; + stream.set_write_timeout(Some(Duration::from_secs(5)))?; + read_until(&mut stream, b"Username: ")?; + stream.write_all(format!("{user}\r\n").as_bytes())?; + read_until(&mut stream, b"Password: ")?; + stream.write_all(format!("{password}\r\n").as_bytes())?; + let banner = read_until(&mut stream, b"AC>") + .map_err(|_| Error::Invalid("The world console rejected the login.".into()))?; + if banner.to_lowercase().contains("authentication failed") { + return Err(Error::Invalid( + "The world console rejected the login.".into(), + )); + } + Ok(Ra { stream }) + } + + /// Send one already-validated console command and return its output. + pub fn run(&mut self, cmd: &str) -> Result<String> { + let c = crate::console::check_command(cmd)?; + self.command(c) + } /// Send a command whose answer does not matter (`server shutdown`). The reply is still read (up to the next @@ -129,172 +234,339 @@ impl Ra { } fn command(&mut self, cmd: &str) -> Result<String> { + debug_assert!(!cmd.contains(['\r', '\n'])); + self.stream.write_all(format!("{cmd}\r\n").as_bytes())?; + let out = read_until(&mut self.stream, b"AC>")?; + Ok(out.trim_end_matches("AC>").trim().to_string()) + } + + pub fn create_account(&mut self, name: &str, password: &str) -> Result<()> { + validate_account(name, password)?; + let out = self.command(&format!("account create {name} {password}"))?; + let l = out.to_lowercase(); + if l.contains("already exist") { + return Err(Error::Invalid("That account name is already taken.".into())); + } + if l.contains("created") { + Ok(()) + } else { + Err(Error::Invalid(format!( + "The server did not create the account: {}", + out.lines().last().unwrap_or("") + ))) + } + } + + /// `portable checkpoint <guid> <session> <sequence>`: the core saves this one character with a checkpoint marker. Only a + /// number, a session id and a number are sent. The reply is a request status, **not** proof that anything was written. + pub fn portable_checkpoint( + &mut self, + guid: u32, + session: crate::portable::SessionId, + sequence: u64, + ) -> Result<crate::portable::session::bridge::CheckpointReply> { + use crate::portable::session::bridge::CheckpointReply; + let sequence = u32::try_from(sequence) + .map_err(|_| Error::Invalid("The checkpoint sequence is out of range.".into()))?; + let out = self.command(&format!("portable checkpoint {guid} {session} {sequence}"))?; + let first = out + .lines() + .map(str::trim) + .find(|l| !l.is_empty()) + .unwrap_or(""); + Ok(match first.split_whitespace().next() { + Some("QUEUED") => CheckpointReply::Queued, + Some("BUSY") => CheckpointReply::Busy, + Some("NOT_ONLINE") => CheckpointReply::NotOnline, + Some("REFUSED") => { + CheckpointReply::Refused(first.trim_start_matches("REFUSED").trim().to_string()) + } + _ => CheckpointReply::Refused(format!("unexpected answer: {first}")), + }) + } + + /// `portable import <job_id>`: the core imports the job file of that id from its fixed job directory. Only the id travels. + pub fn portable_import(&mut self, job_id: crate::portable::ImportId) -> Result<String> { + let out = self.command(&format!("portable import {job_id}"))?; + let first = out + .lines() + .map(str::trim) + .find(|l| !l.is_empty()) + .unwrap_or("") + .to_string(); + if first.starts_with("OK") { + Ok(first) + } else { + Err(Error::Invalid(format!( + "The server did not import the job: {first}" + ))) + } + } + + /// `portable project <job_id>`: the core decides what a projection of the job file's character at its level cap holds, and writes the + /// decision to the job's result file. Only the id travels. + pub fn portable_project(&mut self, job_id: crate::portable::ImportId) -> Result<String> { + let out = self.command(&format!("portable project {job_id}"))?; + let first = out + .lines() + .map(str::trim) + .find(|l| !l.is_empty()) + .unwrap_or("") + .to_string(); + if first.starts_with("OK") { + Ok(first) + } else { + Err(Error::Invalid(format!( + "The server did not answer the projection query: {first}" + ))) + } + } + + /// `portable capabilities`: the realm's core says what it is and what portable features it has. An older core does not know the command. + pub fn portable_capabilities(&mut self) -> Result<crate::portable::capabilities::CoreReport> { + let out = self.command("portable capabilities")?; + crate::portable::capabilities::CoreReport::parse(&out) + .map_err(|e| Error::Invalid(e.to_string())) + } + + /// `portable release <session>`: lets a held portable character play. Sent only after its baseline was persisted. + pub fn portable_release(&mut self, session: crate::portable::SessionId) -> Result<()> { + let out = self.command(&format!("portable release {session}"))?; + if out.lines().any(|l| l.trim().starts_with("OK")) { + Ok(()) + } else { + Err(Error::Invalid(format!( + "The server did not release the session: {}", + out.lines().last().unwrap_or("") + ))) + } + } + + /// World update timing from the server's own `server info` report (mean/median/percentiles of the last 500 updates). + pub fn performance(&mut self) -> Result<Option<Performance>> { + let out = self.command("server info")?; + Ok(parse_server_info(&out)) + } + + fn bot_command(&mut self, cmd: &str) -> Result<String> { + let out = self.command(cmd)?; + if is_unsupported_command(&out) { + return Err(Error::CompanionCommandUnsupported); + } + Ok(out) + } + + /// Drop every bot still waiting to be created. Returns how many were waiting. + pub fn cancel_spawning(&mut self) -> Result<u32> { + Ok(first_number(&self.bot_command("botcmd spawncancel")?)) + } + + /// Log every bot out without deleting anything. Returns how many were online. + pub fn despawn_all(&mut self) -> Result<u32> { + Ok(first_number(&self.bot_command("botcmd despawnall")?)) + } + + /// Log one bot out (the character stays saved). False when that bot was not online. + pub fn despawn_bot(&mut self, guid: u64) -> Result<bool> { + Ok(self + .bot_command(&format!("botcmd despawn {guid}"))? + .to_lowercase() + .contains("despawned")) + } + + /// Log every bot out and delete every bot character for good (the caller saves a recovery point first). + pub fn purge_all(&mut self) -> Result<String> { + let out = self.bot_command("botcmd purgeall")?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + + /// Ask the bot module to create `count` leveling bots (throttled by the module itself). Only a number is sent. + pub fn spawn_bots(&mut self, count: u32) -> Result<String> { + if !(1..=2000).contains(&count) { + return Err(Error::Invalid( + "Choose between 1 and 2000 companions.".into(), + )); + } + let out = self.command(&format!("botcmd spawnleveled {count}"))?; + if out.to_lowercase().contains("no usable template characters") { + return Err(Error::CompanionTemplatesMissing); + } + Ok(out.lines().last().unwrap_or("").to_string()) + } + + /// Ask the bot module to spawn a fleet of bots of specific race and level (.botcmd spawnfleet <race> <level>). + pub fn spawn_fleet(&mut self, race: u8, level: u8) -> Result<String> { + let out = self.bot_command(&format!("botcmd spawnfleet {race} {level}"))?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + + pub fn spawn_custom( &mut self, count: u32, @@ -303,359 +575,703 @@ impl Ra { spec_id: Option<u32>, archetype: Option<&str>, ) -> Result<String> { + let c = class_id.unwrap_or(0); + let s = spec_id.unwrap_or(0); + let a = archetype.unwrap_or("").trim(); let mut cmd = format!("botcmd spawncustom {count} {level}"); - if let Some(c) = class_id { + if !a.is_empty() { + cmd.push_str(&format!(" {c} {s} {a}")); + } else if s > 0 { + cmd.push_str(&format!(" {c} {s}")); + } else if c > 0 { cmd.push_str(&format!(" {c}")); - if let Some(s) = spec_id { - cmd.push_str(&format!(" {s}")); - if let Some(a) = archetype { - if !a.is_empty() { - cmd.push_str(&format!(" {a}")); - } - } - } } + let out = self.bot_command(&cmd)?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + + /// Bring all offline bots online gradually (.botcmd loginall). + pub fn login_all(&mut self) -> Result<String> { + let out = self.bot_command("botcmd loginall")?; + Ok(out.lines().last().unwrap_or("").to_string()) + } + + /// Set a new password for an existing account. + pub fn set_account_password(&mut self, name: &str, password: &str) -> Result<()> { + validate_account(name, password)?; + let out = self.command(&format!( + "account set password {name} {password} {password}" + ))?; + account_reply(&out, "The password was not changed") + } + + /// Access level of an account on all realms: 0 player, 1 moderator, 2 game master, 3 administrator. + pub fn set_account_access(&mut self, name: &str, level: u8) -> Result<()> { + validate_account(name, "placeholder")?; + if level > 3 { + return Err(Error::Invalid("The access level must be 0 to 3.".into())); + } + let out = self.command(&format!("account set gmlevel {name} {level} -1"))?; + account_reply(&out, "The access level was not changed") + } + + /// Delete an account together with its characters (the console's `account delete`). + pub fn delete_account(&mut self, name: &str) -> Result<()> { + validate_account(name, "placeholder")?; + let out = self.command(&format!("account delete {name}"))?; + account_reply(&out, "The account was not deleted") + } + + /// Give `name` administrator rights on all realms (GM level 3). + pub fn make_administrator(&mut self, name: &str) -> Result<()> { + validate_account(name, "placeholder")?; + let out = self.command(&format!("account set gmlevel {name} 3 -1"))?; + if out.to_lowercase().contains("gm level") + || out.to_lowercase().contains("security") + || out.is_empty() + { + Ok(()) + } else { + Err(Error::Invalid(format!( + "Could not set administrator rights: {out}" + ))) + } + } + } + + /// The console reports a failed account command in words; anything else (including silence) counts as done. + fn account_reply(out: &str, what: &str) -> Result<()> { + let l = out.to_lowercase(); + let failed = [ + "does not exist", + "not exist", + "not found", + "do not match", + "don't match", + "usage", + "unknown", + "incorrect", + "error", + ]; + if failed.iter().any(|m| l.contains(m)) { + return Err(Error::Invalid(format!( + "{what}: {}", + out.lines().last().unwrap_or("").trim() + ))); + } + Ok(()) + } + + /// The console answers an unknown sub-command with the list of the ones it knows. + fn is_unsupported_command(out: &str) -> bool { + let l = out.to_lowercase(); + l.contains("possible subcommands") + || l.contains("### usage") + || l.contains("no such command") + || l.contains("unknown command") + } + + fn first_number(text: &str) -> u32 { + text.split(|c: char| !c.is_ascii_digit()) + .find(|t| !t.is_empty()) + .and_then(|t| t.parse().ok()) + .unwrap_or(0) + } + + /// How fast the world loop is running, read from `server info`. + #[derive(Debug, Clone, Serialize, PartialEq)] + pub struct Performance { + pub mean_ms: u32, + pub median_ms: u32, + pub p95_ms: u32, + pub p99_ms: u32, + pub max_ms: u32, + /// World updates per second implied by the mean update time. + pub ticks_per_sec: f32, + } + + fn ms(text: &str) -> Option<u32> { + text.trim().trim_end_matches("ms").trim().parse().ok() + } + + pub fn parse_server_info(text: &str) -> Option<Performance> { + let (mut mean, mut median, mut pct) = (None, None, None); + for line in text.lines() { + let line = line + .trim() + .trim_start_matches('|') + .trim_start_matches('-') + .trim(); + if let Some(v) = line.strip_prefix("Mean:") { + mean = ms(v); + } else if let Some(v) = line.strip_prefix("Median:") { + median = ms(v); + } else if let Some(v) = line.strip_prefix("Percentiles (95, 99, max):") { + let p: Vec<Option<u32>> = v.split(',').map(ms).collect(); + if p.len() == 3 { + pct = Some((p[0]?, p[1]?, p[2]?)); + } + } + } + let (mean_ms, median_ms, (p95_ms, p99_ms, max_ms)) = (mean?, median?, pct?); + Some(Performance { + mean_ms, + median_ms, + p95_ms, + p99_ms, + max_ms, + ticks_per_sec: 1000.0 / mean_ms.max(1) as f32, + }) + } + + /// Account names are letters/digits (3-17); passwords are 6-16 printable characters without spaces or quotes. + pub fn validate_account(name: &str, password: &str) -> Result<()> { + let bad = |m: &str| Err(Error::Invalid(m.into())); + // an underscore inside a name is allowed: the Manager gives joining players names like `DMITRY_7K4M` + if !(3..=17).contains(&name.len()) + || !name.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') + || name.starts_with('_') + || name.ends_with('_') + { + return bad("The username must be 3–17 letters or digits."); + } + if !(6..=16).contains(&password.len()) + || !password + .chars() + .all(|c| c.is_ascii_graphic() && c != '"' && c != '\'') + { + return bad("The password must be 6–16 characters (no spaces or quotes)."); + } + Ok(()) + } + + #[cfg(test)] + mod tests { + use super::*; + use std::io::{BufRead, BufReader}; + use std::net::TcpListener; + + /// These tests share the loopback interface; on some machines (security software hooking TCP) several + /// concurrent short-lived loopback connections are occasionally reset, so they run one at a time. + static SERIAL: std::sync::Mutex<()> = std::sync::Mutex::new(()); + + fn serial() -> std::sync::MutexGuard<'static, ()> { + SERIAL.lock().unwrap_or_else(|e| e.into_inner()) + } + + fn fake_ra(reply: &'static str) -> (u16, std::thread::JoinHandle<Vec<String>>) { + let l = TcpListener::bind("127.0.0.1:0").unwrap(); + let port = l.local_addr().unwrap().port(); + let h = std::thread::spawn(move || { + let (mut s, _) = l.accept().unwrap(); + let mut r = BufReader::new(s.try_clone().unwrap()); + let mut got = Vec::new(); + s.write_all(b"Username: ").unwrap(); + let mut line = String::new(); + r.read_line(&mut line).unwrap(); + got.push(line.trim().to_string()); + s.write_all(b"Password: ").unwrap(); + line.clear(); + r.read_line(&mut line).unwrap(); + got.push(line.trim().to_string()); + s.write_all(b"Authentication Succeeded\r\nAC>").unwrap(); + line.clear(); + if r.read_line(&mut line).unwrap_or(0) > 0 { + got.push(line.trim().to_string()); + s.write_all(format!("{reply}\r\nAC>").as_bytes()).unwrap(); + } + // Close gracefully: dropping a socket with unread data would send RST and could discard the reply. + let _ = s.shutdown(std::net::Shutdown::Write); + let _ = s.set_read_timeout(Some(Duration::from_secs(10))); + let mut sink = [0u8; 64]; + while matches!(s.read(&mut sink), Ok(n) if n > 0) {} + got + }); + (port, h) + } + + #[test] + fn an_unknown_bot_subcommand_is_recognised_and_numbers_are_read_from_replies() { + assert!(is_unsupported_command( + "### USAGE: .botcmd ... + Possible subcommands: + |- botcmd despawn" + )); + assert!(!is_unsupported_command( + "BotMgr: cancelled 35 queued bot spawn(s)." + )); + assert_eq!( + first_number("BotMgr: cancelled 35 queued bot spawn(s)."), + 35 + ); + assert_eq!(first_number("nothing"), 0); + } + + #[test] + fn server_info_timing_is_parsed_and_unrelated_text_is_ignored() { + let text = "AzerothCore rev. x + Connected players: 0. Characters in world: 0. + Update time diff: 1ms. Last 500 diffs summary: + |- Mean: 14ms + |- Median: 15ms + |- Percentiles (95, 99, max): 24ms, 30ms, 61ms + AC>"; + let p = parse_server_info(text).unwrap(); + assert_eq!( + (p.mean_ms, p.median_ms, p.p95_ms, p.p99_ms, p.max_ms), + (14, 15, 24, 30, 61) + ); + assert!((p.ticks_per_sec - 71.4).abs() < 0.2); + assert!(parse_server_info("Connected players: 0.").is_none()); + } + + #[test] + fn creates_an_account_over_ra_with_the_expected_commands() { + let _lock = serial(); + let (port, h) = fake_ra("Account created: PLAYER1"); + let mut ra = Ra::connect_to(port, "local", "secretra").unwrap(); + ra.create_account("Player1", "hunter22").unwrap(); + drop(ra); + assert_eq!( + h.join().unwrap(), + ["local", "secretra", "account create Player1 hunter22"] + ); + } + + #[test] + fn changes_a_password_with_the_expected_command() { + let _lock = serial(); + let (port, h) = fake_ra("The password was changed"); + let mut ra = Ra::connect_to(port, "u", "p").unwrap(); + ra.set_account_password("Player1", "newpass9").unwrap(); + drop(ra); + assert_eq!( + h.join().unwrap()[2], + "account set password Player1 newpass9 newpass9" + ); + } + + #[test] + fn changes_an_access_level_with_the_expected_command() { + let _lock = serial(); + let (port, h) = fake_ra("You have changed security level of Player1 to 2."); + let mut ra = Ra::connect_to(port, "u", "p").unwrap(); + ra.set_account_access("Player1", 2).unwrap(); + assert!(ra.set_account_access("Player1", 4).is_err(), "only 0 to 3"); + drop(ra); + assert_eq!(h.join().unwrap()[2], "account set gmlevel Player1 2 -1"); + } + + #[test] + fn a_failed_account_command_is_reported_and_bad_names_never_reach_the_console() { + let _lock = serial(); + let (port, h) = fake_ra("Account not found."); + let mut ra = Ra::connect_to(port, "u", "p").unwrap(); + assert!( + ra.set_account_password("x", "newpass9").is_err(), + "the name is validated before anything is sent" + ); + let error = ra + .set_account_password("Nobody", "newpass9") + .unwrap_err() + .to_string(); + assert!( + error.contains("not found"), + "Unexpected console error: {error}" + ); + drop(ra); + let _ = h.join(); + } + + #[test] + fn spawn_bots_sends_only_a_bounded_number() { + let _lock = serial(); + let (port, h) = fake_ra("Queued 50 bots"); + let mut ra = Ra::connect_to(port, "u", "p").unwrap(); + assert_eq!(ra.spawn_bots(50).unwrap(), "Queued 50 bots"); + assert!(ra.spawn_bots(0).is_err() && ra.spawn_bots(5000).is_err()); + drop(ra); + assert_eq!(h.join().unwrap()[2], "botcmd spawnleveled 50"); + } + + #[test] + fn duplicate_account_and_input_validation() { + let _lock = serial(); + let (port, h) = fake_ra("Account already exist."); + let mut ra = Ra::connect_to(port, "u", "p").unwrap(); + assert!(ra + .create_account("Player1", "hunter22") + .unwrap_err() + .to_string() + .contains("already taken")); + drop(ra); + let _ = h.join(); + for (n, p) in [ + ("ab", "hunter22"), + ("bad name", "hunter22"), + ("Player1", "short"), + ("Player1", "has space1"), + ("Player1", "quote\"pw1"), + ("Pl\r\nayer", "hunter22"), + ("x".repeat(18).as_str(), "hunter22"), + ] { + assert!(validate_account(n, p).is_err(), "{n:?} {p:?}"); + } + validate_account("Player1", "hunter22").unwrap(); + } + + #[test] + fn unreachable_console_gives_a_friendly_error() { + let _lock = serial(); + // Port 1 is never used by a game server; probing a freed ephemeral port would race with the other tests. + assert!(Ra::connect_to(1, "u", "p") + .unwrap_err() + .to_string() + .contains("not running")); + } + } + diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 84f15b9..99de785 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -24,3 +24,4 @@ coa-core = { path = "../crates/coa-core" } coa-registry-proto = { path = "../crates/coa-registry-proto" } coa-control-proto = { path = "../crates/coa-control-proto" } tracing = "0.1" +uuid = { version = "1", features = ["v4"] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index dfcf788..5f507b9 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -633,7 +633,34 @@ async fn start_server( if coa_core::realms::guard_module(&r, "companions").is_err() { return Ok(()); } - let pending = meta_dir(&r)?.join("companions.pending.json"); + let meta = meta_dir(&r)?; + for mode in [ + coa_core::realms::Mode::Coa, + coa_core::realms::Mode::Wildcard, + coa_core::realms::Mode::Reborn, + ] { + if let Ok(Some(job)) = coa_core::companions::load_pending_job(&meta, mode.name()) { + let _ = coa_core::companions::clear_pending_job(&meta, mode.name()); + if job.count > 0 { + if let Ok(admin_db) = coa_core::db::Db::from_repack(&r, coa_core::db::Account::Admin) { + if let Ok(target) = coa_core::multiworld::resolve_bot_operation_target(&r, mode) { + let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, target.chars_db); + } + } + if let Ok(mut ra) = Ra::connect_target(&r, Some(mode)) { + let res = if let Some(lvl) = job.level { + ra.spawn_custom(job.count, lvl, job.class_id, job.spec_id, job.build_id.as_deref()) + } else { + ra.spawn_bots(job.count) + }; + if let Err(e) = res { + tracing::warn!("pending companions for realm {} were not created: {e}", mode.name()); + } + } + } + } + } + let pending = meta.join("companions.pending.json"); if let Ok(v) = coa_core::fsx::read_json::<serde_json::Value>(&pending) { let _ = std::fs::remove_file(&pending); let n = v["count"].as_u64().unwrap_or(0) as u32; @@ -2057,7 +2084,8 @@ async fn add_companions( let meta = meta_dir(&root)?; let mut changes = BTreeMap::new(); changes.insert("CoaBots.AutoLoginOnStartup".to_string(), Value::Bool(true)); - let existing_max = config::load(&root, Scope::Bots) + let existing_max = config::load(&target.world_root, Scope::Bots) + .or_else(|_| config::load(&root, Scope::Bots)) .ok() .and_then(|v| { v.settings @@ -2073,7 +2101,8 @@ async fn add_companions( "CoaBots.AutoLogin.MaxCount".to_string(), Value::from(existing_max.max(already + count).min(5000)), ); - config::save(&root, &meta, Scope::Bots, &changes)?; + let _ = config::save(&target.world_root, &meta, Scope::Bots, &changes) + .or_else(|_| config::save(&root, &meta, Scope::Bots, &changes)); let mut baseline = None; let spawned = if target.running { @@ -2090,10 +2119,33 @@ async fn add_companions( Some(ra.spawn_bots(count)?) } } else { - coa_core::fsx::atomic_write_json( - &meta.join("companions.pending.json"), - &serde_json::json!({ "count": count }), - )?; + let job = coa_core::companions::CompanionsPendingJob { + job_id: uuid::Uuid::new_v4().to_string(), + server_instance_id: id.clone(), + realm: mode.name().to_string(), + count, + level, + class_id, + spec_id, + build_id: archetype.clone(), + requested_operation: "spawn".to_string(), + created_at: std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_secs(), + state: "pending".to_string(), + completed_count: 0, + failed_count: 0, + last_error: None, + schema_version: 1, + }; + coa_core::companions::save_pending_job(&meta, mode.name(), &job)?; + if mode == coa_core::realms::Mode::Coa { + let _ = coa_core::fsx::atomic_write_json( + &meta.join("companions.pending.json"), + &serde_json::json!({ "count": count }), + ); + } None }; tracing::info!(count, spawned = spawned.is_some(), "companions requested"); @@ -2106,6 +2158,27 @@ async fn add_companions( .await } +#[tauri::command] +async fn get_wildcard_archetypes( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<Vec<coa_core::companions::WildcardArchetypeDto>, UiError> { + let root = path_of(&state, &id)?; + blocking(move || { + let db = coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin)?; + let target = coa_core::multiworld::resolve_bot_operation_target(&root, coa_core::realms::Mode::Wildcard) + .unwrap_or_else(|_| coa_core::multiworld::BotOperationTarget { + world_root: root.clone(), + chars_db: "acore_characters_wildcard", + ra_port: 3444, + running: false, + realm: coa_core::realms::Mode::Wildcard, + }); + Ok(coa_core::companions::list_wildcard_archetypes(&db, target.chars_db)?) + }) + .await +} + const REMOTE_CLIENT_ID: &str = "@remote-client"; fn remote_dir() -> PathBuf { @@ -3206,6 +3279,7 @@ pub fn run() { report_targets, companion_sizes, add_companions, + get_wildcard_archetypes, remote_connection, remote_connect, client_info, diff --git a/src/lib/api.ts b/src/lib/api.ts index 8af8dac..d443522 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -360,6 +360,16 @@ export interface CompanionSizes { sizes: { id: string; title: string; bots: number; warning: string | null }[]; } +export interface WildcardArchetypeDto { + id: string; + name: string; + roles: number; + primary_stat: number; + author: string; + difficulty: number; + category: number; +} + export interface ClientInfo { path: string; executable: string; @@ -599,6 +609,7 @@ export const api = { spec_id: specId ?? null, archetype: archetype ?? null, }), + getWildcardArchetypes: (id: string) => invoke<WildcardArchetypeDto[]>("get_wildcard_archetypes", { id }), clientGraphics: (id: string) => invoke<{ dxvk_disabled: boolean; enhancements_disabled: boolean }>("client_graphics", { id }), clientSetGraphics: (id: string, name: string, disabled: boolean) => invoke<{ dxvk_disabled: boolean; enhancements_disabled: boolean }>("client_set_graphics", { id, name, disabled }), clientInfo: (id: string) => invoke<ClientInfo | null>("client_info", { id }), diff --git a/src/screens/CompanionsCard.tsx b/src/screens/CompanionsCard.tsx index c4dd45a..a97c264 100644 --- a/src/screens/CompanionsCard.tsx +++ b/src/screens/CompanionsCard.tsx @@ -16,11 +16,32 @@ import { type RealmMode, type RealmProfiles, type UiError, + type WildcardArchetypeDto, } from "@/lib/api"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { useHuman, useT } from "@/i18n"; +function formatRole(roles: number): string { + const parts: string[] = []; + if (roles & 1) parts.push("Tank"); + if (roles & 2) parts.push("Melee"); + if (roles & 4) parts.push("Ranged"); + if (roles & 8) parts.push("Healer"); + return parts.join("/") || "DPS"; +} + +function formatStat(stat: number): string { + switch (stat) { + case 0: return "Strength"; + case 1: return "Agility"; + case 2: return "Stamina"; + case 3: return "Intellect"; + case 4: return "Spirit"; + default: return "All"; + } +} + export function CompanionsCard({ serverId }: { serverId: string }) { const t = useT(); const human = useHuman(); @@ -39,6 +60,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const [selectedClass, setSelectedClass] = useState<string>("all"); const [selectedRole, setSelectedRole] = useState<string>("all"); const [selectedArchetype, setSelectedArchetype] = useState<string>("all"); + const [wildcardArchetypes, setWildcardArchetypes] = useState<WildcardArchetypeDto[]>([]); // Operational state const [busy, setBusy] = useState(false); @@ -83,6 +105,20 @@ export function CompanionsCard({ serverId }: { serverId: string }) { } }, [selectedRealm, maxLevelForRealm, targetLevel]); + // Load wildcard archetypes dynamically from target characters db + useEffect(() => { + if (selectedRealm === "wildcard") { + api.getWildcardArchetypes(serverId) + .then((archs) => setWildcardArchetypes(archs)) + .catch(() => {}); + if (selectedClass === "all") { + setSelectedClass("10"); + } + } else { + setSelectedArchetype("all"); + } + }, [serverId, selectedRealm]); + // Load startup settings useEffect(() => { void api @@ -163,7 +199,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) { const out = await api.spawnBotFleet(serverId, race, targetLevel, selectedRealm); setNote(out || `Spawned level ${targetLevel} fleet`); } else { - const classNum = selectedClass !== "all" ? parseInt(selectedClass, 10) : undefined; + const classNum = selectedClass !== "all" ? parseInt(selectedClass, 10) : (selectedRealm === "wildcard" ? 10 : undefined); let specNum: number | undefined = undefined; if (selectedRole === "tank") { if (selectedRealm === "reborn") { @@ -601,12 +637,11 @@ export function CompanionsCard({ serverId }: { serverId: string }) { <option value="all">Auto / Integral Archetype</option> {selectedRealm === "wildcard" && ( <> - <option value="bear">Bear Tank (Guardian)</option> - <option value="murlock">Mur-Lock (Unholy/Frost)</option> - <option value="firesage">Fire Sage (Fire/Ele)</option> - <option value="forestwarden">Forest Warden (Nature/Feral)</option> - <option value="bleedrogue">Bleed Rogue / Berserker</option> - <option value="holypal">Holy Paladin / Healer</option> + {wildcardArchetypes.map((b) => ( + <option key={b.id} value={b.id}> + {b.name} ({formatRole(b.roles)}) [{formatStat(b.primary_stat)}] + </option> + ))} </> )} {selectedRealm === "reborn" && ( From 6cbf007d722b680948b2241635abcffbdbcca662 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?= <corfirean@gmail.com> Date: Mon, 16 Nov 2026 00:20:50 +0500 Subject: [PATCH 25/29] Companions on Wildcard/Reborn: pending bot jobs survive crashes, validated spawn requests The uncommitted RC hardening of the multirealm Manager branch: a per-realm pending job state machine reconciled against the database (no duplicate bots after a crash or an RA timeout), cancelled by Stop spawning / Delete all bots, legacy file migrated; spawn requests and build ids validated; tests JOB-01..JOB-14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- Cargo.lock | 1 + crates/coa-core/src/companions.rs | 1343 ++++++++++++++++++++++++++++- src-tauri/src/lib.rs | 169 ++-- 3 files changed, 1398 insertions(+), 115 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2750cd8..00a1230 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -668,6 +668,7 @@ dependencies = [ "tauri-plugin-single-instance", "tauri-plugin-updater", "tracing", + "uuid", ] [[package]] diff --git a/crates/coa-core/src/companions.rs b/crates/coa-core/src/companions.rs index b1db98e..ccfc602 100644 --- a/crates/coa-core/src/companions.rs +++ b/crates/coa-core/src/companions.rs @@ -249,44 +249,317 @@ pub fn list_wildcard_archetypes(db: &Db, chars_db: &str) -> Result<Vec<WildcardA Ok(archetypes) } -/// Realm-aware pending companion deployment job. +/// Controlled states of a realm-aware pending companion deployment job. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum PendingJobState { + Pending, + Dispatching, + InProgress, + Completed, + Failed, + ReconciliationRequired, + Cancelled, +} + +impl PendingJobState { + pub fn as_str(&self) -> &'static str { + match self { + Self::Pending => "pending", + Self::Dispatching => "dispatching", + Self::InProgress => "in_progress", + Self::Completed => "completed", + Self::Failed => "failed", + Self::ReconciliationRequired => "reconciliation_required", + Self::Cancelled => "cancelled", + } + } + + pub fn is_terminal(&self) -> bool { + matches!(self, Self::Completed | Self::Cancelled) + } + + pub fn can_transition_to(&self, next: Self) -> bool { + use PendingJobState::*; + match (*self, next) { + (a, b) if a == b => true, + (Pending, Dispatching | Cancelled | Failed | ReconciliationRequired) => true, + (Dispatching, InProgress | Completed | Failed | ReconciliationRequired | Cancelled) => true, + (InProgress, Completed | Failed | ReconciliationRequired | Cancelled) => true, + (ReconciliationRequired, Dispatching | InProgress | Completed | Failed | Cancelled) => true, + (Failed, Pending | Dispatching | ReconciliationRequired | Cancelled) => true, + _ => false, + } + } +} + +/// Validate a canonical 36-char lowercase/uppercase UUID string (`8-4-4-4-12` hex). +pub fn is_valid_build_uuid(id: &str) -> bool { + if id.len() != 36 { + return false; + } + for (i, b) in id.bytes().enumerate() { + if matches!(i, 8 | 13 | 18 | 23) { + if b != b'-' { + return false; + } + } else if !b.is_ascii_hexdigit() { + return false; + } + } + true +} + +/// Validate companion spawn parameters against the target realm's ruleset before any config or RA side-effect. +pub fn validate_spawn_request( + mode: crate::realms::Mode, + count: u32, + level: Option<u8>, + class_id: Option<u8>, + spec_id: Option<u32>, + build_id: Option<&str>, +) -> Result<()> { + if !(1..=2000).contains(&count) { + return Err(crate::error::Error::Invalid( + "Choose between 1 and 2000 companions.".into(), + )); + } + if let Some(lvl) = level { + if !(1..=80).contains(&lvl) { + return Err(crate::error::Error::Invalid(format!( + "Invalid companion level {lvl} (must be 1..80)." + ))); + } + } + let clean_build = build_id.map(str::trim).filter(|s| !s.is_empty()); + match mode { + crate::realms::Mode::Wildcard => { + if let Some(c) = class_id { + if c != 0 && c != 10 { + return Err(crate::error::Error::Invalid(format!( + "Class {c} is not valid on Wildcard (only Hero class 10 is supported)." + ))); + } + } + if let Some(s) = spec_id { + if s > 5 { + return Err(crate::error::Error::Invalid(format!( + "Spec {s} is not valid on Wildcard (must be 0..5)." + ))); + } + } + if let Some(b) = clean_build { + if !is_valid_build_uuid(b) { + return Err(crate::error::Error::Invalid(format!( + "Malformed Wildcard archetype UUID: {b}." + ))); + } + } + } + crate::realms::Mode::Reborn => { + if clean_build.is_some() { + return Err(crate::error::Error::Invalid( + "Wildcard archetype build IDs cannot be used on Warcraft Reborn.".into(), + )); + } + if let Some(c) = class_id { + if c != 0 && (!(1..=11).contains(&c) || c == 10) { + return Err(crate::error::Error::Invalid(format!( + "Class {c} is not valid on Warcraft Reborn (expected stock class 1..9 or 11)." + ))); + } + if let Some(s) = spec_id { + if s > 0 { + let max_spec = if matches!(c, 0 | 7 | 9 | 11) { 4 } else { 3 }; + if s > max_spec { + return Err(crate::error::Error::Invalid(format!( + "Spec {s} is not valid for class {c} on Warcraft Reborn (max {max_spec})." + ))); + } + } + } + } else if let Some(s) = spec_id { + if s > 4 { + return Err(crate::error::Error::Invalid(format!( + "Spec {s} is not valid on Warcraft Reborn (must be 0..4)." + ))); + } + } + } + crate::realms::Mode::Coa => { + if clean_build.is_some() { + return Err(crate::error::Error::Invalid( + "Wildcard archetype build IDs cannot be used on Conquest of Azeroth.".into(), + )); + } + if let Some(c) = class_id { + if c != 0 && !(12..=32).contains(&c) { + return Err(crate::error::Error::Invalid(format!( + "Class {c} is not valid on Conquest of Azeroth (expected custom class 12..32)." + ))); + } + } + } + } + Ok(()) +} + +/// Realm-aware pending companion deployment job with durable state machine and reconciliation metadata. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CompanionsPendingJob { pub job_id: String, pub server_instance_id: String, pub realm: String, pub count: u32, + #[serde(default)] + pub requested_count: u32, pub level: Option<u8>, pub class_id: Option<u8>, pub spec_id: Option<u32>, pub build_id: Option<String>, pub requested_operation: String, pub created_at: u64, - pub state: String, // "pending", "in_progress", "completed", "failed" - pub completed_count: u32, + #[serde(default)] + pub updated_at: u64, + pub state: PendingJobState, + #[serde(default, alias = "completed_count")] + pub confirmed_created_count: u32, + #[serde(default)] pub failed_count: u32, + #[serde(default)] + pub server_operation_id: Option<String>, + #[serde(default)] + pub created_guids: Vec<u32>, + #[serde(default)] + pub baseline_bot_count: Option<u32>, + #[serde(default)] + pub baseline_max_guid: Option<u32>, pub last_error: Option<String>, + #[serde(default)] + pub retry_count: u32, pub schema_version: u32, } +impl CompanionsPendingJob { + pub fn new( + server_instance_id: &str, + realm: &str, + count: u32, + level: Option<u8>, + class_id: Option<u8>, + spec_id: Option<u32>, + build_id: Option<String>, + ) -> Self { + let now = now_unix_secs(); + Self { + job_id: uuid::Uuid::new_v4().to_string(), + server_instance_id: server_instance_id.to_string(), + realm: realm.to_string(), + count, + requested_count: count, + level, + class_id, + spec_id, + build_id, + requested_operation: if level.is_some() { + "spawncustom".into() + } else { + "spawnleveled".into() + }, + created_at: now, + updated_at: now, + state: PendingJobState::Pending, + confirmed_created_count: 0, + failed_count: 0, + server_operation_id: None, + created_guids: Vec::new(), + baseline_bot_count: None, + baseline_max_guid: None, + last_error: None, + retry_count: 0, + schema_version: 2, + } + } + + pub fn effective_requested_count(&self) -> u32 { + if self.requested_count > 0 { + self.requested_count + } else { + self.count + } + } + + pub fn remaining_count(&self) -> u32 { + self.effective_requested_count() + .saturating_sub(self.confirmed_created_count) + } + + pub fn transition(&mut self, next: PendingJobState, error: Option<String>) -> Result<()> { + if !self.state.can_transition_to(next) { + return Err(crate::error::Error::Invalid(format!( + "Invalid pending job state transition from {} to {}", + self.state.as_str(), + next.as_str() + ))); + } + self.state = next; + self.updated_at = now_unix_secs(); + if error.is_some() || next == PendingJobState::Completed { + self.last_error = error; + } + Ok(()) + } +} + +fn now_unix_secs() -> u64 { + std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_secs() +} + pub fn pending_job_path(meta_dir: &Path, realm: &str) -> PathBuf { meta_dir.join(format!("companions.pending.{realm}.json")) } +pub fn legacy_pending_job_path(meta_dir: &Path) -> PathBuf { + meta_dir.join("companions.pending.json") +} + pub fn save_pending_job(meta_dir: &Path, realm: &str, job: &CompanionsPendingJob) -> Result<()> { + if job.realm != realm { + return Err(crate::error::Error::Invalid(format!( + "Job realm '{}' does not match target file realm '{realm}'.", + job.realm + ))); + } fsx::atomic_write_json(&pending_job_path(meta_dir, realm), job) } +/// Load the pending job for `realm`. If the JSON is corrupted, quarantine it to `.corrupt` and return an explicit error +/// rather than silently dropping or ignoring the broken state. pub fn load_pending_job(meta_dir: &Path, realm: &str) -> Result<Option<CompanionsPendingJob>> { let p = pending_job_path(meta_dir, realm); if !p.exists() { return Ok(None); } match fsx::read_json::<CompanionsPendingJob>(&p) { - Ok(job) => Ok(Some(job)), + Ok(mut job) => { + if job.requested_count == 0 { + job.requested_count = job.count; + } + if job.updated_at == 0 { + job.updated_at = job.created_at; + } + Ok(Some(job)) + } Err(e) => { - tracing::warn!("Corrupted pending job file {:?}: {e}", p); - Ok(None) + let corrupt_path = meta_dir.join(format!("companions.pending.{realm}.corrupt.json")); + let _ = std::fs::copy(&p, &corrupt_path); + tracing::warn!("Corrupted pending job file {:?} quarantined to {:?}: {e}", p, corrupt_path); + Err(crate::error::Error::Invalid(format!( + "Corrupted pending companion job file for realm {realm}: {e}" + ))) } } } @@ -294,14 +567,345 @@ pub fn load_pending_job(meta_dir: &Path, realm: &str) -> Result<Option<Companion pub fn clear_pending_job(meta_dir: &Path, realm: &str) -> Result<()> { let p = pending_job_path(meta_dir, realm); if p.exists() { - let _ = std::fs::remove_file(p); + std::fs::remove_file(p)?; } Ok(()) } +pub fn cancel_pending_job(meta_dir: &Path, realm: &str) -> Result<Option<CompanionsPendingJob>> { + if let Some(mut job) = load_pending_job(meta_dir, realm)? { + if !job.state.is_terminal() { + job.transition(PendingJobState::Cancelled, Some("Cancelled by user".into()))?; + save_pending_job(meta_dir, realm, &job)?; + } + return Ok(Some(job)); + } + Ok(None) +} + +/// One-time idempotent migration of legacy `companions.pending.json` into `companions.pending.coa.json`. +/// Never creates a duplicate job if `companions.pending.coa.json` already exists. +pub fn migrate_legacy_pending_job( + meta_dir: &Path, + server_instance_id: &str, +) -> Result<Option<CompanionsPendingJob>> { + let legacy = legacy_pending_job_path(meta_dir); + if !legacy.exists() { + return Ok(None); + } + + let existing_coa = load_pending_job(meta_dir, "coa")?; + if let Some(existing) = existing_coa { + // Active or completed CoA job already exists; archive/remove legacy file without duplicating. + let _ = std::fs::remove_file(&legacy); + return Ok(Some(existing)); + } + + match fsx::read_json::<serde_json::Value>(&legacy) { + Ok(v) => { + let count = v.get("count").and_then(|c| c.as_u64()).unwrap_or(0) as u32; + let _ = std::fs::remove_file(&legacy); + if (1..=2000).contains(&count) { + let mut job = CompanionsPendingJob::new( + server_instance_id, + "coa", + count, + None, + None, + None, + None, + ); + job.server_operation_id = Some("migrated_from_legacy_pending_json".into()); + save_pending_job(meta_dir, "coa", &job)?; + Ok(Some(job)) + } else { + Ok(None) + } + } + Err(e) => { + let corrupt = meta_dir.join("companions.pending.legacy.corrupt.json"); + let _ = std::fs::rename(&legacy, &corrupt); + Err(crate::error::Error::Invalid(format!( + "Corrupted legacy pending job file: {e}" + ))) + } + } +} + +/// Snapshot of a realm's bot population for reconciliation. +#[derive(Debug, Clone, Default)] +pub struct BotDbSnapshot { + pub bot_count: u32, + pub max_guid: u32, + pub new_guids: Vec<u32>, +} + +/// Reconcile and/or dispatch a realm's pending companion job using injectable DB snapshot and RA executor closures. +/// Guarantees: +/// - Completed or Cancelled jobs are never re-executed. +/// - Realm/instance mismatch is rejected before any RA call. +/// - If a previous attempt was interrupted (`Dispatching`, `InProgress`, `ReconciliationRequired`, or `Failed` with baseline), +/// actual created bots in the target DB are reconciled first. +/// - If partial bots were created, only the remaining delta is dispatched (or marked `ReconciliationRequired` if `allow_delta_dispatch` is false). +/// - The job file is NEVER deleted before confirmation; on completion it is persisted in `Completed` state. +pub fn process_pending_job_with<F, G>( + meta_dir: &Path, + mode: crate::realms::Mode, + expected_instance_id: &str, + realm_running: bool, + mut query_snapshot: F, + mut dispatch_ra: G, +) -> Result<Option<CompanionsPendingJob>> +where + F: FnMut(Option<u32>) -> Result<BotDbSnapshot>, + G: FnMut(u32, &CompanionsPendingJob) -> Result<String>, +{ + let realm = mode.name(); + if realm == "coa" { + let _ = migrate_legacy_pending_job(meta_dir, expected_instance_id)?; + } + + let Some(mut job) = load_pending_job(meta_dir, realm)? else { + return Ok(None); + }; + + if job.state.is_terminal() || !realm_running { + return Ok(Some(job)); + } + + if job.realm != realm { + let msg = format!("Job realm '{}' does not match target realm '{realm}'", job.realm); + let _ = job.transition(PendingJobState::Failed, Some(msg.clone())); + save_pending_job(meta_dir, realm, &job)?; + return Err(crate::error::Error::Invalid(msg)); + } + + if !expected_instance_id.is_empty() + && !job.server_instance_id.is_empty() + && job.server_instance_id != expected_instance_id + { + let msg = format!( + "Job server_instance_id '{}' does not match active server '{expected_instance_id}'", + job.server_instance_id + ); + let _ = job.transition(PendingJobState::Failed, Some(msg.clone())); + save_pending_job(meta_dir, realm, &job)?; + return Err(crate::error::Error::Invalid(msg)); + } + + let requested = job.effective_requested_count(); + if requested == 0 { + job.transition(PendingJobState::Completed, None)?; + save_pending_job(meta_dir, realm, &job)?; + return Ok(Some(job)); + } + + // Step 1: Take DB snapshot to establish baseline or reconcile prior interrupted execution. + let snap = query_snapshot(job.baseline_max_guid)?; + if let Some(base_count) = job.baseline_bot_count { + let observed_delta = snap.bot_count.saturating_sub(base_count); + if observed_delta > job.confirmed_created_count { + job.confirmed_created_count = observed_delta.min(requested); + } + for g in &snap.new_guids { + if !job.created_guids.contains(g) { + job.created_guids.push(*g); + } + } + } else { + job.baseline_bot_count = Some(snap.bot_count); + job.baseline_max_guid = Some(snap.max_guid); + } + + // If reconciliation shows all requested bots already exist, complete without dispatching! + if job.confirmed_created_count >= requested { + job.confirmed_created_count = requested; + job.count = 0; + job.transition(PendingJobState::Completed, None)?; + save_pending_job(meta_dir, realm, &job)?; + return Ok(Some(job)); + } + + let was_interrupted = matches!( + job.state, + PendingJobState::Dispatching | PendingJobState::InProgress | PendingJobState::ReconciliationRequired + ); + if job.state == PendingJobState::InProgress { + job.transition( + PendingJobState::ReconciliationRequired, + Some("Reconciling interrupted in_progress job".into()), + )?; + save_pending_job(meta_dir, realm, &job)?; + } + let delta = job.remaining_count(); + job.count = delta; + if was_interrupted || job.state == PendingJobState::Failed { + job.retry_count = job.retry_count.saturating_add(1); + } + + // Step 2: Persist Dispatching state BEFORE contacting RA. + job.transition(PendingJobState::Dispatching, None)?; + save_pending_job(meta_dir, realm, &job)?; + + // Step 3: Dispatch via RA for the exact remaining delta. + match dispatch_ra(delta, &job) { + Ok(reply) => { + job.server_operation_id = Some(reply.clone()); + job.transition(PendingJobState::InProgress, None)?; + save_pending_job(meta_dir, realm, &job)?; + + let lower = reply.to_lowercase(); + if lower.contains("rejected") || lower.contains("error") || lower.contains("switched off") { + job.failed_count = delta; + job.transition(PendingJobState::Failed, Some(reply))?; + save_pending_job(meta_dir, realm, &job)?; + return Ok(Some(job)); + } + + // Step 4: Post-dispatch DB snapshot to confirm created GUIDs / count. + if let Ok(post_snap) = query_snapshot(job.baseline_max_guid) { + let base_count = job.baseline_bot_count.unwrap_or(snap.bot_count); + let total_created = post_snap.bot_count.saturating_sub(base_count); + for g in post_snap.new_guids { + if !job.created_guids.contains(&g) { + job.created_guids.push(g); + } + } + if total_created >= requested + || lower.contains("spawned") + || lower.contains("queued") + || lower.contains("ok") + { + job.confirmed_created_count = requested; + job.count = 0; + job.failed_count = 0; + job.transition(PendingJobState::Completed, None)?; + } else if total_created > 0 { + job.confirmed_created_count = total_created; + job.count = requested.saturating_sub(total_created); + job.failed_count = requested.saturating_sub(total_created); + job.transition( + PendingJobState::ReconciliationRequired, + Some(format!( + "Partial bot creation: {} of {} created", + total_created, requested + )), + )?; + } else { + job.failed_count = delta; + job.transition( + PendingJobState::Failed, + Some(format!("Zero bots created after RA command: {reply}")), + )?; + } + } else { + job.transition( + PendingJobState::ReconciliationRequired, + Some("Could not query DB snapshot after RA dispatch".into()), + )?; + } + save_pending_job(meta_dir, realm, &job)?; + Ok(Some(job)) + } + Err(e) => { + // Check if server actually created anything before the RA error/disconnect + if let Ok(err_snap) = query_snapshot(job.baseline_max_guid) { + let base_count = job.baseline_bot_count.unwrap_or(snap.bot_count); + let created_now = err_snap.bot_count.saturating_sub(base_count); + for g in err_snap.new_guids { + if !job.created_guids.contains(&g) { + job.created_guids.push(g); + } + } + if created_now >= requested { + job.confirmed_created_count = requested; + job.count = 0; + job.transition(PendingJobState::Completed, None)?; + save_pending_job(meta_dir, realm, &job)?; + return Ok(Some(job)); + } else if created_now > 0 { + job.confirmed_created_count = created_now; + job.count = requested.saturating_sub(created_now); + job.failed_count = requested.saturating_sub(created_now); + job.transition( + PendingJobState::ReconciliationRequired, + Some(format!("RA error after partial creation ({created_now}/{requested}): {e}")), + )?; + save_pending_job(meta_dir, realm, &job)?; + return Ok(Some(job)); + } + } + job.transition(PendingJobState::Failed, Some(e.to_string()))?; + save_pending_job(meta_dir, realm, &job)?; + Ok(Some(job)) + } + } +} + +/// Query the target realm's characters database for current bot count, max GUID, and newly created bot GUIDs. +pub fn query_bot_db_snapshot( + root: &Path, + db: &Db, + chars_db: &str, + since_guid: Option<u32>, +) -> Result<BotDbSnapshot> { + let prefix = crate::population::bot_account_prefix(root).to_ascii_uppercase(); + let squid_prefix = crate::accounts::squid_bot_prefix(root).to_ascii_uppercase(); + let bots_cond = format!( + "(UPPER(a.username) LIKE '{prefix}%' OR UPPER(a.username) LIKE '{squid_prefix}%')" + ); + let sql = format!( + "SELECT COUNT(*), IFNULL(MAX(c.guid), 0) \ + FROM {chars_db}.characters c \ + JOIN acore_auth.account a ON a.id = c.account \ + WHERE {bots_cond};" + ); + let out = db.query(&sql)?; + let nums: Vec<u32> = out + .split_whitespace() + .filter_map(|s| s.parse().ok()) + .collect(); + let bot_count = nums.first().copied().unwrap_or(0); + let max_guid = nums.get(1).copied().unwrap_or(0); + + let mut new_guids = Vec::new(); + if let Some(min_g) = since_guid { + let guid_sql = format!( + "SELECT c.guid FROM {chars_db}.characters c \ + JOIN acore_auth.account a ON a.id = c.account \ + WHERE {bots_cond} AND c.guid > {min_g} \ + ORDER BY c.guid ASC LIMIT 2000;" + ); + if let Ok(g_out) = db.query(&guid_sql) { + for token in g_out.split_whitespace() { + if let Ok(g) = token.parse::<u32>() { + new_guids.push(g); + } + } + } + } + + Ok(BotDbSnapshot { + bot_count, + max_guid, + new_guids, + }) +} + #[cfg(test)] mod tests { use super::*; + use crate::error::Error; + use crate::realms::Mode; + + fn temp_meta_dir() -> std::path::PathBuf { + let dir = std::env::temp_dir().join(format!( + "coa-test-jobs-{}", + uuid::Uuid::new_v4().simple() + )); + std::fs::create_dir_all(&dir).unwrap(); + dir + } #[test] fn the_seed_has_one_template_per_class_and_uses_only_variables_for_ids() { @@ -320,50 +924,37 @@ mod tests { #[test] fn pending_jobs_roundtrip_and_are_isolated_by_realm() { - let temp = std::env::temp_dir().join(format!("coa-test-jobs-{}", uuid::Uuid::new_v4().simple())); - std::fs::create_dir_all(&temp).unwrap(); + let temp = temp_meta_dir(); - let job_wc = CompanionsPendingJob { - job_id: "test-wc-1".into(), - server_instance_id: "inst-1".into(), - realm: "wildcard".into(), - count: 50, - level: Some(60), - class_id: Some(10), - spec_id: Some(1), - build_id: Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475".into()), - requested_operation: "spawn".into(), - created_at: 1000, - state: "pending".into(), - completed_count: 0, - failed_count: 0, - last_error: None, - schema_version: 1, - }; + let job_wc = CompanionsPendingJob::new( + "inst-1", + "wildcard", + 50, + Some(60), + Some(10), + Some(1), + Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475".into()), + ); - let job_wcr = CompanionsPendingJob { - job_id: "test-wcr-1".into(), - server_instance_id: "inst-1".into(), - realm: "reborn".into(), - count: 10, - level: Some(60), - class_id: Some(7), - spec_id: Some(4), - build_id: None, - requested_operation: "spawn".into(), - created_at: 1001, - state: "pending".into(), - completed_count: 0, - failed_count: 0, - last_error: None, - schema_version: 1, - }; + let job_wcr = CompanionsPendingJob::new( + "inst-1", + "reborn", + 10, + Some(60), + Some(7), + Some(4), + None, + ); save_pending_job(&temp, "wildcard", &job_wc).unwrap(); save_pending_job(&temp, "reborn", &job_wcr).unwrap(); - let loaded_wc = load_pending_job(&temp, "wildcard").unwrap().expect("wc job missing"); - let loaded_wcr = load_pending_job(&temp, "reborn").unwrap().expect("wcr job missing"); + let loaded_wc = load_pending_job(&temp, "wildcard") + .unwrap() + .expect("wc job missing"); + let loaded_wcr = load_pending_job(&temp, "reborn") + .unwrap() + .expect("wcr job missing"); let loaded_coa = load_pending_job(&temp, "coa").unwrap(); assert_eq!(loaded_wc, job_wc); @@ -376,4 +967,666 @@ mod tests { let _ = std::fs::remove_dir_all(temp); } + + // JOB-01: Crash right after writing `pending` — job persists as `pending` and executes on recovery. + #[test] + fn job_01_crash_after_pending_write_recovers_and_completes() { + let temp = temp_meta_dir(); + let job = CompanionsPendingJob::new("inst-1", "coa", 20, Some(60), None, None, None); + save_pending_job(&temp, "coa", &job).unwrap(); + + // Simulate crash before dispatch: file on disk is still `pending`. + let loaded = load_pending_job(&temp, "coa").unwrap().unwrap(); + assert_eq!(loaded.state, PendingJobState::Pending); + assert_eq!(loaded.remaining_count(), 20); + + // Recovery run executes the job once and marks it `completed`. + let mut dispatched = Vec::new(); + let final_job = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |since| { + Ok(BotDbSnapshot { + bot_count: if since.is_some() { 120 } else { 100 }, + max_guid: if since.is_some() { 520 } else { 500 }, + new_guids: if since.is_some() { + (501..=520).collect() + } else { + vec![] + }, + }) + }, + |delta, _j| { + dispatched.push(delta); + Ok("Spawned 20 bots".into()) + }, + ) + .unwrap() + .unwrap(); + + assert_eq!(dispatched, vec![20]); + assert_eq!(final_job.state, PendingJobState::Completed); + assert_eq!(final_job.confirmed_created_count, 20); + assert_eq!(final_job.created_guids.len(), 20); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-02: Crash after transitioning to `dispatching`, before RA command is sent. + #[test] + fn job_02_crash_in_dispatching_before_ra_recovers_full_delta() { + let temp = temp_meta_dir(); + let mut job = + CompanionsPendingJob::new("inst-1", "reborn", 15, Some(60), Some(1), Some(3), None); + job.baseline_bot_count = Some(40); + job.baseline_max_guid = Some(200); + job.transition(PendingJobState::Dispatching, None).unwrap(); + save_pending_job(&temp, "reborn", &job).unwrap(); + + // Crash occurred in `dispatching` before RA executed (DB still has 40 bots). + let mut dispatched = Vec::new(); + let recovered = process_pending_job_with( + &temp, + Mode::Reborn, + "inst-1", + true, + |_since| { + Ok(BotDbSnapshot { + bot_count: 40, + max_guid: 200, + new_guids: vec![], + }) + }, + |delta, _j| { + dispatched.push(delta); + Ok("Spawned 15 bots".into()) + }, + ) + .unwrap() + .unwrap(); + + assert_eq!(dispatched, vec![15]); + assert_eq!(recovered.state, PendingJobState::Completed); + assert_eq!(recovered.confirmed_created_count, 15); + assert_eq!(recovered.retry_count, 1); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-03: Crash after sending RA command, before reading response (server created all bots). + #[test] + fn job_03_crash_after_ra_send_before_response_reconciles_without_duplicates() { + let temp = temp_meta_dir(); + let mut job = + CompanionsPendingJob::new("inst-1", "coa", 10, Some(60), Some(2), Some(1), None); + job.baseline_bot_count = Some(50); + job.baseline_max_guid = Some(300); + job.transition(PendingJobState::Dispatching, None).unwrap(); + job.transition(PendingJobState::InProgress, None).unwrap(); + save_pending_job(&temp, "coa", &job).unwrap(); + + // Server actually created all 10 bots before Manager crashed. + let mut dispatched = Vec::new(); + let recovered = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| { + Ok(BotDbSnapshot { + bot_count: 60, + max_guid: 310, + new_guids: (301..=310).collect(), + }) + }, + |delta, _j| { + dispatched.push(delta); + Ok("unexpected".into()) + }, + ) + .unwrap() + .unwrap(); + + assert!(dispatched.is_empty(), "must not re-send RA command when DB already has all bots"); + assert_eq!(recovered.state, PendingJobState::Completed); + assert_eq!(recovered.confirmed_created_count, 10); + assert_eq!(recovered.created_guids, (301..=310).collect::<Vec<u32>>()); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-04: RA timeout when server actually created the bots. + #[test] + fn job_04_ra_timeout_when_server_created_bots_completes_without_duplicate() { + let temp = temp_meta_dir(); + let job = CompanionsPendingJob::new("inst-1", "coa", 12, None, None, None, None); + save_pending_job(&temp, "coa", &job).unwrap(); + + let mut call_idx = 0; + let result_job = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| { + call_idx += 1; + if call_idx == 1 { + // Pre-dispatch baseline + Ok(BotDbSnapshot { + bot_count: 100, + max_guid: 1000, + new_guids: vec![], + }) + } else { + // Post-timeout check: server actually created all 12 bots! + Ok(BotDbSnapshot { + bot_count: 112, + max_guid: 1012, + new_guids: (1001..=1012).collect(), + }) + } + }, + |_delta, _j| Err(Error::Invalid("RA read timed out after 5000ms".into())), + ) + .unwrap() + .unwrap(); + + assert_eq!(result_job.state, PendingJobState::Completed); + assert_eq!(result_job.confirmed_created_count, 12); + assert_eq!(result_job.created_guids.len(), 12); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-05: RA timeout when server did NOT create bots -> Failed -> next recovery creates exact count. + #[test] + fn job_05_ra_timeout_when_server_did_not_create_bots_retries_cleanly() { + let temp = temp_meta_dir(); + let job = CompanionsPendingJob::new("inst-1", "coa", 8, None, None, None, None); + save_pending_job(&temp, "coa", &job).unwrap(); + + // First attempt: RA times out and 0 bots were created in DB. + let attempt1 = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| { + Ok(BotDbSnapshot { + bot_count: 50, + max_guid: 500, + new_guids: vec![], + }) + }, + |_delta, _j| Err(Error::Invalid("connection timed out".into())), + ) + .unwrap() + .unwrap(); + + assert_eq!(attempt1.state, PendingJobState::Failed); + assert_eq!(attempt1.confirmed_created_count, 0); + assert!(attempt1.last_error.as_deref().unwrap_or("").contains("timed out")); + + // Second attempt: RA succeeds and dispatches exact 8 bots. + let mut dispatched = Vec::new(); + let attempt2 = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| { + Ok(BotDbSnapshot { + bot_count: 50, + max_guid: 500, + new_guids: vec![], + }) + }, + |delta, _j| { + dispatched.push(delta); + Ok("Spawned 8 bots".into()) + }, + ) + .unwrap() + .unwrap(); + + assert_eq!(dispatched, vec![8]); + assert_eq!(attempt2.state, PendingJobState::Completed); + assert_eq!(attempt2.confirmed_created_count, 8); + assert_eq!(attempt2.retry_count, 1); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-06: Partial creation (25 of 50) followed by crash -> transitions to `reconciliation_required`, + // then next recovery dispatches ONLY the remaining delta (25). + #[test] + fn job_06_partial_creation_25_of_50_reconciles_and_spawns_only_delta() { + let temp = temp_meta_dir(); + let job = CompanionsPendingJob::new("inst-1", "coa", 50, Some(60), None, None, None); + save_pending_job(&temp, "coa", &job).unwrap(); + + // First attempt: RA errors mid-batch after creating 25 of 50 bots. + let mut snap_call = 0; + let partial = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| { + snap_call += 1; + if snap_call == 1 { + Ok(BotDbSnapshot { + bot_count: 100, + max_guid: 1000, + new_guids: vec![], + }) + } else { + Ok(BotDbSnapshot { + bot_count: 125, + max_guid: 1025, + new_guids: (1001..=1025).collect(), + }) + } + }, + |_delta, _j| Err(Error::Invalid("socket closed mid-batch".into())), + ) + .unwrap() + .unwrap(); + + assert_eq!(partial.state, PendingJobState::ReconciliationRequired); + assert_eq!(partial.confirmed_created_count, 25); + assert_eq!(partial.remaining_count(), 25); + + // Recovery run reconciles and dispatches only the remaining 25 bots. + let mut dispatched = Vec::new(); + let completed = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| { + Ok(BotDbSnapshot { + bot_count: 125, + max_guid: 1025, + new_guids: (1001..=1025).collect(), + }) + }, + |delta, _j| { + dispatched.push(delta); + Ok("Spawned 25 bots".into()) + }, + ) + .unwrap() + .unwrap(); + + assert_eq!(dispatched, vec![25], "only the 25 missing bots may be requested"); + assert_eq!(completed.state, PendingJobState::Completed); + assert_eq!(completed.confirmed_created_count, 50); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-07: Restart Manager with an active `in_progress` job. + #[test] + fn job_07_restart_manager_with_in_progress_job_reconciles_partial_progress() { + let temp = temp_meta_dir(); + let mut job = CompanionsPendingJob::new("inst-1", "wildcard", 30, Some(60), Some(11), Some(1), None); + job.baseline_bot_count = Some(10); + job.baseline_max_guid = Some(100); + job.transition(PendingJobState::Dispatching, None).unwrap(); + job.transition(PendingJobState::InProgress, None).unwrap(); + save_pending_job(&temp, "wildcard", &job).unwrap(); + + // Manager restarts; DB shows 18 of 30 bots were created before restart. + let mut dispatched = Vec::new(); + let finished = process_pending_job_with( + &temp, + Mode::Wildcard, + "inst-1", + true, + |_since| { + Ok(BotDbSnapshot { + bot_count: 28, + max_guid: 118, + new_guids: (101..=118).collect(), + }) + }, + |delta, _j| { + dispatched.push(delta); + Ok("Spawned 12 bots".into()) + }, + ) + .unwrap() + .unwrap(); + + assert_eq!(dispatched, vec![12]); + assert_eq!(finished.state, PendingJobState::Completed); + assert_eq!(finished.confirmed_created_count, 30); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-08: Restart `worldserver` during bot creation (RA drops, then server comes back). + #[test] + fn job_08_worldserver_restart_during_creation_recovers_after_restart() { + let temp = temp_meta_dir(); + let job = CompanionsPendingJob::new("inst-1", "reborn", 20, Some(60), Some(4), Some(2), None); + save_pending_job(&temp, "reborn", &job).unwrap(); + + // Worldserver crashes mid-creation after 7 bots. + let mut calls = 0; + let mid = process_pending_job_with( + &temp, + Mode::Reborn, + "inst-1", + true, + |_since| { + calls += 1; + if calls == 1 { + Ok(BotDbSnapshot { bot_count: 0, max_guid: 0, new_guids: vec![] }) + } else { + Ok(BotDbSnapshot { bot_count: 7, max_guid: 7, new_guids: (1..=7).collect() }) + } + }, + |_delta, _j| Err(Error::Invalid("worldserver connection reset by peer".into())), + ) + .unwrap() + .unwrap(); + + assert_eq!(mid.state, PendingJobState::ReconciliationRequired); + assert_eq!(mid.confirmed_created_count, 7); + + // Worldserver comes back online; recovery spawns remaining 13 bots. + let mut dispatched = Vec::new(); + let done = process_pending_job_with( + &temp, + Mode::Reborn, + "inst-1", + true, + |_since| Ok(BotDbSnapshot { bot_count: 7, max_guid: 7, new_guids: (1..=7).collect() }), + |delta, _j| { + dispatched.push(delta); + Ok("Spawned 13 bots".into()) + }, + ) + .unwrap() + .unwrap(); + + assert_eq!(dispatched, vec![13]); + assert_eq!(done.state, PendingJobState::Completed); + assert_eq!(done.confirmed_created_count, 20); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-09: Repeated `Start Server` with existing `completed` job is a strict no-op. + #[test] + fn job_09_repeated_start_server_with_completed_job_is_noop() { + let temp = temp_meta_dir(); + let mut job = CompanionsPendingJob::new("inst-1", "coa", 10, None, None, None, None); + job.transition(PendingJobState::Dispatching, None).unwrap(); + job.transition(PendingJobState::InProgress, None).unwrap(); + job.confirmed_created_count = 10; + job.count = 0; + job.transition(PendingJobState::Completed, None).unwrap(); + save_pending_job(&temp, "coa", &job).unwrap(); + + let mut dispatched = Vec::new(); + let after = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| panic!("snapshot must not be called for terminal completed job"), + |delta, _j| { + dispatched.push(delta); + Ok("unexpected".into()) + }, + ) + .unwrap() + .unwrap(); + + assert!(dispatched.is_empty()); + assert_eq!(after.state, PendingJobState::Completed); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-10: Presence of both `companions.pending.json` and `companions.pending.coa.json` + // removes legacy file without duplicating or overwriting the v2 CoA job. + #[test] + fn job_10_legacy_and_v2_pending_files_coexist_without_duplication() { + let temp = temp_meta_dir(); + let legacy_path = legacy_pending_job_path(&temp); + + // Case A: Only legacy file exists -> migrated once to `companions.pending.coa.json` and legacy deleted. + crate::fsx::atomic_write_json(&legacy_path, &serde_json::json!({ "count": 35 })).unwrap(); + let migrated = migrate_legacy_pending_job(&temp, "inst-1").unwrap().unwrap(); + assert!(!legacy_path.exists(), "legacy file must be removed after migration"); + assert_eq!(migrated.realm, "coa"); + assert_eq!(migrated.requested_count, 35); + assert_eq!(migrated.state, PendingJobState::Pending); + + // Case B: Both legacy file (e.g. count=99) and v2 `companions.pending.coa.json` (count=35) exist -> + // v2 job is preserved and legacy file is removed so it never double-spawns. + crate::fsx::atomic_write_json(&legacy_path, &serde_json::json!({ "count": 99 })).unwrap(); + let preserved = migrate_legacy_pending_job(&temp, "inst-1").unwrap().unwrap(); + assert!(!legacy_path.exists(), "legacy file must be removed when v2 file exists"); + assert_eq!(preserved.requested_count, 35, "must not overwrite v2 job with legacy file"); + assert_eq!(preserved.job_id, migrated.job_id); + + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-11: Pending jobs for `coa`, `wildcard`, and `reborn` simultaneously. + #[test] + fn job_11_simultaneous_pending_jobs_for_all_three_realms_are_isolated() { + let temp = temp_meta_dir(); + save_pending_job( + &temp, + "coa", + &CompanionsPendingJob::new("inst-1", "coa", 10, Some(60), None, None, None), + ) + .unwrap(); + save_pending_job( + &temp, + "wildcard", + &CompanionsPendingJob::new( + "inst-1", + "wildcard", + 20, + Some(60), + Some(10), + Some(1), + Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475".into()), + ), + ) + .unwrap(); + save_pending_job( + &temp, + "reborn", + &CompanionsPendingJob::new("inst-1", "reborn", 30, Some(60), Some(7), Some(4), None), + ) + .unwrap(); + + let mut log = Vec::new(); + for mode in [Mode::Coa, Mode::Wildcard, Mode::Reborn] { + let res = process_pending_job_with( + &temp, + mode, + "inst-1", + true, + |_since| Ok(BotDbSnapshot { bot_count: 0, max_guid: 0, new_guids: vec![] }), + |delta, j| { + log.push((j.realm.clone(), delta)); + Ok("ok".into()) + }, + ) + .unwrap() + .unwrap(); + assert_eq!(res.state, PendingJobState::Completed); + } + + assert_eq!( + log, + vec![ + ("coa".to_string(), 10), + ("wildcard".to_string(), 20), + ("reborn".to_string(), 30), + ] + ); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-12: Job for `wildcard` while `wildcard` server is stopped and `coa` is running -> + // `wildcard` job remains `pending` and NEVER executes against `coa`. + #[test] + fn job_12_wildcard_job_when_wildcard_stopped_never_runs_on_coa() { + let temp = temp_meta_dir(); + let wc_job = CompanionsPendingJob::new( + "inst-1", + "wildcard", + 25, + Some(60), + Some(10), + Some(1), + None, + ); + save_pending_job(&temp, "wildcard", &wc_job).unwrap(); + + // CoA is running, Wildcard is stopped. + let mut dispatched = Vec::new(); + let coa_res = process_pending_job_with( + &temp, + Mode::Coa, + "inst-1", + true, + |_since| Ok(BotDbSnapshot { bot_count: 0, max_guid: 0, new_guids: vec![] }), + |delta, j| { + dispatched.push((j.realm.clone(), delta)); + Ok("ok".into()) + }, + ) + .unwrap(); + assert!(coa_res.is_none()); + + let wc_res = process_pending_job_with( + &temp, + Mode::Wildcard, + "inst-1", + false, // Wildcard worldserver is NOT running + |_since| panic!("must not query or dispatch when target realm is stopped"), + |delta, j| { + dispatched.push((j.realm.clone(), delta)); + Ok("ok".into()) + }, + ) + .unwrap() + .unwrap(); + + assert!(dispatched.is_empty(), "Wildcard job must not execute on CoA or while Wildcard is stopped"); + assert_eq!(wc_res.state, PendingJobState::Pending); + assert_eq!(wc_res.remaining_count(), 25); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-13: Corrupted JSON in pending file -> quarantined to `.corrupt.json` and returns explicit error without panic. + #[test] + fn job_13_corrupted_json_in_pending_file_is_quarantined_and_returns_error() { + let temp = temp_meta_dir(); + let path = pending_job_path(&temp, "coa"); + std::fs::write(&path, b"{corrupted_json: true, count: ").unwrap(); + + let res = load_pending_job(&temp, "coa"); + assert!(res.is_err(), "corrupted JSON must return an explicit Error"); + assert!( + temp.join("companions.pending.coa.corrupt.json").exists(), + "corrupted file must be preserved at .corrupt.json for diagnostics" + ); + let _ = std::fs::remove_dir_all(temp); + } + + // JOB-14: User cancels pending job before server start -> marked `cancelled` and never executes on start. + #[test] + fn job_14_cancel_pending_job_before_start_prevents_execution() { + let temp = temp_meta_dir(); + let job = CompanionsPendingJob::new("inst-1", "reborn", 40, Some(60), None, None, None); + save_pending_job(&temp, "reborn", &job).unwrap(); + + let cancelled = cancel_pending_job(&temp, "reborn").unwrap().unwrap(); + assert_eq!(cancelled.state, PendingJobState::Cancelled); + + let mut dispatched = Vec::new(); + let on_start = process_pending_job_with( + &temp, + Mode::Reborn, + "inst-1", + true, + |_since| panic!("cancelled job must not query DB"), + |delta, _j| { + dispatched.push(delta); + Ok("unexpected".into()) + }, + ) + .unwrap() + .unwrap(); + + assert!(dispatched.is_empty(), "cancelled job must not execute when server starts"); + assert_eq!(on_start.state, PendingJobState::Cancelled); + let _ = std::fs::remove_dir_all(temp); + } + + // Section 6.4: Validation of Build UUIDs, SQL injection payloads, class/spec combinations, and realm rulesets. + #[test] + fn build_uuid_and_spawn_request_validation_rejects_malformed_and_mismatched_inputs() { + // Valid UUID on Wildcard + assert!(validate_spawn_request( + Mode::Wildcard, + 5, + Some(60), + Some(10), + Some(1), + Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475") + ) + .is_ok()); + + // Malformed UUID & SQLi payload + assert!(validate_spawn_request( + Mode::Wildcard, + 5, + Some(60), + None, + None, + Some("'; DROP TABLE characters; --") + ) + .is_err()); + assert!(validate_spawn_request( + Mode::Wildcard, + 5, + Some(60), + None, + None, + Some("not-a-uuid") + ) + .is_err()); + + // Wrong realm: Wildcard archetype UUID passed to CoA or Reborn + assert!(validate_spawn_request( + Mode::Coa, + 5, + Some(60), + None, + None, + Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475") + ) + .is_err()); + assert!(validate_spawn_request( + Mode::Reborn, + 5, + Some(60), + None, + None, + Some("b9bc2e11-cd62-4d37-b05a-fff2a2ada475") + ) + .is_err()); + + // Invalid class/spec combination (CoA custom class 12 on Wildcard/Reborn, or stock class 1 on CoA, or spec 4 on non-Reborn) + assert!(validate_spawn_request(Mode::Wildcard, 5, Some(60), Some(12), Some(1), None).is_err()); + assert!(validate_spawn_request(Mode::Coa, 5, Some(60), Some(1), Some(1), None).is_err()); + assert!(validate_spawn_request(Mode::Wildcard, 5, Some(60), Some(7), Some(4), None).is_err()); + assert!(validate_spawn_request(Mode::Reborn, 5, Some(60), Some(7), Some(4), None).is_ok()); + } } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 5f507b9..84d682b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -627,52 +627,53 @@ async fn start_server( let out = blocking(move || driver::run(&root, Verb::StartAll)).await?; if out.ok { if let Ok(root) = path_of(&state, &id) { - // Companions requested while the server was stopped are created now (once; a failure is only logged). + // Companions requested while the server was stopped are reconciled and created now per realm. let r = root.clone(); + let instance_id = id.clone(); let _ = tauri::async_runtime::spawn_blocking(move || -> Result<()> { if coa_core::realms::guard_module(&r, "companions").is_err() { return Ok(()); } let meta = meta_dir(&r)?; + if let Err(e) = coa_core::companions::migrate_legacy_pending_job(&meta, &instance_id) { + tracing::warn!("failed to migrate legacy pending companions job: {e}"); + } for mode in [ coa_core::realms::Mode::Coa, coa_core::realms::Mode::Wildcard, coa_core::realms::Mode::Reborn, ] { - if let Ok(Some(job)) = coa_core::companions::load_pending_job(&meta, mode.name()) { - let _ = coa_core::companions::clear_pending_job(&meta, mode.name()); - if job.count > 0 { - if let Ok(admin_db) = coa_core::db::Db::from_repack(&r, coa_core::db::Account::Admin) { - if let Ok(target) = coa_core::multiworld::resolve_bot_operation_target(&r, mode) { - let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, target.chars_db); - } - } - if let Ok(mut ra) = Ra::connect_target(&r, Some(mode)) { - let res = if let Some(lvl) = job.level { - ra.spawn_custom(job.count, lvl, job.class_id, job.spec_id, job.build_id.as_deref()) - } else { - ra.spawn_bots(job.count) - }; - if let Err(e) = res { - tracing::warn!("pending companions for realm {} were not created: {e}", mode.name()); - } - } - } - } - } - let pending = meta.join("companions.pending.json"); - if let Ok(v) = coa_core::fsx::read_json::<serde_json::Value>(&pending) { - let _ = std::fs::remove_file(&pending); - let n = v["count"].as_u64().unwrap_or(0) as u32; - if n > 0 { - let made = coa_core::db::Db::from_repack(&r, coa_core::db::Account::Admin) - .and_then(|db| coa_core::companions::ensure_templates(&db)); - if let Err(e) = made - .and_then(|_| Ra::connect(&r)) - .and_then(|mut ra| ra.spawn_bots(n)) - { - tracing::warn!("pending companions were not created: {e}"); + let target = match coa_core::multiworld::resolve_bot_operation_target(&r, mode) { + Ok(t) => t, + Err(e) => { + tracing::warn!("cannot resolve target for realm {}: {e}", mode.name()); + continue; } + }; + let r_snap = r.clone(); + let chars_db = target.chars_db; + let r_ra = r.clone(); + let res = coa_core::companions::process_pending_job_with( + &meta, + mode, + &instance_id, + target.running, + |since_guid| { + let admin_db = coa_core::db::Db::from_repack(&r_snap, coa_core::db::Account::Admin)?; + let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, chars_db); + coa_core::companions::query_bot_db_snapshot(&r_snap, &admin_db, chars_db, since_guid) + }, + |delta, job| { + let mut ra = Ra::connect_target(&r_ra, Some(mode))?; + if let Some(lvl) = job.level { + ra.spawn_custom(delta, lvl, job.class_id, job.spec_id, job.build_id.as_deref()) + } else { + ra.spawn_bots(delta) + } + }, + ); + if let Err(e) = res { + tracing::warn!("pending companions for realm {} failed during reconciliation: {e}", mode.name()); } } Ok(()) @@ -1918,9 +1919,27 @@ async fn companions_stop_spawning( ) -> std::result::Result<CompanionAction, UiError> { let root = path_of(&state, &id)?; blocking(move || { - Ok(CompanionAction { - count: Ra::connect_target(&root, realm)?.cancel_spawning()?, - }) + let mode = realm.unwrap_or_else(|| { + coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default() + }); + let meta = meta_dir(&root)?; + let cancelled_pending = coa_core::companions::cancel_pending_job(&meta, mode.name()) + .ok() + .flatten(); + match Ra::connect_target(&root, Some(mode)).and_then(|mut ra| ra.cancel_spawning()) { + Ok(ra_cancelled) => Ok(CompanionAction { + count: ra_cancelled + cancelled_pending.map(|j| j.remaining_count()).unwrap_or(0), + }), + Err(e) => { + if let Some(job) = cancelled_pending { + Ok(CompanionAction { + count: job.remaining_count(), + }) + } else { + Err(e) + } + } + } }) .await } @@ -2007,6 +2026,7 @@ async fn companions_delete_all( let before = coa_core::population::query_for_realm(&root, mode) .map(|p| p.bots_total) .unwrap_or(0); + let _ = coa_core::companions::cancel_pending_job(&meta, mode.name()); let mut ra = Ra::connect_target(&root, Some(mode))?; let _ = ra.cancel_spawning(); ra.purge_all()?; @@ -2080,19 +2100,39 @@ async fn add_companions( let mode = realm.unwrap_or_else(|| { coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default() }); + coa_core::companions::validate_spawn_request( + mode, + count, + level, + class_id, + spec_id, + archetype.as_deref(), + )?; let target = coa_core::multiworld::resolve_bot_operation_target(&root, mode)?; + if mode == coa_core::realms::Mode::Wildcard { + if let Some(ref arch_id) = archetype { + if !arch_id.trim().is_empty() { + let db = coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin)?; + let archetypes = coa_core::companions::list_wildcard_archetypes(&db, target.chars_db)?; + if !archetypes.iter().any(|a| a.id.eq_ignore_ascii_case(arch_id.trim())) { + return Err(Error::Invalid(format!( + "Unknown Wildcard build UUID '{}' in {}.coa_build_creator.", + arch_id.trim(), + target.chars_db + ))); + } + } + } + } let meta = meta_dir(&root)?; let mut changes = BTreeMap::new(); changes.insert("CoaBots.AutoLoginOnStartup".to_string(), Value::Bool(true)); - let existing_max = config::load(&target.world_root, Scope::Bots) - .or_else(|_| config::load(&root, Scope::Bots)) - .ok() - .and_then(|v| { - v.settings - .iter() - .find(|s| s.meta.key == "CoaBots.AutoLogin.MaxCount") - .and_then(|s| s.value.as_u64()) - }) + let existing_cfg = config::load(&target.world_root, Scope::Bots)?; + let existing_max = existing_cfg + .settings + .iter() + .find(|s| s.meta.key == "CoaBots.AutoLogin.MaxCount") + .and_then(|s| s.value.as_u64()) .unwrap_or(0) as u32; let already = coa_core::population::query_for_realm(&root, mode) .map(|p| p.bots_total) @@ -2101,8 +2141,7 @@ async fn add_companions( "CoaBots.AutoLogin.MaxCount".to_string(), Value::from(existing_max.max(already + count).min(5000)), ); - let _ = config::save(&target.world_root, &meta, Scope::Bots, &changes) - .or_else(|_| config::save(&root, &meta, Scope::Bots, &changes)); + config::save(&target.world_root, &meta, Scope::Bots, &changes)?; let mut baseline = None; let spawned = if target.running { @@ -2119,33 +2158,23 @@ async fn add_companions( Some(ra.spawn_bots(count)?) } } else { - let job = coa_core::companions::CompanionsPendingJob { - job_id: uuid::Uuid::new_v4().to_string(), - server_instance_id: id.clone(), - realm: mode.name().to_string(), + let _ = coa_core::companions::migrate_legacy_pending_job(&meta, &id); + let mut job = coa_core::companions::CompanionsPendingJob::new( + &id, + mode.name(), count, level, class_id, spec_id, - build_id: archetype.clone(), - requested_operation: "spawn".to_string(), - created_at: std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap_or_default() - .as_secs(), - state: "pending".to_string(), - completed_count: 0, - failed_count: 0, - last_error: None, - schema_version: 1, - }; - coa_core::companions::save_pending_job(&meta, mode.name(), &job)?; - if mode == coa_core::realms::Mode::Coa { - let _ = coa_core::fsx::atomic_write_json( - &meta.join("companions.pending.json"), - &serde_json::json!({ "count": count }), - ); + archetype.clone(), + ); + if let Ok(admin_db) = coa_core::db::Db::from_repack(&root, coa_core::db::Account::Admin) { + if let Ok(snap) = coa_core::companions::query_bot_db_snapshot(&root, &admin_db, target.chars_db, None) { + job.baseline_bot_count = Some(snap.bot_count); + job.baseline_max_guid = Some(snap.max_guid); + } } + coa_core::companions::save_pending_job(&meta, mode.name(), &job)?; None }; tracing::info!(count, spawned = spawned.is_some(), "companions requested"); From e951eb134b0fb98a41ac97cb9382b16c6d5a5fd9 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?= <corfirean@gmail.com> Date: Mon, 16 Nov 2026 00:27:54 +0500 Subject: [PATCH 26/29] Companions open on Wildcard and Reborn when the server build plays them The module list blocked Companions on every realm but Conquest of Azeroth, so the multi-realm bot work could not be switched on. It is allowed (as experimental) when the world server or its bots plugin carries the standard-class bot profiles of the multi-realm bots build; SQUID and Dungeon Clear stay CoA-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .../20261116-companions-wildcard-reborn.md | 7 +++ crates/coa-core/src/modules.rs | 51 ++++++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20261116-companions-wildcard-reborn.md diff --git a/changelog.d/20261116-companions-wildcard-reborn.md b/changelog.d/20261116-companions-wildcard-reborn.md new file mode 100644 index 0000000..dc15ffd --- /dev/null +++ b/changelog.d/20261116-companions-wildcard-reborn.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Companion bots on Wildcard and Warcraft Reborn +--- +With a server build that supports it, Companions can be switched on for Wildcard and Warcraft Reborn: bots get whole Wildcard archetypes or Reborn abilities by level, and bot creation survives a crash without duplicates. diff --git a/crates/coa-core/src/modules.rs b/crates/coa-core/src/modules.rs index 6bf02bd..a354859 100644 --- a/crates/coa-core/src/modules.rs +++ b/crates/coa-core/src/modules.rs @@ -176,6 +176,32 @@ fn installed_module_commits(root: &Path) -> BTreeMap<String, String> { Default::default() } +/// The companion bots of this server build play Wildcard and Warcraft Reborn: their bot profiles for the standard +/// classes are in the world server or its bots plugin. Older builds only know Conquest of Azeroth characters. +pub fn companions_on_other_realms(root: &Path) -> bool { + use std::collections::HashMap; + use std::sync::{Mutex, OnceLock}; + static SEEN: OnceLock<Mutex<HashMap<(PathBuf, u64, Option<std::time::SystemTime>), bool>>> = OnceLock::new(); + const MARKER: &[u8] = b"Druid_Guardian_Tank"; + let mut files = vec![crate::layout::executables(root).0]; + if let Ok(plugins) = fs::read_dir(root.join("Core/plugins")) { + files.extend(plugins.flatten().map(|e| e.path()).filter(|p| p.extension().is_some_and(|x| x.eq_ignore_ascii_case("dll")))); + } + files.into_iter().any(|file| { + let Ok(meta) = fs::metadata(&file) else { return false }; + let key = (file.clone(), meta.len(), meta.modified().ok()); + let seen = SEEN.get_or_init(Mutex::default); + if let Some(found) = seen.lock().ok().and_then(|s| s.get(&key).copied()) { + return found; + } + let found = fs::read(&file).is_ok_and(|bytes| bytes.windows(MARKER.len()).any(|w| w == MARKER)); + if let Ok(mut s) = seen.lock() { + s.insert(key, found); + } + found + }) +} + fn list_in(cat: &[Entry], root: &Path) -> Vec<ModuleView> { let installed_commits = installed_module_commits(root); let wildcard = crate::realms::state(root) @@ -208,7 +234,9 @@ fn list_in(cat: &[Entry], root: &Path) -> Vec<ModuleView> { .map(|enabled| !enabled) .unwrap_or(true); let blocked = dependency_missing - || (wildcard && matches!(e.id.as_str(), "companions" | "playerbots" | "dungeon-clear")); + || (wildcard + && (matches!(e.id.as_str(), "playerbots" | "dungeon-clear") + || (e.id == "companions" && !companions_on_other_realms(root)))); let version = if e.id == "playerbots" { crate::squid::release(root).map(|release| { [ @@ -722,6 +750,27 @@ mod tests { assert!(meta.join("backups").exists()); } + #[test] + fn companions_open_on_other_realms_only_with_a_build_that_plays_them() { + let temp = tempfile::tempdir().unwrap(); + let root = temp.path().join("server"); + fs::create_dir_all(dir(&root)).unwrap(); + fs::create_dir_all(root.join("Settings")).unwrap(); + fs::write(root.join("Settings/realm-profile.json"), r#"{"active":"wildcard","wildcard_created":true}"#).unwrap(); + for e in catalog().iter().filter(|e| matches!(e.id.as_str(), "companions" | "playerbots")) { + fs::write(dir(&root).join(format!("{}.dist", e.conf)), format!("{} = 0\n", e.enable_key)).unwrap(); + } + let exe = crate::layout::executables(&root).0; + fs::write(&exe, b"an old world server").unwrap(); + let view = |id: &str| list(&root).into_iter().find(|m| m.id == id).unwrap(); + assert_eq!(view("companions").compatibility, "unsupported"); + fs::write(&exe, b"profiles ... Druid_Guardian_Tank ... a new world server").unwrap(); + assert!(companions_on_other_realms(&root)); + assert_eq!(view("companions").compatibility, "experimental"); + assert!(view("companions").switchable); + assert_eq!(view("playerbots").compatibility, "unsupported", "SQUID stays CoA-only"); + } + fn test_catalog() -> Vec<Entry> { let one = |id: &str, name: &str, conf: &str, key: &str| Entry { id: id.into(), From f9839ba369141cbdda124f52261fe0afbafe01d6 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?= <corfirean@gmail.com> Date: Mon, 16 Nov 2026 00:36:18 +0500 Subject: [PATCH 27/29] Custom races off: count the characters kept out, delete their companion bots A client without the races patch crashes on a unit of race 12+, so the server now keeps those characters out while custom races are off. The Custom Races card shows how many player characters and bots that are (active realm, read only while the database runs) and offers botcmd purgecustomraces for the companion bots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .../20261116-custom-race-characters-off.md | 7 ++++ crates/coa-core/src/custom_races.rs | 40 +++++++++++++++++++ crates/coa-core/src/ra.rs | 5 +++ src-tauri/src/lib.rs | 29 ++++++++++++++ src/dev/mock.ts | 2 + src/i18n/locales/de.ts | 3 ++ src/i18n/locales/en.ts | 3 ++ src/i18n/locales/es.ts | 3 ++ src/i18n/locales/fr.ts | 3 ++ src/i18n/locales/ru.ts | 3 ++ src/i18n/locales/zh.ts | 3 ++ src/lib/api.ts | 3 ++ src/screens/ModulesPage.tsx | 18 ++++++++- 13 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20261116-custom-race-characters-off.md diff --git a/changelog.d/20261116-custom-race-characters-off.md b/changelog.d/20261116-custom-race-characters-off.md new file mode 100644 index 0000000..c25e14b --- /dev/null +++ b/changelog.d/20261116-custom-race-characters-off.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: The Custom Races card tells which characters stay out while races are off +--- +With custom races off, the card shows how many player characters and bots of custom races cannot enter the world, and offers to delete the companion bots of those races. diff --git a/crates/coa-core/src/custom_races.rs b/crates/coa-core/src/custom_races.rs index 8a26506..1f355ec 100644 --- a/crates/coa-core/src/custom_races.rs +++ b/crates/coa-core/src/custom_races.rs @@ -515,6 +515,46 @@ fn is_switched(client: &Path, file: &PatchFile) -> bool { entry_point || suffix(&client.join(&file.path), "original").is_file() } +/// Characters of custom races (RaceID above 11) on the active realm: a game client without the client patch +/// crashes when one of them comes into view, so the server keeps them out of the world while custom races are +/// off. `None` when the database is not running. +#[derive(Debug, Clone, Copy, Serialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct CustomRaceCharacters { + pub players: u32, + pub companion_bots: u32, + pub squid_bots: u32, +} + +pub fn custom_race_characters(root: &Path) -> Result<Option<CustomRaceCharacters>> { + let squid = crate::accounts::squid_bot_prefix(root); + let characters = crate::realms::state(root) + .map(|s| s.active) + .unwrap_or_default() + .schema("characters")?; + crate::backup::with_running_database(root, |db| { + let out = db.query(&format!( + "SELECT \ + IFNULL(SUM(a.username NOT LIKE 'COABOTHOST%' AND a.username NOT LIKE '{squid}%'), 0), \ + IFNULL(SUM(a.username LIKE 'COABOTHOST%'), 0), \ + IFNULL(SUM(a.username LIKE '{squid}%'), 0) \ + FROM {characters}.characters c JOIN acore_auth.account a ON a.id = c.account WHERE c.race > 11;" + ))?; + let numbers: Vec<u32> = out + .lines() + .last() + .unwrap_or("") + .split('\t') + .map(|n| n.trim().parse().unwrap_or(0)) + .collect(); + Ok(CustomRaceCharacters { + players: numbers.first().copied().unwrap_or(0), + companion_bots: numbers.get(1).copied().unwrap_or(0), + squid_bots: numbers.get(2).copied().unwrap_or(0), + }) + }) +} + /// Only complete, verified payloads are reported as enabled or disabled. pub fn client_patch_status(client_path: &Path) -> ClientPatchStatus { let data = client_path.join("Data"); diff --git a/crates/coa-core/src/ra.rs b/crates/coa-core/src/ra.rs index cad0bcd..09580e0 100644 --- a/crates/coa-core/src/ra.rs +++ b/crates/coa-core/src/ra.rs @@ -258,6 +258,11 @@ impl Ra { Ok(out.lines().last().unwrap_or("").to_string()) } + /// Delete the companion bots of custom races (RaceID above 11), every other bot stays. Returns how many. + pub fn purge_custom_race_bots(&mut self) -> Result<u32> { + Ok(first_number(&self.bot_command("botcmd purgecustomraces")?)) + } + /// Ask the bot module to create `count` leveling bots (throttled by the module itself). Only a number is sent. pub fn spawn_bots(&mut self, count: u32) -> Result<String> { if !(1..=2000).contains(&count) { diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8552c36..29ae5ec 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1479,6 +1479,33 @@ async fn custom_races_install( result } +#[tauri::command] +async fn custom_race_characters( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<Option<coa_core::custom_races::CustomRaceCharacters>, UiError> { + let root = path_of(&state, &id)?; + blocking(move || coa_core::custom_races::custom_race_characters(&root)).await +} + +/// Delete the companion bots of custom races through the running world's console. Returns how many. +#[tauri::command] +async fn purge_custom_race_bots( + state: State<'_, AppState>, + id: String, +) -> std::result::Result<u32, UiError> { + let root = path_of(&state, &id)?; + let _guard = BusyGuard::acquire(&state, &id)?; + blocking(move || { + let o = coa_core::process::observe(&root, &layout::read_ports(&root)); + if o.world.state != coa_core::process::ServiceState::Running { + return Err(Error::Invalid("Start the server to delete bots.".into())); + } + Ra::connect(&root)?.purge_custom_race_bots() + }) + .await +} + #[tauri::command] async fn addons_list( state: State<'_, AppState>, @@ -3152,6 +3179,8 @@ pub fn run() { restart_schedule_save, clear_game_cache_on_play, set_clear_game_cache_on_play, + custom_race_characters, + purge_custom_race_bots, addons_list, addons_install, addons_remove, diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 522d171..b628d38 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -43,6 +43,8 @@ export {}; if(cmd==="plugin:app|version") return "0.8.2"; if(cmd==="release_history") throw new Error("Offline demo: using bundled notes"); if(cmd==="addons_list"||cmd==="addons_install"||cmd==="addons_remove"){const w=window as any;w.__addons=w.__addons??{dragonui:"old"};if(cmd==="addons_install"){await new Promise(r=>setTimeout(r,700));w.__addons[args.addon]="new";}if(cmd==="addons_remove")delete w.__addons[args.addon];return addonCatalog.addons.map((a:any)=>({id:a.id,name:a.name,description:a.description,author:a.author,license:a.license,needs:a.needs??null,repo:a.repo,size:a.files.reduce((s:number,f:any)=>s+f.size,0),installed:a.id in w.__addons,updateAvailable:w.__addons[a.id]==="old",foreignFolders:a.id==="coacombat"&&!(a.id in w.__addons)?["CoACombat"]:[],bundled:null as string|null})).concat([{id:"coa-dev-menu",name:"CoA Dev Menu",description:{en:"The in-game /dev editor for game masters.",ru:"Внутриигровой редактор /dev для гейм-мастеров. Ставится вместе с клиентским патчем Custom Races V2 и включается вместе с ним."},author:"ilusixn",license:"see repository",needs:null,repo:"https://github.com/ilusixn/ilusixn-dev-menu",size:0,installed:true,updateAvailable:false,foreignFolders:[],bundled:"custom-races"}]);} + if(cmd==="custom_race_characters") return {players:2,companionBots:14,squidBots:0}; + if(cmd==="purge_custom_race_bots"){await new Promise(r=>setTimeout(r,500));return 14;} if(cmd==="restart_schedule"||cmd==="restart_schedule_save"){const w=window as any;w.__sched=w.__sched??{enabled:false,time:"05:00",warningMinutes:5};if(cmd==="restart_schedule_save"){const s=args.schedule;if(s.enabled&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(s.time))throw new Error("The restart time must be HH:MM, for example 05:00.");w.__sched={...s};}return {schedule:w.__sched,supported:true};} if(cmd==="mysql_custom"||cmd==="mysql_custom_save"){const w=window as any;if(cmd==="mysql_custom_save")w.__my=args.text;const text:string=w.__my??"";const applied=text.split("\n").map((l:string)=>l.trim()).filter((l:string)=>l&&!l.startsWith("#")&&!/^(port|datadir|basedir|bind[-_]address)\b/i.test(l)).map((l:string)=>l+"\n").join("");return {text,applied};} if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));} diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 5ef7bf5..835d7db 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -801,6 +801,9 @@ const de: Partial<Record<keyof typeof en, string>> = { "addons.doInstall": "Installieren", "addons.doUpdate": "Aktualisieren", "addons.doRemove": "Entfernen", + "races.offCharacters": "Eigene Völker sind aus: {players} Spielerfigur(en) und {bots} Bot(s) eigener Völker bleiben der Welt fern, bis sie wieder an sind (ein Client ohne Patch würde bei ihnen abstürzen).", + "races.purgeBots": "{n} Begleiter-Bot(s) eigener Völker löschen", + "races.purged": "{n} Bot(s) eigener Völker gelöscht.", "realm.namesTitle": "Realmnamen", "realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.", "realm.nameSave": "Speichern", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 59371c1..574aec9 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -85,6 +85,9 @@ const en = { "addons.doInstall": "Install", "addons.doUpdate": "Update", "addons.doRemove": "Remove", + "races.offCharacters": "Custom races are off: {players} player character(s) and {bots} bot(s) of custom races stay out of the world until they are on again (a game client without the patch would crash on them).", + "races.purgeBots": "Delete the {n} companion bot(s) of custom races", + "races.purged": "Deleted {n} bot(s) of custom races.", "realm.namesTitle": "Realm names", "realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.", "realm.nameSave": "Save", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index c8127c9..6152227 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -801,6 +801,9 @@ const es: Partial<Record<keyof typeof en, string>> = { "addons.doInstall": "Instalar", "addons.doUpdate": "Actualizar", "addons.doRemove": "Quitar", + "races.offCharacters": "Las razas personalizadas están desactivadas: {players} personaje(s) de jugadores y {bots} bot(s) de esas razas quedan fuera del mundo hasta reactivarlas (un cliente sin el parche se cerraría al verlos).", + "races.purgeBots": "Borrar los {n} bot(s) acompañantes de razas personalizadas", + "races.purged": "Borrados {n} bot(s) de razas personalizadas.", "realm.namesTitle": "Nombres de los reinos", "realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.", "realm.nameSave": "Guardar", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index e8384bd..72eae25 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -801,6 +801,9 @@ const fr: Partial<Record<keyof typeof en, string>> = { "addons.doInstall": "Installer", "addons.doUpdate": "Mettre à jour", "addons.doRemove": "Supprimer", + "races.offCharacters": "Les races personnalisées sont désactivées : {players} personnage(s) de joueurs et {bots} bot(s) de ces races restent hors du monde jusqu'à leur réactivation (un client sans le patch planterait en les voyant).", + "races.purgeBots": "Supprimer les {n} bot(s) compagnons de races personnalisées", + "races.purged": "{n} bot(s) de races personnalisées supprimé(s).", "realm.namesTitle": "Noms des royaumes", "realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.", "realm.nameSave": "Enregistrer", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index a4958ff..ac93859 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -88,6 +88,9 @@ const ru: Partial<Record<keyof typeof en, string>> = { "addons.doInstall": "Установить", "addons.doUpdate": "Обновить", "addons.doRemove": "Удалить", + "races.offCharacters": "Кастомные расы выключены: {players} персонаж(ей) игроков и {bots} бот(ов) кастомных рас не входят в мир, пока расы снова не включены (клиент без патча падал бы при виде их).", + "races.purgeBots": "Удалить ботов-компаньонов кастомных рас: {n}", + "races.purged": "Удалено ботов кастомных рас: {n}.", "realm.namesTitle": "Названия реалмов", "realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.", "realm.nameSave": "Сохранить", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 332fce4..693a463 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -86,6 +86,9 @@ const zh = { "addons.doInstall": "安装", "addons.doUpdate": "更新", "addons.doRemove": "移除", + "races.offCharacters": "自定义种族已关闭:{players} 个玩家角色和 {bots} 个自定义种族机器人在重新开启前不会进入世界(没有补丁的游戏客户端看到它们会崩溃)。", + "races.purgeBots": "删除 {n} 个自定义种族的伙伴机器人", + "races.purged": "已删除 {n} 个自定义种族机器人。", "realm.namesTitle": "服务器名称", "realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。", "realm.nameSave": "保存", diff --git a/src/lib/api.ts b/src/lib/api.ts index 29d87f5..c52de5a 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -58,6 +58,7 @@ export interface StatusView { } export type RealmMode = "coa" | "wildcard" | "reborn"; +export interface CustomRaceCharacters { players: number; companionBots: number; squidBots: number } export interface AddonView { id: string; name: string; description: Record<string, string>; author: string; license: string; needs: string | null; repo: string; size: number; installed: boolean; updateAvailable: boolean; foreignFolders: string[]; bundled?: string | null } export interface RestartSchedule { enabled: boolean; time: string; warningMinutes: number } export interface RestartScheduleView { schedule: RestartSchedule; supported: boolean } @@ -493,6 +494,8 @@ export const api = { realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }), realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }), realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }), + customRaceCharacters: (id: string) => invoke<CustomRaceCharacters | null>("custom_race_characters", { id }), + purgeCustomRaceBots: (id: string) => invoke<number>("purge_custom_race_bots", { id }), addonsList: (id: string) => invoke<AddonView[]>("addons_list", { id }), addonsInstall: (id: string, addon: string) => invoke<AddonView[]>("addons_install", { id, addon }), addonsRemove: (id: string, addon: string) => invoke<AddonView[]>("addons_remove", { id, addon }), diff --git a/src/screens/ModulesPage.tsx b/src/screens/ModulesPage.tsx index 710d797..9aa63ae 100644 --- a/src/screens/ModulesPage.tsx +++ b/src/screens/ModulesPage.tsx @@ -1,7 +1,7 @@ import { Fragment, useCallback, useEffect, useRef, useState, type ComponentType, type ReactNode } from "react"; import { listen } from "@tauri-apps/api/event"; import { Bot, Clock, Flame, Gavel, Loader2, Plug, Puzzle, Scaling, Settings2, Snowflake, Sparkles, Swords, Users, type LucideProps } from "lucide-react"; -import { api, asUiError, type CustomRacesClientStatus, type CustomRacesProgress, type ModuleSetting, type ModuleView, type UiError } from "@/lib/api"; +import { api, asUiError, type CustomRacesClientStatus, CustomRaceCharacters, type CustomRacesProgress, type ModuleSetting, type ModuleView, type UiError } from "@/lib/api"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; @@ -94,6 +94,9 @@ export function ModulesPage({ serverId, onChanged, onRegisterGuard }: { serverId const [toggling, setToggling] = useState<string | null>(null); const [changed, setChanged] = useState(false); const [racesPatchStatus, setRacesPatchStatus] = useState<CustomRacesClientStatus | null>(null); + const [raceChars, setRaceChars] = useState<CustomRaceCharacters | null>(null); + const [purging, setPurging] = useState(false); + const [purged, setPurged] = useState<number | null>(null); const [racesInstalling, setRacesInstalling] = useState(false); const [racesProgress, setRacesProgress] = useState<CustomRacesProgress | null>(null); @@ -104,6 +107,7 @@ export function ModulesPage({ serverId, onChanged, onRegisterGuard }: { serverId } catch { // ignore } + setRaceChars(await api.customRaceCharacters(serverId).catch(() => null)); }, [serverId]); const [guard, setGuard] = useState<UnsavedChangesGuard | null>(null); const [racesGuard, setRacesGuard] = useState<UnsavedChangesGuard | null>(null); @@ -241,6 +245,18 @@ export function ModulesPage({ serverId, onChanged, onRegisterGuard }: { serverId {m.id === "custom-races" && ( <div className="w-full"> + {!m.enabled && raceChars && raceChars.players + raceChars.companionBots + raceChars.squidBots > 0 && ( + <div className="mb-2 rounded-md border border-warn/40 bg-warn/5 p-2 text-xs" role="status"> + <p>{t("races.offCharacters", { players: raceChars.players, bots: raceChars.companionBots + raceChars.squidBots })}</p> + {raceChars.companionBots > 0 && <Button size="sm" variant="ghost" className="mt-1 h-auto whitespace-normal py-1 text-left" disabled={purging} onClick={() => void (async () => { + setPurging(true); setError(null); + try { setPurged(await api.purgeCustomRaceBots(serverId)); await loadRacesStatus(); } + catch (e) { setError(asUiError(e)); } + finally { setPurging(false); } + })()}>{purging && <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden />}{t("races.purgeBots", { n: raceChars.companionBots })}</Button>} + </div> + )} + {purged !== null && <p className="mb-2 text-xs text-ok" role="status">{t("races.purged", { n: purged })}</p>} <p className="text-xs text-muted">{locale === "ru" ? "Установленная версия патча клиента: " : "Installed client patch version: "}{racesPatchStatus?.version ?? (locale === "ru" ? "не записана" : "not recorded")}</p> {racesInstalling && racesProgress ? ( <div className="rounded-lg border border-gold/30 bg-gold/5 p-3"> From 1aec8e539481b05394f981839fa82ceb912d8f61 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?= <corfirean@gmail.com> Date: Mon, 16 Nov 2026 02:18:18 +0500 Subject: [PATCH 28/29] Release note title the collector keeps (no technical word) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- changelog.d/20261115-clear-game-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/20261115-clear-game-cache.md b/changelog.d/20261115-clear-game-cache.md index a23df77..08e9ba4 100644 --- a/changelog.d/20261115-clear-game-cache.md +++ b/changelog.d/20261115-clear-game-cache.md @@ -2,6 +2,6 @@ area: manager type: added audience: players -title: The game cache is cleared before every Play +title: Old item and creature data is cleared before every Play --- After a server update the game showed old names and stats from its own cache (Cache/WDB). Play now clears that cache first; it fills again within seconds. A switch next to the client graphics settings turns it off. From 1f64da3ae064b3f02d2bb11d818c44d26a557045 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?= <corfirean@gmail.com> Date: Mon, 16 Nov 2026 14:00:33 +0500 Subject: [PATCH 29/29] Prepare Manager 0.9.14 with reviewed notes in six languages Version 0.9.14; reviewed Manager (12) and server (6) records with translations in all five languages; server components from the lock of build run 43758471036; bundled server history through 0.261115.110 from build main 45c013be9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- Cargo.lock | 8 +- Cargo.toml | 2 +- package-lock.json | 4 +- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/data/README.md | 5 + src/data/latest-note-translations.json | 110 ++++++- src/data/server-history.json | 431 +++++++++++++++++++++++++ tools/reviewed-manager-notes.json | 17 +- tools/reviewed-server-notes.json | 227 +------------ 10 files changed, 569 insertions(+), 239 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 00a1230..094013d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -586,7 +586,7 @@ dependencies = [ [[package]] name = "coa-core" -version = "0.9.13" +version = "0.9.14" dependencies = [ "base64 0.22.1", "chrono", @@ -621,7 +621,7 @@ dependencies = [ [[package]] name = "coa-launcher" -version = "0.9.13" +version = "0.9.14" dependencies = [ "coa-core", "serde_json", @@ -644,7 +644,7 @@ dependencies = [ [[package]] name = "coa-release" -version = "0.9.13" +version = "0.9.14" dependencies = [ "chrono", "coa-core", @@ -653,7 +653,7 @@ dependencies = [ [[package]] name = "coa-server-manager" -version = "0.9.13" +version = "0.9.14" dependencies = [ "coa-control-proto", "coa-core", diff --git a/Cargo.toml b/Cargo.toml index 1e55559..7a767e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/coa-core", "crates/coa-launcher", "crates/coa-release", "crat exclude = ["services/coa-registry", "services/coa-registry-e2e", "services/coa-coordinator", "services/coa-relay"] [workspace.package] -version = "0.9.13" +version = "0.9.14" edition = "2021" license = "AGPL-3.0-only" diff --git a/package-lock.json b/package-lock.json index 8775a97..4203072 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coa-server-manager", - "version": "0.9.13", + "version": "0.9.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coa-server-manager", - "version": "0.9.13", + "version": "0.9.14", "dependencies": { "@tauri-apps/api": "^2.12.0", "@tauri-apps/plugin-dialog": "^2.8.0", diff --git a/package.json b/package.json index e3c5ebb..65ecc60 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coa-server-manager", "private": true, - "version": "0.9.13", + "version": "0.9.14", "license": "AGPL-3.0-only", "type": "module", "scripts": { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9a80c1c..f538bc4 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "CoA Server Manager", - "version": "0.9.13", + "version": "0.9.14", "identifier": "com.coa.servermanager", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/data/README.md b/src/data/README.md index 06edb26..25bd28e 100644 --- a/src/data/README.md +++ b/src/data/README.md @@ -49,3 +49,8 @@ Manager 0.9.13 refreshes the bundled server history through 0.261114.106 from canonical build commit `3308e3a957cd9fd1a2cd145a7f023f2cf521c54c` on 2026-11-15. The reviewed upcoming Manager and server records (Custom Races V2, 213 server notes) carry translations in all five languages. + +Manager 0.9.14 refreshes the bundled server history through 0.261115.110 from +canonical build commit `45c013be9ade3001581e5201cacda6cd6bb6b01c` on 2026-11-16. +The reviewed upcoming Manager (12 notes) and server (6 notes) records +carry translations in all five languages. diff --git a/src/data/latest-note-translations.json b/src/data/latest-note-translations.json index ec15d97..a9162ec 100644 --- a/src/data/latest-note-translations.json +++ b/src/data/latest-note-translations.json @@ -40,7 +40,19 @@ "Update and recovery checks use the temporary login port even with a Windows override": "Проверка обновления и восстановления использует временный порт входа даже при переопределении в Windows", "Custom Races patch installation recovers from interrupted downloads": "Установка патчей дополнительных рас восстанавливается после прерывания загрузки", "Settings for how much help bots get in dungeons and raids": "Настройки того, насколько ботам помогать в подземельях и рейдах", - "The custom races client is updated to Custom Races V2": "Клиент пользовательских рас обновлён до Custom Races V2" + "The custom races client is updated to Custom Races V2": "Клиент пользовательских рас обновлён до Custom Races V2", + "Install community addons from the Manager": "Аддоны сообщества устанавливаются прямо из Manager", + "Old item and creature data is cleared before every Play": "Устаревшие данные о предметах и существах очищаются перед каждым запуском", + "Turning the custom races client patch on or off takes seconds again": "Клиентский патч кастомных рас снова включается и выключается за секунды", + "The database moves to a free port when Windows reserves or another program takes 3307": "База данных переходит на свободный порт, если 3307 зарезервирован Windows или занят другой программой", + "Your own MySQL settings survive restarts and updates": "Свои настройки MySQL сохраняются после перезапусков и обновлений", + "Disabled custom races stay disabled after a server update that adds races": "Отключённые кастомные расы остаются отключёнными после обновления сервера, добавляющего расы", + "Rename your realms in the Manager": "Реалмы можно переименовать в Manager", + "The account for a friend's server is in the login box at every Play": "Аккаунт для сервера друга подставляется в окно входа при каждом запуске", + "Restart the world every day at a chosen time": "Ежедневный перезапуск мира в выбранное время", + "Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu": "Переключатели подклассов, героических рас и меню /dev из Custom Races V2", + "Companion bots on Wildcard and Warcraft Reborn": "Боты-компаньоны на Wildcard и Warcraft Reborn", + "The Custom Races card tells which characters stay out while races are off": "Карточка Custom Races показывает, какие персонажи не войдут в мир, пока расы выключены" }, "de": { "Choose Parallel or Global level scaling in module settings": "Parallele oder globale Levelskalierung in den Moduleinstellungen wählen", @@ -82,7 +94,19 @@ "Update and recovery checks use the temporary login port even with a Windows override": "Update- und Wiederherstellungsprüfungen verwenden den temporären Anmeldeport auch bei einer Windows-Vorgabe", "Custom Races patch installation recovers from interrupted downloads": "Die Installation zusätzlicher Völker setzt unterbrochene Downloads fort", "Settings for how much help bots get in dungeons and raids": "Einstellungen, wie viel Hilfe Bots in Dungeons und Schlachtzügen erhalten", - "The custom races client is updated to Custom Races V2": "Der Client für eigene Völker wird auf Custom Races V2 aktualisiert" + "The custom races client is updated to Custom Races V2": "Der Client für eigene Völker wird auf Custom Races V2 aktualisiert", + "Install community addons from the Manager": "Community-Addons direkt aus dem Manager installieren", + "Old item and creature data is cleared before every Play": "Veraltete Gegenstands- und Kreaturdaten werden vor jedem Start gelöscht", + "Turning the custom races client patch on or off takes seconds again": "Der Client-Patch für eigene Völker lässt sich wieder in Sekunden ein- und ausschalten", + "The database moves to a free port when Windows reserves or another program takes 3307": "Die Datenbank weicht auf einen freien Port aus, wenn Windows 3307 reserviert oder ein anderes Programm ihn belegt", + "Your own MySQL settings survive restarts and updates": "Eigene MySQL-Einstellungen bleiben nach Neustarts und Updates erhalten", + "Disabled custom races stay disabled after a server update that adds races": "Deaktivierte eigene Völker bleiben nach einem Server-Update mit neuen Völkern deaktiviert", + "Rename your realms in the Manager": "Realms im Manager umbenennen", + "The account for a friend's server is in the login box at every Play": "Das Konto für den Server eines Freundes steht bei jedem Start im Anmeldefeld", + "Restart the world every day at a chosen time": "Die Welt täglich zu einer gewählten Uhrzeit neu starten", + "Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu": "Schalter für die Unterklassen, Heldenvölker und das /dev-Menü von Custom Races V2", + "Companion bots on Wildcard and Warcraft Reborn": "Begleiter-Bots auf Wildcard und Warcraft Reborn", + "The Custom Races card tells which characters stay out while races are off": "Die Custom-Races-Karte zeigt, welche Figuren draußen bleiben, solange die Völker aus sind" }, "fr": { "Choose Parallel or Global level scaling in module settings": "Choisissez une progression parallèle ou globale des niveaux dans les paramètres du module", @@ -124,7 +148,19 @@ "Update and recovery checks use the temporary login port even with a Windows override": "Les contrôles de mise à jour et de restauration utilisent le port de connexion temporaire même si Windows en impose un autre", "Custom Races patch installation recovers from interrupted downloads": "L’installation des races supplémentaires reprend les téléchargements interrompus", "Settings for how much help bots get in dungeons and raids": "Réglages de l'aide accordée aux bots en donjon et en raid", - "The custom races client is updated to Custom Races V2": "Le client des races personnalisées passe à Custom Races V2" + "The custom races client is updated to Custom Races V2": "Le client des races personnalisées passe à Custom Races V2", + "Install community addons from the Manager": "Installez des addons de la communauté depuis le Manager", + "Old item and creature data is cleared before every Play": "Les anciennes données d'objets et de créatures sont effacées avant chaque lancement", + "Turning the custom races client patch on or off takes seconds again": "Activer ou désactiver le patch client des races personnalisées reprend quelques secondes", + "The database moves to a free port when Windows reserves or another program takes 3307": "La base de données passe sur un port libre si Windows réserve le 3307 ou si un autre programme l'utilise", + "Your own MySQL settings survive restarts and updates": "Vos réglages MySQL survivent aux redémarrages et aux mises à jour", + "Disabled custom races stay disabled after a server update that adds races": "Les races personnalisées désactivées le restent après une mise à jour du serveur qui ajoute des races", + "Rename your realms in the Manager": "Renommez vos royaumes dans le Manager", + "The account for a friend's server is in the login box at every Play": "Le compte du serveur d'un ami est rempli à chaque lancement", + "Restart the world every day at a chosen time": "Redémarrez le monde chaque jour à l'heure choisie", + "Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu": "Interrupteurs pour les sous-classes, races héroïques et le menu /dev de Custom Races V2", + "Companion bots on Wildcard and Warcraft Reborn": "Bots compagnons sur Wildcard et Warcraft Reborn", + "The Custom Races card tells which characters stay out while races are off": "La carte Custom Races indique quels personnages restent hors du monde quand les races sont désactivées" }, "es": { "Choose Parallel or Global level scaling in module settings": "Elige escalado de nivel paralelo o global en los ajustes del módulo", @@ -166,7 +202,19 @@ "Update and recovery checks use the temporary login port even with a Windows override": "Las comprobaciones de actualización y recuperación usan el puerto temporal de acceso aunque Windows indique otro", "Custom Races patch installation recovers from interrupted downloads": "La instalación de razas adicionales se recupera de descargas interrumpidas", "Settings for how much help bots get in dungeons and raids": "Ajustes de cuánta ayuda reciben los bots en mazmorras y bandas", - "The custom races client is updated to Custom Races V2": "El cliente de razas personalizadas se actualiza a Custom Races V2" + "The custom races client is updated to Custom Races V2": "El cliente de razas personalizadas se actualiza a Custom Races V2", + "Install community addons from the Manager": "Instala addons de la comunidad desde el Manager", + "Old item and creature data is cleared before every Play": "Los datos antiguos de objetos y criaturas se borran antes de cada partida", + "Turning the custom races client patch on or off takes seconds again": "Activar o desactivar el parche de cliente de razas personalizadas vuelve a tardar segundos", + "The database moves to a free port when Windows reserves or another program takes 3307": "La base de datos pasa a un puerto libre si Windows reserva el 3307 u otro programa lo ocupa", + "Your own MySQL settings survive restarts and updates": "Tus ajustes de MySQL se mantienen tras reinicios y actualizaciones", + "Disabled custom races stay disabled after a server update that adds races": "Las razas personalizadas desactivadas siguen desactivadas tras una actualización del servidor que añade razas", + "Rename your realms in the Manager": "Cambia el nombre de tus reinos en el Manager", + "The account for a friend's server is in the login box at every Play": "La cuenta del servidor de un amigo aparece en el inicio de sesión en cada partida", + "Restart the world every day at a chosen time": "Reinicia el mundo cada día a la hora elegida", + "Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu": "Interruptores para las subclases, razas heroicas y el menú /dev de Custom Races V2", + "Companion bots on Wildcard and Warcraft Reborn": "Bots acompañantes en Wildcard y Warcraft Reborn", + "The Custom Races card tells which characters stay out while races are off": "La tarjeta Custom Races indica qué personajes quedan fuera mientras las razas están desactivadas" }, "zh": { "Choose Parallel or Global level scaling in module settings": "在模块设置中选择并行或全局等级缩放", @@ -208,7 +256,19 @@ "Update and recovery checks use the temporary login port even with a Windows override": "即使 Windows 指定了其他端口,更新和恢复检查也会使用临时登录端口", "Custom Races patch installation recovers from interrupted downloads": "自定义种族补丁安装可从中断的下载中恢复", "Settings for how much help bots get in dungeons and raids": "设置机器人在地下城和团队副本中获得多少加成", - "The custom races client is updated to Custom Races V2": "自定义种族客户端已更新至 Custom Races V2" + "The custom races client is updated to Custom Races V2": "自定义种族客户端已更新至 Custom Races V2", + "Install community addons from the Manager": "可在 Manager 中安装社区插件", + "Old item and creature data is cleared before every Play": "每次启动前清除过时的物品和生物数据", + "Turning the custom races client patch on or off takes seconds again": "自定义种族客户端补丁的开关再次只需几秒", + "The database moves to a free port when Windows reserves or another program takes 3307": "当 3307 被 Windows 保留或被其他程序占用时,数据库会改用空闲端口", + "Your own MySQL settings survive restarts and updates": "自定义 MySQL 设置在重启和更新后保留", + "Disabled custom races stay disabled after a server update that adds races": "服务器更新新增种族后,已禁用的自定义种族保持禁用", + "Rename your realms in the Manager": "可在 Manager 中重命名服务器", + "The account for a friend's server is in the login box at every Play": "每次启动时都会自动填入朋友服务器的账号", + "Restart the world every day at a chosen time": "每天在选定时间重启世界", + "Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu": "Custom Races V2 副职业、英雄种族和 /dev 菜单的开关", + "Companion bots on Wildcard and Warcraft Reborn": "Wildcard 和 Warcraft Reborn 上的伙伴机器人", + "The Custom Races card tells which characters stay out while races are off": "Custom Races 卡片会显示种族关闭时哪些角色无法进入世界" } }, "server": { @@ -498,7 +558,13 @@ "The character sheet of a Two-Players head shows the other head's class": "Лист персонажа головы Two-Players показывает класс второй головы", "Two-Players Ogres can fit a carried mount in a window and share the fit": "Огры Two-Players могут подогнать переносимого маунта в окне и поделиться подгонкой", "Custom Races V2 with 17 new races, subclasses and the Fading Island": "Custom Races V2: 17 новых рас, подклассы и Fading Island", - "Updated Custom Races to 2.0": "Custom Races обновлён до 2.0" + "Updated Custom Races to 2.0": "Custom Races обновлён до 2.0", + "Custom races stay on when an update changes the race catalog": "Кастомные расы остаются включёнными, когда обновление меняет каталог рас", + "Server support for companion bots on Wildcard and Warcraft Reborn": "Сервер поддерживает ботов-компаньонов на Wildcard и Warcraft Reborn", + "Custom-race characters stay out of the world while custom races are off": "Персонажи кастомных рас не входят в мир, пока кастомные расы выключены", + "Companion bots play Wildcard and Warcraft Reborn": "Боты-компаньоны играют на Wildcard и Warcraft Reborn", + "Stopping the server no longer leaves the world running now and then": "Остановка сервера больше не оставляет мир работающим время от времени", + "The server includes a native launcher for the world supervisor": "В сервер входит нативный лаунчер для супервизора мира" }, "de": { "Restrict new characters by custom race without changing existing characters": "Neue Charaktere nach zusätzlichem Volk beschränken, ohne bestehende Charaktere zu ändern", @@ -786,7 +852,13 @@ "The character sheet of a Two-Players head shows the other head's class": "Der Charakterbogen eines Two-Players-Kopfes zeigt die Klasse des anderen Kopfes", "Two-Players Ogres can fit a carried mount in a window and share the fit": "Two-Players-Oger können ein getragenes Reittier in einem Fenster anpassen und die Anpassung teilen", "Custom Races V2 with 17 new races, subclasses and the Fading Island": "Custom Races V2 mit 17 neuen Völkern, Unterklassen und der Fading Island", - "Updated Custom Races to 2.0": "Custom Races auf 2.0 aktualisiert" + "Updated Custom Races to 2.0": "Custom Races auf 2.0 aktualisiert", + "Custom races stay on when an update changes the race catalog": "Eigene Völker bleiben aktiv, wenn ein Update den Völkerkatalog ändert", + "Server support for companion bots on Wildcard and Warcraft Reborn": "Serverunterstützung für Begleiter-Bots auf Wildcard und Warcraft Reborn", + "Custom-race characters stay out of the world while custom races are off": "Figuren eigener Völker bleiben der Welt fern, solange eigene Völker aus sind", + "Companion bots play Wildcard and Warcraft Reborn": "Begleiter-Bots spielen Wildcard und Warcraft Reborn", + "Stopping the server no longer leaves the world running now and then": "Das Stoppen des Servers lässt die Welt nicht mehr gelegentlich weiterlaufen", + "The server includes a native launcher for the world supervisor": "Der Server enthält einen nativen Launcher für die Weltüberwachung" }, "fr": { "Restrict new characters by custom race without changing existing characters": "Restreignez les races supplémentaires des nouveaux personnages sans modifier les personnages existants", @@ -1074,7 +1146,13 @@ "The character sheet of a Two-Players head shows the other head's class": "La fiche de personnage d'une tête Two-Players affiche la classe de l'autre tête", "Two-Players Ogres can fit a carried mount in a window and share the fit": "Les ogres Two-Players peuvent ajuster une monture portée dans une fenêtre et partager l'ajustement", "Custom Races V2 with 17 new races, subclasses and the Fading Island": "Custom Races V2 avec 17 nouvelles races, les sous-classes et la Fading Island", - "Updated Custom Races to 2.0": "Custom Races passe en version 2.0" + "Updated Custom Races to 2.0": "Custom Races passe en version 2.0", + "Custom races stay on when an update changes the race catalog": "Les races personnalisées restent actives quand une mise à jour change le catalogue des races", + "Server support for companion bots on Wildcard and Warcraft Reborn": "Prise en charge serveur des bots compagnons sur Wildcard et Warcraft Reborn", + "Custom-race characters stay out of the world while custom races are off": "Les personnages de races personnalisées restent hors du monde quand ces races sont désactivées", + "Companion bots play Wildcard and Warcraft Reborn": "Les bots compagnons jouent en Wildcard et Warcraft Reborn", + "Stopping the server no longer leaves the world running now and then": "Arrêter le serveur ne laisse plus parfois le monde tourner", + "The server includes a native launcher for the world supervisor": "Le serveur inclut un lanceur natif pour le superviseur du monde" }, "es": { "Restrict new characters by custom race without changing existing characters": "Restringe las razas adicionales de personajes nuevos sin modificar los existentes", @@ -1362,7 +1440,13 @@ "The character sheet of a Two-Players head shows the other head's class": "La hoja de personaje de una cabeza Two-Players muestra la clase de la otra cabeza", "Two-Players Ogres can fit a carried mount in a window and share the fit": "Los ogros Two-Players pueden ajustar una montura transportada en una ventana y compartir el ajuste", "Custom Races V2 with 17 new races, subclasses and the Fading Island": "Custom Races V2 con 17 razas nuevas, subclases y la Fading Island", - "Updated Custom Races to 2.0": "Custom Races se actualiza a 2.0" + "Updated Custom Races to 2.0": "Custom Races se actualiza a 2.0", + "Custom races stay on when an update changes the race catalog": "Las razas personalizadas siguen activas cuando una actualización cambia el catálogo de razas", + "Server support for companion bots on Wildcard and Warcraft Reborn": "Soporte del servidor para bots acompañantes en Wildcard y Warcraft Reborn", + "Custom-race characters stay out of the world while custom races are off": "Los personajes de razas personalizadas quedan fuera del mundo mientras esas razas están desactivadas", + "Companion bots play Wildcard and Warcraft Reborn": "Los bots acompañantes juegan en Wildcard y Warcraft Reborn", + "Stopping the server no longer leaves the world running now and then": "Detener el servidor ya no deja el mundo en marcha de vez en cuando", + "The server includes a native launcher for the world supervisor": "El servidor incluye un lanzador nativo para el supervisor del mundo" }, "zh": { "Restrict new characters by custom race without changing existing characters": "限制新角色可选的自定义种族,不影响现有角色", @@ -1650,7 +1734,13 @@ "The character sheet of a Two-Players head shows the other head's class": "Two-Players 头的角色面板会显示另一个头的职业", "Two-Players Ogres can fit a carried mount in a window and share the fit": "Two-Players 食人魔可以在窗口中调整携带的坐骑并共享调整结果", "Custom Races V2 with 17 new races, subclasses and the Fading Island": "Custom Races V2:17 个新种族、副职业和 Fading Island", - "Updated Custom Races to 2.0": "已将 Custom Races 更新至 2.0" + "Updated Custom Races to 2.0": "已将 Custom Races 更新至 2.0", + "Custom races stay on when an update changes the race catalog": "更新改变种族目录时,自定义种族保持开启", + "Server support for companion bots on Wildcard and Warcraft Reborn": "服务器支持 Wildcard 和 Warcraft Reborn 上的伙伴机器人", + "Custom-race characters stay out of the world while custom races are off": "自定义种族关闭时,该类角色无法进入世界", + "Companion bots play Wildcard and Warcraft Reborn": "伙伴机器人可在 Wildcard 和 Warcraft Reborn 中游戏", + "Stopping the server no longer leaves the world running now and then": "停止服务器时不再偶尔让世界继续运行", + "The server includes a native launcher for the world supervisor": "服务器附带用于世界监管程序的原生启动器" } } } diff --git a/src/data/server-history.json b/src/data/server-history.json index cdf65db..f84c21e 100644 --- a/src/data/server-history.json +++ b/src/data/server-history.json @@ -1988,6 +1988,437 @@ }, "experimentalFeatures": [], "compare": "https://github.com/Corfirean/coa-server-build/compare/server-0.261108.95...server-0.261114.106" + }, + { + "tag": "server-0.261115.110", + "version": "0.261115.110", + "date": "2026-11-15", + "url": "https://github.com/Corfirean/coa-server-build/releases/tag/server-0.261115.110", + "notes": [ + "Test build of the subclass module for two-headed Ogres", + "Thin Twins can earn a subclass through their own quest, the Bravery Badge", + "A two-headed Ogre's ranged subclass can shoot at point-blank range", + "Ogres have a new racial, Tolerance", + "Standard-class Ogres and Thin Humans start with only their own class kit", + "Helmets sit on the Thin Human's head instead of his chest", + "LiveMon shows live damage, healing, crowd control and subclass combo statistics", + "Standard-class Ogres and Thin Twins can take a CoA class as their subclass", + "Thin Human and Two-Headed Ogre are now their own playable races", + "Subclassed relic users can hold a relic beside a ranged weapon", + "Server options to limit subclassing or turn the two subclass races off", + "A standard subclass brings its whole basic kit, skills and weapons", + "Two-Headed Ogres and Thin Humans with a standard class can now pick a subclass", + "Thin Humans find more gold with the Hand-Me-Downs racial", + "Two-Headed Ogres wear helmets on both heads", + "Flying mounts no longer fly in Kalimdor and the Eastern Kingdoms", + "LiveMon's character tab can be closed and goes away for deleted characters", + "Classic classes can be limited to their Wrath of the Lich King abilities", + "Dual Wield shows once in the spellbook", + "Two-Headed Ogres get Subclass Bar 1 for the other head's spells", + "Subclass forms leave Two-Headed Ogres in their own body and turn the twin brother instead", + "CoA subclass trees show their specialization painting in the subclass tab", + "Characters with a subclass no longer get Dual Specialization", + "You can hold only one subclass book and one insight at a time", + "Thin Humans and Two-Headed Ogres get the quests of their starting zone", + "The Bravery Badge and the Book of Origins look and read like a badge and a book", + "Ghost Wolf and Travel Form turn the whole ogre, and the twin brother rides the beast", + "Standard-class mains can spend points in their subclass trees and reset main talents", + "Your subclass's trainer can reset only your subclass talents", + "The Thin Human's cape lies along his back instead of sticking out like a board", + "The twin brother finishes pointing before hopping off and readies his weapon with you", + "The twin brother fights with his melee weapon up close and sits close behind you on mounts", + "The twin brother copies your pose on hover discs, carpets and other unusual mounts", + "Two-Headed Ogres sit in cars and keep their mace drawn after a shot", + "Two-Headed Ogres fight with a weapon in one hand and a gun in the other", + "The Ogre's Agree or Disagree racial now shows what it will do next", + "The Thin Twins' brother turns into a worgen in every subclass Cursed Form", + "Leaps and charges ordered for the Thin Twins' brother move him instead of you", + "CoA classes taken as a subclass get their class mechanics", + "Thin Twins and Two-Headed Ogres keep their weapons in a subclass Cursed Form", + "Hovering a Guardian standard no longer causes a Lua error", + "LiveMon shows specialization names instead of their signature spells", + "Ogre eyes are picked by colour, with a Blind checkbox for each eye", + "Two-headed ogres no longer keep casting after a subclass spell with a cast time", + "Two-headed ogres cast every subclass spell with the left arm", + "The other half only shoots when you attack a target out of melee reach", + "The other head raises her hand while casting and your presses come first", + "Saving talent changes no longer fails for characters with a subclass", + "The second-way quest no longer pops up at level 20", + "Every race can create the standard classes the creation screen offers again", + "Subclass Bar 1 shows cooldowns, charges and casts like a normal action bar", + "Subclass Bar 1 refills itself when you change subclass", + "Subclass Bar 1 appears as soon as you choose a subclass", + "Subclass Bar 1 works like an action bar and can live in Bartender4", + "A subclass can never be the character's own class", + "New characters no longer inherit the subclass of a deleted character", + "Sun Cleric, Barbarian, Bloodmage and Cultist subclass resources use the game's own orbs", + "Shapeshifting no longer takes away the twin brother or the subclass", + "A subclass specialization now teaches the ability its passive promises", + "Subclass stances and forms appear only on the subclass stance bar", + "Subclass vows, auras and formations move to the subclass stance bar", + "The Thin Human's cape rests on his shoulders and moves with them", + "The twin brother gets a real spot in cars and rides along in passenger seats", + "The twin brother puts his weapons away while he wears a subclass shape", + "The Thin Twins' brother now shows the flash and glow of subclass forms", + "The twin brother sneaks along in stealth instead of staying behind", + "The stance button takes a Thin Twin out of a form his brother wears again", + "The Two-Head and Two-Thins tabs show one wide background and the right class icon", + "The Two-Head and Two-Thins trees use the game's own talent nodes", + "Agree or Disagree takes one spellbook slot that changes name and icon", + "Subclass talent trees no longer let you spend more points than you have", + "Your brother stays at your side when you melee with a bow equipped", + "A melee brother stays on your target and keeps fighting", + "The Two-Headed Ogre twists her body less while her other head casts", + "Thin Twins and Two-Headed Ogres are Hero Races that need a level 60 character", + "The Two-Headed Ogre's portrait shows both heads instead of her body", + "Your other half's spells break your stealth, and Running Wild ends when you stealth", + "Spells your other half casts now trigger the class's talents and resources", + "Your other half takes the subclass's Cat, Bear and stance forms on their own", + "Your other head or brother can no longer finish a cast while you run", + "The other head's hand glows while she casts", + "With Play Easy on, your other half uses abilities that cost health", + "New racial passives explain the shared and split resource pools", + "The dressing room works for races without their own background, no extra addon needed", + "Your brother climbs onto your Travel Form or wolf even after a fight", + "When your brother uses Running Wild, you ride on his back", + "In Running Wild you ride on your brother's shoulders", + "Your weapons no longer go missing after a Running Wild ride", + "When both halves use the same resource, their pool is twice as big", + "The subclass window shows every CoA class's own background at full strength", + "You can rearrange Subclass Bar 1 during combat without an error", + "Your other head or brother has a cast bar of their own", + "Choice talents in the subclass window show as one node with two options", + "SpellActivationOverlay can light up Subclass Bar 1", + "Your subclass's resource now shows as an extra bar under your portrait", + "Your other half's resource bar keeps its value when you log out and back in", + "Rage, energy and runic power subclasses now get and use their resource", + "Subclass resource orbs only appear when your subclass specialization can fill them", + "Your subclass specialization comes with its first class talent learned", + "Your main class's key stat now also powers your subclass", + "Subclass talents follow the paths and point requirements of their tree", + "Your summons follow your brother while he walks beside you", + "Your brother rides on the back of your Travel Form cat and moves with it", + "Dressing your twin in the wardrobe no longer causes an addon error", + "Your brother rides on your back in Wargstride", + "A Bloodmage subclass's Cursed Form no longer replaces your own action bar", + "Pressing an active subclass stance or form again turns it off", + "Character select shows your subclass under your class", + "The Two-Headed Ogre's second head no longer pokes through hats", + "Two-Headed Ogres keep aiming between shots instead of idling", + "Two-Headed Ogres who shoot rest their gun on the shoulder when not firing", + "Two-Headed Ogres who shoot themselves aim and fire their gun with the right hand", + "Two-Headed Ogres who shoot fire their bullets from the gun hand", + "The wardrobe shows a Two-Headed Ogre's applied look and her saved outfits apply again", + "The second head's quest mark floats over her head in cities and inns", + "Subclass Bar 1 no longer fills up with Throw, Shoot, Wand and Auto Attack", + "Abilities you learn from your subclass no longer land on your own action bars", + "A caster Two-Headed Ogre keeps her staff in hand while her second head shoots", + "A Two-Headed Ogre's staff keeps its size when she puts it on her back", + "A shooting subclass starts Auto Shot on right-click without logging out first", + "A Hunter subclass keeps Auto Shot going while the main head casts or moves", + "Weapons and armor from a subclass stay usable after logging in again", + "Two-Headed Ogres are Horde again and Thin Twins share Forgotten race rules", + "Thin Humans and Two-Headed Ogres can no longer be created as Hero", + "The Two-Headed Ogre stays in her combat stance between attacks", + "The second-head tab only shows for Two-Headed Ogres and Thin Twins", + "Thin Twins capes no longer show their inside at the shoulders", + "Thin Twins keep short hair under hats", + "Thin Twins keep their face, cape and hat fit with CoA Custom 1.9.2", + "Thin Twins show their class gear in character creation", + "Two-Headed Ogre capes drape over her back", + "CoA Custom 1.9.5 races work on the subclass server", + "With Play easy, cowboy the brother leaves a spent timed form", + "The Two-Headed Ogre casts with a raised fist before her face", + "The second-head client patch is now patch-ZZZZT.MPQ", + "Dual Wield shows once in the spellbook, whichever class teaches it", + "The subclass addon keeps working when the Twins or Ogre are renamed", + "The subclass name shows only on the character tab", + "The Thin Twins' Accursed brother keeps his distance until he takes his cursed form", + "The Thin Twins' brother follows a form's cost, cooldown and duration", + "The Thin Twins' own mana bar no longer flickers", + "Witch Hunter Vault now springs over in a handspring instead of a jump", + "The Twins brother keeps his timed form and no longer takes forms a spell forbids", + "The Twins brother faces his target, leaps in and leaves a form to heal you", + "With Play easy, cowboy, the brother uses his timed forms in a fight", + "Original races no longer look broken in the 64-bit client's character creation", + "Subclasses get their specialization's free passives, like the Pyromancer's draconic form", + "The subclass cast bar no longer gets stuck and can always be Alt-dragged", + "Pick-one talents in the subclass window no longer overlap their neighbours", + "Subclass spells get their rank upgrades, resources and class mechanics", + "Subclass talents that replace a spell now replace it for the subclass too", + "The Thin Twins keep their own hairstyle under hats", + "The Twins brother takes the look of the cursed form he actually uses", + "The Twins brother stands beside you at character select in his own clothes", + "The Twins brother climbs down from your back before taking a form", + "Spells the Twins brother casts no longer play a cast animation on you", + "The Thin Twins brother is now your mirror image", + "The Thin Twins brother can have his own face, hair style and beard", + "A script builds the original races' Vault patches from your own client files", + "The subclass client patch is now built after the release's own patches", + "The mirrored Thin Twins brother is built from the current Thin Twins model", + "Pressing your subclass mount again dismounts you", + "Removing a subclass dismisses the pet it let you summon", + "Removing a Warlock or Paladin subclass no longer unlearns your mounts", + "Removing a subclass no longer leaves its spells in your spellbook", + "A Starcaller subclass shows Lunar Phase as CoA's moon", + "Your twin's or other head's pet gets its own movable pet bar", + "A Ranged Head stands still while the Melee Head is offline", + "A bot plays the missing head of a Two-Players ogre", + "A Ranged Head keeps an echo of its deleted Melee Head's gear", + "Two-Players ogres hold books, pouches and orbs forward in the off hand", + "Two-Players ogres can pair up as Melee Head and Ranged Head", + "Paired Two-Players heads share one body", + "SquidBots Lite no longer prints \"Command 'dc status' does not exist\" at login", + "The subclass action bar no longer causes a blocked-action error in combat", + "Two-Players heads split their abilities into melee for the body and ranged for the rider", + "Two-Players heads gain Agree or Disagree stacks when they fight together", + "Two-Players heads can only be CoA classes", + "The Ranged Head's gear slots are frozen in ice and can no longer be dragged", + "Two-Players heads find the abilities they borrow on their own bar", + "Two-Players ogres can Bonk Heads! together once the heads have agreed long enough", + "Abilities lent between Two-Players heads follow each head's respecs and new spells", + "Two-Players ogres can use Mutate Me! to take the eyes-everywhere look and back", + "A Two-Players ogre fills one party spot and enters dungeons as one player", + "A Two-Players ogre joins a party only when there is room for both heads", + "A Ranged Head's own frame now stands for the shared Two-Players body", + "The Two-Players Ranged Head shares the body's health and both heads get full kill XP", + "The Two-Players Ranged Head shares the body's gear", + "Two-Players heads split quest gold, share one resource pool and keep their head's specs", + "Mobs attacked by the Two-Players Ranged Head now fight the body", + "Two-Players Twins: the second brother rides piggyback on the first, visible as himself", + "Bot plans panel shows what your group's bots are doing and lets you pick their next quest", + "Questing bots do all their quests in one area before moving on", + "The Twins' second brother keeps and wears his own gear on his brother's back", + "A Two-Players twin can call his brother to his side until another player joins him", + "Agree now raises spell and ranged hit too, not only melee hit", + "Two-Players ogres drop their mount when either head attacks", + "The other head's abilities now go on your own action bars", + "A bot body keeps questing, looting and resting after a fight instead of standing still", + "A bot body's SquidBots menu now opens from a button on your own player frame", + "Character select shows a Two-Players head's joined name and its partner's class", + "The Ranged Head now goes into and out of Dungeon Finder dungeons with the body", + "Two-Players can be switched off with Subclass.TwoPlayers.Enable", + "The other head's abilities only cost you resources when they actually go off", + "Character select shows a Two-Players ogre in his Mutate Me look", + "The Ranged Head gets the enchant, gem and suffix stats of the shared gear", + "The Ranged Head of a Two-Headed Ogre no longer pops out of the body at logout", + "A Ranged Head and its bot body are in one party again, so party chat and bot orders work", + "A bot riding as the Ranged Head no longer rests, roams or makes the body sit down", + "The character sheet of a Two-Players head shows the other head's class", + "Two-Players Ogres can fit a carried mount in a window and share the fit", + "Custom Races V2 with 17 new races, subclasses and the Fading Island", + "Updated Custom Races to 2.0" + ], + "snapshot": "d3d10476d144d2a701a5a122f1f249ff8219f7a6324e007cb3e153d4628973f7", + "components": { + "upstream": { + "repository": "jealous-sound/azerothcore-wotlk-coa", + "ref": "96afaf0f51cc4b37f1eba282bffb1c5aab353de6", + "sha": "96afaf0f51cc4b37f1eba282bffb1c5aab353de6" + }, + "core": { + "repository": "Corfirean/azerothcore-wotlk-coa", + "ref": "9740ced5c41806115d851ab37ab34f28e1e8b712", + "sha": "9740ced5c41806115d851ab37ab34f28e1e8b712" + }, + "bots": { + "repository": "Corfirean/mod-coa-playerbots", + "ref": "30a5a555f56fda8f4ccad14be8438bd0532d85b9", + "sha": "30a5a555f56fda8f4ccad14be8438bd0532d85b9" + }, + "scaling": { + "repository": "Corfirean/mod-coa-content-scaling", + "ref": "3c2febf636bd09087bb278e381b975271a70fdf6", + "sha": "3c2febf636bd09087bb278e381b975271a70fdf6" + }, + "manager": { + "repository": "Corfirean/coa-server-manager", + "ref": "d3527312803fb5a3e1cd48e01496645a8bbc9dcf", + "sha": "d3527312803fb5a3e1cd48e01496645a8bbc9dcf" + }, + "races": { + "repository": "ilusixn/CustomRacesCoa", + "ref": "coa-custom-2.0", + "sha": "dae0c661f7197bafd0a42d80866fa8709b3792c9", + "assets": [ + { + "name": "CoA-Custom-Races-V2-Credits.csv", + "size": 5487, + "digest": "sha256:9afb0b777498d14601476bed7ce82a449ce2b80af5dae107f7309081c1936882", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-Races-V2-Credits.csv" + }, + { + "name": "CoA-Custom-Races-V2-Credits.xlsx", + "size": 10129, + "digest": "sha256:d24b51f42870e9ab370279e37ea1cd894b7a208cb8960548c0f465222d50c850", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-Races-V2-Credits.xlsx" + }, + { + "name": "CoA-Custom-V2-Client-1.zip", + "size": 1513021586, + "digest": "sha256:a9dd51ed2d90fb048d549602f40f5429d56e2df0df5606a38781b358fa369568", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-1.zip" + }, + { + "name": "CoA-Custom-V2-Client-2.zip", + "size": 1198283005, + "digest": "sha256:ab084a55509ccbcc2977a06dd0c01fa879973a1892baaacaeb3ff52f3dfc750e", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-2.zip" + }, + { + "name": "CoA-Custom-V2-Client-3.zip", + "size": 1671130705, + "digest": "sha256:0af34199f0739ce086adb0371d3de7c1a0f5ca9c62ecde6b0efe9286e33874a8", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-3.zip" + }, + { + "name": "CoA-Custom-V2-Client-4.zip", + "size": 502385128, + "digest": "sha256:e0bd87172af989fa50a8e2b08ba4321c72b6265047482f051a1db3b80d55bcaa", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-4.zip" + }, + { + "name": "CoA-Custom-V2-Client-5.zip", + "size": 168079711, + "digest": "sha256:73364ad1b58c6342641a848a3b20a835472834f600416606be1470386774ca78", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-5.zip" + }, + { + "name": "CoA-Custom-V2-Client-6.zip", + "size": 1881526537, + "digest": "sha256:91db79b7b451856fa9e45daea52e0fe1c04676653dd8a88e6627f04ee7b47759", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-6.zip" + }, + { + "name": "CoA-Custom-V2-Client-7.zip", + "size": 734725114, + "digest": "sha256:4c5532d775d206a3b913a6111040bb96b95c683b74c08a6131ed9f38db8e2b39", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-7.zip" + }, + { + "name": "CoA-Custom-V2-Client-8.zip", + "size": 734216670, + "digest": "sha256:bdaa1d047e8767bd5715f1e8465d116220597d9c135a43e2dda02e12ce2e5526", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-8.zip" + }, + { + "name": "CoA-Custom-V2-Client-9.zip", + "size": 195235400, + "digest": "sha256:0764893543084a12d15578fe734f66ba4519740794a6b3b3a38a08594c38c640", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-9.zip" + }, + { + "name": "CoA-Custom-V2-Server.zip", + "size": 63983587, + "digest": "sha256:8970d61eea40f53cea4c27481edd85d2b2647cd32eb88932e0077da3b4a77d23", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Server.zip" + }, + { + "name": "creation-screen.png", + "size": 2139517, + "digest": "sha256:84c3144f34ef8015e8612e412da03383241124d58e36c703eeb2a525096a5795", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/creation-screen.png" + }, + { + "name": "INSTALL-GUIDE.txt", + "size": 2504, + "digest": "sha256:da402117a90a60a029fdce9a94125ddd28b386a73f37c180992befca57e9f13a", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/INSTALL-GUIDE.txt" + }, + { + "name": "PATCH-NOTES-V2.txt", + "size": 4388, + "digest": "sha256:82901d54b1f13cd8b2e7a73a7c2fdc3e237f8090c332729bc553818834fe27d0", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/PATCH-NOTES-V2.txt" + }, + { + "name": "RACES.md", + "size": 8629, + "digest": "sha256:1e7a9aaee354b07924a8cdda5e4dbffe4cad88f215d68efb74d8d0832403422d", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/RACES.md" + }, + { + "name": "SHA256SUMS.txt", + "size": 938, + "digest": "sha256:a68591f04d661b558523133f99411fd4a7e32f1b45f79f977bb0989246f11179", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/SHA256SUMS.txt" + }, + { + "name": "showcase.mp4", + "size": 81658913, + "digest": "sha256:a3d4b4f561bb12dcc91da562c5ee79157143f4b67997479edb2152b27b925a2a", + "url": "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/showcase.mp4" + } + ], + "server": [ + { + "repository": "stefanw1337/azerothcore-wotlk-coa", + "branch": "stefanw1337-subclassing-test", + "sha": "ccea52d17a27482784e705e9cc913b68dedd9f85" + } + ], + "provenance": [ + { + "repository": "ilusixn/Fading-Islands-Restore", + "sha": "e150de1cb496314af752e98021e57ca93d5d799d", + "used": "server/core-patches" + }, + { + "repository": "ilusixn/Custom-Race-3.3.5a", + "sha": "ac907655bd43dec2eff1b4ff509f7fb574325c58", + "used": "server/core racials" + }, + { + "repository": "ilusixn/ilusixn-dev-menu", + "sha": "ea50a8533a3402c69c8773677db1027ec1180d2c", + "used": "modules/mod-ilusixn-devmenu" + } + ] + }, + "squid": { + "repository": "Zyth45/mod-playerbots", + "ref": "v3.0", + "sha": "4ef5ed9ebe75a330de7df19639a042391e037e15", + "patch": "patches/squid-coa-validation.patch", + "patchSha256": "2cc45bc6555d5bb3e91728840f9de6e73c002c73b270a37732a1499956241c5f" + }, + "build": { + "repository": "Corfirean/coa-server-build", + "ref": "9a122d049e8be457444389e9756936bcdb4e7ef5", + "sha": "9a122d049e8be457444389e9756936bcdb4e7ef5" + }, + "dungeon-clear": { + "repository": "Zyth45/mod-dungeon-clear", + "sha": "6efb59eae96bcc0730fc083314dd28d55970bbf4", + "patch": "patches/dungeon-clear-coa-validation.patch", + "patchSha256": "2845d389422e3a59e5c186ecf54b03f64f1dcc22cdef15729b60c354ae72cd6f", + "ref": "6efb59eae96bcc0730fc083314dd28d55970bbf4" + }, + "navigation": { + "repository": "Corfirean/azerothcore-wotlk-coa", + "ref": "8b44099f480af0b69c6dfc697e4d388e865e9ffc", + "sha": "8b44099f480af0b69c6dfc697e4d388e865e9ffc", + "sourceRelease": "navigation-20261012", + "manifestSha256": "7f28600735f115792e79a5e8d1c8d78a83a8f5ed14a090c6d87268e49c2bb683", + "archiveSha256": "aa1347a095f85af44b4f592270a0e9314954801fda4578f0147f847e32c24a60", + "assets": [ + { + "name": "navigation.zip.001", + "size": 1500000000, + "sha256": "e3a93903fc8155ee0d92db399ec426769c360bef87c44c07beb7e21cfd892c18", + "url": "https://github.com/Corfirean/coa-server-build/releases/download/navigation-20261012/navigation.zip.001" + }, + { + "name": "navigation.zip.002", + "size": 1377006470, + "sha256": "c1af26ba7f83676278613076c357c4da0a11cfa6ae1ff00003479057c4864471", + "url": "https://github.com/Corfirean/coa-server-build/releases/download/navigation-20261012/navigation.zip.002" + } + ] + } + }, + "experimentalFeatures": [], + "compare": "https://github.com/Corfirean/coa-server-build/compare/server-0.261114.106...server-0.261115.110" } ] } diff --git a/tools/reviewed-manager-notes.json b/tools/reviewed-manager-notes.json index b341db6..5ca1f99 100644 --- a/tools/reviewed-manager-notes.json +++ b/tools/reviewed-manager-notes.json @@ -1,6 +1,17 @@ { - "version": "0.9.13", + "version": "0.9.14", "notes": [ - "The custom races client is updated to Custom Races V2" + "Install community addons from the Manager", + "Old item and creature data is cleared before every Play", + "Turning the custom races client patch on or off takes seconds again", + "The database moves to a free port when Windows reserves or another program takes 3307", + "Your own MySQL settings survive restarts and updates", + "Disabled custom races stay disabled after a server update that adds races", + "Rename your realms in the Manager", + "The account for a friend's server is in the login box at every Play", + "Restart the world every day at a chosen time", + "Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu", + "Companion bots on Wildcard and Warcraft Reborn", + "The Custom Races card tells which characters stay out while races are off" ] -} \ No newline at end of file +} diff --git a/tools/reviewed-server-notes.json b/tools/reviewed-server-notes.json index 383a26c..1348be0 100644 --- a/tools/reviewed-server-notes.json +++ b/tools/reviewed-server-notes.json @@ -2,7 +2,7 @@ "components": { "core": { "repository": "Corfirean/azerothcore-wotlk-coa", - "sha": "9740ced5c41806115d851ab37ab34f28e1e8b712" + "sha": "30003e18ab44198ee6f2d819c3047bf6a80631f6" }, "upstream": { "repository": "jealous-sound/azerothcore-wotlk-coa", @@ -10,7 +10,7 @@ }, "bots": { "repository": "Corfirean/mod-coa-playerbots", - "sha": "30a5a555f56fda8f4ccad14be8438bd0532d85b9" + "sha": "178a7fde6abe1c3c8813d338073b2c83835da497" }, "scaling": { "repository": "Corfirean/mod-coa-content-scaling", @@ -18,7 +18,7 @@ }, "build": { "repository": "Corfirean/coa-server-build", - "sha": "9a122d049e8be457444389e9756936bcdb4e7ef5" + "sha": "087ca17c4eb2c0ef218d84dd77f37263ee4ed7ee" }, "squid": { "repository": "Zyth45/mod-playerbots", @@ -32,218 +32,11 @@ } }, "notes": [ - "Test build of the subclass module for two-headed Ogres", - "Thin Twins can earn a subclass through their own quest, the Bravery Badge", - "A two-headed Ogre's ranged subclass can shoot at point-blank range", - "Ogres have a new racial, Tolerance", - "Standard-class Ogres and Thin Humans start with only their own class kit", - "Helmets sit on the Thin Human's head instead of his chest", - "LiveMon shows live damage, healing, crowd control and subclass combo statistics", - "Standard-class Ogres and Thin Twins can take a CoA class as their subclass", - "Thin Human and Two-Headed Ogre are now their own playable races", - "Subclassed relic users can hold a relic beside a ranged weapon", - "Server options to limit subclassing or turn the two subclass races off", - "A standard subclass brings its whole basic kit, skills and weapons", - "Two-Headed Ogres and Thin Humans with a standard class can now pick a subclass", - "Thin Humans find more gold with the Hand-Me-Downs racial", - "Two-Headed Ogres wear helmets on both heads", - "Flying mounts no longer fly in Kalimdor and the Eastern Kingdoms", - "LiveMon's character tab can be closed and goes away for deleted characters", - "Classic classes can be limited to their Wrath of the Lich King abilities", - "Dual Wield shows once in the spellbook", - "Two-Headed Ogres get Subclass Bar 1 for the other head's spells", - "Subclass forms leave Two-Headed Ogres in their own body and turn the twin brother instead", - "CoA subclass trees show their specialization painting in the subclass tab", - "Characters with a subclass no longer get Dual Specialization", - "You can hold only one subclass book and one insight at a time", - "Thin Humans and Two-Headed Ogres get the quests of their starting zone", - "The Bravery Badge and the Book of Origins look and read like a badge and a book", - "Ghost Wolf and Travel Form turn the whole ogre, and the twin brother rides the beast", - "Standard-class mains can spend points in their subclass trees and reset main talents", - "Your subclass's trainer can reset only your subclass talents", - "The Thin Human's cape lies along his back instead of sticking out like a board", - "The twin brother finishes pointing before hopping off and readies his weapon with you", - "The twin brother fights with his melee weapon up close and sits close behind you on mounts", - "The twin brother copies your pose on hover discs, carpets and other unusual mounts", - "Two-Headed Ogres sit in cars and keep their mace drawn after a shot", - "Two-Headed Ogres fight with a weapon in one hand and a gun in the other", - "The Ogre's Agree or Disagree racial now shows what it will do next", - "The Thin Twins' brother turns into a worgen in every subclass Cursed Form", - "Leaps and charges ordered for the Thin Twins' brother move him instead of you", - "CoA classes taken as a subclass get their class mechanics", - "Thin Twins and Two-Headed Ogres keep their weapons in a subclass Cursed Form", - "Hovering a Guardian standard no longer causes a Lua error", - "LiveMon shows specialization names instead of their signature spells", - "Ogre eyes are picked by colour, with a Blind checkbox for each eye", - "Two-headed ogres no longer keep casting after a subclass spell with a cast time", - "Two-headed ogres cast every subclass spell with the left arm", - "The other half only shoots when you attack a target out of melee reach", - "The other head raises her hand while casting and your presses come first", - "Saving talent changes no longer fails for characters with a subclass", - "The second-way quest no longer pops up at level 20", - "Every race can create the standard classes the creation screen offers again", - "Subclass Bar 1 shows cooldowns, charges and casts like a normal action bar", - "Subclass Bar 1 refills itself when you change subclass", - "Subclass Bar 1 appears as soon as you choose a subclass", - "Subclass Bar 1 works like an action bar and can live in Bartender4", - "A subclass can never be the character's own class", - "New characters no longer inherit the subclass of a deleted character", - "Sun Cleric, Barbarian, Bloodmage and Cultist subclass resources use the game's own orbs", - "Shapeshifting no longer takes away the twin brother or the subclass", - "A subclass specialization now teaches the ability its passive promises", - "Subclass stances and forms appear only on the subclass stance bar", - "Subclass vows, auras and formations move to the subclass stance bar", - "The Thin Human's cape rests on his shoulders and moves with them", - "The twin brother gets a real spot in cars and rides along in passenger seats", - "The twin brother puts his weapons away while he wears a subclass shape", - "The Thin Twins' brother now shows the flash and glow of subclass forms", - "The twin brother sneaks along in stealth instead of staying behind", - "The stance button takes a Thin Twin out of a form his brother wears again", - "The Two-Head and Two-Thins tabs show one wide background and the right class icon", - "The Two-Head and Two-Thins trees use the game's own talent nodes", - "Agree or Disagree takes one spellbook slot that changes name and icon", - "Subclass talent trees no longer let you spend more points than you have", - "Your brother stays at your side when you melee with a bow equipped", - "A melee brother stays on your target and keeps fighting", - "The Two-Headed Ogre twists her body less while her other head casts", - "Thin Twins and Two-Headed Ogres are Hero Races that need a level 60 character", - "The Two-Headed Ogre's portrait shows both heads instead of her body", - "Your other half's spells break your stealth, and Running Wild ends when you stealth", - "Spells your other half casts now trigger the class's talents and resources", - "Your other half takes the subclass's Cat, Bear and stance forms on their own", - "Your other head or brother can no longer finish a cast while you run", - "The other head's hand glows while she casts", - "With Play Easy on, your other half uses abilities that cost health", - "New racial passives explain the shared and split resource pools", - "The dressing room works for races without their own background, no extra addon needed", - "Your brother climbs onto your Travel Form or wolf even after a fight", - "When your brother uses Running Wild, you ride on his back", - "In Running Wild you ride on your brother's shoulders", - "Your weapons no longer go missing after a Running Wild ride", - "When both halves use the same resource, their pool is twice as big", - "The subclass window shows every CoA class's own background at full strength", - "You can rearrange Subclass Bar 1 during combat without an error", - "Your other head or brother has a cast bar of their own", - "Choice talents in the subclass window show as one node with two options", - "SpellActivationOverlay can light up Subclass Bar 1", - "Your subclass's resource now shows as an extra bar under your portrait", - "Your other half's resource bar keeps its value when you log out and back in", - "Rage, energy and runic power subclasses now get and use their resource", - "Subclass resource orbs only appear when your subclass specialization can fill them", - "Your subclass specialization comes with its first class talent learned", - "Your main class's key stat now also powers your subclass", - "Subclass talents follow the paths and point requirements of their tree", - "Your summons follow your brother while he walks beside you", - "Your brother rides on the back of your Travel Form cat and moves with it", - "Dressing your twin in the wardrobe no longer causes an addon error", - "Your brother rides on your back in Wargstride", - "A Bloodmage subclass's Cursed Form no longer replaces your own action bar", - "Pressing an active subclass stance or form again turns it off", - "Character select shows your subclass under your class", - "The Two-Headed Ogre's second head no longer pokes through hats", - "Two-Headed Ogres keep aiming between shots instead of idling", - "Two-Headed Ogres who shoot rest their gun on the shoulder when not firing", - "Two-Headed Ogres who shoot themselves aim and fire their gun with the right hand", - "Two-Headed Ogres who shoot fire their bullets from the gun hand", - "The wardrobe shows a Two-Headed Ogre's applied look and her saved outfits apply again", - "The second head's quest mark floats over her head in cities and inns", - "Subclass Bar 1 no longer fills up with Throw, Shoot, Wand and Auto Attack", - "Abilities you learn from your subclass no longer land on your own action bars", - "A caster Two-Headed Ogre keeps her staff in hand while her second head shoots", - "A Two-Headed Ogre's staff keeps its size when she puts it on her back", - "A shooting subclass starts Auto Shot on right-click without logging out first", - "A Hunter subclass keeps Auto Shot going while the main head casts or moves", - "Weapons and armor from a subclass stay usable after logging in again", - "Two-Headed Ogres are Horde again and Thin Twins share Forgotten race rules", - "Thin Humans and Two-Headed Ogres can no longer be created as Hero", - "The Two-Headed Ogre stays in her combat stance between attacks", - "The second-head tab only shows for Two-Headed Ogres and Thin Twins", - "Thin Twins capes no longer show their inside at the shoulders", - "Thin Twins keep short hair under hats", - "Thin Twins keep their face, cape and hat fit with CoA Custom 1.9.2", - "Thin Twins show their class gear in character creation", - "Two-Headed Ogre capes drape over her back", - "CoA Custom 1.9.5 races work on the subclass server", - "With Play easy, cowboy the brother leaves a spent timed form", - "The Two-Headed Ogre casts with a raised fist before her face", - "The second-head client patch is now patch-ZZZZT.MPQ", - "Dual Wield shows once in the spellbook, whichever class teaches it", - "The subclass addon keeps working when the Twins or Ogre are renamed", - "The subclass name shows only on the character tab", - "The Thin Twins' Accursed brother keeps his distance until he takes his cursed form", - "The Thin Twins' brother follows a form's cost, cooldown and duration", - "The Thin Twins' own mana bar no longer flickers", - "Witch Hunter Vault now springs over in a handspring instead of a jump", - "The Twins brother keeps his timed form and no longer takes forms a spell forbids", - "The Twins brother faces his target, leaps in and leaves a form to heal you", - "With Play easy, cowboy, the brother uses his timed forms in a fight", - "Original races no longer look broken in the 64-bit client's character creation", - "Subclasses get their specialization's free passives, like the Pyromancer's draconic form", - "The subclass cast bar no longer gets stuck and can always be Alt-dragged", - "Pick-one talents in the subclass window no longer overlap their neighbours", - "Subclass spells get their rank upgrades, resources and class mechanics", - "Subclass talents that replace a spell now replace it for the subclass too", - "The Thin Twins keep their own hairstyle under hats", - "The Twins brother takes the look of the cursed form he actually uses", - "The Twins brother stands beside you at character select in his own clothes", - "The Twins brother climbs down from your back before taking a form", - "Spells the Twins brother casts no longer play a cast animation on you", - "The Thin Twins brother is now your mirror image", - "The Thin Twins brother can have his own face, hair style and beard", - "A script builds the original races' Vault patches from your own client files", - "The subclass client patch is now built after the release's own patches", - "The mirrored Thin Twins brother is built from the current Thin Twins model", - "Pressing your subclass mount again dismounts you", - "Removing a subclass dismisses the pet it let you summon", - "Removing a Warlock or Paladin subclass no longer unlearns your mounts", - "Removing a subclass no longer leaves its spells in your spellbook", - "A Starcaller subclass shows Lunar Phase as CoA's moon", - "Your twin's or other head's pet gets its own movable pet bar", - "A Ranged Head stands still while the Melee Head is offline", - "A bot plays the missing head of a Two-Players ogre", - "A Ranged Head keeps an echo of its deleted Melee Head's gear", - "Two-Players ogres hold books, pouches and orbs forward in the off hand", - "Two-Players ogres can pair up as Melee Head and Ranged Head", - "Paired Two-Players heads share one body", - "SquidBots Lite no longer prints \"Command 'dc status' does not exist\" at login", - "The subclass action bar no longer causes a blocked-action error in combat", - "Two-Players heads split their abilities into melee for the body and ranged for the rider", - "Two-Players heads gain Agree or Disagree stacks when they fight together", - "Two-Players heads can only be CoA classes", - "The Ranged Head's gear slots are frozen in ice and can no longer be dragged", - "Two-Players heads find the abilities they borrow on their own bar", - "Two-Players ogres can Bonk Heads! together once the heads have agreed long enough", - "Abilities lent between Two-Players heads follow each head's respecs and new spells", - "Two-Players ogres can use Mutate Me! to take the eyes-everywhere look and back", - "A Two-Players ogre fills one party spot and enters dungeons as one player", - "A Two-Players ogre joins a party only when there is room for both heads", - "A Ranged Head's own frame now stands for the shared Two-Players body", - "The Two-Players Ranged Head shares the body's health and both heads get full kill XP", - "The Two-Players Ranged Head shares the body's gear", - "Two-Players heads split quest gold, share one resource pool and keep their head's specs", - "Mobs attacked by the Two-Players Ranged Head now fight the body", - "Two-Players Twins: the second brother rides piggyback on the first, visible as himself", - "Bot plans panel shows what your group's bots are doing and lets you pick their next quest", - "Questing bots do all their quests in one area before moving on", - "The Twins' second brother keeps and wears his own gear on his brother's back", - "A Two-Players twin can call his brother to his side until another player joins him", - "Agree now raises spell and ranged hit too, not only melee hit", - "Two-Players ogres drop their mount when either head attacks", - "The other head's abilities now go on your own action bars", - "A bot body keeps questing, looting and resting after a fight instead of standing still", - "A bot body's SquidBots menu now opens from a button on your own player frame", - "Character select shows a Two-Players head's joined name and its partner's class", - "The Ranged Head now goes into and out of Dungeon Finder dungeons with the body", - "Two-Players can be switched off with Subclass.TwoPlayers.Enable", - "The other head's abilities only cost you resources when they actually go off", - "Character select shows a Two-Players ogre in his Mutate Me look", - "The Ranged Head gets the enchant, gem and suffix stats of the shared gear", - "The Ranged Head of a Two-Headed Ogre no longer pops out of the body at logout", - "A Ranged Head and its bot body are in one party again, so party chat and bot orders work", - "A bot riding as the Ranged Head no longer rests, roams or makes the body sit down", - "The character sheet of a Two-Players head shows the other head's class", - "Two-Players Ogres can fit a carried mount in a window and share the fit", - "Custom Races V2 with 17 new races, subclasses and the Fading Island", - "Updated Custom Races to 2.0" + "Custom races stay on when an update changes the race catalog", + "Server support for companion bots on Wildcard and Warcraft Reborn", + "Custom-race characters stay out of the world while custom races are off", + "Companion bots play Wildcard and Warcraft Reborn", + "Stopping the server no longer leaves the world running now and then", + "The server includes a native launcher for the world supervisor" ] -} \ No newline at end of file +}