2019-04-10 23:16:29 +00:00
|
|
|
use vek::*;
|
2019-04-14 20:30:27 +00:00
|
|
|
use crate::{
|
|
|
|
comp,
|
|
|
|
terrain::TerrainChunk,
|
|
|
|
};
|
2019-04-10 17:23:27 +00:00
|
|
|
use super::EcsPacket;
|
2019-03-04 19:50:26 +00:00
|
|
|
|
2019-04-10 23:16:29 +00:00
|
|
|
#[derive(Clone, Serialize, Deserialize)]
|
2019-03-03 22:02:38 +00:00
|
|
|
pub enum ServerMsg {
|
2019-04-10 17:23:27 +00:00
|
|
|
Handshake {
|
|
|
|
ecs_state: sphynx::StatePackage<EcsPacket>,
|
|
|
|
player_entity: u64,
|
|
|
|
},
|
2019-03-03 22:02:38 +00:00
|
|
|
Shutdown,
|
2019-03-05 18:39:18 +00:00
|
|
|
Ping,
|
|
|
|
Pong,
|
2019-03-04 19:50:26 +00:00
|
|
|
Chat(String),
|
2019-04-10 17:23:27 +00:00
|
|
|
SetPlayerEntity(u64),
|
|
|
|
EcsSync(sphynx::SyncPackage<EcsPacket>),
|
2019-04-14 20:30:27 +00:00
|
|
|
EntityPhysics {
|
|
|
|
entity: u64,
|
|
|
|
pos: comp::phys::Pos,
|
|
|
|
vel: comp::phys::Vel,
|
|
|
|
dir: comp::phys::Dir,
|
|
|
|
},
|
2019-04-16 14:29:44 +00:00
|
|
|
EntityAnimation {
|
|
|
|
entity: u64,
|
2019-04-17 17:32:29 +00:00
|
|
|
animationHistory: comp::AnimationHistory,
|
2019-04-16 14:29:44 +00:00
|
|
|
},
|
2019-04-10 23:16:29 +00:00
|
|
|
TerrainChunkUpdate {
|
|
|
|
key: Vec3<i32>,
|
2019-04-11 22:26:43 +00:00
|
|
|
chunk: Box<TerrainChunk>,
|
2019-04-10 23:16:29 +00:00
|
|
|
},
|
2019-03-03 22:02:38 +00:00
|
|
|
}
|