author | Wuzzy <Wuzzy2@mail.ru> |
Sat, 17 Mar 2018 04:37:13 +0100 | |
changeset 13235 | 9f5023a5f9e1 |
parent 13119 | 1e39b8749072 |
child 13419 | 81e0ed105f5d |
permissions | -rw-r--r-- |
13119
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12853
diff
changeset
|
1 |
pub type ClientId = usize; |
12128 | 2 |
|
3 |
pub struct HWClient { |
|
13119
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12853
diff
changeset
|
4 |
pub id: ClientId, |
12852 | 5 |
pub room_id: Option<usize>, |
12141 | 6 |
pub nick: String, |
12146
8d8fb85bc09c
SendAllButMe action, list all clients in lobby in LobbyJoined message to newcomers
unc0rr
parents:
12144
diff
changeset
|
7 |
pub protocol_number: u32, |
12147 | 8 |
pub is_master: bool, |
9 |
pub is_ready: bool, |
|
10 |
pub is_joined_mid_game: bool, |
|
12128 | 11 |
} |
12 |
||
13 |
impl HWClient { |
|
13119
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12853
diff
changeset
|
14 |
pub fn new(id: ClientId) -> HWClient { |
12128 | 15 |
HWClient { |
13119
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12853
diff
changeset
|
16 |
id, |
12146
8d8fb85bc09c
SendAllButMe action, list all clients in lobby in LobbyJoined message to newcomers
unc0rr
parents:
12144
diff
changeset
|
17 |
room_id: None, |
12141 | 18 |
nick: String::new(), |
12146
8d8fb85bc09c
SendAllButMe action, list all clients in lobby in LobbyJoined message to newcomers
unc0rr
parents:
12144
diff
changeset
|
19 |
protocol_number: 0, |
12147 | 20 |
is_master: false, |
21 |
is_ready: false, |
|
22 |
is_joined_mid_game: false, |
|
12128 | 23 |
} |
24 |
} |
|
13119
1e39b8749072
separated the server logic from all the async io mess.
alfadur
parents:
12853
diff
changeset
|
25 |
} |