Sync animation states on initial connection

Former-commit-id: 4ed67b6cbf56fceb03fa6a66b25b78925b91fc8a
This commit is contained in:
timokoesters 2019-04-17 22:26:11 +02:00
parent 7e3f271838
commit 61578b238e

View File

@ -364,6 +364,18 @@ impl Server {
.into(),
});
// Sync logical information other players have authority over, not the server
for (other_entity, &uid, &animationHistory) in (
&state.ecs().internal().entities(),
&state.ecs().internal().read_storage::<common::state::Uid>(),
&state.ecs().internal().read_storage::<comp::AnimationHistory>(),
).join() {
// AnimationHistory
client.postbox.send_message(ServerMsg::EntityAnimation {
entity: uid.into(),
animationHistory: animationHistory,
});
}
}
/// Sync client states with the most up to date information