equal
deleted
inserted
replaced
59 HWServerMessage::Connected(utils::PROTOCOL_VERSION), |
59 HWServerMessage::Connected(utils::PROTOCOL_VERSION), |
60 ); |
60 ); |
61 key |
61 key |
62 } |
62 } |
63 |
63 |
64 pub fn client_lost(&mut self, client_id: ClientId) { |
64 pub fn remove_client(&mut self, client_id: ClientId) { |
65 actions::run_action( |
65 let client = &self.clients[client_id]; |
66 self, |
66 let nick = client.nick.clone(); |
67 client_id, |
67 |
68 actions::Action::ByeClient("Connection reset".to_string()), |
68 if let Some(id) = client.room_id { |
69 ); |
69 if id != self.lobby_id { |
|
70 //MoveToLobby(format!("quit: {}", msg.clone())) |
|
71 } |
|
72 } |
|
73 |
|
74 self.removed_clients.push(client_id); |
|
75 if self.clients.contains(client_id) { |
|
76 self.clients.remove(client_id); |
|
77 } |
70 } |
78 } |
71 |
79 |
72 pub fn add_room(&mut self) -> &mut HWRoom { |
80 pub fn add_room(&mut self) -> &mut HWRoom { |
73 allocate_room(&mut self.rooms) |
81 allocate_room(&mut self.rooms) |
74 } |
82 } |