gameServer2/src/server/handlers/inroom.rs
changeset 13428 c8425fbcf1d9
parent 13427 6f6a866c86a2
child 13429 4c5ed27b1ff8
equal deleted inserted replaced
13427:6f6a866c86a2 13428:c8425fbcf1d9
   246                         _ => None
   246                         _ => None
   247                     }).next().map(|s| encode(s));
   247                     }).next().map(|s| encode(s));
   248 
   248 
   249                     let em_response = encode(&valid.flat_map(|msg| msg).cloned().collect::<Vec<_>>());
   249                     let em_response = encode(&valid.flat_map(|msg| msg).cloned().collect::<Vec<_>>());
   250                     if !em_response.is_empty() {
   250                     if !em_response.is_empty() {
   251                         actions.push(ForwardEngineMessage(em_response)
   251                         actions.push(ForwardEngineMessage(vec![em_response])
   252                             .send_all().in_room(r.id).but_self().action());
   252                             .send_all().in_room(r.id).but_self().action());
   253                     }
   253                     }
   254                     let em_log = encode(&non_empty.flat_map(|msg| msg).cloned().collect::<Vec<_>>());
   254                     let em_log = encode(&non_empty.flat_map(|msg| msg).cloned().collect::<Vec<_>>());
   255                     if let Some(ref mut info) = r.game_info {
   255                     if let Some(ref mut info) = r.game_info {
   256                         info.msg_log.push_str(&em_log);
   256                         if (!em_log.is_empty()) {
       
   257                             info.msg_log.push(em_log);
       
   258                         }
   257                         if last_msg.is_some() {
   259                         if last_msg.is_some() {
   258                             info.last_msg = last_msg;
   260                             info.last_msg = last_msg;
   259                         }
   261                         }
   260                     }
   262                     }
   261                 }
   263                 }