gameServer2/src/server/room.rs
changeset 13533 c8b626b0a3ad
parent 13532 e3ae9eea0689
child 13534 662f7df89d06
--- a/gameServer2/src/server/room.rs	Fri Jul 20 00:02:52 2018 +0300
+++ b/gameServer2/src/server/room.rs	Fri Jul 20 22:14:20 2018 +0300
@@ -335,6 +335,10 @@
         }
     }
 
+    pub fn save_config(&mut self, name: String, location: String) {
+        self.saves.insert(name, RoomSave { location, config: self.config.clone() });
+    }
+
     pub fn load_config(&mut self, name: &str) -> Option<&str> {
         if let Some(save) = self.saves.get(name) {
             self.config = save.config.clone();
@@ -344,6 +348,10 @@
         }
     }
 
+    pub fn delete_config(&mut self, name: &str) -> bool {
+        self.saves.remove(name).is_some()
+    }
+
     pub fn team_info(owner: &HWClient, team: &TeamInfo) -> Vec<String> {
         let mut info = vec![
             team.name.clone(),