gameServer2/src/server/client.rs
author Wuzzy <Wuzzy2@mail.ru>
Tue, 17 Jul 2018 21:17:33 +0200
changeset 13506 bdac56fb6f1a
parent 13450 d79795acaa73
child 13486 1ee192f13456
permissions -rw-r--r--
Clarify/rewrite a few OutError messages

use super::coretypes::ClientId;

pub struct HWClient {
    pub id: ClientId,
    pub room_id: Option<usize>,
    pub nick: String,
    pub protocol_number: u32,
    pub is_admin: bool,
    pub is_master: bool,
    pub is_ready: bool,
    pub is_in_game: bool,
    pub teams_in_game: u8,
    pub team_indices: Vec<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_admin: false,
            is_master: false,
            is_ready: false,
            is_in_game: false,
            teams_in_game: 0,
            team_indices: Vec::new(),
            clan: None,
            is_joined_mid_game: false,
        }
    }
}