rust/hedgewars-server/src/handlers.rs
changeset 15831 7d0f747afcb8
parent 15810 ee84e417d8d0
child 16002 e915ed28726e
--- a/rust/hedgewars-server/src/handlers.rs	Mon Jan 31 18:24:49 2022 +0300
+++ b/rust/hedgewars-server/src/handlers.rs	Tue Feb 01 02:23:35 2022 +0300
@@ -359,6 +359,7 @@
                             response.warn(ACCESS_DENIED);
                         }
                     }
+                    #[allow(unused_variables)]
                     HwProtocolMessage::Watch(id) => {
                         #[cfg(feature = "official-server")]
                         {
@@ -386,13 +387,14 @@
     response: &mut Response,
     addr: [u8; 4],
     is_local: bool,
-) {
+) -> bool {
     let ban_reason = Some(addr)
         .filter(|_| !is_local)
         .and_then(|a| state.anteroom.find_ip_ban(a));
     if let Some(reason) = ban_reason {
         response.add(HwServerMessage::Bye(reason).send_self());
         response.remove_client(client_id);
+        false
     } else {
         let mut salt = [0u8; 18];
         thread_rng().fill_bytes(&mut salt);
@@ -401,7 +403,11 @@
             .anteroom
             .add_client(client_id, encode(&salt), is_local);
 
-        response.add(HwServerMessage::Connected(utils::SERVER_MESSAGE.to_owned(), utils::SERVER_VERSION).send_self());
+        response.add(
+            HwServerMessage::Connected(utils::SERVER_MESSAGE.to_owned(), utils::SERVER_VERSION)
+                .send_self(),
+        );
+        true
     }
 }