Expand description

Contains types and traits to use on authoritative server.

Usage

let listener = tokio::net::TcpListener::bind((std::net::Ipv4Addr::UNSPECIFIED, 12345)).await?;

#[derive(Clone, PartialEq, serde::Serialize)]
struct Foo;

let mut server = ServerSystem::builder()
    .with_descriptor::<Foo>() // Server will replicate `Foo` component
    .with_player::<DummyRemotePlayer>()
    .build(listener);

server.run(world, scope).await?;

Structs

This type is dummy implementation of RemotePlayer trait.

This type implements builder-pattern to configure ServerSystem. Allows adding new descriptors and setting remote player type.

This component is a marker for ServerSystem. ServerSystem replicates only entities marked with this component.

Authoritative server system. It should be configured with ServerBuilder and polled using ServerSystem::run method, preferably on fixed interval.

Enums

Marker type signals that remote player type is not set. ServerBuilder starts with this type parameter in place where RemotePlayer is expected.

Result of Descriptor::replicate. Either signals that state wasn’t modified and need not to be send, or contains serializable representation.

Traits

This trait manages components replication. Typical implementation covers only one component, but is not limited to do so.

This trait is conceptually part of Descriptor trait. Used as a workaround for HKT.

This trait defines how players are connected and commands are processed.

Type Definitions

Shortcut for item type fetched by descriptor’s query.

Shortcut for packed type produced by descriptor.