mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-20 19:25:56 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bff5248591 | ||
|
|
41977442e9 | ||
|
|
c75785d13e | ||
|
|
2b9021ce07 | ||
|
|
b9e663079e | ||
|
|
d7693b0878 |
No files matched your search
@@ -8,6 +8,29 @@ Published releases and previews. Pre-release entries do not change the stable up
|
||||
|
||||
Dates follow GitHub publication (UTC); legacy records retain their archived dates. Newest releases first.
|
||||
|
||||
## 0.9.15 — 2026-11-19
|
||||
|
||||
- The Custom Races client update brings version 2.0.2.
|
||||
|
||||
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.9.15) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.9.14...v0.9.15)
|
||||
|
||||
## 0.9.14 — 2026-11-16
|
||||
|
||||
- Install community addons from the Manager.
|
||||
- Old item and creature data is cleared before every Play.
|
||||
- Turning the custom races client patch on or off takes seconds again.
|
||||
- The database moves to a free port when Windows reserves or another program takes 3307.
|
||||
- Your own MySQL settings survive restarts and updates.
|
||||
- Disabled custom races stay disabled after a server update that adds races.
|
||||
- Rename your realms in the Manager.
|
||||
- The account for a friend's server is in the login box at every Play.
|
||||
- Restart the world every day at a chosen time.
|
||||
- Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu.
|
||||
- Companion bots on Wildcard and Warcraft Reborn.
|
||||
- The Custom Races card tells which characters stay out while races are off.
|
||||
|
||||
[Release](https://github.com/Corfirean/coa-server-manager/releases/tag/v0.9.14) · [Source changes](https://github.com/Corfirean/coa-server-manager/compare/v0.9.13...v0.9.14)
|
||||
|
||||
## 0.9.13 — 2026-11-15
|
||||
|
||||
- The custom races client is updated to Custom Races V2.
|
||||
|
||||
Generated
+4
-4
@@ -586,7 +586,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "coa-core"
|
||||
version = "0.9.14"
|
||||
version = "0.9.15"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
@@ -621,7 +621,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "coa-launcher"
|
||||
version = "0.9.14"
|
||||
version = "0.9.15"
|
||||
dependencies = [
|
||||
"coa-core",
|
||||
"serde_json",
|
||||
@@ -644,7 +644,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "coa-release"
|
||||
version = "0.9.14"
|
||||
version = "0.9.15"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"coa-core",
|
||||
@@ -653,7 +653,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "coa-server-manager"
|
||||
version = "0.9.14"
|
||||
version = "0.9.15"
|
||||
dependencies = [
|
||||
"coa-control-proto",
|
||||
"coa-core",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ members = ["crates/coa-core", "crates/coa-launcher", "crates/coa-release", "crat
|
||||
exclude = ["services/coa-registry", "services/coa-registry-e2e", "services/coa-coordinator", "services/coa-relay"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.9.14"
|
||||
version = "0.9.15"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-only"
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
area: manager
|
||||
type: changed
|
||||
audience: players
|
||||
title: The Custom Races client update brings version 2.0.2
|
||||
---
|
||||
Updating the Custom Races client now installs 2.0.2: the retail body model files, the subclass and HD patches, the current CoACustomRace.exe and the newer subclass interface with the Two-Players bar. The 2.0 archives already downloaded are reused, so about 4.4 GB of new files are fetched. Update the Manager before the server: the matching server release needs this version.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
area: manager
|
||||
type: changed
|
||||
audience: players
|
||||
title: The startup limit for companions now creates the ones that are missing
|
||||
---
|
||||
With 50 companions and a startup limit of 300, the Manager now creates the missing 250 instead of logging in only 50. Companions that exist are never created again. Up to 2000 are created at a time.
|
||||
+47
-1
@@ -178,7 +178,20 @@
|
||||
"Corfirean/coa-server-manager:20261031-validation-mysql-reuse.md",
|
||||
"Corfirean/coa-server-manager:20261103-isolated-login-port.md",
|
||||
"Corfirean/coa-server-manager:20261107-bot-strength-scaling-settings.md",
|
||||
"Corfirean/coa-server-manager:20261115-custom-races-v2-client.md"
|
||||
"Corfirean/coa-server-manager:20261115-addon-catalog.md",
|
||||
"Corfirean/coa-server-manager:20261115-clear-game-cache.md",
|
||||
"Corfirean/coa-server-manager:20261115-custom-races-fast-toggle.md",
|
||||
"Corfirean/coa-server-manager:20261115-custom-races-v2-client.md",
|
||||
"Corfirean/coa-server-manager:20261115-database-port-relocation.md",
|
||||
"Corfirean/coa-server-manager:20261115-mysql-custom-options.md",
|
||||
"Corfirean/coa-server-manager:20261115-race-restriction-kept.md",
|
||||
"Corfirean/coa-server-manager:20261115-realm-names.md",
|
||||
"Corfirean/coa-server-manager:20261115-remembered-friend-login.md",
|
||||
"Corfirean/coa-server-manager:20261115-scheduled-restart.md",
|
||||
"Corfirean/coa-server-manager:20261115-v2-feature-switches.md",
|
||||
"Corfirean/coa-server-manager:20261116-companions-wildcard-reborn.md",
|
||||
"Corfirean/coa-server-manager:20261116-custom-race-characters-off.md",
|
||||
"Corfirean/coa-server-manager:20261118-custom-races-2-0-2-client.md"
|
||||
],
|
||||
"releases": [
|
||||
{
|
||||
@@ -936,6 +949,39 @@
|
||||
],
|
||||
"commit": "d3527312803fb5a3e1cd48e01496645a8bbc9dcf",
|
||||
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.9.12...v0.9.13"
|
||||
},
|
||||
{
|
||||
"tag": "v0.9.14",
|
||||
"version": "0.9.14",
|
||||
"date": "2026-11-16",
|
||||
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.9.14",
|
||||
"notes": [
|
||||
"Install community addons from the Manager",
|
||||
"Old item and creature data is cleared before every Play",
|
||||
"Turning the custom races client patch on or off takes seconds again",
|
||||
"The database moves to a free port when Windows reserves or another program takes 3307",
|
||||
"Your own MySQL settings survive restarts and updates",
|
||||
"Disabled custom races stay disabled after a server update that adds races",
|
||||
"Rename your realms in the Manager",
|
||||
"The account for a friend's server is in the login box at every Play",
|
||||
"Restart the world every day at a chosen time",
|
||||
"Switches for the Custom Races V2 subclasses, Hero Races and the /dev menu",
|
||||
"Companion bots on Wildcard and Warcraft Reborn",
|
||||
"The Custom Races card tells which characters stay out while races are off"
|
||||
],
|
||||
"commit": "1f64da3ae064b3f02d2bb11d818c44d26a557045",
|
||||
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.9.13...v0.9.14"
|
||||
},
|
||||
{
|
||||
"tag": "v0.9.15",
|
||||
"version": "0.9.15",
|
||||
"date": "2026-11-19",
|
||||
"url": "https://github.com/Corfirean/coa-server-manager/releases/tag/v0.9.15",
|
||||
"notes": [
|
||||
"The Custom Races client update brings version 2.0.2"
|
||||
],
|
||||
"commit": "2b9021ce072e3b6c7e9c8106f8a54f59f1b37424",
|
||||
"compare": "https://github.com/Corfirean/coa-server-manager/compare/v0.9.14...v0.9.15"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -583,6 +583,45 @@ pub fn cancel_pending_job(meta_dir: &Path, realm: &str) -> Result<Option<Compani
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// The most companions a startup fleet can hold (the limit the settings accept).
|
||||
pub const STARTUP_FLEET_MAX: u32 = 5000;
|
||||
|
||||
/// The most companions one creation job asks the server for (a single server command takes at most this many).
|
||||
pub const FLEET_JOB_MAX: u32 = 2000;
|
||||
|
||||
/// Companions still missing so that `limit` of them exist. The startup limit is a fleet size, not an addition: with
|
||||
/// 50 companions and a limit of 300 only 250 are missing, and with 300 or more nothing is.
|
||||
pub fn fleet_shortfall(limit: u32, existing: u32) -> u32 {
|
||||
limit.min(STARTUP_FLEET_MAX).saturating_sub(existing)
|
||||
}
|
||||
|
||||
/// Queue the durable job that creates the companions a realm's startup fleet is missing (at most `FLEET_JOB_MAX`
|
||||
/// at a time; the rest follows at the next start or save). Returns the new job, or `None` when the fleet is complete
|
||||
/// or an unfinished job already exists for the realm: that one is carried out instead, because a second job would
|
||||
/// create the same bots twice.
|
||||
pub fn queue_fleet_top_up(
|
||||
meta_dir: &Path,
|
||||
instance_id: &str,
|
||||
mode: crate::realms::Mode,
|
||||
limit: u32,
|
||||
existing: u32,
|
||||
) -> Result<Option<CompanionsPendingJob>> {
|
||||
let missing = fleet_shortfall(limit, existing).min(FLEET_JOB_MAX);
|
||||
if missing == 0 {
|
||||
return Ok(None);
|
||||
}
|
||||
let realm = mode.name();
|
||||
if let Some(job) = load_pending_job(meta_dir, realm)? {
|
||||
if !job.state.is_terminal() {
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
validate_spawn_request(mode, missing, None, None, None, None)?;
|
||||
let job = CompanionsPendingJob::new(instance_id, realm, missing, None, None, None, None);
|
||||
save_pending_job(meta_dir, realm, &job)?;
|
||||
Ok(Some(job))
|
||||
}
|
||||
|
||||
/// One-time idempotent migration of legacy `companions.pending.json` into `companions.pending.coa.json`.
|
||||
/// Never creates a duplicate job if `companions.pending.coa.json` already exists.
|
||||
pub fn migrate_legacy_pending_job(
|
||||
@@ -1630,3 +1669,65 @@ mod tests {
|
||||
assert!(validate_spawn_request(Mode::Reborn, 5, Some(60), Some(7), Some(4), None).is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod fleet_tests {
|
||||
use super::*;
|
||||
use crate::realms::Mode;
|
||||
|
||||
#[test]
|
||||
fn the_limit_is_a_fleet_size_not_an_addition() {
|
||||
assert_eq!(fleet_shortfall(300, 50), 250);
|
||||
assert_eq!(fleet_shortfall(300, 300), 0);
|
||||
assert_eq!(fleet_shortfall(300, 450), 0);
|
||||
assert_eq!(fleet_shortfall(0, 0), 0);
|
||||
assert_eq!(fleet_shortfall(9000, 0), STARTUP_FLEET_MAX);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_the_missing_companions_are_queued() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let job = queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 300, 50).unwrap().unwrap();
|
||||
assert_eq!(job.count, 250);
|
||||
assert_eq!(job.effective_requested_count(), 250);
|
||||
assert_eq!(job.realm, "coa");
|
||||
let saved = load_pending_job(dir.path(), "coa").unwrap().unwrap();
|
||||
assert_eq!(saved.job_id, job.job_id);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_complete_fleet_creates_nothing() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
assert!(queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 300, 300).unwrap().is_none());
|
||||
assert!(queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 300, 1000).unwrap().is_none());
|
||||
assert!(load_pending_job(dir.path(), "coa").unwrap().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_unfinished_job_is_not_doubled_but_a_finished_one_is_replaced() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let first = queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 300, 50).unwrap().unwrap();
|
||||
assert!(queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 400, 50).unwrap().is_none());
|
||||
assert_eq!(load_pending_job(dir.path(), "coa").unwrap().unwrap().job_id, first.job_id);
|
||||
cancel_pending_job(dir.path(), "coa").unwrap();
|
||||
let second = queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 400, 50).unwrap().unwrap();
|
||||
assert_ne!(second.job_id, first.job_id);
|
||||
assert_eq!(second.count, 350);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_job_never_asks_for_more_than_a_server_command_takes() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let job = queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 5000, 0).unwrap().unwrap();
|
||||
assert_eq!(job.count, FLEET_JOB_MAX);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn realms_keep_separate_jobs() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
queue_fleet_top_up(dir.path(), "srv", Mode::Coa, 100, 0).unwrap().unwrap();
|
||||
let reborn = queue_fleet_top_up(dir.path(), "srv", Mode::Reborn, 40, 10).unwrap().unwrap();
|
||||
assert_eq!(reborn.count, 30);
|
||||
assert_eq!(load_pending_job(dir.path(), "coa").unwrap().unwrap().count, 100);
|
||||
}
|
||||
}
|
||||
@@ -14,24 +14,34 @@ use crate::download::Cancel;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::fsx;
|
||||
|
||||
pub const CLIENT_VERSION: &str = "2.0";
|
||||
pub const CLIENT_VERSION: &str = "2.0.2";
|
||||
pub const MANIFEST_FILENAME: &str = "custom_races_patch_manifest.txt";
|
||||
/// Files earlier releases installed that the current release no longer ships (removed on update).
|
||||
#[cfg(test)]
|
||||
const RETIRED_FILES: &[&str] = &["Ascension.exe"];
|
||||
/// The client archives of the coa-custom-2.0 release. The server archive is read only for its client
|
||||
/// addons (files/addons: subclass interface, dev menu, teleports, spell activation overlay).
|
||||
/// The client archives of the coa-custom-2.0.2 release. Clients 1 to 9 are byte for byte the 2.0 archives and keep their
|
||||
/// 2.0 file names, so a verified copy in the cache or in Downloads is not fetched again. The server archive is read
|
||||
/// only for its client addons; the SkinCollection (Skinshifter) addon in Client 17 is not installed (see RACE_ADDONS).
|
||||
/// Order matters: a later archive replaces a file of an earlier one, and Client 17 carries the newer Ascension_Subclass.
|
||||
pub const ARCHIVES: &[(&str, &str)] = &[
|
||||
("CoA-Custom-V2-Client-1.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-1.zip"),
|
||||
("CoA-Custom-V2-Client-2.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-2.zip"),
|
||||
("CoA-Custom-V2-Client-3.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-3.zip"),
|
||||
("CoA-Custom-V2-Client-4.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-4.zip"),
|
||||
("CoA-Custom-V2-Client-5.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-5.zip"),
|
||||
("CoA-Custom-V2-Client-6.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-6.zip"),
|
||||
("CoA-Custom-V2-Client-7.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-7.zip"),
|
||||
("CoA-Custom-V2-Client-8.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-8.zip"),
|
||||
("CoA-Custom-V2-Client-9.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Client-9.zip"),
|
||||
("CoA-Custom-V2-Server.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0/CoA-Custom-V2-Server.zip"),
|
||||
("CoA-Custom-V2-Client-1.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-1.zip"),
|
||||
("CoA-Custom-V2-Client-2.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-2.zip"),
|
||||
("CoA-Custom-V2-Client-3.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-3.zip"),
|
||||
("CoA-Custom-V2-Client-4.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-4.zip"),
|
||||
("CoA-Custom-V2-Client-5.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-5.zip"),
|
||||
("CoA-Custom-V2-Client-6.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-6.zip"),
|
||||
("CoA-Custom-V2-Client-7.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-7.zip"),
|
||||
("CoA-Custom-V2-Client-8.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-8.zip"),
|
||||
("CoA-Custom-V2-Client-9.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-9.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-10.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-10.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-11.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-11.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-12.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-12.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-13.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-13.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-14.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-14.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-15.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-15.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-16.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-16.zip"),
|
||||
("CoA-Custom-V2.0.2-Server.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Server.zip"),
|
||||
("CoA-Custom-V2.0.2-Client-17.zip", "https://github.com/ilusixn/CustomRacesCoa/releases/download/coa-custom-2.0.2/CoA-Custom-V2.0.2-Client-17.zip"),
|
||||
];
|
||||
|
||||
pub const RACE_MPQS: &[&str] = &[
|
||||
@@ -111,6 +121,24 @@ pub const RACE_MPQS: &[&str] = &[
|
||||
"patch-ZZZZZW.MPQ",
|
||||
"patch-ZZZZZX.MPQ",
|
||||
"patch-ZZZZZY.MPQ",
|
||||
"patch-ZZZZZY-SUBMA.MPQ",
|
||||
"patch-ZZZZZY-SUBVA.MPQ",
|
||||
"patch-ZZZZZY-SUBVB.MPQ",
|
||||
"patch-ZZZZZY-SUBVC.MPQ",
|
||||
"patch-ZZZZZY-SUBXA-HD.MPQ",
|
||||
"patch-ZZZZZY-SUBXB-HD.MPQ",
|
||||
"patch-ZZZZZY-SUBXC-HD.MPQ",
|
||||
"patch-ZZZZZZ.MPQ",
|
||||
"patch-ZZZZZZA.MPQ",
|
||||
"patch-ZZZZZZB.MPQ",
|
||||
"patch-ZZZZZZC.MPQ",
|
||||
"patch-ZZZZZZD.MPQ",
|
||||
"patch-ZZZZZZE.MPQ",
|
||||
"patch-retail-001.mpq",
|
||||
"patch-retail-002.mpq",
|
||||
"patch-retail-003.mpq",
|
||||
"patch-retail-004.mpq",
|
||||
"patch-retail-005.mpq",
|
||||
];
|
||||
|
||||
pub const RACE_ADDONS: &[&str] = &[
|
||||
@@ -118,13 +146,18 @@ pub const RACE_ADDONS: &[&str] = &[
|
||||
"Ascension_Subclass/Ascension_Subclass.toc",
|
||||
"Ascension_Subclass/Bindings.xml",
|
||||
"Ascension_Subclass/SubclassBar.lua",
|
||||
"Ascension_Subclass/SubclassBonk.lua",
|
||||
"Ascension_Subclass/SubclassCarry.lua",
|
||||
"Ascension_Subclass/SubclassCastBar.lua",
|
||||
"Ascension_Subclass/SubclassChoices.lua",
|
||||
"Ascension_Subclass/SubclassGlow.lua",
|
||||
"Ascension_Subclass/SubclassNodes.lua",
|
||||
"Ascension_Subclass/SubclassOrbs.lua",
|
||||
"Ascension_Subclass/SubclassPairs.lua",
|
||||
"Ascension_Subclass/SubclassPetBar.lua",
|
||||
"Ascension_Subclass/SubclassPowerBar.lua",
|
||||
"Ascension_Subclass/SubclassRaceBackground.lua",
|
||||
"Ascension_Subclass/Textures/IceFrame.tga",
|
||||
"CoAHideArmor/CoAHideArmor.lua",
|
||||
"CoAHideArmor/CoAHideArmor.toc",
|
||||
"CoAQuestSafe/CoAQuestSafe.lua",
|
||||
@@ -405,6 +438,8 @@ fn patch_files(client: &Path) -> Result<Vec<PatchFile>> {
|
||||
include_str!("custom_races_hashes_1_9_1.json")
|
||||
} else if manifest.lines().any(|line| line == "# CoA Custom 1.9.2") {
|
||||
include_str!("custom_races_hashes_1_9_2.json")
|
||||
} else if manifest.lines().any(|line| line == "# CoA Custom 2.0") {
|
||||
include_str!("custom_races_hashes_2_0.json")
|
||||
} else {
|
||||
include_str!("custom_races_hashes.json")
|
||||
};
|
||||
@@ -1100,9 +1135,41 @@ fn archive_job(filename: &str, url: &str, cache: &Path) -> Result<crate::downloa
|
||||
195_235_400,
|
||||
"0764893543084a12d15578fe734f66ba4519740794a6b3b3a38a08594c38c640",
|
||||
),
|
||||
"CoA-Custom-V2-Server.zip" => (
|
||||
63_983_587,
|
||||
"8970d61eea40f53cea4c27481edd85d2b2647cd32eb88932e0077da3b4a77d23",
|
||||
"CoA-Custom-V2.0.2-Client-10.zip" => (
|
||||
73_099_250,
|
||||
"035720776b66a18b965bbd7262154ea398f5425b8cd116fdfc5f663cd800316e",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-11.zip" => (
|
||||
178_667_276,
|
||||
"9a66f782be47f66ce4ec9f4f70cb1970218fe48950a031b39aa79c091008901b",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-12.zip" => (
|
||||
1_053_880_101,
|
||||
"f7a90890a0248967eb4572c641f5dee1bd0cafba12d1841360821b79cd5b1c3e",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-13.zip" => (
|
||||
950_360_503,
|
||||
"8ae00b9bebc4e21d6d6d32ddbf319c341f3c418349a3aeb3d840dffb0fa14d3f",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-14.zip" => (
|
||||
971_472_467,
|
||||
"511ec3fd1933b9342920262f6a5eae7e451671a49679e93612632b77c31ba57f",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-15.zip" => (
|
||||
1_106_537_793,
|
||||
"b65505a047508cbd15f4fec670d3953873014250efc484aa3bdb75cb3b3cbbf1",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-16.zip" => (
|
||||
11_874_081,
|
||||
"5442dc06147e60140c43eebfae14f6ad5f19e6fed974db471b65211497609a27",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Client-17.zip" => (
|
||||
947_478,
|
||||
"707e09c8b95926e2d83bdc16adab763901951566caf6bf4fcebfdf4d7ba0e62a",
|
||||
),
|
||||
"CoA-Custom-V2.0.2-Server.zip" => (
|
||||
96_857_277,
|
||||
"36d0cba993623064ce01f364116f99330423cec3cef22101e50cf941dfd85afe",
|
||||
),
|
||||
_ => return Err(Error::Invalid("Unknown custom races archive.".into())),
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CoACustomRace.exe": "428e41f5cb349f66b9ac133c711c2ffb92bd2be28c595f67268924df8a5c89cc",
|
||||
"CoACustomRace.exe": "8c283dcd464418e6859217dd53ad522b6a61f064c6db349c77d3cb90412690d9",
|
||||
"CoAVolFog-regions.ini": "a21c2616c866ea29bdf2c75af2607e8cb982fdaaef1167375b23f1490325a0a5",
|
||||
"CoAVolFog.dll": "65c9abb6d44ce41bc943b25a83ab4292dd0697d6490a60385e75610fe66801ce",
|
||||
"CoAVolFog.ini": "921d99e3dd5a85db4d815c4baf94851639e85e74a5bb5b5f610548a0fbf94483",
|
||||
@@ -4798,7 +4798,7 @@
|
||||
"Data/patch-ZZZZX.MPQ": "d4b1352e62f3b47b2a8fe38cf751825f20f58e4feee0a1b04e935e2211554f30",
|
||||
"Data/patch-ZZZZY.MPQ": "f9d05e9e0b0c31264c5d5dfd3bb3d486acfd0f3380186a3dec73cd2fa92c4859",
|
||||
"Data/patch-ZZZZZ.MPQ": "9d94a39178f2e8b34e612321ed1ad484d60be395520a38818546b5a8e96c94f4",
|
||||
"Data/patch-ZZZZZA.MPQ": "23d62f92116106039afbe37e7ad8199a99ec8401e6c65728d6293c8155591e89",
|
||||
"Data/patch-ZZZZZA.MPQ": "dad9d283885b69d4f11daacfd667acec691220cfc22d3abbbad557739a38da51",
|
||||
"Data/patch-ZZZZZB.MPQ": "07146bfd6501d3022133bf661786f1061e57393993b79b6115b12ddc77e9946c",
|
||||
"Data/patch-ZZZZZC.MPQ": "94b21941edef2e81b4461716f8945d7b19e8f0fb09071f4b777c26d9dccd2670",
|
||||
"Data/patch-ZZZZZM.MPQ": "cebe58e8c25192593afeabab9e23ec2757de6811e944823350af709ba15b6ab8",
|
||||
@@ -4813,7 +4813,25 @@
|
||||
"Data/patch-ZZZZZV.MPQ": "f0a7c595575ae2bbb58b6c525fc61c613ae2960e9b76742c128a83247f6b240c",
|
||||
"Data/patch-ZZZZZW.MPQ": "80d9288310710cb6a438621f95dfa22798f335a347b4a62c7cabd22a656b431b",
|
||||
"Data/patch-ZZZZZX.MPQ": "775539db1818068f4d676cbcb7fb1f87f61f303f0952d9843e273fe105eba019",
|
||||
"Data/patch-ZZZZZY-SUBMA.MPQ": "389255c799b27a8c82d2f39911433cc3e91c4f4ad1f244cccc9661ccb1dc82a2",
|
||||
"Data/patch-ZZZZZY-SUBVA.MPQ": "93c6aad4289ade86eee6c49377d21f34b7b29fa92edb31bb1798df9cc66b1494",
|
||||
"Data/patch-ZZZZZY-SUBVB.MPQ": "ea1d10a77c84dae77f137ff7307bc00e27891ee873789a58ddf924681e0ada5b",
|
||||
"Data/patch-ZZZZZY-SUBVC.MPQ": "23b02a87cde6a443046de12ac13fc7b1ea3e1a74e7f5ce3723292da24ff3f099",
|
||||
"Data/patch-ZZZZZY-SUBXA-HD.MPQ": "19c88cd704511375ee98730d05e9aded49894c9497d9ee2ad7823028b0104668",
|
||||
"Data/patch-ZZZZZY-SUBXB-HD.MPQ": "7fb6172edd64f6fc27816964d0ed13ba351afc9c07b2920564a5d41694e5ae1b",
|
||||
"Data/patch-ZZZZZY-SUBXC-HD.MPQ": "765a0158bc501c435b828e64923f06f981a1408ea27b42a38b9ea2b467dcd54f",
|
||||
"Data/patch-ZZZZZY.MPQ": "05b8cbd7a45cc9933a84ee991ff3193063cb2d040296843b947e190e8c64e741",
|
||||
"Data/patch-ZZZZZZ.MPQ": "b3f95a34f2c5d2157f54191124e864db4d2cb559156d2b7fccb119d9ae247ec8",
|
||||
"Data/patch-ZZZZZZA.MPQ": "2c8f9caef8e3f3cf33b9b35bf5782123b4759a8fecb92a326be59d2f918608f7",
|
||||
"Data/patch-ZZZZZZB.MPQ": "cb3107c155b57e6b77e92d881be3f2113a5401c101be185175d06b0a7ffdf6ab",
|
||||
"Data/patch-ZZZZZZC.MPQ": "0fbd43a7208a11ee02a2ed31ed1da90bf4240074e7e508ed801f20de50e697d4",
|
||||
"Data/patch-ZZZZZZD.MPQ": "53f4dac665280030ac8764cd2b45fc8ff65c5e85981b3f3ddcff34d5bc8d3c7f",
|
||||
"Data/patch-ZZZZZZE.MPQ": "64fb42fc12367bc0b8b95489315c882d36c195c90732bd5a8ed449f7373653cf",
|
||||
"Data/patch-retail-001.mpq": "1b0fafbdc6d01b92b5f09566f05510361972879a0407a79c03d1146f3440b764",
|
||||
"Data/patch-retail-002.mpq": "6802c1c9530a9fb4107fd56bf18185484257cda69ead36a170ab557cea5b64d3",
|
||||
"Data/patch-retail-003.mpq": "ae3f030fdb0b340a420ee9a3f027c47798e2646ab73bcac62b6f6b6c8589ca9b",
|
||||
"Data/patch-retail-004.mpq": "ed857958adcf96266d25c2ab2da882359fc302d9d2f2da9032010061a0ca0a37",
|
||||
"Data/patch-retail-005.mpq": "4fb237c92ccfccb7de90ff3ef184d04edb08dfda0ed2b2f16de802dff0455a5e",
|
||||
"EsteriaAppearance.bin": "90d9cfaeaf6de10f014f1d1610ea10453ec9b240255759aea99513cac488a3ec",
|
||||
"EsteriaAppearance.dll": "88e268d3be9eca3b0644f543d823f4bdcc04a9700a6e8ed73fd2a1260ad191af",
|
||||
"EsteriaAppearanceGeometry.bin": "cacd2086eabf43391bca07b622e17444de91b30593827e9e1e54758fe4dcd8e7",
|
||||
@@ -4894,17 +4912,22 @@
|
||||
"EsteriaVulperaTextures.bin": "1ab844e74684aced2b069f1b91cd563aade45e05bd5e23f866a6c0c301cb098e",
|
||||
"EsteriaWretched.bin": "a407b49ef55e6d76411bee2f522a2087b3571e8ec5d12b630a859cdbcdbde890",
|
||||
"EsteriaWretchedTextures.bin": "837774377ca055e6a5c79c1a4cfd8151e7c1f7ce2c16990b00fd445281137433",
|
||||
"Interface/AddOns/Ascension_Subclass/Ascension_Subclass.lua": "30710edd3d3bbdf393c6665850bd022f5cabffa58ae66bd1476769799635c7a0",
|
||||
"Interface/AddOns/Ascension_Subclass/Ascension_Subclass.toc": "9498ac1dd7f810d3314b0bf4a2404c3f49df9825b73469952a72c28c2419ff7c",
|
||||
"Interface/AddOns/Ascension_Subclass/Ascension_Subclass.lua": "b769f6c64d93c5e1850456782cfaebca073e97ad23fbf5e6b0068a58399d64ad",
|
||||
"Interface/AddOns/Ascension_Subclass/Ascension_Subclass.toc": "c840e4396adb66534586f5d55ee58586d0f2343108383322e6de5bbbceee563c",
|
||||
"Interface/AddOns/Ascension_Subclass/Bindings.xml": "cd057da400c0d40277ca5b310f021b78ac2b4e95b6a9445460b8651fffa83b8e",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassBar.lua": "c3b809a024780ba7fac3689b329dc3b906aa046ede233fc5ef522a029d7ed2fe",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassBar.lua": "af91304e5628d6e0327dfa2472fcbf9ad317ee32ca7777b3c09cfe60062174fe",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassBonk.lua": "3cdc86792529c75d4186accaa1ed5b8a7541c17b0b9a022cf3ebdadf802b4c54",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassCarry.lua": "e915f4a2e52f0d417e46654d5e5d438cc258be429661018c0155c4cd007aacb9",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassCastBar.lua": "395ccda4bc0733cfa34dd506a2578ae73867305b5cd09dc988ff615a7d8a1e78",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassChoices.lua": "3e313f30eade45b32c7827d8e045ed74ff05ff5fb9263d8f28e4c6c98ad74288",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassGlow.lua": "c9a4c900c97a4f215f00ed3fd3c703058522c4f5180d8c4dd76e60b1611e0366",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassNodes.lua": "cdc91d73d066664133bc3f621c4994360474486bd6ffe1bc96964bfc35faf2c7",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassOrbs.lua": "cc29fbabe955cdd994d0f3281dff758ea4146dbe5fd6e65e0ad87b8b5fd2238e",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassOrbs.lua": "e4d337628d267f338846b5d0aefe5204de91e1dec6d933a4bca208eccfdf0052",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassPairs.lua": "670b67e6fc400ead68ef0324172467219e14342dce9b9015e674414d1a6efc5d",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassPetBar.lua": "ab487a1b2eabef221a2c23eb8e3f52dfb90194a75db46c88c006e3fad3ac5926",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassPowerBar.lua": "609819307864810cdc36bb52305ab0525094466e5e2be135d96c878081cf69f6",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassRaceBackground.lua": "b63fa918438386a0c1cd861b4655785cd63b1089e721c6e3bd9585e372950b68",
|
||||
"Interface/AddOns/Ascension_Subclass/SubclassRaceBackground.lua": "d38352928ee3e546eaa25c77e0e961ddfe1bd383020904f84907a4b3f5fce132",
|
||||
"Interface/AddOns/Ascension_Subclass/Textures/IceFrame.tga": "91cefa31a6f32a847c888651bc3f90a2a91fb07b7a33c74bf8090efc92d22705",
|
||||
"Interface/AddOns/CoAHideArmor/CoAHideArmor.lua": "8c1c7403524fc9bd56c0809b4101b141da700ba163701209bf1420f2ef106aa7",
|
||||
"Interface/AddOns/CoAHideArmor/CoAHideArmor.toc": "123580d92fd5ceee258e96296f42c359b7e83cdff151af49c50c6c4e2059677c",
|
||||
"Interface/AddOns/CoAQuestSafe/CoAQuestSafe.lua": "062de55c91228971553f482fd2c8753f4752993b4e8e49d4ded04fa18b98bde7",
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "coa-server-manager",
|
||||
"version": "0.9.14",
|
||||
"version": "0.9.15",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "coa-server-manager",
|
||||
"version": "0.9.14",
|
||||
"version": "0.9.15",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.12.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.8.0",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "coa-server-manager",
|
||||
"private": true,
|
||||
"version": "0.9.14",
|
||||
"version": "0.9.15",
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
+89
-32
@@ -2,7 +2,7 @@
|
||||
//! registry; the frontend can never ask the backend to touch an arbitrary path (scan is read-only).
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
mod browse_preferences;
|
||||
@@ -597,6 +597,91 @@ async fn run_verb(
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Creates the companions a realm's startup fleet is missing (when its auto-login is on and its world runs) and
|
||||
/// carries out the realm's pending companion job. Returns how many companions were queued to top the fleet up.
|
||||
fn reconcile_realm_companions(
|
||||
root: &Path,
|
||||
meta: &Path,
|
||||
instance_id: &str,
|
||||
mode: coa_core::realms::Mode,
|
||||
top_up: bool,
|
||||
) -> Result<u32> {
|
||||
let target = coa_core::multiworld::resolve_bot_operation_target(root, mode)?;
|
||||
let mut queued = 0;
|
||||
if top_up && target.running {
|
||||
match queue_startup_fleet(root, meta, instance_id, mode, &target.world_root) {
|
||||
Ok(n) => queued = n,
|
||||
Err(e) => tracing::warn!("startup fleet of realm {} was not topped up: {e}", mode.name()),
|
||||
}
|
||||
}
|
||||
let r_snap = root.to_path_buf();
|
||||
let chars_db = target.chars_db;
|
||||
let r_ra = root.to_path_buf();
|
||||
coa_core::companions::process_pending_job_with(
|
||||
meta,
|
||||
mode,
|
||||
instance_id,
|
||||
target.running,
|
||||
|since_guid| {
|
||||
let admin_db = coa_core::db::Db::from_repack(&r_snap, coa_core::db::Account::Admin)?;
|
||||
let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, chars_db);
|
||||
coa_core::companions::query_bot_db_snapshot(&r_snap, &admin_db, chars_db, since_guid)
|
||||
},
|
||||
|delta, job| {
|
||||
let mut ra = Ra::connect_target(&r_ra, Some(mode))?;
|
||||
if let Some(lvl) = job.level {
|
||||
ra.spawn_custom(delta, lvl, job.class_id, job.spec_id, job.build_id.as_deref())
|
||||
} else {
|
||||
ra.spawn_bots(delta)
|
||||
}
|
||||
},
|
||||
)?;
|
||||
Ok(queued)
|
||||
}
|
||||
|
||||
/// Queues the job that creates the companions missing from a realm's startup fleet. The realm's auto-login limit is
|
||||
/// the fleet size: companions that exist already count, so only the difference is created. Nothing is created when
|
||||
/// the number of existing companions cannot be read.
|
||||
fn queue_startup_fleet(
|
||||
root: &Path,
|
||||
meta: &Path,
|
||||
instance_id: &str,
|
||||
mode: coa_core::realms::Mode,
|
||||
world_root: &Path,
|
||||
) -> Result<u32> {
|
||||
let cfg = config::load(world_root, Scope::Bots)?;
|
||||
let value = |key: &str| cfg.settings.iter().find(|s| s.meta.key == key).map(|s| s.value.clone());
|
||||
let on = value("CoaBots.AutoLoginOnStartup").and_then(|v| v.as_bool()).unwrap_or(false);
|
||||
let limit = value("CoaBots.AutoLogin.MaxCount").and_then(|v| v.as_u64()).unwrap_or(0) as u32;
|
||||
if !on || limit == 0 {
|
||||
return Ok(0);
|
||||
}
|
||||
let existing = coa_core::population::query_for_realm(root, mode)?.bots_total;
|
||||
let job = coa_core::companions::queue_fleet_top_up(meta, instance_id, mode, limit, existing)?;
|
||||
Ok(job.map_or(0, |j| j.count))
|
||||
}
|
||||
|
||||
/// After the startup fleet settings are saved: create the companions the fleet is missing right away when the realm's
|
||||
/// world is running (otherwise it happens at the next start). Returns how many were queued.
|
||||
#[tauri::command]
|
||||
async fn top_up_startup_fleet(
|
||||
state: State<'_, AppState>,
|
||||
id: String,
|
||||
realm: Option<coa_core::realms::Mode>,
|
||||
) -> std::result::Result<u32, UiError> {
|
||||
let root = path_of(&state, &id)?;
|
||||
let _guard = BusyGuard::acquire(&state, &id)?;
|
||||
blocking(move || {
|
||||
if coa_core::realms::guard_module(&root, "companions").is_err() {
|
||||
return Ok(0);
|
||||
}
|
||||
let meta = meta_dir(&root)?;
|
||||
let mode = realm.unwrap_or_else(|| coa_core::realms::view(&root).map(|v| v.active).unwrap_or_default());
|
||||
reconcile_realm_companions(&root, &meta, &id, mode, true)
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn start_server(
|
||||
state: State<'_, AppState>,
|
||||
@@ -643,37 +728,8 @@ async fn start_server(
|
||||
coa_core::realms::Mode::Wildcard,
|
||||
coa_core::realms::Mode::Reborn,
|
||||
] {
|
||||
let target = match coa_core::multiworld::resolve_bot_operation_target(&r, mode) {
|
||||
Ok(t) => t,
|
||||
Err(e) => {
|
||||
tracing::warn!("cannot resolve target for realm {}: {e}", mode.name());
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let r_snap = r.clone();
|
||||
let chars_db = target.chars_db;
|
||||
let r_ra = r.clone();
|
||||
let res = coa_core::companions::process_pending_job_with(
|
||||
&meta,
|
||||
mode,
|
||||
&instance_id,
|
||||
target.running,
|
||||
|since_guid| {
|
||||
let admin_db = coa_core::db::Db::from_repack(&r_snap, coa_core::db::Account::Admin)?;
|
||||
let _ = coa_core::companions::ensure_templates_for_schema(&admin_db, chars_db);
|
||||
coa_core::companions::query_bot_db_snapshot(&r_snap, &admin_db, chars_db, since_guid)
|
||||
},
|
||||
|delta, job| {
|
||||
let mut ra = Ra::connect_target(&r_ra, Some(mode))?;
|
||||
if let Some(lvl) = job.level {
|
||||
ra.spawn_custom(delta, lvl, job.class_id, job.spec_id, job.build_id.as_deref())
|
||||
} else {
|
||||
ra.spawn_bots(delta)
|
||||
}
|
||||
},
|
||||
);
|
||||
if let Err(e) = res {
|
||||
tracing::warn!("pending companions for realm {} failed during reconciliation: {e}", mode.name());
|
||||
if let Err(e) = reconcile_realm_companions(&r, &meta, &instance_id, mode, true) {
|
||||
tracing::warn!("companions for realm {} failed during start-up: {e}", mode.name());
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@@ -3337,6 +3393,7 @@ pub fn run() {
|
||||
report_targets,
|
||||
companion_sizes,
|
||||
add_companions,
|
||||
top_up_startup_fleet,
|
||||
get_wildcard_archetypes,
|
||||
remote_connection,
|
||||
remote_connect,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "CoA Server Manager",
|
||||
"version": "0.9.14",
|
||||
"version": "0.9.15",
|
||||
"identifier": "com.coa.servermanager",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
@@ -69,6 +69,7 @@ export {};
|
||||
if(cmd==="list_presets"){const pr=args?.scope==="server"?serverPresets:botsPresets;return (pr.presets as any[]).map(p=>({id:p.id,title:p.title,description:p.description}));}
|
||||
if(cmd==="preview_preset"){const a=args;const sc=a.scope==="server"?serverSchema:botsSchema;const pr=(a.scope==="server"?serverPresets:botsPresets).presets as any[];const p=pr.find(x=>x.id===a.preset)??{id:a.preset??"defaults",title:"Recommended defaults",description:"Every setting returns to its default value."};const st=(sc.settings as any[]).filter(x=>x.type==="int"||x.type==="float"||x.type==="enum").slice(0,3);return {id:p.id,title:p.title,description:p.description,changes:st.map(x=>({key:x.key,title:x.title,from:x.default,to:x.type==="enum"?(x.options?.[1]?.value??x.default):(Number(x.default)||1)*2,dangerous:false}))};}
|
||||
if(cmd==="companion_sizes") return {hardware:{cores:16,ram_gb:31,free_ram_gb:12},sizes:[{id:"small",title:"Small",bots:50,warning:null},{id:"medium",title:"Medium",bots:250,warning:null},{id:"large",title:"Large",bots:500,warning:"500 companions may need more CPU and memory than this computer has (8 cores, 16 GB)."}]};
|
||||
if(cmd==="top_up_startup_fleet") return 0;
|
||||
if(cmd==="add_companions"){const base=(window as any).__bots??85;(window as any).__target=base+args.count;return {spawned:"queued",created:null,baseline:base};}
|
||||
if(cmd==="check_update") return {from_version:(window as any).__updated?"0.261028.83":"0.261026.81",to_version:"0.261028.83",items:[],conflicts:[],migrations:5,pending_migrations:(window as any).__updated?0:5,download_bytes:6000000};
|
||||
if(cmd==="apply_update"){const w=window as any;for(let i=1;i<=8;i++){await new Promise((r: any)=>setTimeout(r,700));(w.__handlers?.["update-progress"]??[]).forEach((h: any)=>h({event:"update-progress",id:1,payload:{step:i<4?"Downloading the update":i<7?"Applying the update":"Finishing",percent:i*12}}));}(window as any).__updated=true;return {txn:{state:"committed",to_version:"0.261028.83"},migrations:null};}
|
||||
|
||||
@@ -597,6 +597,8 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.startCount": "Wie viele sich anmelden",
|
||||
"comp.startSave": "Speichern",
|
||||
"comp.startSaved": "Gespeichert. Gilt ab dem nächsten Serverstart.",
|
||||
"comp.startTopUp": "Gespeichert. {n} weitere Begleiter werden erstellt, damit {max} existieren; die übrigen gibt es schon.",
|
||||
"comp.startTopUpConfirm": "{n} weitere Begleiter erstellen, damit {max} existieren? Vorhandene werden nicht erneut erstellt.",
|
||||
"comp.startHint": "Bots, die sich nicht anmelden, bleiben gespeichert und können später online gebracht werden.",
|
||||
"comp.startInvalid": "Gib eine ganze Zahl von 0 bis 5000 ein.",
|
||||
|
||||
|
||||
@@ -696,6 +696,8 @@ const en = {
|
||||
"comp.startCount": "How many log in",
|
||||
"comp.startSave": "Save",
|
||||
"comp.startSaved": "Saved. It applies the next time the server starts.",
|
||||
"comp.startTopUp": "Saved. Creating {n} more companions so that {max} exist; the others already exist.",
|
||||
"comp.startTopUpConfirm": "Create {n} more companions so that {max} exist? Companions that already exist are not created again.",
|
||||
"comp.startHint": "Bots that do not log in stay saved and can be brought online later.",
|
||||
"comp.startInvalid": "Enter a whole number from 0 to 5000.",
|
||||
|
||||
|
||||
@@ -597,6 +597,8 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.startCount": "Cuántos inician sesión",
|
||||
"comp.startSave": "Guardar",
|
||||
"comp.startSaved": "Guardado. Se aplica la próxima vez que se inicie el servidor.",
|
||||
"comp.startTopUp": "Guardado. Se crean {n} compañeros más para que existan {max}; los demás ya existen.",
|
||||
"comp.startTopUpConfirm": "¿Crear {n} compañeros más para que existan {max}? Los que ya existen no se crean de nuevo.",
|
||||
"comp.startHint": "Los bots que no inician sesión quedan guardados y se pueden conectar más tarde.",
|
||||
"comp.startInvalid": "Introduce un número entero de 0 a 5000.",
|
||||
|
||||
|
||||
@@ -597,6 +597,8 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.startCount": "Combien se connectent",
|
||||
"comp.startSave": "Enregistrer",
|
||||
"comp.startSaved": "Enregistré. S’applique au prochain démarrage du serveur.",
|
||||
"comp.startTopUp": "Enregistré. {n} compagnons de plus sont créés pour qu’il y en ait {max} ; les autres existent déjà.",
|
||||
"comp.startTopUpConfirm": "Créer {n} compagnons de plus pour qu’il y en ait {max} ? Ceux qui existent déjà ne sont pas recréés.",
|
||||
"comp.startHint": "Les bots qui ne se connectent pas restent enregistrés et peuvent être mis en ligne plus tard.",
|
||||
"comp.startInvalid": "Saisissez un nombre entier de 0 à 5000.",
|
||||
|
||||
|
||||
@@ -679,6 +679,8 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.startCount": "Сколько входит",
|
||||
"comp.startSave": "Сохранить",
|
||||
"comp.startSaved": "Сохранено. Вступит в силу при следующем запуске сервера.",
|
||||
"comp.startTopUp": "Сохранено. Создаётся ещё {n} компаньонов, чтобы их стало {max}; остальные уже есть.",
|
||||
"comp.startTopUpConfirm": "Создать ещё {n} компаньонов, чтобы их стало {max}? Уже существующие заново не создаются.",
|
||||
"comp.startHint": "Боты, которые не входят, остаются сохранёнными, их можно вывести в сеть позже.",
|
||||
"comp.startInvalid": "Введите целое число от 0 до 5000.",
|
||||
|
||||
|
||||
@@ -650,6 +650,8 @@ const zh = {
|
||||
"comp.startCount": "自动登录随从数量",
|
||||
"comp.startSave": "保存",
|
||||
"comp.startSaved": "已保存。将在下次服务器启动时生效。",
|
||||
"comp.startTopUp": "已保存。正在再创建 {n} 个同伴,使总数达到 {max};其余已存在。",
|
||||
"comp.startTopUpConfirm": "再创建 {n} 个同伴,使总数达到 {max}?已存在的不会重复创建。",
|
||||
"comp.startHint": "未登录的随从仍保留在数据库中,随时可在需要时手动调出上线。",
|
||||
"comp.startInvalid": "请输入 0 到 5000 之间的整数。",
|
||||
|
||||
|
||||
@@ -584,6 +584,8 @@ export const api = {
|
||||
invoke<{ txn: UpdateTxn; preexisting_character_count?: number }>("apply_update", { id, source: source ?? null, resolutions }),
|
||||
rollbackUpdate: (id: string, txn: string) => invoke<UpdateTxn>("rollback_update", { id, txn }),
|
||||
retryUpdateValidation: (id: string, txn: string) => invoke<UpdateTxn>("retry_update_validation", { id, txn }),
|
||||
/** Creates the companions the startup fleet is missing (the limit is a fleet size). Returns how many were queued. */
|
||||
topUpStartupFleet: (id: string, realm?: RealmMode) => invoke<number>("top_up_startup_fleet", { id, realm: realm ?? null }),
|
||||
population: (id: string, realm?: RealmMode) => invoke<Population | null>("get_population", { id, realm: realm ?? null }),
|
||||
stopSpawning: (id: string, realm?: RealmMode) => invoke<{ count: number }>("companions_stop_spawning", { id, realm: realm ?? null }),
|
||||
takeOffline: (id: string, realm?: RealmMode) => invoke<{ count: number }>("companions_take_offline", { id, realm: realm ?? null }),
|
||||
|
||||
@@ -305,11 +305,18 @@ export function CompanionsCard({ serverId }: { serverId: string }) {
|
||||
setError(null);
|
||||
setStartNote(null);
|
||||
try {
|
||||
// The limit is a fleet size: companions that exist count, only the missing ones are created.
|
||||
const missing = autoOn && running && isViewingActiveRealm && pop ? Math.max(0, maxNum - pop.bots_total) : 0;
|
||||
if (missing > 200 && !window.confirm(t("comp.startTopUpConfirm", { n: Math.min(missing, 2000), max: maxNum }))) {
|
||||
setStartBusy(false);
|
||||
return;
|
||||
}
|
||||
await api.save(serverId, "bots", {
|
||||
"CoaBots.AutoLoginOnStartup": autoOn,
|
||||
"CoaBots.AutoLogin.MaxCount": maxNum,
|
||||
});
|
||||
setStartNote(t("comp.startSaved"));
|
||||
const queued = autoOn && running ? await api.topUpStartupFleet(serverId, activeServerRealm) : 0;
|
||||
setStartNote(queued > 0 ? t("comp.startTopUp", { n: queued, max: maxNum }) : t("comp.startSaved"));
|
||||
} catch (e) {
|
||||
setError(asUiError(e));
|
||||
} finally {
|
||||
@@ -781,7 +788,7 @@ export function CompanionsCard({ serverId }: { serverId: string }) {
|
||||
Persistent Startup Fleet
|
||||
</h3>
|
||||
<p className="text-xs text-muted">
|
||||
Configure how many bots automatically log into the world whenever the server launches.
|
||||
The server keeps this many companions. At every start the ones that exist log in, and only the missing ones are created.
|
||||
</p>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-4 text-sm">
|
||||
|
||||
Reference in new issue
Block a user