gameServer2/src/server/handlers/inroom.rs
changeset 13439 c4f917c6be51
parent 13429 4c5ed27b1ff8
child 13443 2501428303a2
equal deleted inserted replaced
13438:da71e0d88a1c 13439:c4f917c6be51
   219         Cfg(cfg) => {
   219         Cfg(cfg) => {
   220             let actions = if let (c, Some(r)) = server.client_and_room(client_id) {
   220             let actions = if let (c, Some(r)) = server.client_and_room(client_id) {
   221                 if !c.is_master {
   221                 if !c.is_master {
   222                     vec![ProtocolError("You're not the room master!".to_string())]
   222                     vec![ProtocolError("You're not the room master!".to_string())]
   223                 } else {
   223                 } else {
   224                     r.set_config(cfg.clone());
   224                     let v = vec![cfg.to_server_msg()
   225                     vec![cfg.into_server_msg()
   225                         .send_all().in_room(r.id).but_self().action()];
   226                         .send_all().in_room(r.id).but_self().action()]
   226                     r.set_config(cfg);
       
   227                     v
   227                 }
   228                 }
   228             } else {
   229             } else {
   229                 Vec::new()
   230                 Vec::new()
   230             };
   231             };
   231             server.react(client_id, actions);
   232             server.react(client_id, actions);