pub enum NetworkEvent {
Show 14 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,
},
Disconnected(ClientId),
}Expand description
Events produced by GameTransport::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).
Disconnected(ClientId)
A local event indicating the client transport has been disconnected.
Implementations§
Trait Implementations§
Source§impl Clone for NetworkEvent
impl Clone for NetworkEvent
Source§fn clone(&self) -> NetworkEvent
fn clone(&self) -> NetworkEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more