]> git.lizzy.rs Git - minetest.git/blobdiff - src/server.h
Add Mapgen V7, reorganize biomes
[minetest.git] / src / server.h
index 63717eaecab4e97abee82f1fe910974542217376..ea1cb79af529aef55fc09de91c2c583abdd1dac9 100644 (file)
@@ -456,6 +456,34 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        // Envlock and conlock should be locked when calling this
        void notifyPlayer(const char *name, const std::wstring msg);
        void notifyPlayers(const std::wstring msg);
+       void spawnParticle(const char *playername,
+               v3f pos, v3f velocity, v3f acceleration,
+               float expirationtime, float size,
+               bool collisiondetection, std::string texture);
+
+       void spawnParticleAll(v3f pos, v3f velocity, v3f acceleration,
+               float expirationtime, float size,
+               bool collisiondetection, std::string texture);
+
+       u32 addParticleSpawner(const char *playername,
+               u16 amount, float spawntime,
+               v3f minpos, v3f maxpos,
+               v3f minvel, v3f maxvel,
+               v3f minacc, v3f maxacc,
+               float minexptime, float maxexptime,
+               float minsize, float maxsize,
+               bool collisiondetection, std::string texture);
+
+       u32 addParticleSpawnerAll(u16 amount, float spawntime,
+               v3f minpos, v3f maxpos,
+               v3f minvel, v3f maxvel,
+               v3f minacc, v3f maxacc,
+               float minexptime, float maxexptime,
+               float minsize, float maxsize,
+               bool collisiondetection, std::string texture);
+
+       void deleteParticleSpawner(const char *playername, u32 id);
+       void deleteParticleSpawnerAll(u32 id);
 
        void queueBlockEmerge(v3s16 blockpos, bool allow_generate);
 
@@ -468,11 +496,9 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        // Envlock should be locked when using the rollback manager
        IRollbackManager *getRollbackManager(){ return m_rollback; }
 
-       //TODO:  determine what should be locked when accessing the emerge manager
+       //TODO: determine what (if anything) should be locked to access EmergeManager
        EmergeManager *getEmergeManager(){ return m_emerge; }
 
-       BiomeDefManager *getBiomeDef(){ return m_biomedef; }
-
        // actions: time-reversed list
        // Return value: success/failure
        bool rollbackRevertActions(const std::list<RollbackAction> &actions,
@@ -527,7 +553,7 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        static void SendDeathscreen(con::Connection &con, u16 peer_id,
                        bool set_camera_point_target, v3f camera_point_target);
        static void SendItemDef(con::Connection &con, u16 peer_id,
-                       IItemDefManager *itemdef);
+                       IItemDefManager *itemdef, u16 protocol_version);
        static void SendNodeDef(con::Connection &con, u16 peer_id,
                        INodeDefManager *nodedef, u16 protocol_version);
 
@@ -574,6 +600,41 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        void sendDetachedInventoryToAll(const std::string &name);
        void sendDetachedInventories(u16 peer_id);
 
+       // Adds a ParticleSpawner on peer with peer_id
+       void SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime,
+               v3f minpos, v3f maxpos,
+               v3f minvel, v3f maxvel,
+               v3f minacc, v3f maxacc,
+               float minexptime, float maxexptime,
+               float minsize, float maxsize,
+               bool collisiondetection, std::string texture, u32 id);
+
+       // Adds a ParticleSpawner on all peers
+       void SendAddParticleSpawnerAll(u16 amount, float spawntime,
+               v3f minpos, v3f maxpos,
+               v3f minvel, v3f maxvel,
+               v3f minacc, v3f maxacc,
+               float minexptime, float maxexptime,
+               float minsize, float maxsize,
+               bool collisiondetection, std::string texture, u32 id);
+
+       // Deletes ParticleSpawner on a single client
+       void SendDeleteParticleSpawner(u16 peer_id, u32 id);
+
+       // Deletes ParticleSpawner on all clients
+       void SendDeleteParticleSpawnerAll(u32 id);
+
+       // Spawns particle on single client
+       void SendSpawnParticle(u16 peer_id,
+               v3f pos, v3f velocity, v3f acceleration,
+               float expirationtime, float size,
+               bool collisiondetection, std::string texture);
+
+       // Spawns particle on all clients
+       void SendSpawnParticleAll(v3f pos, v3f velocity, v3f acceleration,
+               float expirationtime, float size,
+               bool collisiondetection, std::string texture);
+
        /*
                Something random
        */
@@ -670,9 +731,6 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        // Emerge manager
        EmergeManager *m_emerge;
 
-       // Biome Definition Manager
-       BiomeDefManager *m_biomedef;
-
        // Scripting
        // Envlock and conlock should be locked when using Lua
        lua_State *m_lua;
@@ -790,6 +848,11 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        */
        // key = name
        std::map<std::string, Inventory*> m_detached_inventories;
+
+       /*
+               Particles
+       */
+       std::vector<u32> m_particlespawner_ids;
 };
 
 /*