#[non_exhaustive]pub enum VoiceEvent {
Connected {
connection: ConnectionId,
},
Disconnected {
connection: ConnectionId,
reason: String,
},
Migrated {
connection: ConnectionId,
to: ShardId,
},
RequestedChannel {
connection: ConnectionId,
channel: ChannelKey,
},
RequestedSelfState {
connection: ConnectionId,
self_mute: Option<bool>,
self_deaf: Option<bool>,
},
InvokedAction {
connection: ConnectionId,
action: ActionKey,
on: ActionTarget,
},
Said {
connection: ConnectionId,
to: Audience,
text: String,
},
}Expand description
A voice-plane fact reported to the flavor.
Always a statement about the runtime, never a command: the flavor alone decides what its state becomes, and ignoring an event is a valid answer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connected
A connection was attached to this shard.
Fields
connection: ConnectionIdDisconnected
A connection is gone. No further event will carry it.
Migrated
A connection left for another shard. Its socket is still alive and its session is unchanged; only this shard stops describing it.
Distinct from VoiceEvent::Disconnected because the two mean opposite
things to a flavor: a disconnect frees a slot, a migration hands it over.
RequestedChannel
The client asked to enter a channel, by double-clicking it or dragging itself into it.
A request, never a fact: the channel is one this connection can actually see, and nothing has moved. What it means is entirely the flavor’s business, up to and including ignoring it.
REF: references/vendored/Mumble.proto : UserState.channel_id sent by a
client for its own session.
RequestedSelfState
The client asked to mute or deafen itself.
A request like the others: the flags a client sees are the ones the
flavor renders, so refusing is simply rendering nothing new. A flavor
that grants it stores the pair and hands it back through
crate::build::ShardBuilder::user_flags.
None means the client said nothing about that flag, so whatever the
flavor currently renders stands. The runtime holds no copy of the pair:
that state belongs to the flavor, and keeping a second one here is how
the two start disagreeing.
REF: references/mumble/src/mumble/ServerHandler.cpp :
setSelfMuteDeafState sends a UserState carrying both flags.
InvokedAction
The client invoked a context action this shard had offered it.
Everything is already resolved against what that connection was actually
granted and can actually see: the key was offered to it, the target is
visible to it, and the place matches the bits the flavor declared. What
the action means is the flavor’s business alone, including doing
nothing and refusing through crate::reply::Reply::refuse.
REF: references/mumble/src/mumble/MainWindow.cpp : context_triggered
sends back the identifier the server stored, with the selected user
and channel.
Said
The client typed something and aimed it somewhere.
A request like every other: the target is already resolved against what this connection can see, and the channel it names is one the flavor rendered as writable, but nothing has been delivered. A flavor that ignores this event delivers nothing, which is the honest default for a runtime whose whole subject is who may know what.
crate::reply::Reply::relay is the one line that carries it out, and
the flavor is free to rewrite the audience, the text, or both.
REF: references/mumble/src/murmur/Messages.cpp : msgTextMessage resolves
the targets against the sender’s view, then routes.
Trait Implementations§
Source§impl Clone for VoiceEvent
impl Clone for VoiceEvent
Source§fn clone(&self) -> VoiceEvent
fn clone(&self) -> VoiceEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more