Skip to content

Commit

Permalink
bhcl: Fix bug when launching a website game.
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeNapCali committed Jun 15, 2023
1 parent 0899dd3 commit 0d5e357
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ fn launch_game(button: &gtk::Button, in_field: &Entry)
let mut game_token: String = String::new();
let mut game_ip: String = String::new();
let mut game_port: String = String::new();
if (in_url.eq("localhost"))
let (game_token, game_ip, game_port) = if (in_url.as_str() == "localhost")
{
game_token = String::from("local");
game_ip = String::from("local");
game_port = String::from("42480");
(game_token, game_ip, game_port)
}
else
{
Expand Down Expand Up @@ -118,7 +119,8 @@ fn launch_game(button: &gtk::Button, in_field: &Entry)
let token_request = token_client.unwrap();
let token_request_json: Value = serde_json::from_str(token_request.as_str()).unwrap();
let game_token = token_request_json.get("token").unwrap().as_str().unwrap().to_string();
}
(game_token, game_ip, game_port)
};

let launcher_arg = format!("brickhill.legacy://client/{}/{}/{}", game_token, game_ip, game_port);
println!("{}", launcher_arg);
Expand Down

0 comments on commit 0d5e357

Please sign in to comment.