diff options
author | Henauxg <19689618+Henauxg@users.noreply.github.com> | 2022-11-02 17:14:06 +0100 |
---|---|---|
committer | Henauxg <19689618+Henauxg@users.noreply.github.com> | 2022-11-02 17:14:06 +0100 |
commit | 1655dfb503af20f0de37cbca694443b8bac35def (patch) | |
tree | ffa689e20e9ec741c269059c60f20e234c853c8c /examples/breakout/protocol.rs | |
parent | 2ab5dda6513f4995a10d25a040be643d666602b7 (diff) |
[example] Versus breakout prototype
Diffstat (limited to 'examples/breakout/protocol.rs')
-rw-r--r-- | examples/breakout/protocol.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/breakout/protocol.rs b/examples/breakout/protocol.rs new file mode 100644 index 0000000..7ed1710 --- /dev/null +++ b/examples/breakout/protocol.rs @@ -0,0 +1,24 @@ +use bevy_quinnet::ClientId; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum Input {} + +// Messages from clients +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum ClientMessage { + Join {}, + Disconnect {}, + PaddleInput {}, +} + +// Messages from the server +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum ServerMessage { + ClientConnected { client_id: ClientId }, + ClientDisconnected { client_id: ClientId }, + InitClient { client_id: ClientId }, + BrickDestroyed {}, + BallPosition {}, + PaddlePosition {}, +} |