aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/data.rs8
-rw-r--r--server/src/state.rs9
2 files changed, 3 insertions, 14 deletions
diff --git a/server/src/data.rs b/server/src/data.rs
index 408ea736..48540d72 100644
--- a/server/src/data.rs
+++ b/server/src/data.rs
@@ -121,7 +121,6 @@ pub struct Gamedata {
#[derive(Debug, Deserialize, Default)]
pub struct DataIndex {
pub maps: HashMap<String, MapMetadata>,
- pub demands: HashSet<String>,
pub recipes: HashSet<String>,
}
@@ -147,13 +146,6 @@ impl DataIndex {
let path = data_dir().join(format!("maps/{name}.yaml"));
Ok(read_to_string(path).await?)
}
- pub async fn read_demands(&self, name: &str) -> Result<String> {
- if !self.demands.contains(name) {
- bail!("unknown demands: {name:?}");
- }
- let path = data_dir().join(format!("demands/{name}.yaml"));
- Ok(read_to_string(path).await?)
- }
pub async fn read_recipes(&self, name: &str) -> Result<String> {
if !self.recipes.contains(name) {
bail!("unknown recipes: {name:?}");
diff --git a/server/src/state.rs b/server/src/state.rs
index 44b4078a..11c45933 100644
--- a/server/src/state.rs
+++ b/server/src/state.rs
@@ -44,7 +44,7 @@ enum Command {
},
/// Abort the current game
End,
- /// Download recipe/demand/map's source declaration
+ /// Download recipe/map's source declaration
Download {
/// Resource kind
#[arg(value_enum)]
@@ -52,7 +52,7 @@ enum Command {
/// Name
name: String,
},
- /// List all recipes, demands and maps
+ /// List all recipes and maps
List,
/// Send an effect
Effect { name: String },
@@ -69,7 +69,6 @@ enum Command {
enum DownloadType {
Map,
Recipes,
- Demand,
}
impl State {
@@ -202,15 +201,13 @@ impl State {
let source = match r#type {
DownloadType::Map => self.index.read_map(&name).await,
DownloadType::Recipes => self.index.read_recipes(&name).await,
- DownloadType::Demand => self.index.read_demands(&name).await,
}?;
bail!("{source}");
}
Command::List => {
bail!(
- "Maps: {:?}\nDemands: {:?}\nRecipes: {:?}",
+ "Maps: {:?}\nRecipes: {:?}",
self.index.maps.keys().collect::<Vec<_>>(),
- self.index.demands,
self.index.recipes
)
}