gameServer2/src/server/client.rs
author alfadur
Tue, 26 Jun 2018 23:22:38 +0300
changeset 13422 5fb27f94fc3b
parent 13419 81e0ed105f5d
child 13423 87a6cad20c90
permissions -rw-r--r--
Implement game config messages

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 teams_in_game: u8,
    pub clan: Option<u8>,
    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,
            teams_in_game: 0,
            clan: None,
            is_joined_mid_game: false,
        }
    }
}