From 2d0761b8932f11b01e241e2db3a8f08250efe878 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 7 Sep 2023 19:17:49 +0200 Subject: new protocol --- server/src/protocol.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'server/src/protocol.rs') diff --git a/server/src/protocol.rs b/server/src/protocol.rs index a27e339..85ab03a 100644 --- a/server/src/protocol.rs +++ b/server/src/protocol.rs @@ -5,22 +5,27 @@ */ use serde::{Deserialize, Serialize}; +use crate::logic::Client; + #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ClientboundPacket { - Init { your_id: usize, version: String }, - ClientJoin { id: usize }, - ClientLeave { id: usize }, - Message { sender: usize, message: String }, + Init { your_id: Client, version: String }, + ClientJoin { id: Client }, + ClientLeave { id: Client }, + Message { sender: Client, message: String }, RoomInfo { hash: String, user_count: usize }, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ServerboundPacket { + Join { + hash: Option, + }, Ping, Relay { - recipient: Option, + recipient: Option, message: String, }, WatchRooms(Vec), -- cgit v1.2.3-70-g09d2