aboutsummaryrefslogtreecommitdiff
path: root/planetwars-client/src
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-22 23:06:59 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-22 23:06:59 +0200
commitfe2f382e0478b13e57a8e79a4c4c5a919f0d1a33 (patch)
treec1747b513998ffd2fe02ce2ce5a32f3369813385 /planetwars-client/src
parentb0725c21df3d7a2b63d0d9ea7af6ec393fb66ad1 (diff)
downloadplanetwars.dev-fe2f382e0478b13e57a8e79a4c4c5a919f0d1a33.tar.xz
planetwars.dev-fe2f382e0478b13e57a8e79a4c4c5a919f0d1a33.zip
allow configuring grpc server url
Diffstat (limited to 'planetwars-client/src')
-rw-r--r--planetwars-client/src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/planetwars-client/src/main.rs b/planetwars-client/src/main.rs
index cafb956..ae2fb5e 100644
--- a/planetwars-client/src/main.rs
+++ b/planetwars-client/src/main.rs
@@ -18,6 +18,14 @@ struct PlayMatch {
#[clap(value_parser)]
opponent_name: String,
+
+ #[clap(
+ value_parser,
+ long,
+ default_value = "http://planetwars.dev:7492",
+ env = "PLANETWARS_GRPC_SERVER_URL"
+ )]
+ gprc_server_url: String,
}
#[derive(Deserialize)]
@@ -34,7 +42,8 @@ async fn main() {
let content = std::fs::read_to_string(play_match.bot_config_path).unwrap();
let bot_config: BotConfig = toml::from_str(&content).unwrap();
- let channel = Channel::from_static("http://localhost:50051")
+ let channel = Channel::from_shared(play_match.gprc_server_url)
+ .expect("invalid grpc server url")
.connect()
.await
.unwrap();