Struct crystalorb::server::Server[][src]

pub struct Server<WorldType: World> { /* fields omitted */ }
Expand description

This is the top-level structure of CrystalOrb for your game server, analogous to the Client for game clients. You create, store, and update this server instance to run your game on the server side.

Implementations

Constructs a new Server. This function requires a seconds_since_startup parameter to initialize the server’s simulation timestamp.

The timestamp of the most recent frame that has completed its simulation. This is typically one less than Server::simulating_timestamp.

The timestamp of the frame that is in the process of being simulated. This is typically one more than Server::simulating_timestamp.

The timestamp that clients are supposed to be simulating at the moment (which should always be ahead of the server to compensate for the latency between the server and the clients).

This is also the timestamp that gets attached to the command when you call Server::issue_command.

The timestamp that clients have supposed to have completed simulating (which should always be ahead of the server to compensate for the latency between the server and the clients).

Issue a command from the server to the world. The command will be scheduled to the estimated client’s current timestamp.

Iterate through the commands that are being kept around. This is intended to be for diagnostic purposes.

Get the current display state of the server’s world.

Perform the next update. You would typically call this in your game engine’s update loop of some kind.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.