diff --git a/src/cli/manage.rs b/src/cli/manage.rs index 48c333f3e..55ccf8351 100644 --- a/src/cli/manage.rs +++ b/src/cli/manage.rs @@ -44,6 +44,13 @@ pub struct Manage { /// The configuration source for a management server. #[clap(subcommand)] pub provider: crate::config::Providers, + /// If specified, filters the available gameserver addresses to the one that + /// matches the specified type + #[clap(long)] + pub address_type: Option, + /// If specified, additionally filters the gameserver address by its ip kind + #[clap(long, requires("address_type"), value_enum, default_value_t=crate::config::AddrKind::Any)] + pub ip_kind: crate::config::AddrKind, } impl Manage { @@ -69,6 +76,10 @@ impl Manage { provider: self.provider, relay_servers: self.relay, listener, + address_selector: self.address_type.map(|at| crate::config::AddressSelector { + name: at, + kind: self.ip_kind, + }), } .run(crate::components::RunArgs { config, diff --git a/src/components/manage.rs b/src/components/manage.rs index 85481173d..b9811b571 100644 --- a/src/components/manage.rs +++ b/src/components/manage.rs @@ -26,6 +26,7 @@ pub struct Manage { pub relay_servers: Vec, pub provider: Providers, pub listener: crate::net::TcpListener, + pub address_selector: Option, } impl Manage { @@ -48,7 +49,7 @@ impl Manage { config.clone(), ready.provider_is_healthy.clone(), self.locality, - None, + self.address_selector, false, );