gameServer2/src/server/client.rs
changeset 13798 4664da990556
parent 13529 662f7df89d06
child 13805 0463a4221327
--- a/gameServer2/src/server/client.rs	Wed Sep 05 18:09:06 2018 +0300
+++ b/gameServer2/src/server/client.rs	Wed Sep 05 19:22:29 2018 +0300
@@ -7,6 +7,7 @@
         const IS_READY = 0b0000_0100;
         const IS_IN_GAME = 0b0000_1000;
         const IS_JOINED_MID_GAME = 0b0001_0000;
+        const IS_CHECKER = 0b0010_0000;
 
         const NONE = 0b0000_0000;
         const DEFAULT = Self::NONE.bits;
@@ -17,6 +18,8 @@
     pub id: ClientId,
     pub room_id: Option<usize>,
     pub nick: String,
+    pub web_password: String,
+    pub server_salt: String,
     pub protocol_number: u16,
     pub flags: ClientFlags,
     pub teams_in_game: u8,
@@ -25,11 +28,13 @@
 }
 
 impl HWClient {
-    pub fn new(id: ClientId) -> HWClient {
+    pub fn new(id: ClientId, salt: String) -> HWClient {
         HWClient {
             id,
             room_id: None,
             nick: String::new(),
+            web_password: String::new(),
+            server_salt: salt,
             protocol_number: 0,
             flags: ClientFlags::DEFAULT,
             teams_in_game: 0,
@@ -51,10 +56,12 @@
     pub fn is_ready(&self)-> bool { self.contains(ClientFlags::IS_READY) }
     pub fn is_in_game(&self)-> bool { self.contains(ClientFlags::IS_IN_GAME) }
     pub fn is_joined_mid_game(&self)-> bool { self.contains(ClientFlags::IS_JOINED_MID_GAME) }
+    pub fn is_checker(&self)-> bool { self.contains(ClientFlags::IS_CHECKER) }
 
     pub fn set_is_admin(&mut self, value: bool) { self.set(ClientFlags::IS_ADMIN, value) }
     pub fn set_is_master(&mut self, value: bool) { self.set(ClientFlags::IS_MASTER, value) }
     pub fn set_is_ready(&mut self, value: bool) { self.set(ClientFlags::IS_READY, value) }
     pub fn set_is_in_game(&mut self, value: bool) { self.set(ClientFlags::IS_IN_GAME, value) }
     pub fn set_is_joined_mid_game(&mut self, value: bool) { self.set(ClientFlags::IS_JOINED_MID_GAME, value) }
+    pub fn set_is_checker(&mut self, value: bool) { self.set(ClientFlags::IS_CHECKER, value) }
 }
\ No newline at end of file