X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FMasterState.hpp;h=78ab3703b756539bad02d8f26ce4511efd4886ff;hb=69a4ba4fa3e4694887087ab6dddc784a593d2b03;hp=50773a63d03e7d700b7e7e5b7c63d6da8f8b33c3;hpb=8ae45b6555d55f301f83daf8c1337d332d8305ab;p=blank.git diff --git a/src/client/MasterState.hpp b/src/client/MasterState.hpp index 50773a6..78ab370 100644 --- a/src/client/MasterState.hpp +++ b/src/client/MasterState.hpp @@ -1,11 +1,13 @@ #ifndef BLANK_CLIENT_CLIENTSTATE_HPP_ #define BLANK_CLIENT_CLIENTSTATE_HPP_ +#include "../app/State.hpp" +#include "../net/ConnectionHandler.hpp" + #include "Client.hpp" #include "InitialState.hpp" #include "InteractiveState.hpp" -#include "../app/State.hpp" -#include "../net/ConnectionHandler.hpp" +#include "../app/Config.hpp" #include #include @@ -26,18 +28,18 @@ class MasterState public: MasterState( Environment &, - const World::Config &, - const Interface::Config &, - const Client::Config & + Config &, + const World::Config & ); Client &GetClient() noexcept { return client; } Environment &GetEnv() noexcept { return env; } + Config &GetConfig() noexcept { return config; } + const Config &GetConfig() const noexcept { return config; } + World::Config &GetWorldConf() noexcept { return world_conf; } const World::Config &GetWorldConf() const noexcept { return world_conf; } - const Interface::Config &GetInterfaceConf() const noexcept { return intf_conf; } - const Client::Config &GetClientConf() const noexcept { return client_conf; } void Quit(); @@ -58,19 +60,13 @@ public: void On(const Packet::PlayerCorrection &) override; void On(const Packet::ChunkBegin &) override; void On(const Packet::ChunkData &) 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); + void On(const Packet::BlockUpdate &) override; + void On(const Packet::Message &) override; private: Environment &env; + Config &config; World::Config world_conf; - const Interface::Config &intf_conf; - const Client::Config &client_conf; std::unique_ptr state; Client client; @@ -78,13 +74,6 @@ private: int login_packet; - struct UpdateStatus { - std::uint16_t last_packet; - int last_update; - }; - std::map update_status; - IntervalTimer update_timer; - }; }