Skip to content

Commit 5b7ccdc

Browse files
committed
fix: new game request
1 parent de6e453 commit 5b7ccdc

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

crates/rpc/src/routes/new_game.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,19 @@ pub async fn new_game(address: &str, state: &State<ClusterState>) -> Result<Json
4141
.unwrap_or_default();
4242

4343
let url = local_url + "/game/new_game?address=" + address;
44-
println!("{}", url);
4544
let response = reqwest::get(url)
4645
.await
4746
.context("failed to hit new_game metrics server endpoint")?;
4847

49-
println!(
50-
"respons status {:?} | body: {:?}",
51-
response.status(),
52-
response.json::<Value>().await
53-
);
54-
55-
// let body = response
56-
// .json::<NewGameLocalResponse>()
57-
// .await
58-
// .context("http error")?;
48+
let body = response
49+
.json::<NewGameLocalResponse>()
50+
.await
51+
.context("http error")?;
5952

6053
Ok(Json(NewGameResponse {
6154
game_id: node_id,
6255
ip: external_url,
63-
player_state: "".to_string(),
64-
admin_pkh: "".to_string(),
56+
player_state: body.player_state,
57+
admin_pkh: body.admin_pkh,
6558
}))
6659
}

0 commit comments

Comments
 (0)