]> git.lizzy.rs Git - minetest.git/blobdiff - src/nodedef.h
Do not allow the m_transforming_liquid queue to increase until all RAM is consumed
[minetest.git] / src / nodedef.h
index 489aefffddb0af0b53ac58af06932d5797e26187..dd76717e1b15ffd68be0a9dc4be36c5822b35d79 100644 (file)
@@ -40,6 +40,8 @@ class IShaderSource;
 class IGameDef;
 
 typedef std::list<std::pair<content_t, int> > GroupItems;
+typedef std::list<std::pair<std::string, std::vector<content_t> *> >
+       ContentVectorResolveList;
 
 enum ContentParamType
 {
@@ -164,7 +166,7 @@ struct ContentFeatures
        */
 #ifndef SERVER
        // 0     1     2     3     4     5
-       // up    down  right left  back  front 
+       // up    down  right left  back  front
        TileSpec tiles[6];
        // Special tiles
        // - Currently used for flowing liquids
@@ -191,7 +193,7 @@ struct ContentFeatures
        std::string mesh;
 #ifndef SERVER
        scene::IMesh *mesh_ptr[24];
-#endif 
+#endif
        float visual_scale; // Misc. scale parameter
        TileDef tiledef[6];
        TileDef tiledef_special[CF_SPECIAL_COUNT]; // eg. flowing liquid
@@ -261,7 +263,7 @@ struct ContentFeatures
        /*
                Methods
        */
-       
+
        ContentFeatures();
        ~ContentFeatures();
        void reset();
@@ -335,7 +337,7 @@ class NodeResolver {
                        node name resolution.
                @return Status of node resolution request.
        */
-       int addNode(std::string n_wanted, std::string n_alt,
+       int addNode(const std::string &n_wanted, const std::string &n_alt,
                content_t c_fallback, content_t *content);
 
        /**
@@ -350,17 +352,18 @@ class NodeResolver {
                before the pending request had been satisfied, cancelNodeList() must be
                called.
 
-               @param nodename Name of node (or node group) to be resolved. 
+               @param nodename Name of node (or node group) to be resolved.
                @param content_vec Pointer to content_t vector onto which the results
                        are added.
 
                @return Status of node resolution request.
        */
-       int addNodeList(const char *nodename, std::vector<content_t> *content_vec);
+       int addNodeList(const std::string &nodename,
+               std::vector<content_t> *content_vec);
 
        /**
-               Removes all pending requests from the resolution queue to be satisfied
-               to content.
+               Removes all pending requests from the resolution queue with the output
+               address of 'content'.
 
                @param content Location of the content ID for the request being
                        cancelled.
@@ -369,8 +372,8 @@ class NodeResolver {
        bool cancelNode(content_t *content);
 
        /**
-               Removes all pending requests from the resolution queue to be satisfied
-               to content_vec.
+               Removes all pending requests from the resolution queue with the output
+               address of 'content_vec'.
 
                @param content_vec Location of the content ID vector for requests being
                        cancelled.
@@ -399,7 +402,7 @@ class NodeResolver {
        INodeDefManager *m_ndef;
        bool m_is_node_registration_complete;
        std::list<NodeResolveInfo *> m_pending_contents;
-       std::list<std::pair<std::string, std::vector<content_t> *> > m_pending_content_vecs;
+       ContentVectorResolveList m_pending_content_vecs;
 };
 
 class INodeDefManager
@@ -416,7 +419,7 @@ class INodeDefManager
        virtual void getIds(const std::string &name, std::set<content_t> &result)
                        const=0;
        virtual const ContentFeatures& get(const std::string &name) const=0;
-       
+
        virtual void serialize(std::ostream &os, u16 protocol_version)=0;
 
        virtual NodeResolver *getResolver()=0;