rust/hedgewars-server/src/handlers/common.rs
changeset 15509 91f0c5ec37b5
parent 15504 4cc9ec732392
child 15514 395be40faa51
--- a/rust/hedgewars-server/src/handlers/common.rs	Sat Oct 26 23:48:57 2019 +0200
+++ b/rust/hedgewars-server/src/handlers/common.rs	Mon Oct 28 00:31:41 2019 +0300
@@ -98,38 +98,6 @@
     response.add(rooms_msg.send_self());
 }
 
-pub fn change_master(
-    server: &mut HwServer,
-    room_id: RoomId,
-    new_master_id: ClientId,
-    response: &mut Response,
-) {
-    let room = &mut server.rooms[room_id];
-    if let Some(master_id) = room.master_id {
-        server.clients[master_id].set_is_master(false);
-        response.add(
-            ClientFlags(
-                remove_flags(&[Flags::RoomMaster]),
-                vec![server.clients[master_id].nick.clone()],
-            )
-            .send_all()
-            .in_room(room_id),
-        )
-    }
-
-    room.master_id = Some(new_master_id);
-    server.clients[new_master_id].set_is_master(true);
-
-    response.add(
-        ClientFlags(
-            add_flags(&[Flags::RoomMaster]),
-            vec![server.clients[new_master_id].nick.clone()],
-        )
-        .send_all()
-        .in_room(room_id),
-    );
-}
-
 pub fn get_room_join_data<'a, I: Iterator<Item = &'a HwClient> + Clone>(
     client: &HwClient,
     room: &HwRoom,