equal
deleted
inserted
replaced
116 RemoveClient, |
116 RemoveClient, |
117 ByeClient(String), |
117 ByeClient(String), |
118 ReactProtocolMessage(HWProtocolMessage), |
118 ReactProtocolMessage(HWProtocolMessage), |
119 CheckRegistered, |
119 CheckRegistered, |
120 JoinLobby, |
120 JoinLobby, |
121 AddRoom(String, Option<String>), |
|
122 RemoveRoom(RoomId), |
121 RemoveRoom(RoomId), |
123 MoveToRoom(RoomId), |
122 MoveToRoom(RoomId), |
124 MoveToLobby(String), |
123 MoveToLobby(String), |
125 ChangeMaster(RoomId, Option<ClientId>), |
124 ChangeMaster(RoomId, Option<ClientId>), |
126 RemoveTeam(String), |
125 RemoveTeam(String), |
238 server_msg.send_self().action(), |
237 server_msg.send_self().action(), |
239 rooms_msg.send_self().action(), |
238 rooms_msg.send_self().action(), |
240 ], |
239 ], |
241 ); |
240 ); |
242 } |
241 } |
243 AddRoom(name, password) => { |
|
244 let room_id = server.add_room();; |
|
245 |
|
246 let r = &mut server.rooms[room_id]; |
|
247 let c = &mut server.clients[client_id]; |
|
248 r.master_id = Some(c.id); |
|
249 r.name = name; |
|
250 r.password = password; |
|
251 r.protocol_number = c.protocol_number; |
|
252 |
|
253 let actions = vec![ |
|
254 RoomAdd(r.info(Some(&c))) |
|
255 .send_all() |
|
256 .with_protocol(r.protocol_number) |
|
257 .action(), |
|
258 MoveToRoom(room_id), |
|
259 ]; |
|
260 |
|
261 server.react(client_id, actions); |
|
262 } |
|
263 RemoveRoom(room_id) => { |
242 RemoveRoom(room_id) => { |
264 let r = &mut server.rooms[room_id]; |
243 let r = &mut server.rooms[room_id]; |
265 let actions = vec![RoomRemove(r.name.clone()) |
244 let actions = vec![RoomRemove(r.name.clone()) |
266 .send_all() |
245 .send_all() |
267 .with_protocol(r.protocol_number) |
246 .with_protocol(r.protocol_number) |