X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fserverenvironment.h;h=a11c814ed1e9e3a419b7eb22d3f99fad376cfe6c;hb=ed0882fd58fb0f663cc115d23a11643874facc06;hp=4b453d39a35bda885a7ca68e9fdd8335f9d6898d;hpb=471e567657dfd75a994a1b54d7a23cf4541a6bed;p=minetest.git diff --git a/src/serverenvironment.h b/src/serverenvironment.h index 4b453d39a..a11c814ed 100644 --- a/src/serverenvironment.h +++ b/src/serverenvironment.h @@ -190,14 +190,6 @@ enum ClearObjectsMode { CLEAR_OBJECTS_MODE_QUICK, }; -/* - The server-side environment. - - This is not thread-safe. Server uses an environment mutex. -*/ - -typedef std::unordered_map ServerActiveObjectMap; - class ServerEnvironment : public Environment { public: @@ -322,6 +314,9 @@ class ServerEnvironment : public Environment bool removeNode(v3s16 p); bool swapNode(v3s16 p, const MapNode &n); + // Find the daylight value at pos with a Depth First Search + u8 findSunlight(v3s16 pos) const; + // Find all active objects inside a radius around a point void getObjectsInsideRadius(std::vector &objects, const v3f &pos, float radius, std::function include_obj_cb) @@ -329,6 +324,13 @@ class ServerEnvironment : public Environment return m_ao_manager.getObjectsInsideRadius(pos, radius, objects, include_obj_cb); } + // Find all active objects inside a box + void getObjectsInArea(std::vector &objects, const aabb3f &box, + std::function include_obj_cb) + { + return m_ao_manager.getObjectsInArea(box, objects, include_obj_cb); + } + // Clear objects, loading and going through every MapBlock void clearObjects(ClearObjectsMode mode); @@ -436,7 +438,6 @@ class ServerEnvironment : public Environment IntervalLimiter m_object_management_interval; // List of active blocks ActiveBlockList m_active_blocks; - IntervalLimiter m_database_check_interval; IntervalLimiter m_active_blocks_management_interval; IntervalLimiter m_active_block_modifier_interval; IntervalLimiter m_active_blocks_nodemetadata_interval;