diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-19 22:52:37 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:21:49 +0200 |
commit | 6ca76cc0568f3d60b280f11ae07a34303c317f34 (patch) | |
tree | ac867e47b3fb4b6ed99189cb302b2741b107d272 /server/src/protocol.rs | |
parent | 3dc8cc2abb4e6a7be8237b86dab6ebed75fa43cb (diff) | |
download | hurrycurry-6ca76cc0568f3d60b280f11ae07a34303c317f34.tar hurrycurry-6ca76cc0568f3d60b280f11ae07a34303c317f34.tar.bz2 hurrycurry-6ca76cc0568f3d60b280f11ae07a34303c317f34.tar.zst |
implement customer communication
Diffstat (limited to 'server/src/protocol.rs')
-rw-r--r-- | server/src/protocol.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/server/src/protocol.rs b/server/src/protocol.rs index 18b5f6fa..7eff2ba1 100644 --- a/server/src/protocol.rs +++ b/server/src/protocol.rs @@ -15,6 +15,14 @@ pub enum PacketS { Position { pos: Vec2, rot: f32 }, Interact { pos: IVec2, edge: bool }, Collide { player: PlayerID, force: Vec2 }, + Communicate { message: Option<Message> }, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum Message { + Text(String), + Item(ItemIndex), } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -61,10 +69,14 @@ pub enum PacketC { UpdateMap { pos: IVec2, tile: TileIndex, - neighbours: [Option<TileIndex>; 4], + neighbors: [Option<TileIndex>; 4], }, Collide { player: PlayerID, force: Vec2, }, + Communicate { + player: PlayerID, + message: Option<Message>, + }, } |