From 61578b238edf6fe2f7576d61cb906473f20b2305 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 17 Apr 2019 22:26:11 +0200 Subject: [PATCH] Sync animation states on initial connection Former-commit-id: 4ed67b6cbf56fceb03fa6a66b25b78925b91fc8a --- server/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/lib.rs b/server/src/lib.rs index ebd76783a5..305667195b 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -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::(), + &state.ecs().internal().read_storage::(), + ).join() { + // AnimationHistory + client.postbox.send_message(ServerMsg::EntityAnimation { + entity: uid.into(), + animationHistory: animationHistory, + }); + } } /// Sync client states with the most up to date information