Enum naia_client::Event[][src]

pub enum Event<P: ProtocolType, E: Copy> {
Show 14 variants Connection, Disconnection, Tick, SpawnEntity(E, Vec<P::Kind>), DespawnEntity(E), OwnEntity(OwnedEntity<E>), DisownEntity(OwnedEntity<E>), RewindEntity(OwnedEntity<E>), InsertComponent(E, P::Kind), UpdateComponent(E, P::Kind), RemoveComponent(E, P), Message(P), NewCommand(OwnedEntity<E>, P), ReplayCommand(OwnedEntity<E>, P),
}
Expand description

An Event that is be emitted by the Client, usually as a result of some communication with the Server

Variants

Connection

Occurs when the Client has successfully established a connection with the Server

Disconnection

Occurs when the Client has lost connection with the Server, usually as a result of a timeout

Tick

A Tick Event, the duration between Tick events is defined in the Config passed to the Client on initialization

SpawnEntity(E, Vec<P::Kind>)

Occurs when an Entity on the Server has come into scope for the Client

Tuple Fields of SpawnEntity

0: E1: Vec<P::Kind>
DespawnEntity(E)

Occurs when an Entity on the Server has been destroyed, or left the Client’s scope

Tuple Fields of DespawnEntity

0: E
OwnEntity(OwnedEntity<E>)

Occurs when an Entity has been assigned to the current User, meaning it can receive Commands from the Client, and be extrapolated forward into the “present” time

Tuple Fields of OwnEntity

0: OwnedEntity<E>
DisownEntity(OwnedEntity<E>)

Occurs when an Entity has been unassigned from the current User, meaning it can no longer receive Commands from this Client

Tuple Fields of DisownEntity

0: OwnedEntity<E>
RewindEntity(OwnedEntity<E>)

Occurs when an assigned Entity needs to be reset from the “present” state, back to it’s authoritative “past”, due to some misprediction error

Tuple Fields of RewindEntity

0: OwnedEntity<E>
InsertComponent(E, P::Kind)

Occurs when a Component should be added to a given Entity

Tuple Fields of InsertComponent

0: E1: P::Kind
UpdateComponent(E, P::Kind)

Occurs when a Component has had a state change on the Server while the Entity it is attached to has come into scope for the Client

Tuple Fields of UpdateComponent

0: E1: P::Kind
RemoveComponent(E, P)

Occurs when a Component should be removed from the given Entity

Tuple Fields of RemoveComponent

0: E1: P
Message(P)

An Message emitted to the Client from the Server

Tuple Fields of Message

0: P
NewCommand(OwnedEntity<E>, P)

A new Command received immediately to an assigned Entity, used to extrapolate Entity from the “past” to the “present”.

Tuple Fields of NewCommand

0: OwnedEntity<E>1: P
ReplayCommand(OwnedEntity<E>, P)

An old Command which has already been received by the assigned Entity, but which must be replayed after a “RewindEntity” event in order to extrapolate back to the “present”

Tuple Fields of ReplayCommand

0: OwnedEntity<E>1: P

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.