From 078ff7182b58cc8800d2223ba15ffb5468605699 Mon Sep 17 00:00:00 2001 From: stephanzlatarev Date: Sat, 5 Oct 2024 15:25:41 +0300 Subject: [PATCH 1/2] Pass bot names as player_name in game info --- proxy_controller/src/websocket/player.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy_controller/src/websocket/player.rs b/proxy_controller/src/websocket/player.rs index 5523565..9f6982a 100644 --- a/proxy_controller/src/websocket/player.rs +++ b/proxy_controller/src/websocket/player.rs @@ -388,7 +388,10 @@ impl Player { if response.has_game_info() { for pi in &mut response.mut_game_info().player_info { if pi.player_id() != r_vars.player_id() { + pi.player_name = Some(config.players[&player_num.other_player()].name.clone()); pi.race_actual = pi.race_requested; + } else { + pi.player_name = Some(config.players[&player_num].name.clone()); } } } From f0cc19bbd84305d5bc488e2408b1bb9e6cf672f8 Mon Sep 17 00:00:00 2001 From: stephanzlatarev Date: Sun, 6 Oct 2024 17:46:05 +0300 Subject: [PATCH 2/2] Fix formatting --- proxy_controller/src/websocket/player.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy_controller/src/websocket/player.rs b/proxy_controller/src/websocket/player.rs index 9f6982a..57bd91e 100644 --- a/proxy_controller/src/websocket/player.rs +++ b/proxy_controller/src/websocket/player.rs @@ -388,7 +388,8 @@ impl Player { if response.has_game_info() { for pi in &mut response.mut_game_info().player_info { if pi.player_id() != r_vars.player_id() { - pi.player_name = Some(config.players[&player_num.other_player()].name.clone()); + pi.player_name = + Some(config.players[&player_num.other_player()].name.clone()); pi.race_actual = pi.race_requested; } else { pi.player_name = Some(config.players[&player_num].name.clone());