Enum common::ServerAction
source · [−]pub enum ServerAction {
Effects {
time: WorldInstant,
chunk_updates: Vec<(usize, ChunkUpdate)>,
},
Welcome(PcHandle),
UnloadChunks(Vec<usize>),
}
Expand description
Messages sent back to clients by the server.
Variants
Effects
Fields
time: WorldInstant
The time at which the world should be before applying the effects. If the receiver World’s time is behind, it should be updated until it reaches this time.
chunk_updates: Vec<(usize, ChunkUpdate)>
Effects or entire chunks to apply or replace, respectively.
Game state updates for a specific time, to sync up the client with the server’s World state.
Welcome(PcHandle)
Response to ClientAction::Hello, tells the peer which PlayerCharacter they’re controlling. PcHandle is used to index into Chunk::pcs.
UnloadChunks(Vec<usize>)
Hint for the client to unload the chunks, as effects for the chunks won’t be sent anymore, and they will drift out of sync with the server.
Trait Implementations
sourceimpl Clone for ServerAction
impl Clone for ServerAction
sourcefn clone(&self) -> ServerAction
fn clone(&self) -> ServerAction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'de> Deserialize<'de> for ServerAction
impl<'de> Deserialize<'de> for ServerAction
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for ServerAction
impl Serialize for ServerAction
Auto Trait Implementations
impl RefUnwindSafe for ServerAction
impl Send for ServerAction
impl Sync for ServerAction
impl Unpin for ServerAction
impl UnwindSafe for ServerAction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more