gameServer2/src/server/room.rs
changeset 13528 c8b626b0a3ad
parent 13527 e3ae9eea0689
child 13529 662f7df89d06
equal deleted inserted replaced
13527:e3ae9eea0689 13528:c8b626b0a3ad
   333             Some(ref info) => game_config_from(&info.config),
   333             Some(ref info) => game_config_from(&info.config),
   334             None => game_config_from(&self.config)
   334             None => game_config_from(&self.config)
   335         }
   335         }
   336     }
   336     }
   337 
   337 
       
   338     pub fn save_config(&mut self, name: String, location: String) {
       
   339         self.saves.insert(name, RoomSave { location, config: self.config.clone() });
       
   340     }
       
   341 
   338     pub fn load_config(&mut self, name: &str) -> Option<&str> {
   342     pub fn load_config(&mut self, name: &str) -> Option<&str> {
   339         if let Some(save) = self.saves.get(name) {
   343         if let Some(save) = self.saves.get(name) {
   340             self.config = save.config.clone();
   344             self.config = save.config.clone();
   341             Some(&save.location[..])
   345             Some(&save.location[..])
   342         } else {
   346         } else {
   343             None
   347             None
   344         }
   348         }
       
   349     }
       
   350 
       
   351     pub fn delete_config(&mut self, name: &str) -> bool {
       
   352         self.saves.remove(name).is_some()
   345     }
   353     }
   346 
   354 
   347     pub fn team_info(owner: &HWClient, team: &TeamInfo) -> Vec<String> {
   355     pub fn team_info(owner: &HWClient, team: &TeamInfo) -> Vec<String> {
   348         let mut info = vec![
   356         let mut info = vec![
   349             team.name.clone(),
   357             team.name.clone(),