From 74ffa47147d2bb989057b4513075975c44c2bc42 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 1 Mar 2026 21:55:16 +0100 Subject: add serverdata packet with data fields that dont change across games; add motd and server name --- server/protocol/src/lib.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'server/protocol/src/lib.rs') 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, + pub maps: Vec<(String, MapMetadata)>, + pub bot_algos: Vec, +} + #[derive(Debug, Clone, Serialize, Deserialize, Default)] -#[rustfmt::skip] pub struct Gamedata { pub current_map: String, pub item_names: Vec, @@ -92,8 +99,6 @@ pub struct Gamedata { pub tile_placeable_items: BTreeMap>, pub tile_placeable_any: HashSet, pub tile_interactable_empty: HashSet, - pub maps: Vec<(String, MapMetadata)>, - pub bot_algos: Vec, pub recipes: Vec, pub demands: Vec, pub hand_count: usize, @@ -216,7 +221,10 @@ pub enum PacketC { Joined { id: PlayerID, }, - Data { + ServerData { + data: Box, + }, + GameData { data: Box, }, AddPlayer { -- cgit v1.3