aboutsummaryrefslogtreecommitdiff
path: root/server/protocol/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/protocol/src/lib.rs')
-rw-r--r--server/protocol/src/lib.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs
index 8a6e282e..db69f6be 100644
--- a/server/protocol/src/lib.rs
+++ b/server/protocol/src/lib.rs
@@ -81,8 +81,15 @@ pub struct Demand {
pub points: i64,
}
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct Serverdata {
+ pub name: String,
+ pub motd: Option<String>,
+ pub maps: Vec<(String, MapMetadata)>,
+ pub bot_algos: Vec<String>,
+}
+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
-#[rustfmt::skip]
pub struct Gamedata {
pub current_map: String,
pub item_names: Vec<String>,
@@ -92,8 +99,6 @@ pub struct Gamedata {
pub tile_placeable_items: BTreeMap<TileIndex, HashSet<ItemIndex>>,
pub tile_placeable_any: HashSet<TileIndex>,
pub tile_interactable_empty: HashSet<TileIndex>,
- pub maps: Vec<(String, MapMetadata)>,
- pub bot_algos: Vec<String>,
pub recipes: Vec<Recipe>,
pub demands: Vec<Demand>,
pub hand_count: usize,
@@ -216,7 +221,10 @@ pub enum PacketC {
Joined {
id: PlayerID,
},
- Data {
+ ServerData {
+ data: Box<Serverdata>,
+ },
+ GameData {
data: Box<Gamedata>,
},
AddPlayer {