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).
pub fn issue_command<NetworkResourceType: NetworkResource>(
&mut self,
command: WorldType::CommandType,
net: &mut NetworkResourceType
)
[src]
pub fn issue_command<NetworkResourceType: NetworkResource>(
&mut self,
command: WorldType::CommandType,
net: &mut NetworkResourceType
)
[src]Issue a command from the server to the world. The command will be scheduled to the estimated client’s current timestamp.
pub fn buffered_commands(
&self
) -> impl Iterator<Item = (Timestamp, &Vec<WorldType::CommandType>)>
[src]
pub fn buffered_commands(
&self
) -> impl Iterator<Item = (Timestamp, &Vec<WorldType::CommandType>)>
[src]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.
Trait Implementations
Auto Trait Implementations
impl<WorldType> RefUnwindSafe for Server<WorldType> where
WorldType: RefUnwindSafe,
<WorldType as World>::CommandType: RefUnwindSafe,
impl<WorldType> UnwindSafe for Server<WorldType> where
WorldType: UnwindSafe,
<WorldType as World>::CommandType: RefUnwindSafe,