rust/hedgewars-server/src/server/client.rs
changeset 14693 6a2e13e36b7f
parent 14457 98ef2913ec73
child 14779 f43ab2bd76ae
equal deleted inserted replaced
14692:e5415faa117b 14693:6a2e13e36b7f
    17 
    17 
    18 pub struct HWClient {
    18 pub struct HWClient {
    19     pub id: ClientId,
    19     pub id: ClientId,
    20     pub room_id: Option<usize>,
    20     pub room_id: Option<usize>,
    21     pub nick: String,
    21     pub nick: String,
    22     pub web_password: String,
       
    23     pub server_salt: String,
       
    24     pub protocol_number: u16,
    22     pub protocol_number: u16,
    25     pub flags: ClientFlags,
    23     pub flags: ClientFlags,
    26     pub teams_in_game: u8,
    24     pub teams_in_game: u8,
    27     pub team_indices: Vec<u8>,
    25     pub team_indices: Vec<u8>,
    28     pub clan: Option<u8>,
    26     pub clan: Option<u8>,
    29 }
    27 }
    30 
    28 
    31 impl HWClient {
    29 impl HWClient {
    32     pub fn new(id: ClientId, salt: String) -> HWClient {
    30     pub fn new(id: ClientId, protocol_number: u16, nick: String) -> HWClient {
    33         HWClient {
    31         HWClient {
    34             id,
    32             id,
       
    33             nick,
       
    34             protocol_number,
    35             room_id: None,
    35             room_id: None,
    36             nick: String::new(),
       
    37             web_password: String::new(),
       
    38             server_salt: salt,
       
    39             protocol_number: 0,
       
    40             flags: ClientFlags::DEFAULT,
    36             flags: ClientFlags::DEFAULT,
    41             teams_in_game: 0,
    37             teams_in_game: 0,
    42             team_indices: Vec::new(),
    38             team_indices: Vec::new(),
    43             clan: None,
    39             clan: None,
    44         }
    40         }