gameServer2/src/server/client.rs
author Wuzzy <Wuzzy2@mail.ru>
Tue, 17 Apr 2018 00:37:15 +0200
changeset 13332 817e1890ee66
parent 13124 1e39b8749072
child 13424 81e0ed105f5d
permissions -rw-r--r--
Added tag 0.9.24-release for changeset a4e7e62f2c0d

pub type ClientId = usize;

pub struct HWClient {
    pub id: ClientId,
    pub room_id: Option<usize>,
    pub nick: String,
    pub protocol_number: u32,
    pub is_master: bool,
    pub is_ready: bool,
    pub is_joined_mid_game: bool,
}

impl HWClient {
    pub fn new(id: ClientId) -> HWClient {
        HWClient {
            id,
            room_id: None,
            nick: String::new(),
            protocol_number: 0,
            is_master: false,
            is_ready: false,
            is_joined_mid_game: false,
        }
    }
}