From 558a40523e058e1fc10ce26b34fa162d69ab76f5 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 10 Mar 2020 18:06:33 -0700 Subject: [PATCH] net payloads for channels and online users --- server/src/payload.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/server/src/payload.rs b/server/src/payload.rs index 79470fe..b20c898 100644 --- a/server/src/payload.rs +++ b/server/src/payload.rs @@ -5,10 +5,30 @@ // This structure allows us to provide some critical data for the client to reconnect to // the server without having to go through a sign in process everytime +// TODO: refactor this so that we don't need any optional fields #[derive(Serialize, Deserialize, Debug)] pub struct NewUserResponse { pub userid: Option, pub username: Option, pub key: Option, pub err: Option<&'static str>, +} + +// This is basically anyone that's online at the moment +pub struct OnlineUser { + pub id: u64, + pub username: String, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct VoiceChannel { + pub id: i32, + pub name: String, + pub usercount: i32, // how many people are in the channel at that moment +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct TextChannel { + pub id: i32, + pub name: String, } \ No newline at end of file