Selecting/Creating/Joining Rooms & Severs!

This commit is contained in:
2024-10-13 16:46:28 -04:00
Unverified
parent 3d2445c94c
commit 8168f19b5f
9 changed files with 473 additions and 286 deletions

View File

@@ -1,64 +1,64 @@
use durian::bincode_packet;
use crate::types::{Message, Room, User};
#[bincode_packet]
pub struct Greet {
pub id: u32
}
#[bincode_packet]
pub struct UserJoinedEvent {
pub user: User,
}
#[bincode_packet]
pub struct UserLeftEvent {
pub user: User,
}
#[bincode_packet]
pub struct NewMessageEvent {
pub message: Message,
}
// use durian::bincode_packet;
// use crate::types::{Message, Room, User};
//
// #[bincode_packet]
// pub struct StartTypingEvent {
// pub user: User,
// pub room: String,
// pub struct Greet {
// pub id: u32
// }
//
// #[bincode_packet]
// pub struct StopTypingEvent {
// pub struct UserJoinedEvent {
// pub user: User,
// pub room: String,
// }
#[bincode_packet]
pub struct NewRoomEvent {
pub room: Room,
}
#[bincode_packet]
pub struct DeleteRoomEvent {
pub roomid: String,
}
#[bincode_packet]
pub struct KickedUserEvent {
pub userid: String,
}
#[bincode_packet]
pub struct BannedUserEvent {
pub userid: String,
}
#[bincode_packet]
pub struct PromotedUserEvent {
pub userid: String,
}
#[bincode_packet]
pub struct DemotedUserEvent {
pub userid: String,
}
//
// #[bincode_packet]
// pub struct UserLeftEvent {
// pub user: User,
// }
//
// #[bincode_packet]
// pub struct NewMessageEvent {
// pub message: Message,
// }
//
// // #[bincode_packet]
// // pub struct StartTypingEvent {
// // pub user: User,
// // pub room: String,
// // }
// //
// // #[bincode_packet]
// // pub struct StopTypingEvent {
// // pub user: User,
// // pub room: String,
// // }
//
// #[bincode_packet]
// pub struct NewRoomEvent {
// pub room: Room,
// }
//
// #[bincode_packet]
// pub struct DeleteRoomEvent {
// pub roomid: String,
// }
//
// #[bincode_packet]
// pub struct KickedUserEvent {
// pub userid: String,
// }
//
// #[bincode_packet]
// pub struct BannedUserEvent {
// pub userid: String,
// }
//
// #[bincode_packet]
// pub struct PromotedUserEvent {
// pub userid: String,
// }
//
// #[bincode_packet]
// pub struct DemotedUserEvent {
// pub userid: String,
// }