X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FMasterState.hpp;h=61069dc5aa7136eb8be750bce26ece226ebef708;hb=ee77b8cf96525f0db007b170b6e96f055cba4d33;hp=8eeadf051811596a8f3db3b47306b6b537925f62;hpb=51a0b19601cb4b044c7eee1782aa85fc3a399d33;p=blank.git diff --git a/src/client/MasterState.hpp b/src/client/MasterState.hpp index 8eeadf0..61069dc 100644 --- a/src/client/MasterState.hpp +++ b/src/client/MasterState.hpp @@ -7,6 +7,7 @@ #include "../net/Client.hpp" #include "../net/ConnectionHandler.hpp" +#include #include @@ -55,6 +56,13 @@ public: void On(const Packet::DespawnEntity &) override; void On(const Packet::EntityUpdate &) 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: Environment &env; World::Config world_conf; @@ -67,6 +75,13 @@ private: int login_packet; + struct UpdateStatus { + std::uint16_t last_packet; + int last_update; + }; + std::map update_status; + IntervalTimer update_timer; + }; }