fix: guests
* make guest status a flag on users * add logout handlers * add logout notification for other users
This commit is contained in:
parent
23630b19b2
commit
60a6680eaf
21 changed files with 523 additions and 601 deletions
|
|
@ -26,6 +26,8 @@ pub mod close_codes {
|
|||
pub const SCENE_CHANGE: u16 = 4000;
|
||||
/// Server timeout (no message received within timeout period).
|
||||
pub const SERVER_TIMEOUT: u16 = 4001;
|
||||
/// User explicitly logged out.
|
||||
pub const LOGOUT: u16 = 4003;
|
||||
}
|
||||
|
||||
/// Reason for member disconnect.
|
||||
|
|
@ -126,20 +128,16 @@ pub enum ServerMessage {
|
|||
|
||||
/// A member left the channel.
|
||||
MemberLeft {
|
||||
/// User ID (if authenticated user).
|
||||
user_id: Option<Uuid>,
|
||||
/// Guest session ID (if guest).
|
||||
guest_session_id: Option<Uuid>,
|
||||
/// User ID of the member who left.
|
||||
user_id: Uuid,
|
||||
/// Reason for disconnect.
|
||||
reason: DisconnectReason,
|
||||
},
|
||||
|
||||
/// A member updated their position.
|
||||
PositionUpdated {
|
||||
/// User ID (if authenticated user).
|
||||
user_id: Option<Uuid>,
|
||||
/// Guest session ID (if guest).
|
||||
guest_session_id: Option<Uuid>,
|
||||
/// User ID of the member.
|
||||
user_id: Uuid,
|
||||
/// New X coordinate.
|
||||
x: f64,
|
||||
/// New Y coordinate.
|
||||
|
|
@ -148,10 +146,8 @@ pub enum ServerMessage {
|
|||
|
||||
/// A member changed their emotion.
|
||||
EmotionUpdated {
|
||||
/// User ID (if authenticated user).
|
||||
user_id: Option<Uuid>,
|
||||
/// Guest session ID (if guest).
|
||||
guest_session_id: Option<Uuid>,
|
||||
/// User ID of the member.
|
||||
user_id: Uuid,
|
||||
/// Emotion name (e.g., "happy", "sad", "neutral").
|
||||
emotion: String,
|
||||
/// Asset paths for all 9 positions of the new emotion layer.
|
||||
|
|
@ -173,10 +169,8 @@ pub enum ServerMessage {
|
|||
ChatMessageReceived {
|
||||
/// Unique message ID.
|
||||
message_id: Uuid,
|
||||
/// User ID of sender (if authenticated user).
|
||||
user_id: Option<Uuid>,
|
||||
/// Guest session ID (if guest).
|
||||
guest_session_id: Option<Uuid>,
|
||||
/// User ID of sender.
|
||||
user_id: Uuid,
|
||||
/// Display name of sender.
|
||||
display_name: String,
|
||||
/// Message content.
|
||||
|
|
@ -217,10 +211,8 @@ pub enum ServerMessage {
|
|||
PropPickedUp {
|
||||
/// ID of the prop that was picked up.
|
||||
prop_id: Uuid,
|
||||
/// User ID who picked it up (if authenticated).
|
||||
picked_up_by_user_id: Option<Uuid>,
|
||||
/// Guest session ID who picked it up (if guest).
|
||||
picked_up_by_guest_id: Option<Uuid>,
|
||||
/// User ID who picked it up.
|
||||
picked_up_by_user_id: Uuid,
|
||||
},
|
||||
|
||||
/// A prop expired and was removed.
|
||||
|
|
@ -231,10 +223,8 @@ pub enum ServerMessage {
|
|||
|
||||
/// A member updated their avatar appearance.
|
||||
AvatarUpdated {
|
||||
/// User ID (if authenticated user).
|
||||
user_id: Option<Uuid>,
|
||||
/// Guest session ID (if guest).
|
||||
guest_session_id: Option<Uuid>,
|
||||
/// User ID of the member.
|
||||
user_id: Uuid,
|
||||
/// Updated avatar render data.
|
||||
avatar: AvatarRenderData,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue