diff --git a/changelog.d/20261010-local-host-while-sharing.md b/changelog.d/20261010-local-host-while-sharing.md new file mode 100644 index 0000000..80ad6f9 --- /dev/null +++ b/changelog.d/20261010-local-host-while-sharing.md @@ -0,0 +1,7 @@ +--- +area: manager +type: fixed +audience: admins +title: Local hosts can connect while sharing a server online +--- +The Manager no longer replaces the realm's local address with its public address when Friends mode is enabled. diff --git a/crates/coa-core/src/friends.rs b/crates/coa-core/src/friends.rs index 9b8a71a..afc8277 100644 --- a/crates/coa-core/src/friends.rs +++ b/crates/coa-core/src/friends.rs @@ -125,7 +125,8 @@ pub fn set_open(root: &Path, meta: &Path, open: bool) -> Result { Ok(true) } -/// Make the realm list advertise `host` (the launcher resets it to 127.0.0.1 at every start, so this runs after each start). +/// Make the realm list advertise `host` to remote clients (the launcher resets it to 127.0.0.1 at every start, so this +/// runs after each start). pub fn apply_realm_address(root: &Path, host: &str) -> Result<()> { if !host_ok(host) { return Err(Error::Invalid("That address is not valid.".into())); @@ -133,7 +134,7 @@ pub fn apply_realm_address(root: &Path, host: &str) -> Result<()> { let db = Db::from_repack(root, Account::Admin)?; let realm = crate::realms::state(root)?.active.realm_id(); let where_realms = if crate::realms::state(root)?.simultaneous { "id IN (1,2)".into() } else { format!("id={realm}") }; - db.query(&format!("UPDATE acore_auth.realmlist SET address='{host}', localAddress='{host}' WHERE {where_realms};"))?; + db.query(&format!("UPDATE acore_auth.realmlist SET address='{host}' WHERE {where_realms};"))?; Ok(()) }