//! TCP Control Lane events.
//!
//! Defines the reliable commands sent over the TCP connection for state
//! synchronization, such as authentication and text chat.

use serde::{Deserialize, Serialize};

/// Represents all possible events sent over the reliable TCP control lane.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum TcpEvent {
    /// Initial request from the client containing their chosen username.
    AuthRequest {
        /// The username requested by the client.
        username: String,
    },
    /// The server's response confirming authentication and granting a session token.
    AuthResponse {
        /// A unique, ephemeral ID assigned to the client for the duration of the session.
        session_token: u32,
    },
    /// A request to join a specific voice channel.
    ChannelJoin {
        /// The unique ID of the target channel.
        channel_id: u32,
    },
    /// A text message intended for the current channel's chat.
    ChatMessage {
        /// The raw text message.
        message: String,
    },
}
