veloren/common/src/msg/server.rs
timokoesters fc2e6c3624 Clean up client state code
Former-commit-id: 2469a49abd23038838f6176b7f5cf0b303e8bee5
2019-04-22 23:00:22 +02:00

44 lines
950 B
Rust

use vek::*;
use crate::{
comp,
terrain::TerrainChunk,
};
use super::{EcsPacket, ClientState};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum RequestStateError {
Denied,
Already,
Impossible,
}
#[derive(Clone, Serialize, Deserialize)]
pub enum ServerMsg {
StateAnswer(Result<ClientState, (RequestStateError, ClientState)>),
ForceState(ClientState),
InitialSync {
ecs_state: sphynx::StatePackage<EcsPacket>,
player_entity_uid: u64,
},
Ping,
Pong,
Chat(String),
SetPlayerEntity(u64),
EcsSync(sphynx::SyncPackage<EcsPacket>),
EntityPhysics {
entity: u64,
pos: comp::phys::Pos,
vel: comp::phys::Vel,
dir: comp::phys::Dir,
},
EntityAnimation {
entity: u64,
animation_history: comp::AnimationHistory,
},
TerrainChunkUpdate {
key: Vec3<i32>,
chunk: Box<TerrainChunk>,
},
Shutdown,
}