rust/hedgewars-server/src/core/server.rs
changeset 15176 f6115638aa92
parent 15075 e935b1ad23f3
child 15439 a158ff8f84ef
--- a/rust/hedgewars-server/src/core/server.rs	Wed Jun 19 01:47:56 2019 +0300
+++ b/rust/hedgewars-server/src/core/server.rs	Wed Jun 19 02:40:00 2019 +0300
@@ -18,6 +18,7 @@
     pub protocol_number: Option<NonZeroU16>,
     pub server_salt: String,
     pub is_checker: bool,
+    pub is_local_admin: bool,
 }
 
 pub struct HwAnteroom {
@@ -30,12 +31,13 @@
         HwAnteroom { clients }
     }
 
-    pub fn add_client(&mut self, client_id: ClientId, salt: String) {
+    pub fn add_client(&mut self, client_id: ClientId, salt: String, is_local_admin: bool) {
         let client = HwAnteClient {
             nick: None,
             protocol_number: None,
             server_salt: salt,
             is_checker: false,
+            is_local_admin,
         };
         self.clients.insert(client_id, client);
     }
@@ -93,6 +95,9 @@
         if let (Some(protocol), Some(nick)) = (data.protocol_number, data.nick) {
             let mut client = HwClient::new(client_id, protocol.get(), nick);
             client.set_is_checker(data.is_checker);
+            #[cfg(not(feature = "official-server"))]
+            client.set_is_admin(data.is_local_admin);
+
             self.clients.insert(client_id, client);
         }
     }