Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e62be5097 |
No files matched your search
@@ -6,7 +6,7 @@ on:
|
||||
pull_request:
|
||||
paths: [tools/sync_history.py, tools/test_sync_history.py, changelog/history.json, .github/workflows/changelog.yml]
|
||||
release:
|
||||
types: [published, prereleased, released]
|
||||
types: [published, released]
|
||||
workflow_run:
|
||||
workflows: [release]
|
||||
types: [completed]
|
||||
|
||||
@@ -31,10 +31,6 @@ Optional: one short paragraph in plain English for the reader (at most 300 chara
|
||||
|
||||
## Shared build and release workflow
|
||||
|
||||
Every published Manager version, including a clearly marked Pre-release, belongs in this repository's
|
||||
CHANGELOG.md and changelog/history.json. Its GitHub release notes use the same reviewed record.
|
||||
Promotion updates that entry without duplicating it; Manager and server histories remain separate.
|
||||
|
||||
Before preparing or publishing a Manager/server release, read the maintained
|
||||
[release runbook](https://github.com/Corfirean/coa-server-build/blob/main/docs/server-release.md)
|
||||
and [build agent instructions](https://github.com/Corfirean/coa-server-build/blob/main/AGENTS.md).
|
||||
|
||||
@@ -4,29 +4,8 @@ Manager releases only. Updating the Manager does not update the server.
|
||||
|
||||
[Server changelog](https://github.com/Corfirean/coa-server-build/blob/main/CHANGELOG.md)
|
||||
|
||||
Published releases and previews. Pre-release entries do not change the stable update channel.
|
||||
|
||||
Dates follow GitHub publication (UTC); legacy records retain their archived dates. Newest releases first.
|
||||
|
||||
## 0.7.0 — 2026-10-21
|
||||
|
||||
Portable transfers into Warcraft Reborn are not supported yet.
|
||||
|
||||
**Portable Characters are experimental and may contain bugs.**
|
||||
|
||||
- Keep portable characters and their saved versions in the Manager, and use them on compatible realms.
|
||||
- Make an existing character portable from a connected realm.
|
||||
- Browse public realms and see their connection details.
|
||||
- Link an existing realm account or create one on hosts that allow it.
|
||||
- Switch between CoA, Wildcard and Warcraft Reborn realm profiles on supported server builds.
|
||||
- Adjust creature health for different locations and enemy types in Content Scaling.
|
||||
- Switch Custom Races patches faster, with visible feedback while changes are applied.
|
||||
- Handle Windows requests for administrator permission when launching the game.
|
||||
|
||||
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.7.0) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.6.22...v0.7.0)
|
||||
|
||||
[Player guides and screenshots](https://github.com/Corfirean/coa-server-manager/tree/d22ff09ac6fd7628aac14d90ec23f547cd9b4bf1/docs)
|
||||
|
||||
## 0.6.22 — 2026-10-19
|
||||
|
||||
- Updated Custom Races client patches to 1.8.
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
# CoA Server Manager
|
||||
|
||||
**Portable characters are experimental.** This feature is in active development and may contain bugs.
|
||||
|
||||
A Windows app that installs and runs your own **Conquest of Azeroth** server (AzerothCore) with a few clicks:
|
||||
no console, no config files, no database tools. Tauri 2 + Rust + React.
|
||||
|
||||

|
||||

|
||||
|
||||
## What it does
|
||||
|
||||
* **Portable characters (Experimental).** Keep saved characters in the Manager, review their saved versions and make an existing character portable from a realm you can access. See the [short guide](docs/PORTABLE-CHARACTERS.md).
|
||||
* **Find a realm.** Browse public realms and compare their game modes, level caps, rates, modules and population.
|
||||
* **One-click install.** Downloads a signed, verified server package (resumable, checked file by file), sets up the
|
||||
database and creates your first account. Or import a server you already have.
|
||||
* **Start / Stop / PLAY.** One button for the whole server (database, auth, world) with live status, uptime and
|
||||
@@ -43,22 +39,17 @@ no console, no config files, no database tools. Tauri 2 + Rust + React.
|
||||
supports LAN, direct and private-network (Tailscale) play, with step-by-step guides and a package to send to friends.
|
||||
* **Updates to the Manager itself** download in the background and install when you close it. Your servers are never
|
||||
stopped or changed by a Manager update.
|
||||
* **Languages:** English, Russian, German, French, Spanish, Simplified Chinese.
|
||||
* **Languages:** English, Russian, German, French, Spanish.
|
||||
|
||||
## See the Manager
|
||||
| Install | Ready |
|
||||
|---------|-------|
|
||||
|  |  |
|
||||
|
||||
| Portable characters (Experimental) | Public realms |
|
||||
|---|---|
|
||||
|  |  |
|
||||
| Overview | Server updates |
|
||||
|----------|----------------|
|
||||
|  |  |
|
||||
|
||||
| Companions | Backups |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|
||||
The full gallery also covers setup, modules, game clients, playing with friends and making an existing character portable.
|
||||
|
||||
|
||||
[Browse the screenshot gallery](docs/SCREENSHOTS.md).
|
||||

|
||||
|
||||
## Install
|
||||
|
||||
@@ -73,13 +64,9 @@ Manager and server updates have separate version histories.
|
||||
|
||||
## Status
|
||||
|
||||
**In active development.** Bugs may still occur. If you run into a problem, please [open an issue](https://github.com/Corfirean/coa-server-manager/issues/new/choose).
|
||||
|
||||
### Known Limitations
|
||||
* **Native client login prefill**: Ascension's 3.3.5 client does not accept command-line credentials; users type their password once or link an existing account.
|
||||
* **Non-Windows SecretStore**: Windows uses DPAPI (`CryptProtectData`) with domain separation entropy. On Linux/macOS, keys fall back to strict 0600 file permissions.
|
||||
* **Direct to Relay migration**: Established direct TCP sessions cannot migrate mid-stream to Relay; network breaks trigger automatic fallback on the next JOIN.
|
||||
* **WorkerThreads**: `CharacterDatabase.WorkerThreads` must be set to `1` (the default) for safe remote portable character imports.
|
||||
Phases 0–10 of the plan in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) are done: foundation, import, start/stop,
|
||||
config engine, backups, clean install from signed packages, updates, companions, client launch, friends, polish.
|
||||
Remaining work (translation review by native speakers, optional extras) is listed in section 9 of that document. Translation notes: [docs/TRANSLATIONS.md](docs/TRANSLATIONS.md).
|
||||
|
||||
## Develop
|
||||
```
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
area: manager
|
||||
type: added
|
||||
audience: admins
|
||||
title: Module settings for Content Scaling include creature health
|
||||
---
|
||||
The Content Scaling page now has five health multipliers: for the open world, dungeons and raids, and for ordinary mobs and bosses. They multiply the health the scaling already gives creatures (1 keeps the normal balance, lower is easier, 0.1 to 10) and need a server build that includes the matching Content Scaling settings.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
area: manager
|
||||
type: added
|
||||
audience: admins
|
||||
title: Warcraft Reborn can now be created and selected as a separate realm
|
||||
---
|
||||
Warcraft Reborn has separate characters and settings, shares accounts, and is included in backups, updates and database checks. A server build with Warcraft Reborn support is required.
|
||||
@@ -112,14 +112,7 @@
|
||||
"Corfirean/coa-server-manager:20261016-preserve-core-migration-history.md",
|
||||
"Corfirean/coa-server-manager:20261016-shared-auth-migration-history.md",
|
||||
"Corfirean/coa-server-manager:20261016-update-compatibility-wording.md",
|
||||
"Corfirean/coa-server-manager:20261018-custom-races-client.md",
|
||||
"Corfirean/coa-server-manager:20261019-portable-stop-diagnostics.md",
|
||||
"Corfirean/coa-server-manager:20261019-remote-character-class-names.md",
|
||||
"Corfirean/coa-server-manager:20261020-client-elevation.md",
|
||||
"Corfirean/coa-server-manager:20261021-custom-races-switching.md",
|
||||
"Corfirean/coa-server-manager:20261021-portable-experimental.md",
|
||||
"Corfirean/coa-server-manager:20261021-scaling-health-settings.md",
|
||||
"Corfirean/coa-server-manager:20261021-warcraft-reborn-realm.md"
|
||||
"Corfirean/coa-server-manager:20261018-custom-races-client.md"
|
||||
],
|
||||
"releases": [
|
||||
{
|
||||
@@ -578,31 +571,6 @@
|
||||
"Existing client files are preserved when installing or removing race patches"
|
||||
],
|
||||
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.21...v0.6.22"
|
||||
},
|
||||
{
|
||||
"tag": "v0.7.0",
|
||||
"version": "0.7.0",
|
||||
"date": "2026-10-21",
|
||||
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.7.0",
|
||||
"notes": [
|
||||
"Keep portable characters and their saved versions in the Manager, and use them on compatible realms",
|
||||
"Make an existing character portable from a connected realm",
|
||||
"Browse public realms and see their connection details",
|
||||
"Link an existing realm account or create one on hosts that allow it",
|
||||
"Switch between CoA, Wildcard and Warcraft Reborn realm profiles on supported server builds",
|
||||
"Adjust creature health for different locations and enemy types in Content Scaling",
|
||||
"Switch Custom Races patches faster, with visible feedback while changes are applied",
|
||||
"Handle Windows requests for administrator permission when launching the game"
|
||||
],
|
||||
"commit": "d22ff09ac6fd7628aac14d90ec23f547cd9b4bf1",
|
||||
"experimentalFeatures": [
|
||||
"portable-characters"
|
||||
],
|
||||
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.6.22...v0.7.0",
|
||||
"notice": "Portable transfers into Warcraft Reborn are not supported yet.",
|
||||
"links": [
|
||||
"[Player guides and screenshots](https://github.com/Corfirean/coa-server-manager/tree/d22ff09ac6fd7628aac14d90ec23f547cd9b4bf1/docs)"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -301,10 +301,11 @@ pub fn create(root: &Path, meta: &Path, kind: Kind, trigger: Trigger, label: Opt
|
||||
let realm = crate::realms::state(root)?;
|
||||
let mut databases: Vec<(String, &str)> = wanted_databases(kind).iter()
|
||||
.map(|name| Ok((name.to_string(), realm.active.schema(name)?))).collect::<Result<_>>()?;
|
||||
if realm.wildcard_created && kind != Kind::Config {
|
||||
let other = if realm.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa };
|
||||
databases.push((format!("{}-characters", other.name()), other.schema("characters")?));
|
||||
if kind == Kind::Full { databases.push((format!("{}-world", other.name()), other.schema("world")?)); }
|
||||
if kind != Kind::Config {
|
||||
for other in realm.modes().into_iter().filter(|m| *m != realm.active) {
|
||||
databases.push((format!("{}-characters", other.name()), other.schema("characters")?));
|
||||
if kind == Kind::Full { databases.push((format!("{}-world", other.name()), other.schema("world")?)); }
|
||||
}
|
||||
}
|
||||
if kind != Kind::Config && with_database(root, |db| db.schema_exists("acore_playerbots"))? {
|
||||
databases.push(("playerbots".into(), "acore_playerbots"));
|
||||
|
||||
@@ -69,6 +69,7 @@ fn sync_realm_when_closed(client: &Path, meta: &Path, mode: crate::realms::Mode,
|
||||
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); }
|
||||
@@ -344,6 +345,8 @@ mod tests {
|
||||
assert_eq!(fs::read_dir(backup_dir(&meta)).unwrap().count(), 1);
|
||||
assert!(sync_realm(&c, &meta, crate::realms::Mode::Wildcard).unwrap());
|
||||
assert_eq!(fs::read(c.join("WTF/Config.wtf")).unwrap(), original);
|
||||
assert!(sync_realm(&c, &meta, crate::realms::Mode::Reborn).unwrap());
|
||||
assert_eq!(fs::read(c.join("WTF/Config.wtf")).unwrap(), b"SET sound 1\r\nSET realmName \"Warcraft Reborn\"\r\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -73,6 +73,7 @@ pub const SCHEMAS: [(&str, &str); 3] = [("characters", "acore_characters"), ("au
|
||||
pub fn schema_of(kind: &str) -> Result<&'static str> {
|
||||
if kind == "playerbots" { return Ok("acore_playerbots"); }
|
||||
if let Some(kind) = kind.strip_prefix("wildcard-") { return crate::realms::Mode::Wildcard.schema(kind); }
|
||||
if let Some(kind) = kind.strip_prefix("reborn-") { return crate::realms::Mode::Reborn.schema(kind); }
|
||||
if let Some(kind) = kind.strip_prefix("coa-") { return crate::realms::Mode::Coa.schema(kind); }
|
||||
SCHEMAS.iter().find(|(k, _)| *k == kind).map(|(_, s)| *s).ok_or_else(|| Error::Invalid(format!("unknown database {kind}")))
|
||||
}
|
||||
@@ -124,10 +125,10 @@ impl Db {
|
||||
pub fn realm(&self) -> crate::realms::Mode { self.realm }
|
||||
|
||||
pub fn realm_schema<'a>(&self, name: &'a str) -> &'a str {
|
||||
if self.realm == crate::realms::Mode::Wildcard {
|
||||
if self.realm != crate::realms::Mode::Coa {
|
||||
match name {
|
||||
"acore_world" => "acore_world_wildcard",
|
||||
"acore_characters" => "acore_characters_wildcard",
|
||||
"acore_world" => self.realm.schema("world").unwrap(),
|
||||
"acore_characters" => self.realm.schema("characters").unwrap(),
|
||||
_ => name,
|
||||
}
|
||||
} else { name }
|
||||
@@ -294,7 +295,7 @@ impl Db {
|
||||
if !ident_ok(schema) {
|
||||
return Err(Error::Invalid("bad schema name".into()));
|
||||
}
|
||||
if self.realm == crate::realms::Mode::Wildcard {
|
||||
if self.realm != crate::realms::Mode::Coa {
|
||||
let sql = std::fs::read_to_string(file)?;
|
||||
self.query(&format!("SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; USE `{schema}`;\n{sql}"))?;
|
||||
return Ok(());
|
||||
@@ -411,8 +412,8 @@ fn route_sql(sql: &str, realm: crate::realms::Mode) -> String {
|
||||
} else if bytes[i].is_ascii_alphanumeric() || bytes[i] == b'_' {
|
||||
while i < bytes.len() && (bytes[i].is_ascii_alphanumeric() || bytes[i] == b'_') { i += 1; }
|
||||
out.push_str(match &sql[start..i] {
|
||||
"acore_world" => "acore_world_wildcard",
|
||||
"acore_characters" => "acore_characters_wildcard",
|
||||
"acore_world" => realm.schema("world").unwrap(),
|
||||
"acore_characters" => realm.schema("characters").unwrap(),
|
||||
other => other,
|
||||
});
|
||||
} else {
|
||||
@@ -434,6 +435,14 @@ mod realm_tests {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn reborn_sql_routes_only_database_identifiers() {
|
||||
use crate::realms::Mode;
|
||||
let sql = "SELECT * FROM `acore_characters`.characters WHERE name='acore_world'; -- acore_world\nSELECT * FROM acore_world.items; SELECT * FROM acore_world_wildcard.items;";
|
||||
assert_eq!(super::route_sql(sql, Mode::Reborn), "SELECT * FROM `acore_characters_reborn`.characters WHERE name='acore_world'; -- acore_world\nSELECT * FROM acore_world_reborn.items; SELECT * FROM acore_world_wildcard.items;");
|
||||
assert_eq!(super::schema_of("reborn-characters").unwrap(), "acore_characters_reborn");
|
||||
assert_eq!(super::schema_of("reborn-auth").unwrap(), "acore_auth");
|
||||
}
|
||||
use super::*;
|
||||
use std::ffi::OsStr;
|
||||
|
||||
|
||||
@@ -824,6 +824,10 @@ mod tests {
|
||||
let wild = database_env(&s, true, crate::realms::Mode::Wildcard);
|
||||
assert_eq!(get(&wild, "AC_WORLD_DATABASE_INFO").unwrap(), "db;3306;acore;apppw;acore_world_wildcard");
|
||||
assert_eq!(get(&wild, "AC_CHARACTER_DATABASE_INFO").unwrap(), "db;3306;acore;apppw;acore_characters_wildcard");
|
||||
let reborn = database_env(&s, true, crate::realms::Mode::Reborn);
|
||||
assert_eq!(get(&reborn, "AC_WORLD_DATABASE_INFO").unwrap(), "db;3306;acore;apppw;acore_world_reborn");
|
||||
assert_eq!(get(&reborn, "AC_CHARACTER_DATABASE_INFO").unwrap(), "db;3306;acore;apppw;acore_characters_reborn");
|
||||
assert_eq!(get(&reborn, "AC_LOGIN_DATABASE_INFO").unwrap(), "db;3306;acore;apppw;acore_auth");
|
||||
// Accounts are shared by both realms; the auth server never sees the others.
|
||||
assert_eq!(get(&wild, "AC_LOGIN_DATABASE_INFO").unwrap(), "db;3306;acore;apppw;acore_auth");
|
||||
let auth = database_env(&s, false, crate::realms::Mode::Wildcard);
|
||||
|
||||
@@ -82,8 +82,8 @@ impl Store for Db {
|
||||
let connection = self.clone().for_realm(crate::realms::Mode::Coa);
|
||||
let world = self.realm_schema("acore_world");
|
||||
let characters = self.realm_schema("acore_characters");
|
||||
let other = if self.realm() == crate::realms::Mode::Coa { "acore_world_wildcard" } else { "acore_world" };
|
||||
let schemas: std::collections::BTreeSet<_> = [world, characters, other, AUTH_LEDGER_SCHEMA].into_iter().collect();
|
||||
let others: Vec<_> = [crate::realms::Mode::Coa, crate::realms::Mode::Wildcard, crate::realms::Mode::Reborn].into_iter().filter(|m| *m != self.realm()).map(|m| m.schema("world").unwrap()).collect();
|
||||
let schemas: std::collections::BTreeSet<_> = [world, characters, AUTH_LEDGER_SCHEMA].into_iter().chain(others.iter().copied()).collect();
|
||||
let catalog = connection.query(&format!("SELECT table_schema,table_name FROM information_schema.tables WHERE table_schema IN ('{}') AND table_name IN ('updates','{LEDGER_TABLE}') AND table_type='BASE TABLE';", schemas.into_iter().collect::<Vec<_>>().join("','")))?;
|
||||
let available: std::collections::BTreeSet<_> = catalog.lines().filter_map(|line| line.split_once('\t')).collect();
|
||||
let text = |expression: &str| format!("CONVERT({expression} USING utf8mb4) COLLATE utf8mb4_bin");
|
||||
@@ -93,7 +93,7 @@ impl Store for Db {
|
||||
queries.push(format!("SELECT 'core','{kind}',{},REPEAT('0',64),'applied',1,'' FROM `{schema}`.`updates` WHERE BINARY RIGHT(name,4)='.sql'",text("LEFT(name,CHAR_LENGTH(name)-4)")));
|
||||
}
|
||||
}
|
||||
for (origin, schema, filter) in [("local",world,""), ("other",other," WHERE `db` IN ('auth','coa-auth','wildcard-auth')"), ("shared",AUTH_LEDGER_SCHEMA,"")] {
|
||||
for (origin, schema, filter) in [("local",world,""), ("shared",AUTH_LEDGER_SCHEMA,"")].into_iter().chain(others.iter().map(|schema| ("other", *schema, " WHERE `db` IN ('auth','coa-auth','wildcard-auth','reborn-auth')"))) {
|
||||
if available.contains(&(schema, LEDGER_TABLE)) {
|
||||
queries.push(format!("SELECT '{origin}',{},{},{},{},`baseline`,{} FROM `{schema}`.`{LEDGER_TABLE}`{filter}",text("`db`"),text("`id`"),text("`sha256`"),text("`status`"),text("COALESCE(HEX(`error`),'')")));
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ fn installed_module_commits(root: &Path) -> BTreeMap<String, String> {
|
||||
|
||||
fn list_in(cat: &[Entry], root: &Path) -> Vec<ModuleView> {
|
||||
let installed_commits = installed_module_commits(root);
|
||||
let wildcard = crate::realms::state(root).map(|s| s.active == crate::realms::Mode::Wildcard).unwrap_or(true);
|
||||
let wildcard = crate::realms::state(root).map(|s| s.active != crate::realms::Mode::Coa).unwrap_or(true);
|
||||
cat.iter()
|
||||
.cloned()
|
||||
.map(|e| {
|
||||
@@ -371,12 +371,6 @@ fn save_settings_in(cat: &[Entry], root: &Path, meta: &Path, id: &str, changes:
|
||||
return Err(Error::Invalid("Enemy damage must be a number from 0.25 to 2.0.".into()));
|
||||
}
|
||||
}
|
||||
if id == "content-scaling" && key.starts_with("CoAContentScaling.Difficulty.Health.") && key.ends_with("Multiplier") {
|
||||
let multiplier = value.parse::<f32>().map_err(|_| Error::Invalid("Health multipliers must be a number from 0.1 to 10.".into()))?;
|
||||
if !multiplier.is_finite() || !(0.1..=10.0).contains(&multiplier) {
|
||||
return Err(Error::Invalid("Health multipliers must be a number from 0.1 to 10.".into()));
|
||||
}
|
||||
}
|
||||
if id == "content-scaling" && key == "CoAContentScaling.World.Leech.Percent" {
|
||||
let percent = value.parse::<f32>().map_err(|_| Error::Invalid("Life steal must be a number from 0 to 100 percent.".into()))?;
|
||||
if !percent.is_finite() || !(0.0..=100.0).contains(&percent) {
|
||||
@@ -703,36 +697,6 @@ mod tests {
|
||||
assert_eq!(settings_in(&cat, &root, "content-scaling").unwrap().iter().find(|s| s.key == key).unwrap().value, "2");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn creature_health_multipliers_are_validated_per_key() {
|
||||
let d = tempfile::tempdir().unwrap();
|
||||
let (root, meta) = server(d.path());
|
||||
let cat = catalog();
|
||||
let conf = dir(&root).join("mod-coa-content-scaling.conf.dist");
|
||||
let keys = [
|
||||
"CoAContentScaling.Difficulty.Health.WorldMultiplier",
|
||||
"CoAContentScaling.Difficulty.Health.DungeonMultiplier",
|
||||
"CoAContentScaling.Difficulty.Health.RaidMultiplier",
|
||||
"CoAContentScaling.Difficulty.Health.TrashMultiplier",
|
||||
"CoAContentScaling.Difficulty.Health.BossMultiplier",
|
||||
];
|
||||
let mut text = String::from("CoAContentScaling.Enable = 1\n");
|
||||
for key in keys {
|
||||
text.push_str(&format!("{key} = 1.0\n"));
|
||||
}
|
||||
fs::write(&conf, text).unwrap();
|
||||
for key in keys {
|
||||
let changes = |v: &str| BTreeMap::from([(key.to_string(), v.to_string())]);
|
||||
for bad in ["NaN", "inf", "0", "0.09", "10.01", "-1", "abc", ""] {
|
||||
assert!(save_settings_in(&cat, &root, &meta, "content-scaling", &changes(bad)).is_err(), "{key} {bad}");
|
||||
}
|
||||
for good in ["0.1", "0.4", "1", "2.5", "10"] {
|
||||
assert_eq!(save_settings_in(&cat, &root, &meta, "content-scaling", &changes(good)).unwrap(), [key]);
|
||||
assert_eq!(settings_in(&cat, &root, "content-scaling").unwrap().iter().find(|s| s.key == key).unwrap().value, good);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_older_file_name_is_used_when_the_current_one_is_missing_and_a_part_that_cannot_be_switched_stays_on() {
|
||||
let d = tempfile::tempdir().unwrap();
|
||||
|
||||
@@ -28,6 +28,7 @@ fn copy_tree(from: &Path, to: &Path) -> Result<()> {
|
||||
pub fn set_enabled(main: &Path, enabled: bool) -> Result<realms::View> {
|
||||
if enabled && !cfg!(windows) { return Err(Error::Invalid("Simultaneous realms currently require Windows.".into())); }
|
||||
if enabled {
|
||||
if realms::state(main)?.active == Mode::Reborn { return Err(Error::Invalid("Simultaneous startup supports CoA and Wildcard. Select one of these realms first.".into())); }
|
||||
if !realms::view(main)?.supported { return Err(Error::Invalid("Update the server to a build with Wildcard support first.".into())); }
|
||||
secondary_launcher(&fs::read_to_string(main.join("Scripts/manage.py"))?)?;
|
||||
}
|
||||
|
||||
@@ -18,13 +18,15 @@ pub enum Mode {
|
||||
#[default]
|
||||
Coa,
|
||||
Wildcard,
|
||||
Reborn,
|
||||
}
|
||||
|
||||
impl Mode {
|
||||
pub fn name(self) -> &'static str {
|
||||
match self { Self::Coa => "coa", Self::Wildcard => "wildcard" }
|
||||
match self { Self::Coa => "coa", Self::Wildcard => "wildcard", Self::Reborn => "reborn" }
|
||||
}
|
||||
pub fn realm_id(self) -> u32 { if self == Self::Coa { 1 } else { 2 } }
|
||||
pub fn realm_id(self) -> u32 { match self { Self::Coa => 1, Self::Wildcard => 2, Self::Reborn => 3 } }
|
||||
pub fn label(self) -> &'static str { match self { Self::Coa => "Conquest of Azeroth", Self::Wildcard => "Wildcard", Self::Reborn => "Warcraft Reborn" } }
|
||||
pub fn schema(self, kind: &str) -> Result<&'static str> {
|
||||
match (self, kind) {
|
||||
(_, "auth") => Ok("acore_auth"),
|
||||
@@ -32,6 +34,8 @@ impl Mode {
|
||||
(Self::Coa, "world") => Ok("acore_world"),
|
||||
(Self::Wildcard, "characters") => Ok("acore_characters_wildcard"),
|
||||
(Self::Wildcard, "world") => Ok("acore_world_wildcard"),
|
||||
(Self::Reborn, "characters") => Ok("acore_characters_reborn"),
|
||||
(Self::Reborn, "world") => Ok("acore_world_reborn"),
|
||||
_ => Err(Error::Invalid("Unknown realm database.".into())),
|
||||
}
|
||||
}
|
||||
@@ -42,6 +46,8 @@ pub struct RealmState {
|
||||
pub active: Mode,
|
||||
pub wildcard_created: bool,
|
||||
#[serde(default)]
|
||||
pub reborn_created: bool,
|
||||
#[serde(default)]
|
||||
pub simultaneous: bool,
|
||||
#[serde(default)]
|
||||
pub secondary_world_port: Option<u16>,
|
||||
@@ -49,10 +55,21 @@ pub struct RealmState {
|
||||
pub secondary_ra_port: Option<u16>,
|
||||
}
|
||||
|
||||
impl RealmState {
|
||||
pub fn created(&self, mode: Mode) -> bool { match mode { Mode::Coa => true, Mode::Wildcard => self.wildcard_created, Mode::Reborn => self.reborn_created } }
|
||||
pub fn modes(&self) -> Vec<Mode> {
|
||||
let mut modes = vec![self.active];
|
||||
modes.extend([Mode::Coa, Mode::Wildcard, Mode::Reborn].into_iter().filter(|m| *m != self.active && self.created(*m)));
|
||||
modes
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct View {
|
||||
pub active: Mode,
|
||||
pub wildcard_created: bool,
|
||||
pub reborn_created: bool,
|
||||
pub reborn_supported: bool,
|
||||
pub supported: bool,
|
||||
pub recovery_pending: bool,
|
||||
pub simultaneous: bool,
|
||||
@@ -74,14 +91,15 @@ fn world_binary(root: &Path) -> std::path::PathBuf {
|
||||
pub fn view(root: &Path) -> Result<View> {
|
||||
let s = state(root)?;
|
||||
// Inspect the binary itself; templates or an old log cannot prove installed support.
|
||||
let supported = fs::read(world_binary(root))?
|
||||
.windows(b"Wildcard synergy settings".len()).any(|w| w == b"Wildcard synergy settings");
|
||||
Ok(View { active: s.active, wildcard_created: s.wildcard_created, supported, recovery_pending: root.join(JOURNAL).exists(), simultaneous: s.simultaneous, secondary_world_port: s.secondary_world_port, secondary_running: crate::multiworld::is_running(root) })
|
||||
let binary = fs::read(world_binary(root))?;
|
||||
let reborn_supported = binary.windows(b"Warcraft Reborn class spells are unavailable".len()).any(|w| w == b"Warcraft Reborn class spells are unavailable");
|
||||
let supported = binary.windows(b"Wildcard synergy settings".len()).any(|w| w == b"Wildcard synergy settings");
|
||||
Ok(View { active: s.active, wildcard_created: s.wildcard_created, reborn_created: s.reborn_created, reborn_supported, supported, recovery_pending: root.join(JOURNAL).exists(), simultaneous: s.simultaneous, secondary_world_port: s.secondary_world_port, secondary_running: crate::multiworld::is_running(root) })
|
||||
}
|
||||
|
||||
pub fn guard_module(root: &Path, id: &str) -> Result<()> {
|
||||
if state(root)?.active == Mode::Wildcard && matches!(id, "companions" | "playerbots") {
|
||||
return Err(Error::Invalid("CoA companion class mechanics have not been validated for Wildcard. This module is unavailable on this realm.".into()));
|
||||
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()));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -145,6 +163,24 @@ 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/playerbots.conf", "AiPlayerbot.Enabled", "0")?;
|
||||
Ok(files)
|
||||
}
|
||||
|
||||
fn reborn_configs(mut files: Files) -> Result<Files> {
|
||||
for (key, value) in [
|
||||
("CoA.ClassModel", "\"wcr\""), ("CoA.GameModeMask", "0"),
|
||||
("CoA.MapClass10ToWarrior", "0"), ("CoA.RealmType", "\"live\""),
|
||||
("CoA.ClientBooleanConfigs", "\"\""),
|
||||
] { set(&mut files, "Core/configs/modules/coa.conf", key, value)?; }
|
||||
set(&mut files, "Core/configs/modules/mod-coa-challenges.conf", "CoAChallenges.GameModes.Realm", "\"\"")?;
|
||||
for path in ["Settings/worldserver.conf.template", "Core/configs/worldserver.conf"] {
|
||||
if files.contains_key(path) { 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/playerbots.conf", "AiPlayerbot.Enabled", "0")?;
|
||||
Ok(files)
|
||||
}
|
||||
|
||||
@@ -169,15 +205,15 @@ pub fn recover(root: &Path) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn create_databases(root: &Path) -> Result<()> {
|
||||
fn create_databases(root: &Path, mode: Mode) -> Result<()> {
|
||||
crate::backup::with_database(root, |_| {
|
||||
let db = Db::from_repack(root, Account::Admin)?.for_realm(Mode::Coa);
|
||||
if db.query("SELECT COUNT(*) FROM acore_auth.realmlist WHERE id=2;")? != "0" {
|
||||
return Err(Error::Invalid("Realm ID 2 is already in use. Its settings were left intact.".into()));
|
||||
if db.query(&format!("SELECT COUNT(*) FROM acore_auth.realmlist WHERE id={};", mode.realm_id()))? != "0" {
|
||||
return Err(Error::Invalid(format!("Realm ID {} is already in use. Its settings were left intact.", mode.realm_id())));
|
||||
}
|
||||
for kind in ["world", "characters"] {
|
||||
let source = Mode::Coa.schema(kind)?;
|
||||
let dest = Mode::Wildcard.schema(kind)?;
|
||||
let dest = mode.schema(kind)?;
|
||||
if db.schema_exists(dest)? {
|
||||
return Err(Error::Invalid(format!("Database {dest} already exists. It was left intact; inspect it before creating a realm.")));
|
||||
}
|
||||
@@ -185,7 +221,7 @@ fn create_databases(root: &Path) -> Result<()> {
|
||||
return Err(Error::Invalid("Realm creation does not support databases with routines, triggers or views.".into()));
|
||||
}
|
||||
}
|
||||
for (kind, tables) in crate::schema_check::WILDCARD_TABLES {
|
||||
for (kind, tables) in crate::schema_check::WILDCARD_TABLES.iter().filter(|_| mode == Mode::Wildcard) {
|
||||
let schema = crate::db::schema_of(kind)?;
|
||||
let present = db.tables(schema)?;
|
||||
let missing: Vec<_> = tables.iter().filter(|table| !present.iter().any(|p| p == **table)).copied().collect();
|
||||
@@ -211,9 +247,11 @@ fn create_databases(root: &Path) -> Result<()> {
|
||||
if db.tables("acore_world")?.iter().any(|t| t == "coa_manager_migrations") {
|
||||
db.query(&format!("CREATE TABLE IF NOT EXISTS `{stage_world}`.coa_manager_migrations LIKE acore_world.coa_manager_migrations;"))?;
|
||||
}
|
||||
db.query("CREATE DATABASE acore_world_wildcard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE acore_characters_wildcard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;")?;
|
||||
let world = mode.schema("world")?;
|
||||
let characters = mode.schema("characters")?;
|
||||
db.query(&format!("CREATE DATABASE `{world}` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE `{characters}` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"))?;
|
||||
let mut renames = Vec::new();
|
||||
for (stage, dest) in [(&stage_world, "acore_world_wildcard"), (&stage_chars, "acore_characters_wildcard")] {
|
||||
for (stage, dest) in [(&stage_world, world), (&stage_chars, characters)] {
|
||||
for table in db.tables(stage)? {
|
||||
if !crate::db::valid_identifier(&table) { return Err(Error::Invalid("Unsupported table name.".into())); }
|
||||
renames.push(format!("`{stage}`.`{table}` TO `{dest}`.`{table}`"));
|
||||
@@ -223,7 +261,7 @@ fn create_databases(root: &Path) -> Result<()> {
|
||||
for host in db.query("SELECT host FROM mysql.user WHERE user='acore';")?.lines() {
|
||||
let host = hex::encode(host.as_bytes());
|
||||
// Host names are trusted database data, but still quote them through a hex SQL literal.
|
||||
db.query(&format!("SET @host=CONVERT(UNHEX('{host}') USING utf8mb4); SET @grant=CONCAT('GRANT ALL ON acore_world_wildcard.* TO ', QUOTE('acore'), '@', QUOTE(@host)); PREPARE realm_grant FROM @grant; EXECUTE realm_grant; DEALLOCATE PREPARE realm_grant; SET @grant=CONCAT('GRANT ALL ON acore_characters_wildcard.* TO ', QUOTE('acore'), '@', QUOTE(@host)); PREPARE realm_grant FROM @grant; EXECUTE realm_grant; DEALLOCATE PREPARE realm_grant;"))?;
|
||||
db.query(&format!("SET @host=CONVERT(UNHEX('{host}') USING utf8mb4); SET @grant=CONCAT('GRANT ALL ON {world}.* TO ', QUOTE('acore'), '@', QUOTE(@host)); PREPARE realm_grant FROM @grant; EXECUTE realm_grant; DEALLOCATE PREPARE realm_grant; SET @grant=CONCAT('GRANT ALL ON {characters}.* TO ', QUOTE('acore'), '@', QUOTE(@host)); PREPARE realm_grant FROM @grant; EXECUTE realm_grant; DEALLOCATE PREPARE realm_grant;"))?;
|
||||
}
|
||||
db.query(&format!("DROP DATABASE `{stage_world}`; DROP DATABASE `{stage_chars}`;"))?;
|
||||
fs::remove_file(&dump)?;
|
||||
@@ -242,14 +280,22 @@ pub fn select(root: &Path, mode: Mode) -> Result<View> {
|
||||
if mode == Mode::Wildcard && !view(root)?.supported {
|
||||
return Err(Error::Invalid("Update the server to a build with Wildcard support first.".into()));
|
||||
}
|
||||
if mode == Mode::Reborn && !view(root)?.reborn_supported {
|
||||
return Err(Error::Invalid("Update the server to a build with Warcraft Reborn support first.".into()));
|
||||
}
|
||||
if s.simultaneous && mode != s.active {
|
||||
return Err(Error::Invalid("Disable simultaneous startup 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)?;
|
||||
if mode == Mode::Wildcard && !s.wildcard_created {
|
||||
fsx::atomic_write_json(&snapshot(root, mode), &wildcard_configs(before.clone())?)?;
|
||||
create_databases(root)?;
|
||||
s.wildcard_created = true;
|
||||
if !s.created(mode) {
|
||||
let base = if s.active == Mode::Coa { before.clone() } else { fsx::read_json(&snapshot(root, Mode::Coa))? };
|
||||
let files = match mode { Mode::Wildcard => wildcard_configs(base)?, Mode::Reborn => reborn_configs(base)?, Mode::Coa => unreachable!() };
|
||||
fsx::atomic_write_json(&snapshot(root, mode), &files)?;
|
||||
create_databases(root, mode)?;
|
||||
match mode { Mode::Wildcard => s.wildcard_created = true, Mode::Reborn => s.reborn_created = true, Mode::Coa => {} }
|
||||
fsx::atomic_write_json(&root.join(STATE), &s)?;
|
||||
}
|
||||
let target: Files = fsx::read_json(&snapshot(root, mode))?;
|
||||
@@ -305,25 +351,48 @@ const LAUNCHER_REALM_REPLACEMENTS: &[(&str, &str)] = &[
|
||||
|
||||
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-v1") { return Ok(source.into()); }
|
||||
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_REALM_REPLACEMENTS {
|
||||
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);
|
||||
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!("{LAUNCHER_REALM_INSERT}{marker}")))
|
||||
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> {
|
||||
if !source.contains(LAUNCHER_REALM_INSERT) { return None; }
|
||||
let mut original = source.replacen(LAUNCHER_REALM_INSERT, "", 1);
|
||||
for &(from, to) in LAUNCHER_REALM_REPLACEMENTS { original = original.replace(to, from); }
|
||||
patch_launcher(&original).ok().filter(|patched| patched == source).map(|_| original)
|
||||
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)
|
||||
}
|
||||
|
||||
pub fn before_start(root: &Path) -> Result<()> {
|
||||
@@ -332,23 +401,36 @@ 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())); }
|
||||
if s.simultaneous && s.active == Mode::Reborn { return Err(Error::Invalid("Simultaneous startup supports CoA and Wildcard only.".into())); }
|
||||
if s.simultaneous { fsx::atomic_write_json(&snapshot(root, s.active), &configs(root)?)?; }
|
||||
if s.active == Mode::Wildcard {
|
||||
if !view(root)?.supported { return Err(Error::Invalid("The installed server build does not support Wildcard.".into())); }
|
||||
if s.active == Mode::Reborn && !view(root)?.reborn_supported { return Err(Error::Invalid("The installed server build does not support Warcraft Reborn.".into())); }
|
||||
if s.active != Mode::Coa {
|
||||
if s.active == Mode::Wildcard && !view(root)?.supported { return Err(Error::Invalid("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())?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn setup_realmlist(root: &Path) -> Result<()> {
|
||||
let s = state(root)?;
|
||||
if !root.join(STATE).exists() || !s.wildcard_created { return Ok(()); }
|
||||
let db = Db::from_repack(root, Account::Admin)?;
|
||||
if !root.join(STATE).exists() { return Ok(()); }
|
||||
let db = Db::from_repack(root, Account::Admin)?.for_realm(Mode::Coa);
|
||||
let port = layout::read_ports(root).world;
|
||||
db.query(&format!("INSERT INTO acore_auth.realmlist (id,name,address,localAddress,localSubnetMask,port,icon,flag,timezone,gamebuild) SELECT 2,'Wildcard',address,localAddress,localSubnetMask,{port},icon,2,timezone,gamebuild FROM acore_auth.realmlist WHERE id=1 ON DUPLICATE KEY UPDATE port={port}; UPDATE acore_auth.realmlist SET flag=2 WHERE id IN (1,2) AND id<>{};", s.active.realm_id()))?;
|
||||
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 ids = s.modes().iter().map(|m| m.realm_id().to_string()).collect::<Vec<_>>().join(",");
|
||||
db.query(&format!("UPDATE acore_auth.realmlist SET flag=2 WHERE id IN ({ids}) AND id<>{};", s.active.realm_id()))?;
|
||||
if s.simultaneous {
|
||||
let second = s.secondary_world_port.ok_or_else(|| Error::Invalid("Second realm port is missing.".into()))?;
|
||||
let (coa, wildcard) = if s.active == Mode::Coa { (port, second) } else { (second, port) };
|
||||
@@ -361,6 +443,66 @@ pub fn setup_realmlist(root: &Path) -> Result<()> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn legacy_states_and_all_created_realms_are_enumerated_once() {
|
||||
let legacy: RealmState = serde_json::from_str(r#"{"active":"wildcard","wildcard_created":true}"#).unwrap();
|
||||
assert!(!legacy.reborn_created);
|
||||
assert_eq!(legacy.modes(), [Mode::Wildcard, Mode::Coa]);
|
||||
let all = RealmState { active: Mode::Reborn, wildcard_created: true, reborn_created: true, ..Default::default() };
|
||||
assert_eq!(all.modes(), [Mode::Reborn, Mode::Coa, Mode::Wildcard]);
|
||||
assert_eq!(serde_json::to_string(&Mode::Reborn).unwrap(), "\"reborn\"");
|
||||
assert_eq!(Mode::Reborn.realm_id(), 3);
|
||||
assert_eq!(Mode::Reborn.schema("auth").unwrap(), "acore_auth");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reborn_has_its_own_settings_and_restores_the_coa_profile() {
|
||||
let t = tempfile::tempdir().unwrap();
|
||||
let mut coa = Files::new();
|
||||
coa.insert("Core/configs/modules/coa.conf".into(), b"[worldserver]\nCoA.ClassModel = coa\nCoA.GameModeMask = 0\n".to_vec());
|
||||
coa.insert("Settings/worldserver.conf.template".into(), b"[worldserver]\nRealmID = 1\n".to_vec());
|
||||
coa.insert("Core/configs/modules/playerbots.conf".into(), b"[worldserver]\nAiPlayerbot.Enabled = 1\n".to_vec());
|
||||
let reborn = reborn_configs(coa.clone()).unwrap();
|
||||
let conf = ConfFile::parse_bytes(&reborn["Core/configs/modules/coa.conf"]).unwrap();
|
||||
assert_eq!(conf.get("CoA.ClassModel"), Some("\"wcr\""));
|
||||
assert_eq!(conf.get("CoA.GameModeMask"), Some("0"));
|
||||
assert_eq!(ConfFile::parse_bytes(&reborn["Settings/worldserver.conf.template"]).unwrap().get("RealmID"), Some("3"));
|
||||
assert_eq!(ConfFile::parse_bytes(&reborn["Core/configs/modules/playerbots.conf"]).unwrap().get("AiPlayerbot.Enabled"), Some("0"));
|
||||
write_configs(t.path(), &reborn).unwrap();
|
||||
write_configs(t.path(), &coa).unwrap();
|
||||
assert_eq!(configs(t.path()).unwrap(), coa);
|
||||
fsx::atomic_write_json(&t.path().join(STATE), &RealmState { active: Mode::Reborn, reborn_created: true, ..Default::default() }).unwrap();
|
||||
assert!(guard_module(t.path(), "companions").is_err());
|
||||
assert!(guard_module(t.path(), "playerbots").is_err());
|
||||
assert!(guard_module(t.path(), "content-scaling").is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reborn_support_requires_the_new_code_in_the_installed_binary() {
|
||||
let t = tempfile::tempdir().unwrap();
|
||||
fsx::atomic_write(&t.path().join("Core/worldserver.exe"), b"Wildcard synergy settings").unwrap();
|
||||
assert!(!view(t.path()).unwrap().reborn_supported);
|
||||
fsx::atomic_write(&t.path().join("Core/worldserver.exe"), b"Warcraft Reborn class spells are unavailable").unwrap();
|
||||
let v = view(t.path()).unwrap();
|
||||
assert!(v.reborn_supported);
|
||||
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();
|
||||
|
||||
@@ -24,8 +24,7 @@ pub fn check(root: &Path, dir: &Path) -> Result<Vec<DatabaseCheck>> {
|
||||
let (_, meta) = MetaDir::open(dir)?;
|
||||
let m = installed_manifest(&meta, dir)?;
|
||||
let checks = crate::backup::with_database(root, |db| {
|
||||
let mut modes = vec![crate::realms::Mode::Coa];
|
||||
if crate::realms::state(root)?.wildcard_created { modes.push(crate::realms::Mode::Wildcard); }
|
||||
let modes = crate::realms::state(root)?.modes();
|
||||
let mut checks = Vec::new();
|
||||
for mode in modes {
|
||||
let db = db.clone().for_realm(mode);
|
||||
|
||||
@@ -894,8 +894,7 @@ impl RepackEnv<'_> {
|
||||
if manifest.migrations.is_empty() { return Ok(Some(0)); }
|
||||
let count = |db: &crate::db::Db| -> Result<usize> {
|
||||
let realms = crate::realms::state(self.root)?;
|
||||
let mut modes = vec![realms.active];
|
||||
if realms.wildcard_created { modes.push(if realms.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa }); }
|
||||
let modes = realms.modes();
|
||||
let mut count = 0;
|
||||
for (index, mode) in modes.into_iter().enumerate() {
|
||||
let list: Vec<_> = manifest.migrations.iter().filter(|m| index == 0 || !crate::migrations::shared_auth(&m.db)).cloned().collect();
|
||||
@@ -976,8 +975,7 @@ impl Env for RepackEnv<'_> {
|
||||
}
|
||||
}
|
||||
crate::backup::with_database(self.root, |db| {
|
||||
let mut modes = vec![crate::realms::Mode::Coa];
|
||||
if crate::realms::state(self.root)?.wildcard_created { modes.push(crate::realms::Mode::Wildcard); }
|
||||
let modes = crate::realms::state(self.root)?.modes();
|
||||
for mode in modes {
|
||||
if let Some(problem) = crate::schema_check::check_with_report(&db.clone().for_realm(mode), self.root)?.first() {
|
||||
if crate::docker::is_docker(self.root) {
|
||||
@@ -1065,8 +1063,7 @@ impl RepackEnv<'_> {
|
||||
use crate::process::{observe, ServiceState};
|
||||
let identities = crate::backup::with_database(self.root, |db| {
|
||||
if check_schema {
|
||||
let mut modes = vec![crate::realms::Mode::Coa];
|
||||
if crate::realms::state(self.root)?.wildcard_created { modes.push(crate::realms::Mode::Wildcard); }
|
||||
let modes = crate::realms::state(self.root)?.modes();
|
||||
for mode in modes {
|
||||
if let Some(p) = crate::schema_check::check_with_report(&db.clone().for_realm(mode), self.root)?.first() {
|
||||
return Err(Error::Invalid(format!("Database validation failed on {}: {}.{}: {}", mode.name(), p.database, p.table, p.detail)));
|
||||
@@ -1131,10 +1128,7 @@ impl RepackEnv<'_> {
|
||||
/// One migration pass for both realms, with shared history checks and one recovery point.
|
||||
fn migrate_databases(db: &crate::db::Db, root: &Path, manifest: &Manifest, staged: &Path, snapshot: &dyn Fn() -> Result<String>) -> Result<ApplyReport> {
|
||||
let realms = crate::realms::state(root)?;
|
||||
let mut modes = vec![realms.active];
|
||||
if realms.wildcard_created {
|
||||
modes.push(if realms.active == crate::realms::Mode::Coa { crate::realms::Mode::Wildcard } else { crate::realms::Mode::Coa });
|
||||
}
|
||||
let modes = realms.modes();
|
||||
// Reject a broken history in either realm before changing the first one.
|
||||
for (index, mode) in modes.iter().enumerate() {
|
||||
let list: Vec<_> = manifest.migrations.iter().filter(|m| index == 0 || !crate::migrations::shared_auth(&m.db)).cloned().collect();
|
||||
@@ -1168,6 +1162,7 @@ fn database_identities(db: &crate::db::Db) -> Result<BTreeMap<String, std::colle
|
||||
for (schema, table, columns) in [
|
||||
("acore_characters", "characters", "guid,account,HEX(name)"),
|
||||
("acore_characters_wildcard", "characters", "guid,account,HEX(name)"),
|
||||
("acore_characters_reborn", "characters", "guid,account,HEX(name)"),
|
||||
("acore_auth", "account", "id,HEX(username)"),
|
||||
] {
|
||||
if !db.schema_exists(schema)? || !db.tables(schema)?.iter().any(|name| name == table) { continue; }
|
||||
|
||||
@@ -10,6 +10,7 @@ const FILES: &[&str] = &[
|
||||
".realms/secondary/Settings/repack.json", ".realms/secondary/Settings/realm-profile.json",
|
||||
".realms/secondary/Settings/worldserver.conf.template", ".realms/secondary/Settings/authserver.conf.template",
|
||||
".realms/secondary/Core/configs/worldserver.conf", ".realms/secondary/Core/configs/authserver.conf",
|
||||
"Settings/realm-profiles/reborn.json",
|
||||
];
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@@ -94,6 +95,7 @@ mod tests {
|
||||
#[test]
|
||||
fn interrupted_validation_restores_original_bytes_and_absent_files() {
|
||||
let (_dir, root, meta) = fixture();
|
||||
fsx::atomic_write(&root.join("Settings/realm-profiles/reborn.json"), b"saved reborn profile").unwrap();
|
||||
let original: Vec<_> = FILES.iter().map(|p| fs::read(root.join(p)).ok()).collect();
|
||||
begin(&root, &meta).unwrap();
|
||||
assert!(crate::update::ensure_recovered(&meta).is_err());
|
||||
@@ -106,6 +108,7 @@ mod tests {
|
||||
let config = ConfFile::parse_bytes(&fs::read(root.join(FILES[2])).unwrap()).unwrap();
|
||||
assert_eq!(config.get("BindIP"), Some("\"127.0.0.1\""));
|
||||
fsx::atomic_write(&root.join(FILES[4]), b"rendered temporary configuration").unwrap();
|
||||
fsx::atomic_write(&root.join("Settings/realm-profiles/reborn.json"), b"temporary reborn profile").unwrap();
|
||||
restore(&root, &meta).unwrap();
|
||||
for (rel, bytes) in FILES.iter().zip(original) { assert_eq!(fs::read(root.join(rel)).ok(), bytes); }
|
||||
assert!(!pending(&meta));
|
||||
@@ -141,7 +144,11 @@ pub(crate) fn restore(root: &Path, meta: &Path) -> Result<()> {
|
||||
if !pending(meta) { return Ok(()); }
|
||||
let journal = meta.join("validation-configs.json");
|
||||
let saved: BTreeMap<String, Saved> = fsx::read_json(&journal)?;
|
||||
if saved.len() != FILES.len() || FILES.iter().any(|rel| !saved.contains_key(*rel)) {
|
||||
// Previous managers could journal only the first two profiles. Recover those
|
||||
// journals too, while continuing to reject missing or unknown legacy entries.
|
||||
let legacy = saved.len() == FILES.len() - 1 && !saved.contains_key("Settings/realm-profiles/reborn.json");
|
||||
let required = if legacy { &FILES[..FILES.len() - 1] } else { FILES };
|
||||
if saved.len() != required.len() || required.iter().any(|rel| !saved.contains_key(*rel)) {
|
||||
return Err(Error::Invalid("Isolated validation configuration journal is incomplete.".into()));
|
||||
}
|
||||
for (rel, file) in &saved {
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Host a CoA server for other players
|
||||
|
||||
**Portable characters are experimental.** The feature is in active development and may contain bugs.
|
||||
|
||||
## Set up your server
|
||||
|
||||
1. Choose **Host a server** on the welcome screen.
|
||||
2. Choose **Install new server**, or **I already have a server**.
|
||||
3. Finish setup, then start the server from **Overview**.
|
||||
4. Link your game client and test joining your server yourself.
|
||||
|
||||
## Play with friends
|
||||
|
||||
Open **Play with friends**. Use the LAN/private-network instructions for your connection method and run the connectivity checks. Your computer and server must stay on while friends play. Share the connection information prepared by the Manager, never database credentials.
|
||||
|
||||
## Let other players find your realm
|
||||
|
||||
1. Open **Settings**, then find **Public listing**.
|
||||
2. Fill in a clear realm name, a short description, language and region.
|
||||
3. Review the join/account options and connection route.
|
||||
4. Publish when you are ready to accept players.
|
||||
5. Check that the realm appears in the browser and ask a friend to test joining from another connection.
|
||||
|
||||
A listing makes your server discoverable; it does not move hosting to the cloud or guarantee that your network can be reached. If joining fails, use the connection checks before changing router settings. Portable characters also require a compatible server build and its required settings.
|
||||
|
||||
Use **Backups** before changing server versions or optional modules. To stop accepting visitors, turn off the listing; to stop hosting, stop the server.
|
||||
@@ -1,43 +0,0 @@
|
||||
# Take your character with you
|
||||
|
||||
**Portable characters are experimental.** The feature is in active development and may contain bugs.
|
||||
|
||||
Portable characters let you keep a saved character in the Manager and play it on compatible CoA realms.
|
||||
|
||||
## Make your first character portable
|
||||
|
||||
1. Log out of the character in the game. Keep the Manager open.
|
||||
2. Open **Characters** and choose **Make an existing character portable**.
|
||||
3. Select a realm you can access and choose your character.
|
||||
4. Choose **Make portable**. Your character appears under **Your characters**.
|
||||
|
||||
If a character cannot be selected, read the reason beside it. Bot characters, active challenges and some pending rewards can block the operation. Creating the portable copy does not delete the original realm character.
|
||||
|
||||
## Make a character from another realm portable
|
||||
|
||||
1. Open **Servers** and select the realm where your character lives.
|
||||
2. Choose **Link an existing account** and enter the account you already use on that realm.
|
||||
3. Log in to that realm in the game and stay at the character selection screen.
|
||||
4. Switch back to the Manager with **Alt+Tab** and choose **Show my characters**.
|
||||
5. Find your character and choose **Make portable**.
|
||||
6. Wait for the confirmation and the **Portable** badge.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Play your portable character
|
||||
|
||||
1. Find a compatible server under **Servers** in player mode, or **Play with Friends** when hosting. You can also use a realm already available to your Manager.
|
||||
2. Choose your portable character and review compatibility before pressing **Play**.
|
||||
3. Follow the account prompt. Some hosts create an account for you; others require an existing account.
|
||||
4. Launch the game when the Manager says the character is ready.
|
||||
5. Keep the Manager open while playing. Log out and wait for progress to finish saving before closing it or moving to another realm.
|
||||
|
||||
A realm with a lower level cap may play your character at a lower level. Check the warning: unsupported content is held back rather than silently discarded. Portable play requires a compatible server; installing the Manager alone does not add support to every server.
|
||||
|
||||
## Saved versions and conflicts
|
||||
|
||||
Use **Saved versions** to see when progress was saved. If the Manager reports a conflict, follow its explanation before continuing. Avoid playing two copies at once, and keep normal server backups as well.
|
||||
@@ -1,41 +0,0 @@
|
||||
# CoA Server Manager 0.7.0
|
||||
|
||||
### Your server, a few clicks away
|
||||
|
||||

|
||||
|
||||
### Your server at a glance
|
||||
|
||||

|
||||
|
||||
### Build your own adventuring company
|
||||
|
||||

|
||||
|
||||
### Manage your server modules
|
||||
|
||||

|
||||
|
||||
### Your client, ready to play
|
||||
|
||||

|
||||
|
||||
### Keep your progress safe
|
||||
|
||||

|
||||
|
||||
### Bring your friends along
|
||||
|
||||

|
||||
|
||||
### Find your next realm
|
||||
|
||||

|
||||
|
||||
### Portable characters · Experimental
|
||||
|
||||

|
||||
|
||||
### Make a character portable · Experimental
|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 357 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 492 KiB |
|
Before Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 470 KiB |
|
Before Width: | Height: | Size: 459 KiB |
|
Before Width: | Height: | Size: 357 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 352 KiB |
|
Before Width: | Height: | Size: 382 KiB |
|
Before Width: | Height: | Size: 160 KiB |
@@ -8,7 +8,7 @@ export {};
|
||||
|
||||
(() => {
|
||||
let added = new URLSearchParams(location.search).has("demo"), running = false;
|
||||
let realm: "coa" | "wildcard" = "coa", wildcardCreated = false;
|
||||
let realm: "coa" | "wildcard" | "reborn" = "coa", wildcardCreated = false, rebornCreated = false;
|
||||
let simultaneous = false;
|
||||
let remoteHost = localStorage.getItem("demo-remote-host") ?? "";
|
||||
const moduleEdits: Record<string, Record<string, string>> = {};
|
||||
@@ -26,11 +26,11 @@ export {};
|
||||
(window as any).__TAURI_INTERNALS__ = {
|
||||
transformCallback: (cb: unknown)=>cb, unregisterCallback(){}, convertFileSrc:(x: unknown)=>x,
|
||||
invoke: async (cmd: string, args?: any)=>{
|
||||
if(cmd==="realm_profiles") return {active:realm,wildcard_created:wildcardCreated,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:simultaneous&&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,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:false}; }
|
||||
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};
|
||||
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}; }
|
||||
if(cmd==="check_database") return [{realm, migrations:[],problems:[],full_schema:false}];
|
||||
if(cmd==="repair_server") { if(running) throw new Error("Stop the server before repairing it."); return {restored:[],applied:[],backup:"demo-before-repair",database:[{realm,migrations:[],problems:[],full_schema:false}],error:null}; }
|
||||
if(cmd==="realm_select"){await new Promise(r=>setTimeout(r,600));realm=args.mode;wildcardCreated ||= realm==="wildcard";modState.companions=realm==="coa";return {active:realm,wildcard_created:wildcardCreated,supported:true,recovery_pending:false,simultaneous,secondary_world_port:simultaneous?8086:null,secondary_running:simultaneous&&running};}
|
||||
if(cmd==="realm_select"){await new Promise(r=>setTimeout(r,600));realm=args.mode;rebornCreated ||= realm==="reborn";wildcardCreated ||= realm==="wildcard";modState.companions=realm==="coa";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};}
|
||||
if(cmd==="remote_connection") return {host:remoteHost,client_path:null};
|
||||
if(cmd==="remote_connect") { remoteHost=args.host.trim(); localStorage.setItem("demo-remote-host",remoteHost); return {host:remoteHost,client_path:null}; }
|
||||
if(cmd==="play") return {ok:true,exit_code:null,code:null,human:null,output:""};
|
||||
@@ -69,7 +69,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}].map(m => ({...m, has_settings: !["tbc-content", "wotlk-content"].includes(m.id), compatibility: realm === "wildcard" ? (["companions", "playerbots"].includes(m.id) ? "unsupported" : m.id === "client-compat" ? "compatible" : "experimental") : "compatible", switchable: realm === "wildcard" && ["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}].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||{});
|
||||
|
||||
@@ -730,6 +730,9 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
// Realmlist switcher and modules page
|
||||
"realm.profileLabel": "Realm",
|
||||
"realm.switching": "Realm wird gewechselt…",
|
||||
"realm.rebornCreate": "Warcraft-Reborn-Realm erstellen",
|
||||
"realm.rebornModules": "Die Klassenmechaniken der Bots sind für Warcraft Reborn noch nicht geprüft. Andere Module bleiben experimentell.",
|
||||
"realm.rebornUpdate": "Aktualisiere den Server auf eine Version mit Warcraft-Reborn-Unterstützung.",
|
||||
"realm.create": "Wildcard-Realm erstellen",
|
||||
"realm.restart": "Wechseln und neu starten",
|
||||
"realm.select": "Realm auswählen",
|
||||
@@ -738,8 +741,8 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
"realm.modules": "CoA-Begleiter sind hier nicht verfügbar. Content Scaling und andere Module sind auf Wildcard experimentell.",
|
||||
"realm.update": "Aktualisiere den Server auf eine Version mit Wildcard-Unterstützung, um diesen Realm zu erstellen.",
|
||||
"realm.recovery": "Ein Realm-Wechsel wurde unterbrochen. Wähle einen Realm, um die gespeicherte Konfiguration wiederherzustellen.",
|
||||
"realm.unsupported": "Auf Wildcard nicht verfügbar: Die Klassenmechanik wurde noch nicht geprüft.",
|
||||
"realm.experimental": "Experimentell auf Wildcard · Spielkompatibilität noch nicht geprüft.",
|
||||
"realm.unsupported": "Auf Wildcard / Warcraft Reborn nicht verfügbar: Die Klassenmechanik wurde noch nicht geprüft.",
|
||||
"realm.experimental": "Experimentell auf Wildcard / Warcraft Reborn · Spielkompatibilität noch nicht geprüft.",
|
||||
"realm.label": "Realm",
|
||||
"realm.other": "Anderer",
|
||||
"realm.add": "Realmlist hinzufügen …",
|
||||
|
||||
@@ -38,6 +38,9 @@ const en = {
|
||||
"repair.limited": "This older package has no full schema contract. Only character-save columns and starting data are checked.",
|
||||
"repair.unresolved": "Database problems remain. Repair does not replay already applied SQL or invent column changes. Export diagnostics with the listed problems for a corrective server update.",
|
||||
"realm.switching": "Switching realm…",
|
||||
"realm.rebornCreate": "Create Warcraft Reborn realm",
|
||||
"realm.rebornModules": "Bot class mechanics are not yet validated for Warcraft Reborn. Other modules remain experimental.",
|
||||
"realm.rebornUpdate": "Update the server to a build with Warcraft Reborn support to create this realm.",
|
||||
"realm.create": "Create Wildcard realm",
|
||||
"realm.restart": "Switch and restart",
|
||||
"realm.select": "Select realm",
|
||||
@@ -46,8 +49,8 @@ const en = {
|
||||
"realm.modules": "CoA companions are unavailable here. Content Scaling and other modules remain experimental on Wildcard.",
|
||||
"realm.update": "Update the server to a build with Wildcard support to create this realm.",
|
||||
"realm.recovery": "A realm switch was interrupted. Select a realm to recover the saved configuration.",
|
||||
"realm.unsupported": "Unavailable on Wildcard: class mechanics have not been validated.",
|
||||
"realm.experimental": "Experimental on Wildcard · gameplay compatibility is not yet verified.",
|
||||
"realm.unsupported": "Unavailable on Wildcard / Warcraft Reborn: class mechanics have not been validated.",
|
||||
"realm.experimental": "Experimental on Wildcard / Warcraft Reborn · gameplay compatibility is not yet verified.",
|
||||
"app.name": "CoA Server Manager",
|
||||
|
||||
"nav.overview": "Overview",
|
||||
|
||||
@@ -730,6 +730,9 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
// Realmlist switcher and modules page
|
||||
"realm.profileLabel": "Reino",
|
||||
"realm.switching": "Cambiando de reino…",
|
||||
"realm.rebornCreate": "Crear reino Warcraft Reborn",
|
||||
"realm.rebornModules": "Las mecánicas de clase de los bots aún no se han validado en Warcraft Reborn. Los demás módulos siguen siendo experimentales.",
|
||||
"realm.rebornUpdate": "Actualiza el servidor a una versión compatible con Warcraft Reborn.",
|
||||
"realm.create": "Crear reino Wildcard",
|
||||
"realm.restart": "Cambiar y reiniciar",
|
||||
"realm.select": "Seleccionar reino",
|
||||
@@ -738,8 +741,8 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
"realm.modules": "Los compañeros de CoA no están disponibles aquí. Content Scaling y los demás módulos siguen siendo experimentales en Wildcard.",
|
||||
"realm.update": "Actualiza el servidor a una versión compatible con Wildcard para crear este reino.",
|
||||
"realm.recovery": "Se interrumpió un cambio de reino. Selecciona un reino para recuperar la configuración guardada.",
|
||||
"realm.unsupported": "No disponible en Wildcard: las mecánicas de clase aún no se han validado.",
|
||||
"realm.experimental": "Experimental en Wildcard · compatibilidad en juego sin verificar.",
|
||||
"realm.unsupported": "No disponible en Wildcard / Warcraft Reborn: las mecánicas de clase aún no se han validado.",
|
||||
"realm.experimental": "Experimental en Wildcard / Warcraft Reborn · compatibilidad en juego sin verificar.",
|
||||
"realm.label": "Reino",
|
||||
"realm.other": "Otro",
|
||||
"realm.add": "Añadir una realmlist…",
|
||||
|
||||
@@ -730,6 +730,9 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
// Realmlist switcher and modules page
|
||||
"realm.profileLabel": "Royaume",
|
||||
"realm.switching": "Changement de royaume…",
|
||||
"realm.rebornCreate": "Créer le royaume Warcraft Reborn",
|
||||
"realm.rebornModules": "Les mécaniques de classe des bots ne sont pas encore validées sur Warcraft Reborn. Les autres modules restent expérimentaux.",
|
||||
"realm.rebornUpdate": "Mettez le serveur à jour vers une version compatible avec Warcraft Reborn.",
|
||||
"realm.create": "Créer le royaume Wildcard",
|
||||
"realm.restart": "Changer et redémarrer",
|
||||
"realm.select": "Choisir le royaume",
|
||||
@@ -738,8 +741,8 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
"realm.modules": "Les compagnons CoA sont indisponibles ici. Content Scaling et les autres modules restent expérimentaux sur Wildcard.",
|
||||
"realm.update": "Mettez le serveur à jour vers une version compatible avec Wildcard pour créer ce royaume.",
|
||||
"realm.recovery": "Un changement de royaume a été interrompu. Choisissez un royaume pour restaurer la configuration enregistrée.",
|
||||
"realm.unsupported": "Indisponible sur Wildcard : les mécaniques de classe ne sont pas encore validées.",
|
||||
"realm.experimental": "Expérimental sur Wildcard · compatibilité en jeu non vérifiée.",
|
||||
"realm.unsupported": "Indisponible sur Wildcard / Warcraft Reborn : les mécaniques de classe ne sont pas encore validées.",
|
||||
"realm.experimental": "Expérimental sur Wildcard / Warcraft Reborn · compatibilité en jeu non vérifiée.",
|
||||
"realm.label": "Royaume",
|
||||
"realm.other": "Autre",
|
||||
"realm.add": "Ajouter une realmlist…",
|
||||
|
||||
@@ -40,6 +40,9 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"repair.limited": "В старом пакете нет полного описания схемы. Проверяются только колонки сохранения персонажей и стартовые данные.",
|
||||
"repair.unresolved": "Проблемы БД остались. Repair не повторяет уже применённые SQL и не добавляет колонки наугад. Экспортируйте диагностику с этим списком для исправляющего обновления сервера.",
|
||||
"realm.switching": "Переключение реалма…",
|
||||
"realm.rebornCreate": "Создать реалм Warcraft Reborn",
|
||||
"realm.rebornModules": "Классовые механики ботов пока не проверены в Warcraft Reborn. Остальные модули экспериментальны.",
|
||||
"realm.rebornUpdate": "Для создания реалма обновите сервер до сборки с поддержкой Warcraft Reborn.",
|
||||
"realm.create": "Создать реалм Wildcard",
|
||||
"realm.restart": "Переключить и перезапустить",
|
||||
"realm.select": "Выбрать реалм",
|
||||
@@ -48,8 +51,8 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"realm.modules": "CoA-боты здесь недоступны. Скалирование и другие модули пока экспериментальны для Wildcard.",
|
||||
"realm.update": "Для создания реалма обновите сервер до сборки с поддержкой Wildcard.",
|
||||
"realm.recovery": "Переключение прервалось. Выберите реалм, чтобы восстановить сохранённые настройки.",
|
||||
"realm.unsupported": "Недоступен в Wildcard: классовые механики ещё не проверены.",
|
||||
"realm.experimental": "Экспериментально в Wildcard · игровая совместимость пока не проверена.",
|
||||
"realm.unsupported": "Недоступен в Wildcard / Warcraft Reborn: классовые механики ещё не проверены.",
|
||||
"realm.experimental": "Экспериментально в Wildcard / Warcraft Reborn · игровая совместимость пока не проверена.",
|
||||
"nav.overview": "Обзор",
|
||||
"nav.bots": "Боты",
|
||||
"nav.server": "Сервер",
|
||||
|
||||
@@ -17,6 +17,9 @@ const zh = {
|
||||
|
||||
"realm.profileLabel": "服务器",
|
||||
"realm.switching": "正在切换服务器…",
|
||||
"realm.rebornCreate": "创建 Warcraft Reborn 服务器",
|
||||
"realm.rebornModules": "Warcraft Reborn 的机器人职业机制尚未验证,其他模块仍处于实验阶段。",
|
||||
"realm.rebornUpdate": "请将服务器更新至支持 Warcraft Reborn 的版本。",
|
||||
"realm.create": "创建 Wildcard 服务器",
|
||||
"realm.restart": "切换并重启",
|
||||
"realm.select": "选择服务器",
|
||||
@@ -25,8 +28,8 @@ const zh = {
|
||||
"realm.modules": "此处无法使用 CoA 随从。动态难度等级缩放及其他模块在 Wildcard 上仍处于实验阶段。",
|
||||
"realm.update": "请先将服务器更新至支持 Wildcard 的版本以创建此服务器。",
|
||||
"realm.recovery": "服务器切换被中断。请选择一个服务器以恢复保存的配置。",
|
||||
"realm.unsupported": "在 Wildcard 上不可用:职业机制尚未验证通过。",
|
||||
"realm.experimental": "在 Wildcard 上处于实验阶段 · 游戏玩法兼容性尚未验证。",
|
||||
"realm.unsupported": "在 Wildcard / Warcraft Reborn 上不可用:职业机制尚未验证通过。",
|
||||
"realm.experimental": "在 Wildcard / Warcraft Reborn 上处于实验阶段 · 游戏玩法兼容性尚未验证。",
|
||||
"app.name": "CoA Server Manager",
|
||||
|
||||
"nav.overview": "概览",
|
||||
|
||||
@@ -53,8 +53,8 @@ export interface StatusView {
|
||||
path_exists: boolean;
|
||||
}
|
||||
|
||||
export type RealmMode = "coa" | "wildcard";
|
||||
export interface RealmProfiles { active: RealmMode; wildcard_created: boolean; supported: boolean; recovery_pending: boolean; simultaneous: boolean; secondary_world_port: number | null; secondary_running: boolean }
|
||||
export type RealmMode = "coa" | "wildcard" | "reborn";
|
||||
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 }
|
||||
export interface DatabaseCheck {
|
||||
realm: RealmMode;
|
||||
migrations: { id: string; db: string; status: "applied" | "pending" | "failed"; error: string | null }[];
|
||||
|
||||
@@ -50,11 +50,6 @@ add(scaling + "LFG.AllowPartialGroups", "bool", ["Enter with the current party",
|
||||
add(scaling + "World.Leech.Enable", "bool", ["Open-world life steal", "Отхил от урона в открытом мире", "Lebensraub in der offenen Welt", "Vol de vie en monde ouvert", "Robo de vida en mundo abierto", "开放世界吸血"], ["Heal from your damage to open-world creatures. Excludes players, their pets and instances. Requires the module; group scaling and solo assistance are optional.", "Восстанавливает здоровье от вашего урона существам открытого мира. Исключает игроков, их питомцев и инстансы. Требует включения модуля; скейлинг группы и соло-помощь необязательны.", "Heilt durch eigenen Schaden an Weltkreaturen. Ohne Spieler, deren Begleiter und Instanzen. Erfordert das Modul; Gruppenanpassung und Solohilfe sind optional.", "Soigne grâce aux dégâts aux créatures du monde ouvert. Exclut joueurs, familiers et instances. Nécessite le module ; adaptation au groupe et aide solo facultatives.", "Cura con tu daño a criaturas del mundo abierto. Excluye jugadores, mascotas e instancias. Requiere el módulo; ajuste al grupo y ayuda individual opcionales.", "对开放世界生物造成伤害时恢复生命。不适用于玩家、玩家宠物和副本。需要启用模块,队伍缩放和单人辅助可选。"]);
|
||||
add(scaling + "World.Leech.Percent", "float", ["Life steal (%)", "Отхил от нанесённого урона (%)", "Lebensraub (%)", "Vol de vie (%)", "Robo de vida (%)", "吸血比例(%)"], ["Percentage of damage returned as health: 0–100. 10 means 10%. Requires open-world life steal. Overkill gives no extra healing.", "Процент урона, возвращаемый здоровьем: 0–100. Значение 10 означает 10%. Требует включения отхила в открытом мире. Избыточный урон при добивании не увеличивает отхил.", "Schadensanteil als Heilung: 0–100. 10 bedeutet 10%. Erfordert Welt-Lebensraub. Überzähliger Schaden heilt nicht zusätzlich.", "Pourcentage des dégâts rendu en vie : 0–100. 10 signifie 10%. Nécessite le vol de vie. Les dégâts excédentaires ne soignent pas davantage.", "Porcentaje del daño recuperado como salud: 0–100. 10 significa 10%. Requiere robo de vida. El daño excedente no aporta curación adicional.", "将伤害的0至100%转化为生命。10表示10%。需要启用吸血。过量伤害不会额外治疗。"], { min: 0, max: 100 });
|
||||
add(scaling + "Difficulty.DamageMultiplier", "range", ["Enemy damage", "Урон противников", "Gegnerschaden", "Dégâts ennemis", "Daño enemigo", "敌人伤害"], ["Dungeon and raid damage after group scaling and solo assistance. 100% keeps the normal balance; lower is easier. Applies to everyone on this server. Does not change health, loot or instant-kill mechanics.", "Урон в подземельях и рейдах после скейлинга группы и соло-помощи. 100% — обычный баланс, ниже — легче. Действует для всех игроков сервера. Не меняет здоровье, добычу и механики мгновенной смерти.", "Schaden in Dungeons und Schlachtzügen nach Gruppenanpassung und Solohilfe. 100% ist normal, weniger ist leichter. Gilt für alle Spieler. Ändert weder Gesundheit noch Beute oder Soforttötungen.", "Dégâts en donjon et raid après adaptation au groupe et aide solo. 100% conserve l’équilibrage normal ; moins est plus facile. Pour tous les joueurs. Ne change ni la vie, ni le butin, ni les morts instantanées.", "Daño en mazmorras y bandas tras el ajuste del grupo y la ayuda individual. 100% mantiene el equilibrio normal; menos es más fácil. Para todos los jugadores. No cambia salud, botín ni muerte instantánea.", "队伍缩放和单人辅助后的地下城与团队副本伤害。100%为正常,降低后更容易。对全服玩家生效,不改变生命值、掉落或即死机制。"], { min: 0.25, max: 2 });
|
||||
add(scaling + "Difficulty.Health.WorldMultiplier", "float", ["Mob health in the open world (×)", "Здоровье мобов в открытом мире (×)", "Mob-Gesundheit in der offenen Welt (×)", "Vie des monstres en monde ouvert (×)", "Vida de los monstruos en el mundo abierto (×)", "野外怪物生命值(×)"], ["Multiplies the health of scaled creatures in the open world, on top of the scaling and the world health setting of the server. 1 keeps the normal balance; lower is easier. Creatures already in the world change when they respawn.", "Умножает здоровье подстроенных существ в открытом мире поверх скейлинга и настройки здоровья мира. 1 — обычный баланс, меньше — легче. Существа, уже стоящие в мире, меняются после возрождения.", "Multipliziert die Gesundheit skalierter Kreaturen in der offenen Welt zusätzlich zur Skalierung und zur Welt-Gesundheitseinstellung. 1 ist normal, weniger ist leichter. Bereits vorhandene Kreaturen ändern sich nach dem Respawn.", "Multiplie la vie des créatures adaptées en monde ouvert, en plus de l’adaptation et du réglage de vie du monde. 1 conserve l’équilibrage normal ; moins est plus facile. Les créatures déjà présentes changent après réapparition.", "Multiplica la vida de las criaturas ajustadas en el mundo abierto, además del ajuste y la vida configurada del mundo. 1 mantiene el equilibrio normal; menos es más fácil. Las criaturas ya presentes cambian al reaparecer.", "在缩放和服务器世界生命值设置之上,倍乘野外已缩放生物的生命值。1为正常,降低后更容易。已存在的生物在重生后生效。"], { min: 0.1, max: 10 });
|
||||
add(scaling + "Difficulty.Health.DungeonMultiplier", "float", ["Mob health in dungeons (×)", "Здоровье мобов в подземельях (×)", "Mob-Gesundheit in Dungeons (×)", "Vie des monstres en donjon (×)", "Vida de los monstruos en mazmorras (×)", "地下城怪物生命值(×)"], ["Multiplies the health of scaled creatures in dungeons, on top of the scaling and the dungeon health setting of the server. 1 keeps the normal balance; lower is easier. Applies to new dungeon runs.", "Умножает здоровье подстроенных существ в подземельях поверх скейлинга и настройки здоровья подземелий. 1 — обычный баланс, меньше — легче. Действует на новые заходы.", "Multipliziert die Gesundheit skalierter Kreaturen in Dungeons zusätzlich zur Skalierung und zur Dungeon-Gesundheitseinstellung. 1 ist normal, weniger ist leichter. Gilt für neue Dungeon-Läufe.", "Multiplie la vie des créatures adaptées en donjon, en plus de l’adaptation et du réglage de vie des donjons. 1 conserve l’équilibrage normal ; moins est plus facile. S’applique aux nouvelles instances.", "Multiplica la vida de las criaturas ajustadas en mazmorras, además del ajuste y la vida configurada de mazmorras. 1 mantiene el equilibrio normal; menos es más fácil. Se aplica a nuevas instancias.", "在缩放和服务器地下城生命值设置之上,倍乘地下城内已缩放生物的生命值。1为正常,降低后更容易。对新的副本生效。"], { min: 0.1, max: 10 });
|
||||
add(scaling + "Difficulty.Health.RaidMultiplier", "float", ["Mob health in raids (×)", "Здоровье мобов в рейдах (×)", "Mob-Gesundheit in Schlachtzügen (×)", "Vie des monstres en raid (×)", "Vida de los monstruos en bandas (×)", "团队副本怪物生命值(×)"], ["Multiplies the health of scaled creatures in raids, on top of the scaling and the raid health setting of the server. 1 keeps the normal balance; lower is easier. A boss with a calibrated health value keeps it.", "Умножает здоровье подстроенных существ в рейдах поверх скейлинга и настройки здоровья рейдов. 1 — обычный баланс, меньше — легче. Босс с откалиброванным здоровьем сохраняет его.", "Multipliziert die Gesundheit skalierter Kreaturen in Schlachtzügen zusätzlich zur Skalierung und zur Schlachtzug-Gesundheitseinstellung. 1 ist normal, weniger ist leichter. Ein Boss mit kalibriertem Wert behält ihn.", "Multiplie la vie des créatures adaptées en raid, en plus de l’adaptation et du réglage de vie des raids. 1 conserve l’équilibrage normal ; moins est plus facile. Un boss à vie calibrée la conserve.", "Multiplica la vida de las criaturas ajustadas en bandas, además del ajuste y la vida configurada de bandas. 1 mantiene el equilibrio normal; menos es más fácil. Un jefe con vida calibrada la conserva.", "在缩放和服务器团队副本生命值设置之上,倍乘团队副本内已缩放生物的生命值。1为正常,降低后更容易。有校准生命值的首领保持原值。"], { min: 0.1, max: 10 });
|
||||
add(scaling + "Difficulty.Health.TrashMultiplier", "float", ["Ordinary mob health (×)", "Здоровье обычных мобов (×)", "Gesundheit gewöhnlicher Mobs (×)", "Vie des monstres ordinaires (×)", "Vida de monstruos normales (×)", "普通怪物生命值(×)"], ["Multiplies the health of ordinary creatures everywhere, together with the place setting. 1 keeps the normal balance; lower is easier.", "Умножает здоровье обычных существ везде, вместе с настройкой места. 1 — обычный баланс, меньше — легче.", "Multipliziert die Gesundheit gewöhnlicher Kreaturen überall, zusammen mit der Ortseinstellung. 1 ist normal, weniger ist leichter.", "Multiplie la vie des créatures ordinaires partout, avec le réglage du lieu. 1 conserve l’équilibrage normal ; moins est plus facile.", "Multiplica la vida de las criaturas normales en todas partes, junto con el ajuste del lugar. 1 mantiene el equilibrio normal; menos es más fácil.", "与所在区域设置一起,倍乘各处普通生物的生命值。1为正常,降低后更容易。"], { min: 0.1, max: 10 });
|
||||
add(scaling + "Difficulty.Health.BossMultiplier", "float", ["Boss health (×)", "Здоровье боссов (×)", "Boss-Gesundheit (×)", "Vie des boss (×)", "Vida de los jefes (×)", "首领生命值(×)"], ["Multiplies the health of bosses everywhere, together with the place setting: a dungeon boss gets the dungeon and the boss multiplier. 1 keeps the normal balance; lower is easier.", "Умножает здоровье боссов везде, вместе с настройкой места: босс подземелья получает множитель подземелья и боссов. 1 — обычный баланс, меньше — легче.", "Multipliziert die Gesundheit von Bossen überall, zusammen mit der Ortseinstellung: ein Dungeon-Boss erhält den Dungeon- und den Boss-Multiplikator. 1 ist normal, weniger ist leichter.", "Multiplie la vie des boss partout, avec le réglage du lieu : un boss de donjon reçoit le multiplicateur du donjon et celui des boss. 1 conserve l’équilibrage normal ; moins est plus facile.", "Multiplica la vida de los jefes en todas partes, junto con el ajuste del lugar: un jefe de mazmorra recibe el multiplicador de mazmorra y el de jefes. 1 mantiene el equilibrio normal; menos es más fácil.", "与所在区域设置一起,倍乘各处首领的生命值:地下城首领同时受地下城和首领倍率影响。1为正常,降低后更容易。"], { min: 0.1, max: 10 });
|
||||
add(scaling + "SoloAssist.Mode", "enum", ["Solo assistance", "Помощь в соло", "Solohilfe", "Aide solo", "Ayuda individual", "单人辅助"], ["Additional damage reduction when the scaling target is one player.", "Дополнительное снижение урона, когда расчёт сложности рассчитан на одного игрока.", "Zusätzliche Schadensreduktion bei einem Skalierungsziel von einem Spieler.", "Réduction supplémentaire quand la difficulté est calculée pour un joueur.", "Reducción adicional cuando la dificultad se calcula para un jugador.", "难度目标为一名玩家时额外减伤。"], { options: [
|
||||
{ value: "None", label: ["None", "Без помощи", "Keine", "Aucune", "Ninguna", "无"] },
|
||||
{ value: "Light", label: ["Light (−15%)", "Лёгкая (−15%)", "Leicht (−15%)", "Légère (−15%)", "Ligera (−15%)", "轻度(−15%)"] },
|
||||
|
||||
@@ -36,7 +36,7 @@ export function BackupsPage({ serverId }: { serverId: string }) {
|
||||
const trigger = (x: string) => (TRIGGER_KEYS.includes(x) ? t(`bk.trigger.${x}` as Key) : x);
|
||||
const dbLabel = (x: string) => {
|
||||
const [realm, kind] = x.split("-");
|
||||
if (kind && DB_KEYS.includes(kind)) return `${realm === "coa" ? "CoA" : "Wildcard"} · ${t(`bk.db.${kind}` as Key)}`;
|
||||
if (kind && DB_KEYS.includes(kind)) return `${realm === "coa" ? "CoA" : realm === "reborn" ? "Warcraft Reborn" : "Wildcard"} · ${t(`bk.db.${kind}` as Key)}`;
|
||||
return DB_KEYS.includes(x) ? t(`bk.db.${x}` as Key) : x;
|
||||
};
|
||||
const [points, setPoints] = useState<RecoveryPoint[] | null>(null);
|
||||
@@ -198,7 +198,7 @@ export function BackupsPage({ serverId }: { serverId: string }) {
|
||||
<div>
|
||||
<p className="font-medium">{p.label && p.trigger === "manual" && p.label !== "e2e" ? p.label : trigger(p.trigger)}</p>
|
||||
<p className="text-sm text-muted">
|
||||
{w(p.created_at)} · {p.realm === "wildcard" ? "Wildcard" : "CoA"} · {t(`bk.kind.${p.kind}` as Key)} · {size(p.components.reduce((a, c) => a + c.bytes, p.mysql_snapshot?.bytes ?? 0))}
|
||||
{w(p.created_at)} · {p.realm === "reborn" ? "Warcraft Reborn" : p.realm === "wildcard" ? "Wildcard" : "CoA"} · {t(`bk.kind.${p.kind}` as Key)} · {size(p.components.reduce((a, c) => a + c.bytes, p.mysql_snapshot?.bytes ?? 0))}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex shrink-0 gap-1">
|
||||
|
||||
@@ -79,7 +79,7 @@ export function Overview({ server, companions = true, onForget, onOpenUpdates, o
|
||||
let alive = true;
|
||||
void api.realmProfiles(server.id).then((r) => {
|
||||
if (!alive) return;
|
||||
const name = (m: "coa" | "wildcard") => (m === "coa" ? "Conquest of Azeroth" : "Wildcard");
|
||||
const name = (m: "coa" | "wildcard" | "reborn") => (m === "coa" ? "Conquest of Azeroth" : m === "reborn" ? "Warcraft Reborn" : "Wildcard");
|
||||
setRealms({ first: name(r.active), second: name(r.active === "coa" ? "wildcard" : "coa") });
|
||||
}).catch(() => { if (alive) setRealms(null); });
|
||||
return () => { alive = false; };
|
||||
|
||||
@@ -37,16 +37,19 @@ export function RealmPicker({ serverId, running, disabled, onChanged, onBusy }:
|
||||
{view?.simultaneous ? <span className="text-sm text-muted">Conquest of Azeroth + Wildcard</span> : <select id="realm-profile" value={selected} disabled={!view || disabled || busy} onChange={e => setSelected(e.target.value as RealmMode)} className="min-w-52 rounded-md border border-line bg-card-2 px-3 py-2 text-ink">
|
||||
<option value="coa">Conquest of Azeroth</option>
|
||||
<option value="wildcard" disabled={!view?.supported && !view?.wildcard_created}>Wildcard · Darkmoon</option>
|
||||
<option value="reborn" disabled={!view?.reborn_supported && !view?.reborn_created}>Warcraft Reborn</option>
|
||||
</select>}
|
||||
{view && !view.simultaneous && (selected !== view.active || view.recovery_pending) && <Button size="sm" disabled={disabled || busy} onClick={() => void select()}>
|
||||
{busy && <Loader2 className="h-4 w-4 animate-spin" aria-hidden />}
|
||||
{busy ? t("realm.switching") : selected === "wildcard" && !view.wildcard_created ? t("realm.create") : running ? t("realm.restart") : t("realm.select")}
|
||||
{busy ? t("realm.switching") : selected === "wildcard" && !view.wildcard_created ? t("realm.create") : selected === "reborn" && !view.reborn_created ? t("realm.rebornCreate") : running ? t("realm.restart") : t("realm.select")}
|
||||
</Button>}
|
||||
{view && !view.simultaneous && <span className="ml-auto text-xs text-muted">{t("realm.active", { name: view.active === "coa" ? "CoA" : "Wildcard" })}</span>}
|
||||
{view && !view.simultaneous && <span className="ml-auto text-xs text-muted">{t("realm.active", { name: view.active === "coa" ? "CoA" : view.active === "reborn" ? "Warcraft Reborn" : "Wildcard" })}</span>}
|
||||
</div>
|
||||
<p className="mt-3 text-sm text-muted">{t(view?.simultaneous ? "realm.bothRunning" : "realm.separate")}</p>
|
||||
{selected === "reborn" && <p className="mt-2 text-sm text-warn">{t("realm.rebornModules")}</p>}
|
||||
{view && selected === "reborn" && !view.reborn_supported && <p className="mt-2 text-sm text-warn">{t("realm.rebornUpdate")}</p>}
|
||||
{selected === "wildcard" && <p className="mt-2 text-sm text-warn">{t("realm.modules")}</p>}
|
||||
{view && !view.supported && <p className="mt-2 text-sm text-warn">{t("realm.update")}</p>}
|
||||
{view && selected === "wildcard" && !view.supported && <p className="mt-2 text-sm text-warn">{t("realm.update")}</p>}
|
||||
{view?.recovery_pending && <p className="mt-2 text-sm text-warn">{t("realm.recovery")}</p>}
|
||||
{error && <p className="mt-3 selectable text-sm text-bad" role="alert">{error}</p>}
|
||||
</Card>;
|
||||
|
||||
@@ -22,7 +22,7 @@ export function RealmStartupSettings({ serverId }: { serverId: string }) {
|
||||
return <Card className="mt-6 p-6" aria-busy={busy}>
|
||||
<h2 className="font-semibold">{t("realm.startupTitle")}</h2>
|
||||
<label className="mt-3 flex items-center gap-3">
|
||||
<input type="checkbox" checked={view?.simultaneous ?? false} disabled={!view || busy || !view.supported} onChange={e => void change(e.target.checked)} />
|
||||
<input type="checkbox" checked={view?.simultaneous ?? false} disabled={!view || busy || !view.supported || view.active === "reborn"} onChange={e => void change(e.target.checked)} />
|
||||
<span>{t("realm.simultaneous")}</span>
|
||||
</label>
|
||||
<p className="mt-2 text-sm text-muted">{t("realm.simultaneousHint")}</p>
|
||||
|
||||
@@ -45,7 +45,7 @@ export function RepairCard({ serverId }: { serverId: string }) {
|
||||
{checks?.map(c => {
|
||||
const pending = c.migrations.filter(m => m.status !== "applied");
|
||||
return <div key={c.realm} className="mt-4 border-t border-line pt-3 text-sm">
|
||||
<p className="font-medium">{c.realm === "coa" ? "Conquest of Azeroth" : "Wildcard"}</p>
|
||||
<p className="font-medium">{c.realm === "coa" ? "Conquest of Azeroth" : c.realm === "reborn" ? "Warcraft Reborn" : "Wildcard"}</p>
|
||||
<p className={c.problems.length || pending.length ? "text-warn" : "text-ok"}>{t("repair.dbCount", { columns: c.problems.length, sql: pending.length })}</p>
|
||||
{!c.full_schema && <p className="mt-1 text-muted">{t("repair.limited")}</p>}
|
||||
<ul className="mt-2 max-h-52 overflow-auto selectable text-muted">
|
||||
|
||||
@@ -32,7 +32,7 @@ def version_key(version):
|
||||
|
||||
def eligible(release, component):
|
||||
pattern = r'v(\d+(?:\.\d+)+)' if component == 'manager' else r'server-(\d+(?:\.\d+)+)'
|
||||
return not release['draft'] and re.fullmatch(pattern, release['tag_name'])
|
||||
return not release['draft'] and not release['prerelease'] and re.fullmatch(pattern, release['tag_name'])
|
||||
|
||||
|
||||
def published(repo, component):
|
||||
@@ -42,7 +42,7 @@ def published(repo, component):
|
||||
|
||||
|
||||
def fragment_note(text, areas):
|
||||
sections = text.lstrip('\ufeff').strip().split('---', 2)
|
||||
sections = text.strip().split('---', 2)
|
||||
if len(sections) != 3 or sections[0]:
|
||||
raise ValueError('Invalid release fragment')
|
||||
fields = dict(line.split(':', 1) for line in sections[1].splitlines() if ':' in line)
|
||||
@@ -58,24 +58,16 @@ def fragment_note(text, areas):
|
||||
return title
|
||||
|
||||
|
||||
def remote_fragments(repo, sha, seen, areas, excluded_blobs=(), overrides=None):
|
||||
def remote_fragments(repo, sha, seen, areas):
|
||||
if not re.fullmatch(r'[0-9a-f]{40}', sha):
|
||||
raise ValueError('Changelog collection requires an immutable source SHA')
|
||||
listing = api(f'repos/{repo}/contents/changelog.d?ref={sha}')
|
||||
files = [f for f in listing if re.fullmatch(r'\d{8}-[a-z0-9-]+\.md', f['name'])]
|
||||
new = [f for f in files if repo + ':' + f['name'] not in seen and f['sha'] not in excluded_blobs]
|
||||
new = [f for f in files if repo + ':' + f['name'] not in seen]
|
||||
|
||||
def read(item):
|
||||
reviewed = (overrides or {}).get(repo + ':' + item['sha'])
|
||||
if reviewed is not None:
|
||||
if not isinstance(reviewed, str) or not reviewed.strip():
|
||||
raise ValueError('Reviewed fragment override needs a player-facing title')
|
||||
return reviewed
|
||||
blob = api(f'repos/{repo}/git/blobs/{item["sha"]}')
|
||||
try:
|
||||
return fragment_note(base64.b64decode(blob['content']).decode('utf-8'), areas)
|
||||
except ValueError as error:
|
||||
raise ValueError(f'{repo}:{item["name"]}@{sha}: {error}') from error
|
||||
return fragment_note(base64.b64decode(blob['content']).decode('utf-8'), areas)
|
||||
|
||||
with ThreadPoolExecutor(max_workers=6) as pool:
|
||||
notes = [note for note in pool.map(read, new) if note]
|
||||
@@ -83,50 +75,32 @@ def remote_fragments(repo, sha, seen, areas, excluded_blobs=(), overrides=None):
|
||||
|
||||
|
||||
def collect_manager(root, tag, seen):
|
||||
sha = subprocess.check_output(['git', '-C', str(root), 'rev-parse', tag + '^{commit}'], encoding='utf8').strip()
|
||||
paths = subprocess.check_output(['git', '-C', str(root), 'ls-tree', '-r', '--name-only', sha, 'changelog.d'], encoding='utf8').splitlines()
|
||||
sha = subprocess.check_output(['git', '-C', str(root), 'rev-parse', tag + '^{commit}'], encoding='utf8', newline='\n').strip()
|
||||
paths = subprocess.check_output(['git', '-C', str(root), 'ls-tree', '-r', '--name-only', sha, 'changelog.d'], encoding='utf8', newline='\n').splitlines()
|
||||
paths = [p for p in paths if re.fullmatch(r'changelog.d/\d{8}-[a-z0-9-]+\.md', p)]
|
||||
repo = 'Corfirean/coa-server-manager'
|
||||
notes = []
|
||||
for path in paths:
|
||||
if repo + ':' + Path(path).name not in seen:
|
||||
text = subprocess.check_output(['git', '-C', str(root), 'show', f'{sha}:{path}'], encoding='utf8')
|
||||
text = subprocess.check_output(['git', '-C', str(root), 'show', f'{sha}:{path}'], encoding='utf8', newline='\n')
|
||||
note = fragment_note(text, MANAGER_AREAS)
|
||||
if note:
|
||||
notes.append(note)
|
||||
source = {'commit': sha}
|
||||
if any('portable' in note.lower() and 'experimental' in note.lower() for note in notes):
|
||||
source['experimentalFeatures'] = ['portable-characters']
|
||||
return notes, [repo + ':' + Path(p).name for p in paths], source
|
||||
return notes, [repo + ':' + Path(p).name for p in paths], {'commit': sha}
|
||||
|
||||
|
||||
def upstream_fragment_blobs(lock):
|
||||
upstream = lock['components'].get('upstream')
|
||||
if not upstream:
|
||||
return set()
|
||||
prefix = 'repos/' + upstream['repository'] + '/git/trees/'
|
||||
tree = api(prefix + upstream['sha'])['tree']
|
||||
directory = next((item for item in tree if item['path'] == 'changelog.d' and item['type'] == 'tree'), None)
|
||||
if not directory:
|
||||
return set()
|
||||
files = api(prefix + directory['sha'])['tree']
|
||||
return {item['sha'] for item in files if item['type'] == 'blob' and re.fullmatch(r'\d{8}-[a-z0-9-]+\.md', item['path'])}
|
||||
|
||||
|
||||
def collect_server(repo, tag, seen, previous, overrides=None):
|
||||
def collect_server(repo, tag, seen, previous):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
subprocess.run(['gh', 'release', 'download', tag, '--repo', repo, '--pattern', 'release-lock.json', '--dir', folder], check=True)
|
||||
lock = json.loads((Path(folder) / 'release-lock.json').read_text(encoding='utf-8-sig'))
|
||||
notes, ids = [], []
|
||||
imported_blobs = upstream_fragment_blobs(lock)
|
||||
for role in ('core', 'bots', 'scaling', 'build'):
|
||||
item = lock['components'].get(role)
|
||||
if not item:
|
||||
raise ValueError('Release lock has no ' + role + ' source')
|
||||
if item['repository'] == 'Corfirean/coa-server-manager':
|
||||
raise ValueError('A Manager source cannot supply server release notes')
|
||||
entries, found = remote_fragments(item['repository'], item['sha'], seen, SERVER_AREAS,
|
||||
imported_blobs if role == 'core' else (), overrides)
|
||||
entries, found = remote_fragments(item['repository'], item['sha'], seen, SERVER_AREAS)
|
||||
notes.extend(entries)
|
||||
ids.extend(found)
|
||||
old = previous.get('components', {})
|
||||
@@ -140,24 +114,16 @@ def collect_server(repo, tag, seen, previous, overrides=None):
|
||||
notes.append(f'Updated {label} to {version}')
|
||||
if lock['components'].get('upstream', {}).get('sha') != old.get('upstream', {}).get('sha'):
|
||||
notes.append('Updated the reviewed CoA upstream snapshot')
|
||||
return list(dict.fromkeys(notes)), ids, {'snapshot': lock['snapshot'], 'components': lock['components'],
|
||||
'experimentalFeatures': lock.get('experimentalFeatures', [])}
|
||||
return list(dict.fromkeys(notes)), ids, {'snapshot': lock['snapshot'], 'components': lock['components']}
|
||||
|
||||
|
||||
def notes_md(record):
|
||||
status = ' (Pre-release)' if record.get('prerelease') else ''
|
||||
lines = [f'## {record["version"]}{status} — {record["date"]}', '']
|
||||
if record.get('notice'):
|
||||
lines += [record['notice'], '']
|
||||
if 'portable-characters' in record.get('experimentalFeatures', []):
|
||||
lines += ['**Portable Characters are experimental and may contain bugs.**', '']
|
||||
lines.extend('- ' + note.strip().rstrip('.') + '.' for note in record['notes'])
|
||||
lines = [f'## {record["version"]} — {record["date"]}', '']
|
||||
lines.extend('- ' + note.rstrip('.') + '.' for note in record['notes'])
|
||||
label = 'Archived release record' if record.get('legacy') else 'Release'
|
||||
lines += ['', f'[{label}]({record["url"]})']
|
||||
if record.get('compare'):
|
||||
lines[-1] += f' · [Source changes]({record["compare"]})'
|
||||
if record.get('links'):
|
||||
lines += ['', *(link.strip() for link in record['links'])]
|
||||
return '\n'.join(lines) + '\n'
|
||||
|
||||
|
||||
@@ -169,8 +135,7 @@ def render(history):
|
||||
lines = [f'# {title} changelog', '',
|
||||
('Manager releases only. Updating the Manager does not update the server.' if component == 'manager'
|
||||
else 'Server packages, companions and server modules only. Manager releases have their own changelog.'),
|
||||
'', other, '', 'Published releases and previews. Pre-release entries do not change the stable update channel.', '',
|
||||
'Dates follow GitHub publication (UTC); legacy records retain their archived dates. Newest releases first.', '']
|
||||
'', other, '', 'Dates follow GitHub publication (UTC); legacy records retain their archived dates. Newest releases first.', '']
|
||||
for record in sorted(history['releases'], key=lambda r: (r['date'], version_key(r['version'])), reverse=True):
|
||||
lines.append(notes_md(record))
|
||||
return '\n'.join(lines).rstrip() + '\n'
|
||||
@@ -196,45 +161,6 @@ def validate_history(history):
|
||||
raise ValueError('Server history cannot consume Manager fragments')
|
||||
|
||||
|
||||
def reconcile(history, releases, root):
|
||||
component, repo = history['component'], history['repository']
|
||||
records = {r['tag']: r for r in history['releases']}
|
||||
seen = set(history.get('consumedFragments', []))
|
||||
for release in releases:
|
||||
tag = release['tag_name']
|
||||
preview = bool(release.get('prerelease'))
|
||||
if tag in records:
|
||||
record = records[tag]
|
||||
if preview:
|
||||
record['prerelease'] = True
|
||||
elif record.pop('prerelease', False):
|
||||
seen.update(record.pop('fragments', []))
|
||||
continue
|
||||
version = tag.removeprefix('server-').removeprefix('v')
|
||||
older = [r for r in history['releases'] if not r.get('prerelease')
|
||||
and version_key(r['version']) < version_key(version)]
|
||||
previous = max(older, key=lambda r: version_key(r['version']), default={})
|
||||
if component == 'manager':
|
||||
notes, ids, source = collect_manager(root, tag, frozenset(seen))
|
||||
else:
|
||||
notes, ids, source = collect_server(repo, tag, frozenset(seen), previous,
|
||||
history.get('fragmentOverrides'))
|
||||
if not notes:
|
||||
notes = ['No additional player-facing changes were recorded for this build']
|
||||
record = {'tag': tag, 'version': version, 'date': release['published_at'][:10],
|
||||
'url': release['html_url'], 'notes': notes, **source}
|
||||
if preview:
|
||||
record.update(prerelease=True, fragments=ids)
|
||||
else:
|
||||
seen.update(ids)
|
||||
if previous.get('tag'):
|
||||
record['compare'] = f'https://github.com/{repo}/compare/{previous["tag"]}...{tag}'
|
||||
history['releases'].append(record)
|
||||
records[tag] = record
|
||||
history['consumedFragments'] = sorted(seen)
|
||||
validate_history(history)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--root', type=Path, default=Path.cwd())
|
||||
@@ -248,8 +174,32 @@ def main():
|
||||
component, repo = history['component'], history['repository']
|
||||
if component not in ('server', 'manager'):
|
||||
raise ValueError('History must belong to one component')
|
||||
existing = {r['tag'] for r in history['releases']}
|
||||
seen = set(history.get('consumedFragments', []))
|
||||
releases = [] if args.render_only else published(repo, component)
|
||||
reconcile(history, releases, args.root)
|
||||
previous = sorted(history['releases'], key=lambda r: (r['date'], version_key(r['version'])))[-1] if existing else {}
|
||||
for release in releases:
|
||||
tag = release['tag_name']
|
||||
if tag in existing:
|
||||
continue
|
||||
version = tag.removeprefix('server-').removeprefix('v')
|
||||
if previous and version_key(version) <= version_key(previous['version']):
|
||||
raise ValueError('Historical backfill requires a reviewed history correction: ' + tag)
|
||||
if component == 'manager':
|
||||
notes, ids, source = collect_manager(args.root, tag, seen)
|
||||
else:
|
||||
notes, ids, source = collect_server(repo, tag, seen, previous)
|
||||
if not notes:
|
||||
notes = ['Detailed player-facing notes were not recorded; see the source changes for this release']
|
||||
record = {'tag': tag, 'version': tag.removeprefix('server-').removeprefix('v'),
|
||||
'date': release['published_at'][:10], 'url': release['html_url'], 'notes': notes, **source}
|
||||
if previous.get('tag'):
|
||||
record['compare'] = f'https://github.com/{repo}/compare/{previous["tag"]}...{tag}'
|
||||
history['releases'].append(record)
|
||||
seen.update(ids)
|
||||
previous = record
|
||||
history['consumedFragments'] = sorted(seen)
|
||||
validate_history(history)
|
||||
# Keep a separately reviewed history as the source of truth for historical corrections.
|
||||
path.write_text(json.dumps(history, indent=2, ensure_ascii=False) + '\n', encoding='utf8', newline='\n')
|
||||
(args.root / 'CHANGELOG.md').write_text(render(history), encoding='utf8', newline='\n')
|
||||
@@ -258,7 +208,7 @@ def main():
|
||||
for record in history['releases']:
|
||||
release = actual.get(record['tag'])
|
||||
if not release:
|
||||
continue # Never create a missing historical release.
|
||||
continue # Never create a missing historical release or touch a prerelease.
|
||||
body = notes_md(record)
|
||||
if (release.get('body') or '').strip() != body.strip():
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
|
||||
@@ -28,68 +28,16 @@ class ComponentHistoryTests(unittest.TestCase):
|
||||
history['releases'][0]['tag'] = 'server-0.6.22'
|
||||
with self.assertRaises(ValueError): sync.validate_history(history)
|
||||
|
||||
def test_published_previews_are_included_but_drafts_and_other_components_are_not(self):
|
||||
def test_unpublished_and_prerelease_tags_never_enter_history(self):
|
||||
release = {'tag_name': 'v0.7.0', 'draft': True, 'prerelease': False}
|
||||
self.assertFalse(sync.eligible(release, 'manager'))
|
||||
release.update(draft=False, prerelease=True)
|
||||
self.assertTrue(sync.eligible(release, 'manager'))
|
||||
self.assertFalse(sync.eligible(release, 'manager'))
|
||||
release.update(prerelease=False)
|
||||
self.assertTrue(sync.eligible(release, 'manager'))
|
||||
self.assertFalse(sync.eligible(release, 'server'))
|
||||
self.assertFalse(sync.eligible(dict(release, tag_name='stable'), 'server'))
|
||||
|
||||
def release(self, version='0.7.0', preview=True):
|
||||
return {'tag_name': 'v' + version, 'prerelease': preview, 'draft': False,
|
||||
'published_at': '2026-10-22T12:00:00Z', 'html_url': 'https://example.test/v' + version}
|
||||
|
||||
def test_preview_does_not_consume_stable_changes_and_repeated_sync_is_idempotent(self):
|
||||
history = self.history()
|
||||
with patch.object(sync, 'collect_manager', return_value=(['Portable Characters are experimental'], ['own:portable'], {'commit': 'a' * 40})) as collect:
|
||||
sync.reconcile(history, [self.release()], Path('.'))
|
||||
sync.reconcile(history, [self.release()], Path('.'))
|
||||
self.assertEqual(collect.call_count, 1)
|
||||
self.assertEqual(history['consumedFragments'], [])
|
||||
self.assertEqual(len(history['releases']), 2)
|
||||
self.assertTrue(history['releases'][-1]['prerelease'])
|
||||
self.assertIn('## 0.7.0 (Pre-release)', sync.render(history))
|
||||
|
||||
def test_promotion_updates_the_same_reviewed_record_without_collecting_or_duplicating(self):
|
||||
history = self.history()
|
||||
with patch.object(sync, 'collect_manager', return_value=(['Portable Characters are experimental'], ['own:portable'], {'commit': 'a' * 40})):
|
||||
sync.reconcile(history, [self.release()], Path('.'))
|
||||
history['releases'][-1]['notes'] = ['Reviewed player-facing text']
|
||||
with patch.object(sync, 'collect_manager', side_effect=AssertionError('Frozen notes already recorded')):
|
||||
sync.reconcile(history, [self.release(preview=False)], Path('.'))
|
||||
sync.reconcile(history, [self.release(preview=False)], Path('.'))
|
||||
self.assertEqual(len(history['releases']), 2)
|
||||
self.assertNotIn('prerelease', history['releases'][-1])
|
||||
self.assertEqual(history['consumedFragments'], ['own:portable'])
|
||||
self.assertEqual(history['releases'][-1]['notes'], ['Reviewed player-facing text'])
|
||||
|
||||
def test_stable_hotfix_after_higher_preview_keeps_its_own_notes(self):
|
||||
history = self.history()
|
||||
with patch.object(sync, 'collect_manager', return_value=(['Shared improvement'], ['own:shared'], {'commit': 'a' * 40})):
|
||||
sync.reconcile(history, [self.release()], Path('.'))
|
||||
with patch.object(sync, 'collect_manager', return_value=(['Shared improvement'], ['own:shared'], {'commit': 'b' * 40})) as collect:
|
||||
sync.reconcile(history, [self.release('0.6.23', preview=False), self.release()], Path('.'))
|
||||
self.assertEqual(collect.call_args.args[2], set())
|
||||
hotfix = next(r for r in history['releases'] if r['version'] == '0.6.23')
|
||||
self.assertEqual(hotfix['notes'], ['Shared improvement'])
|
||||
self.assertEqual(history['consumedFragments'], ['own:shared'])
|
||||
|
||||
def test_server_preview_uses_only_server_locked_sources_and_keeps_notice(self):
|
||||
history = {'schema': 1, 'component': 'server', 'repository': 'Corfirean/coa-server-build',
|
||||
'consumedFragments': [], 'releases': []}
|
||||
release = dict(self.release(), tag_name='server-0.261022.75')
|
||||
with patch.object(sync, 'collect_server', return_value=(['Experimental Portable Characters support'], ['core:portable'], {'snapshot': 'a' * 64})), \
|
||||
patch.object(sync, 'collect_manager', side_effect=AssertionError('Wrong component')):
|
||||
sync.reconcile(history, [release], Path('.'))
|
||||
history['releases'][0]['notice'] = 'Portable Characters are experimental.'
|
||||
text = sync.render(history)
|
||||
self.assertIn('## 0.261022.75 (Pre-release)', text)
|
||||
self.assertIn('Portable Characters are experimental.', text)
|
||||
self.assertEqual(history['consumedFragments'], [])
|
||||
|
||||
def test_fragment_classification_preserves_source_boundaries(self):
|
||||
text = '---\narea: manager\ntitle: Updates recover safely\n---\nYour files are preserved.'
|
||||
self.assertIsNone(sync.fragment_note(text, sync.SERVER_AREAS))
|
||||
@@ -103,61 +51,6 @@ class ComponentHistoryTests(unittest.TestCase):
|
||||
api.assert_called_once_with('repos/owner/repo/contents/changelog.d?ref=' + 'a' * 40)
|
||||
with self.assertRaises(ValueError): sync.remote_fragments('owner/repo', 'main', set(), sync.SERVER_AREAS)
|
||||
|
||||
def test_manager_collection_reads_the_real_frozen_tag(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
root = Path(folder)
|
||||
fragments = root / 'changelog.d'
|
||||
fragments.mkdir()
|
||||
own = fragments / '20261021-own.md'
|
||||
own.write_text('---\narea: manager\ntitle: Characters show their saved versions\n---\n', encoding='utf8')
|
||||
(fragments / '20261021-server.md').write_text('---\narea: server\ntitle: Server only\n---\n', encoding='utf8')
|
||||
subprocess.run(['git', 'init', '-q', str(root)], check=True)
|
||||
subprocess.run(['git', '-C', str(root), 'add', '.'], check=True)
|
||||
subprocess.run(['git', '-C', str(root), '-c', 'user.name=Fixture', '-c', 'user.email=fixture@example.invalid', '-c', 'commit.gpgsign=false', 'commit', '-qm', 'Frozen notes'], check=True)
|
||||
subprocess.run(['git', '-C', str(root), 'tag', 'v0.7.0'], check=True)
|
||||
own.write_text('Uncommitted content must not become release notes', encoding='utf8')
|
||||
notes, ids, source = sync.collect_manager(root, 'v0.7.0', set())
|
||||
self.assertEqual(notes, ['Characters show their saved versions'])
|
||||
self.assertEqual(len(ids), 2)
|
||||
self.assertEqual(len(source['commit']), 40)
|
||||
seen = {'Corfirean/coa-server-manager:20261021-own.md'}
|
||||
self.assertEqual(sync.collect_manager(root, 'v0.7.0', seen)[0], [])
|
||||
|
||||
def test_utf8_bom_does_not_break_a_valid_historical_fragment(self):
|
||||
text = '\ufeff---\narea: bots\ntitle: Companions keep their combat form\n---\n'
|
||||
self.assertEqual(sync.fragment_note(text, sync.SERVER_AREAS), 'Companions keep their combat form')
|
||||
|
||||
def test_imported_upstream_fragments_are_not_credited_as_our_changes(self):
|
||||
import base64
|
||||
listing = [{'name': '20261021-imported.md', 'sha': 'upstream'}, {'name': '20261021-own.md', 'sha': 'own'}]
|
||||
body = base64.b64encode(b'---\narea: server\ntitle: Our portable sessions\n---\n').decode()
|
||||
with patch.object(sync, 'api', side_effect=[listing, {'content': body}]) as calls:
|
||||
notes, consumed = sync.remote_fragments('owner/core', 'a' * 40, set(), sync.SERVER_AREAS, {'upstream'})
|
||||
self.assertEqual(notes, ['Our portable sessions'])
|
||||
self.assertEqual(len(consumed), 2)
|
||||
self.assertEqual(calls.call_count, 2)
|
||||
self.assertTrue(calls.call_args.args[0].endswith('/git/blobs/own'))
|
||||
|
||||
def test_reviewed_legacy_fragment_override_is_bound_to_exact_blob(self):
|
||||
import base64
|
||||
listing = [{'name': '20261006-legacy.md', 'sha': 'legacy-blob'}]
|
||||
with patch.object(sync, 'api', return_value=listing) as calls:
|
||||
notes, _ = sync.remote_fragments('owner/core', 'a' * 40, set(), sync.SERVER_AREAS,
|
||||
overrides={'owner/core:legacy-blob': 'Bots retain their combat form'})
|
||||
self.assertEqual(notes, ['Bots retain their combat form'])
|
||||
self.assertEqual(calls.call_count, 1)
|
||||
with patch.object(sync, 'api', side_effect=[listing, {'content': base64.b64encode(b'Malformed new note').decode()}]):
|
||||
with self.assertRaisesRegex(ValueError, 'owner/core:20261006-legacy.md'):
|
||||
sync.remote_fragments('owner/core', 'a' * 40, set(), sync.SERVER_AREAS,
|
||||
overrides={'owner/core:different-blob': 'Must not hide malformed notes'})
|
||||
|
||||
def test_upstream_exclusions_use_the_frozen_source_tree(self):
|
||||
lock = {'components': {'upstream': {'repository': 'upstream/core', 'sha': 'frozen'}}}
|
||||
with patch.object(sync, 'api', side_effect=[{'tree': [{'path': 'changelog.d', 'type': 'tree', 'sha': 'notes-tree'}]}, {'tree': [{'path': '20261021-imported.md', 'type': 'blob', 'sha': 'imported'}, {'path': 'README.md', 'type': 'blob', 'sha': 'readme'}]}]) as calls:
|
||||
self.assertEqual(sync.upstream_fragment_blobs(lock), {'imported'})
|
||||
self.assertEqual(calls.call_args_list[0].args[0], 'repos/upstream/core/git/trees/frozen')
|
||||
self.assertEqual(calls.call_args_list[1].args[0], 'repos/upstream/core/git/trees/notes-tree')
|
||||
|
||||
def test_render_is_component_scoped_and_stable(self):
|
||||
text = sync.render(self.history())
|
||||
self.assertIn('# CoA Server Manager changelog', text)
|
||||
@@ -165,13 +58,6 @@ class ComponentHistoryTests(unittest.TestCase):
|
||||
self.assertNotIn('## 0.7.0', text)
|
||||
self.assertEqual(text, sync.render(self.history()))
|
||||
|
||||
def test_reviewed_windows_release_text_renders_without_carriage_returns(self):
|
||||
record = self.history()['releases'][0]
|
||||
record.update(notes=['Existing files are preserved\r'], links=['[Guide](https://example.test/guide)\r'])
|
||||
text = sync.notes_md(record)
|
||||
self.assertIn('- Existing files are preserved.\n', text)
|
||||
self.assertNotIn('\r', text)
|
||||
|
||||
def test_render_only_does_not_contact_github_or_change_published_history(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
root = Path(folder); (root / 'changelog').mkdir()
|
||||
|
||||