From 25871de08468561472517209f8b7250ed10b1828 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sun, 16 Oct 2022 20:23:12 +0200 Subject: [PATCH] Add a message to explain why connection are closed in case of invalid player names --- rust/sea_battle_backend/src/human_player_ws.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/sea_battle_backend/src/human_player_ws.rs b/rust/sea_battle_backend/src/human_player_ws.rs index 29769a2..30aab8e 100644 --- a/rust/sea_battle_backend/src/human_player_ws.rs +++ b/rust/sea_battle_backend/src/human_player_ws.rs @@ -152,6 +152,7 @@ impl Actor for HumanPlayerWS { fn started(&mut self, ctx: &mut Self::Context) { // Check player name length if self.name.len() < MIN_PLAYER_NAME_LENGTH || self.name.len() > MAX_PLAYER_NAME_LENGTH { + log::error!("Close connection due to invalid user name!"); ctx.stop(); return; }