equal
deleted
inserted
replaced
562 msg: echo.join(" "), |
562 msg: echo.join(" "), |
563 }; |
563 }; |
564 response.add(chat_msg.send_all().in_room(room_id)); |
564 response.add(chat_msg.send_all().in_room(room_id)); |
565 response.add(result.send_all().in_room(room_id)); |
565 response.add(result.send_all().in_room(room_id)); |
566 } |
566 } |
|
567 Delegate(nick) => { |
|
568 let delegate_id = server.find_client(&nick).map(|c| (c.id, c.room_id)); |
|
569 let client = &server.clients[client_id]; |
|
570 if !(client.is_admin() || client.is_master()) { |
|
571 response.add( |
|
572 Warning("You're not the room master or a server admin!".to_string()) |
|
573 .send_self(), |
|
574 ) |
|
575 } else { |
|
576 match delegate_id { |
|
577 None => response.add(Warning("Player is not online.".to_string()).send_self()), |
|
578 Some((id, _)) if id == client_id => response |
|
579 .add(Warning("You're already the room master.".to_string()).send_self()), |
|
580 Some((_, id)) if id != Some(room_id) => response |
|
581 .add(Warning("The player is not in your room.".to_string()).send_self()), |
|
582 Some((id, _)) => { |
|
583 super::common::change_master(server, client_id, id, room_id, response); |
|
584 } |
|
585 } |
|
586 } |
|
587 } |
567 _ => warn!("Unimplemented!"), |
588 _ => warn!("Unimplemented!"), |
568 } |
589 } |
569 } |
590 } |