pub enum NetworkEvent {
Show 20 variants
ClientConnected(ClientId),
ClientDisconnected(ClientId),
UnreliableMessage {
client_id: ClientId,
data: Vec<u8>,
},
ReliableMessage {
client_id: ClientId,
data: Vec<u8>,
},
Ping {
client_id: ClientId,
tick: u64,
},
Pong {
tick: u64,
},
Auth {
session_token: String,
},
SessionClosed(ClientId),
StreamReset(ClientId),
Fragment {
client_id: ClientId,
fragment: FragmentedEvent,
},
StressTest {
client_id: ClientId,
count: u16,
rotate: bool,
},
Spawn {
client_id: ClientId,
entity_type: u16,
x: f32,
y: f32,
rot: f32,
},
ClearWorld {
client_id: ClientId,
},
StartSession {
client_id: ClientId,
},
RequestWorkspaceManifest {
client_id: ClientId,
},
Disconnected(ClientId),
PlatformEvent {
client_id: ClientId,
event: PlatformEvent,
},
ReplicationBatch {
client_id: ClientId,
events: Vec<ReplicationEvent>,
},
EntitySpawned {
client_id: ClientId,
network_id: NetworkId,
kind: u16,
},
EntityDespawned {
client_id: ClientId,
network_id: NetworkId,
},
}Expand description
Events produced by PlatformTransport::poll_events().
Variants§
ClientConnected(ClientId)
A new client has connected and been assigned a ClientId.
ClientDisconnected(ClientId)
A client has disconnected (graceful or timeout).
UnreliableMessage
Raw unreliable data received from a client.
ReliableMessage
Raw reliable data received from a client.
Ping
A heartbeat ping from a client.
Fields
Pong
A heartbeat pong from the server.
Auth
A session authentication request from the client.
SessionClosed(ClientId)
A WebTransport session was closed by the remote or due to error.
StreamReset(ClientId)
A WebTransport stream was reset.
Fragment
A fragment of a larger message.
Fields
fragment: FragmentedEventThe fragment data.
StressTest
A testing command to trigger a stress test (Phase 1/Playground only).
Fields
Spawn
A testing command to spawn a specific entity (Phase 1/Playground only).
Fields
ClearWorld
A command to clear all entities from the world (Phase 1/Playground only).
StartSession
Client requests to start a gameplay session: spawns the session agent and grants Possession.
RequestWorkspaceManifest
A request from a client to receive the current workspace manifest.
Disconnected(ClientId)
A local event indicating the client transport has been disconnected.
PlatformEvent
A discrete platform event (e.g. exhaustion, termination).
ReplicationBatch
A batch of replication updates sent together to save bandwidth/packets.
Fields
events: Vec<ReplicationEvent>The collection of updates.
EntitySpawned
A new entity has been spawned in the world.
Fields
EntityDespawned
An entity has been despawned from the world.
Implementations§
Trait Implementations§
Source§impl Clone for NetworkEvent
impl Clone for NetworkEvent
Source§fn clone(&self) -> NetworkEvent
fn clone(&self) -> NetworkEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NetworkEvent
impl Debug for NetworkEvent
Source§impl<'de> Deserialize<'de> for NetworkEvent
impl<'de> Deserialize<'de> for NetworkEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for NetworkEvent
impl PartialEq for NetworkEvent
Source§fn eq(&self, other: &NetworkEvent) -> bool
fn eq(&self, other: &NetworkEvent) -> bool
self and other values to be equal, and is used by ==.