diff options
author | Jeija <norrepli@gmail.com> | 2013-01-23 18:32:02 +0100 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-03-23 23:16:29 +0100 |
commit | e1ff5b13619666e5b987ecf4faaf294400ffd979 (patch) | |
tree | 13885f396367c79625a72a4445fe6e81819d92c5 /src/server.h | |
parent | ab57fdac44bae20e43500b3edd39bac9a0f563c5 (diff) | |
download | minetest-e1ff5b13619666e5b987ecf4faaf294400ffd979.tar.gz minetest-e1ff5b13619666e5b987ecf4faaf294400ffd979.tar.bz2 minetest-e1ff5b13619666e5b987ecf4faaf294400ffd979.zip |
Allow spawning particles from the server, from lua
Spawn single particles or make use of ParticleSpawner for many randomly spawned particles.
Accessible in Lua using minetest.spawn_particle and minetest.add_particlespawner.
Increase Protocol Version to 17.
Conflicts:
src/clientserver.h
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h index 63717eaec..813dc9828 100644 --- a/src/server.h +++ b/src/server.h @@ -456,6 +456,35 @@ public: // 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); @@ -574,6 +603,41 @@ private: 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 */ @@ -790,6 +854,11 @@ private: */ // key = name std::map<std::string, Inventory*> m_detached_inventories; + + /* + Particles + */ + std::vector<u32> m_particlespawner_ids; }; /* |