summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-01-25 21:19:29 +0100
committersfan5 <sfan5@live.de>2020-02-01 20:31:41 +0100
commitace3c76112a839aaad34f4343cd924412310bbd3 (patch)
tree6efeeb3537314a3cf8594f1a8f80eb28523ccad9 /src/server.h
parentea5e231959365622607c8bfd953f6d96ec54a394 (diff)
downloadminetest-ace3c76112a839aaad34f4343cd924412310bbd3.tar.gz
minetest-ace3c76112a839aaad34f4343cd924412310bbd3.tar.bz2
minetest-ace3c76112a839aaad34f4343cd924412310bbd3.zip
Improve core.sound_play with ephemeral sounds and player exclusion
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server.h b/src/server.h
index d61840871..28d9c8fa1 100644
--- a/src/server.h
+++ b/src/server.h
@@ -98,6 +98,7 @@ struct ServerSoundParams
v3f pos;
u16 object = 0;
std::string to_player = "";
+ std::string exclude_player = "";
v3f getPos(ServerEnvironment *env, bool *pos_exists) const;
};
@@ -209,7 +210,8 @@ public:
// Returns -1 if failed, sound handle on success
// Envlock
- s32 playSound(const SimpleSoundSpec &spec, const ServerSoundParams &params);
+ s32 playSound(const SimpleSoundSpec &spec, const ServerSoundParams &params,
+ bool ephemeral=false);
void stopSound(s32 handle);
void fadeSound(s32 handle, float step, float gain);
@@ -646,7 +648,8 @@ private:
Sounds
*/
std::unordered_map<s32, ServerPlayingSound> m_playing_sounds;
- s32 m_next_sound_id = 0;
+ s32 m_next_sound_id = 0; // positive values only
+ s32 nextSoundId();
/*
Detached inventories (behind m_env_mutex)