Struct crystalorb::client::stage::Ready [−][src]
pub struct Ready<WorldType, ActiveClientRefType>(_, _)
where
ActiveClientRefType: Borrow<ActiveClient<WorldType>>,
WorldType: World;
Expand description
The client interface once the client is in the ready stage.
Implementations
impl<WorldType, ActiveClientRefType> Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Borrow<ActiveClient<WorldType>>,
WorldType: World,
impl<WorldType, ActiveClientRefType> Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Borrow<ActiveClient<WorldType>>,
WorldType: World,
The timestamp of the most recent frame that has completed its simulation.
This is typically one less than Ready::simulating_timestamp
.
The timestamp of the frame that is in the process of being simulated.
This is typically one more than Ready::simulating_timestamp
.
This is also the timestamp that gets attached to the command when you call
Ready::issue_command
.
A number that is used to identify the client among all the clients connected to the server. This number may be useful, for example, to identify which piece of world state belongs to which player.
pub fn buffered_commands(
&self
) -> impl Iterator<Item = (Timestamp, &Vec<WorldType::CommandType>)>
pub fn buffered_commands(
&self
) -> impl Iterator<Item = (Timestamp, &Vec<WorldType::CommandType>)>
Iterate through the commands that are being kept around. This is intended to be for diagnostic purposes.
Get the current display state that can be used to render the client’s screen.
The timestamp used to test whether the next snapshot to be received is newer or older, and therefore should be discarded or queued.
This value gets updated if it gets too old, even if there hasn’t been any newer snapshot received. This is because we need to compare newly-received snapshots with this value, but we can’t compare Timestamps if they are outside the comparable range.
None if no snapshots have been received yet.
The timestamp of the most recently received snapshot, regardless of whether it got queued or discarded.
Unlike Ready::last_queued_snapshot_timestamp
, this does not get updated when it
becomes too old to be compared with the current timestamp. This is primarily used for
diagnostic purposes.
None if no spashots have been received yet.
Useful diagnostic to see what stage of the server reconciliation process that the
client is currently at. For more information, refer to ReconciliationStatus
.
impl<WorldType, ActiveClientRefType> Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Borrow<ActiveClient<WorldType>> + BorrowMut<ActiveClient<WorldType>>,
WorldType: World,
impl<WorldType, ActiveClientRefType> Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Borrow<ActiveClient<WorldType>> + BorrowMut<ActiveClient<WorldType>>,
WorldType: World,
pub fn issue_command<NetworkResourceType: NetworkResource<WorldType>>(
&mut self,
command: WorldType::CommandType,
net: &mut NetworkResourceType
)
pub fn issue_command<NetworkResourceType: NetworkResource<WorldType>>(
&mut self,
command: WorldType::CommandType,
net: &mut NetworkResourceType
)
Issue a command from this client’s player to the world. The command will be scheduled to the current simulating timestamp (the previously completed timestamp + 1).
Trait Implementations
impl<'a, WorldType: World> From<&'a ActiveClient<WorldType>> for Ready<WorldType, &'a ActiveClient<WorldType>>
impl<'a, WorldType: World> From<&'a ActiveClient<WorldType>> for Ready<WorldType, &'a ActiveClient<WorldType>>
Performs the conversion.
impl<'a, WorldType: World> From<&'a mut ActiveClient<WorldType>> for Ready<WorldType, &'a mut ActiveClient<WorldType>>
impl<'a, WorldType: World> From<&'a mut ActiveClient<WorldType>> for Ready<WorldType, &'a mut ActiveClient<WorldType>>
Performs the conversion.
Auto Trait Implementations
impl<WorldType, ActiveClientRefType> RefUnwindSafe for Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: RefUnwindSafe,
WorldType: RefUnwindSafe,
impl<WorldType, ActiveClientRefType> Send for Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Send,
impl<WorldType, ActiveClientRefType> Sync for Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Sync,
impl<WorldType, ActiveClientRefType> Unpin for Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: Unpin,
WorldType: Unpin,
impl<WorldType, ActiveClientRefType> UnwindSafe for Ready<WorldType, ActiveClientRefType> where
ActiveClientRefType: UnwindSafe,
WorldType: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more