author | alfadur |
Fri, 06 Jul 2018 21:03:03 +0300 | |
changeset 13482 | f748a72432f2 |
parent 13428 | 87a6cad20c90 |
child 13483 | d79795acaa73 |
permissions | -rw-r--r-- |
13124
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12858
diff
changeset
|
1 |
pub type ClientId = usize; |
12133 | 2 |
|
3 |
pub struct HWClient { |
|
13124
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12858
diff
changeset
|
4 |
pub id: ClientId, |
12857 | 5 |
pub room_id: Option<usize>, |
12146 | 6 |
pub nick: String, |
12151
8d8fb85bc09c
SendAllButMe action, list all clients in lobby in LobbyJoined message to newcomers
unc0rr
parents:
12149
diff
changeset
|
7 |
pub protocol_number: u32, |
13482 | 8 |
pub is_admin: bool, |
12152 | 9 |
pub is_master: bool, |
10 |
pub is_ready: bool, |
|
13428 | 11 |
pub is_in_game: bool, |
13424 | 12 |
pub teams_in_game: u8, |
13428 | 13 |
pub team_indices: Vec<u8>, |
13424 | 14 |
pub clan: Option<u8>, |
12152 | 15 |
pub is_joined_mid_game: bool, |
12133 | 16 |
} |
17 |
||
18 |
impl HWClient { |
|
13124
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12858
diff
changeset
|
19 |
pub fn new(id: ClientId) -> HWClient { |
12133 | 20 |
HWClient { |
13124
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12858
diff
changeset
|
21 |
id, |
12151
8d8fb85bc09c
SendAllButMe action, list all clients in lobby in LobbyJoined message to newcomers
unc0rr
parents:
12149
diff
changeset
|
22 |
room_id: None, |
12146 | 23 |
nick: String::new(), |
12151
8d8fb85bc09c
SendAllButMe action, list all clients in lobby in LobbyJoined message to newcomers
unc0rr
parents:
12149
diff
changeset
|
24 |
protocol_number: 0, |
13482 | 25 |
is_admin: false, |
12152 | 26 |
is_master: false, |
27 |
is_ready: false, |
|
13428 | 28 |
is_in_game: false, |
13424 | 29 |
teams_in_game: 0, |
13428 | 30 |
team_indices: Vec::new(), |
13424 | 31 |
clan: None, |
12152 | 32 |
is_joined_mid_game: false, |
12133 | 33 |
} |
34 |
} |
|
13124
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12858
diff
changeset
|
35 |
} |