#pragma once #include #include "Abstract.hpp" #include "TOSLib.hpp" #include #include #include #include #include #include #include #include namespace LV::Server { class RemoteClient; class GameServer; class World; /* Игрок */ class ContentEventController { public: std::queue Build, Break; public: ContentEventController(std::unique_ptr&& remote); // Измеряется в чанках в регионах (активная зона) static constexpr uint16_t getViewRangeActive() { return 2; } // Измеряется в чанках в радиусе (Декоративная зона) + getViewRangeActive() uint16_t getViewRangeBackground() const; ServerObjectPos getLastPos() const; ServerObjectPos getPos() const; // Очищает более не наблюдаемые чанки и миры void removeUnobservable(const ContentViewInfo_Diff& diff); // Здесь приходят частично фильтрованные события // Фильтровать не отслеживаемые миры void onWorldUpdate(WorldId_t worldId, World *worldObj); void onEntityEnterLost(WorldId_t worldId, Pos::GlobalRegion regionPos, const std::unordered_set &enter, const std::unordered_set &lost); void onEntitySwap(ServerEntityId_t prevId, ServerEntityId_t newId); void onEntityUpdates(WorldId_t worldId, Pos::GlobalRegion regionPos, const std::unordered_map &entities); void onPortalEnterLost(const std::vector &enter, const std::vector &lost); void onPortalUpdates(const std::vector &portals); inline const SubscribedObj& getSubscribed() { return Subscribed; }; void onUpdate(); }; }