gameServer2/src/server/handlers/inroom.rs
changeset 13533 c8b626b0a3ad
parent 13532 e3ae9eea0689
child 13534 662f7df89d06
--- a/gameServer2/src/server/handlers/inroom.rs	Fri Jul 20 00:02:52 2018 +0300
+++ b/gameServer2/src/server/handlers/inroom.rs	Fri Jul 20 22:14:20 2018 +0300
@@ -275,6 +275,21 @@
             };
             server.react(client_id, actions);
         }
+        Save(name, location) => {
+            let actions = vec![server_chat(format!("Room config saved as {}", name))
+                .send_all().in_room(room_id).action()];
+            server.rooms[room_id].save_config(name, location);
+            server.react(client_id, actions);
+        }
+        Delete(name) => {
+            let actions = if !server.rooms[room_id].delete_config(&name) {
+                vec![Warn(format!("Save doesn't exist: {}", name))]
+            } else {
+                vec![server_chat(format!("Room config {} has been deleted", name))
+                    .send_all().in_room(room_id).action()]
+            };
+            server.react(client_id, actions);
+        }
         CallVote(None) => {
             server.react(client_id, vec![
                 server_chat("Available callvote commands: kick <nickname>, map <name>, pause, newseed, hedgehogs <number>".to_string())