mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-18 11:18:37 +00:00
feat: start Wildcard and Warcraft Reborn together with Conquest of Azeroth
Settings gets two options, one per extra realm; turning on both runs all three realms. Each extra world keeps its own folder, configs, logs and ports (multiworld now handles a set of worlds instead of one second world), and Warcraft Reborn gets its own status card, realm list entry and firewall rule. Starting a server also sets CoA.ClassModel of the realm chosen on Overview to exactly that realm's model, so the shipped "coa wcr" default no longer shows two class models on a Conquest of Azeroth realm. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
925a81f4f2
commit
321ac597ce
24 files changed
+697
-173
No files matched your search
+25
-3
@@ -1169,6 +1169,17 @@ async fn realm_simultaneous(
|
||||
blocking(move || coa_core::multiworld::set_enabled(&root, enabled)).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn realm_with_reborn(
|
||||
state: State<'_, AppState>,
|
||||
id: String,
|
||||
enabled: bool,
|
||||
) -> std::result::Result<coa_core::realms::View, UiError> {
|
||||
let root = path_of(&state, &id)?;
|
||||
let _guard = BusyGuard::acquire(&state, &id)?;
|
||||
blocking(move || coa_core::multiworld::set_reborn_enabled(&root, enabled)).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn check_database(
|
||||
state: State<'_, AppState>,
|
||||
@@ -2322,6 +2333,7 @@ struct FriendsStatus {
|
||||
auth_port: u16,
|
||||
world_port: u16,
|
||||
secondary_world_port: Option<u16>,
|
||||
reborn_world_port: Option<u16>,
|
||||
}
|
||||
|
||||
/// Open one of a few known help pages in the default browser. Anything else is refused, so a page can never ask the
|
||||
@@ -2485,6 +2497,9 @@ async fn friends_status(
|
||||
secondary_world_port: coa_core::realms::state(&root)?
|
||||
.secondary_world_port
|
||||
.filter(|_| coa_core::realms::state(&root).is_ok_and(|s| s.simultaneous)),
|
||||
reborn_world_port: coa_core::realms::state(&root)?
|
||||
.reborn_world_port
|
||||
.filter(|_| coa_core::realms::state(&root).is_ok_and(|s| s.with_reborn)),
|
||||
})
|
||||
})
|
||||
.await
|
||||
@@ -2542,7 +2557,13 @@ async fn friends_enable(
|
||||
let ports = layout::read_ports(&root);
|
||||
let mut note = None;
|
||||
let realms = coa_core::realms::state(&root)?;
|
||||
let secondary = realms.secondary_world_port.filter(|_| realms.simultaneous);
|
||||
let extra: Vec<u16> = [
|
||||
realms.secondary_world_port.filter(|_| realms.simultaneous),
|
||||
realms.reborn_world_port.filter(|_| realms.with_reborn),
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.collect();
|
||||
let host = match mode {
|
||||
Mode::Local => "127.0.0.1".to_string(),
|
||||
Mode::Lan => coa_core::net::resolve_lan_host(lan_address_override.as_deref(), coa_core::net::lan_ip())?,
|
||||
@@ -2552,7 +2573,7 @@ async fn friends_enable(
|
||||
let open = mode != Mode::Local;
|
||||
let changed = friends::set_open(&root, &meta, open)?;
|
||||
if open && platform::flavor() == Flavor::Repack {
|
||||
coa_core::firewall::ensure_rules_with_secondary(&ports, secondary)?;
|
||||
coa_core::firewall::ensure_rules_with_extra(&ports, &extra)?;
|
||||
}
|
||||
if mode == Mode::Direct && use_upnp {
|
||||
match coa_core::upnp::discover() {
|
||||
@@ -2560,7 +2581,7 @@ async fn friends_enable(
|
||||
let lan = coa_core::net::lan_ip().ok_or_else(|| Error::Invalid("No local address.".into()))?;
|
||||
coa_core::upnp::add_mapping(&gw, ports.auth, lan, "Auth")?;
|
||||
coa_core::upnp::add_mapping(&gw, ports.world, lan, "World")?;
|
||||
if let Some(port) = secondary { coa_core::upnp::add_mapping(&gw, port, lan, "Second world")?; }
|
||||
for port in &extra { coa_core::upnp::add_mapping(&gw, *port, lan, "Extra world")?; }
|
||||
note = Some("Your router was asked to forward the game ports.".to_string());
|
||||
}
|
||||
None => note = Some("Your router does not support automatic setup; forward the two game ports by hand or use the private network.".to_string()),
|
||||
@@ -2793,6 +2814,7 @@ pub fn run() {
|
||||
realm_profiles,
|
||||
realm_select,
|
||||
realm_simultaneous,
|
||||
realm_with_reborn,
|
||||
check_database,
|
||||
repair_server,
|
||||
module_set_enabled,
|
||||
|
||||
Reference in new issue
Block a user