X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=731ed0acd82d688e3e76181b129c679a080e03f4;hb=a26ca06878d45d3ce77cbc28b574f2553e121944;hp=86757a294c10501dd28c074a28ba59410220bb59;hpb=bc2806164f55b7ac48dbb6d224b7d4b55683decf;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index 86757a2..731ed0a 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -48,7 +48,10 @@ public: void Update(int dt) override; void Render(Viewport &) override; - void MergePlayerCorrection(std::uint16_t, const EntityState &); + void Handle(const Packet::SpawnEntity &); + void Handle(const Packet::DespawnEntity &); + void Handle(const Packet::EntityUpdate &); + void Handle(const Packet::PlayerCorrection &); void Handle(const Packet::BlockUpdate &); void SetAudio(bool) override; @@ -57,6 +60,13 @@ public: void SetDebug(bool) override; void Exit() override; +private: + /// flag entity as updated by given packet + /// returns false if the update should be ignored + bool UpdateEntity(std::uint32_t id, std::uint16_t seq); + /// drop update information or given entity + void ClearEntity(std::uint32_t id); + private: MasterState &master; ShapeRegistry shapes; @@ -75,6 +85,14 @@ private: SkyBox sky; + std::vector tex_map; + + struct UpdateStatus { + std::uint16_t last_packet; + int last_update; + }; + std::map update_status; + }; }