aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/data.rs6
-rw-r--r--test-client/protocol.ts1
2 files changed, 6 insertions, 1 deletions
diff --git a/server/src/data.rs b/server/src/data.rs
index 62a7f5d8..a1c7e894 100644
--- a/server/src/data.rs
+++ b/server/src/data.rs
@@ -98,6 +98,7 @@ pub struct Gamedata {
pub tile_names: Vec<String>,
pub tile_collide: Vec<bool>,
pub tile_interact: Vec<bool>,
+ pub map_names: HashSet<String>,
#[serde(skip)] pub recipes: Vec<Recipe>,
#[serde(skip)] pub demands: Vec<Demand>,
#[serde(skip)] pub initial_map: HashMap<IVec2, (TileIndex, Option<ItemIndex>)>,
@@ -153,7 +154,9 @@ impl DataIndex {
File::open(recipes_path).context("opening recipes failed. are they generated yet?")?,
)?;
- Ok(Gamedata::build(map_in, demands_in, recipes_in)?)
+ let mut gd = Gamedata::build(map_in, demands_in, recipes_in)?;
+ gd.map_names = self.maps.clone();
+ Ok(gd)
}
}
@@ -259,6 +262,7 @@ impl Gamedata {
tile_collide,
tile_interact,
recipes,
+ map_names: HashSet::new(),
initial_map,
item_names,
entities: map_in.entities,
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index f3bb8acb..ebfd9232 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -26,6 +26,7 @@ export interface Gamedata {
tile_collide: boolean[], // Look-up table for TileIndex to check tile collision with players
tile_interact: boolean[], // Look-up table for TileIndex to check if a tile is interactable
spawn: Vec2, // Where players spawn when they join.
+ map_names: string[],
}
export type PacketS =