QtCraft API C++ classes QML types Handbook

QcServerSounds Class

Sends sound events to the clients that can hear them. More...

Header: #include <server/core/QcServerSounds.h>

Public Functions

void play(const QString &key, const QcVec3 &position, float volume = 1.0f, float pitch = 1.0f)
void playBlock(const QcBlockDefinition &definition, QcBlockSoundAction action, QcBlockPos pos)

Detailed Description

Member Function Documentation

void QcServerSounds::play(const QString &key, const QcVec3 &position, float volume = 1.0f, float pitch = 1.0f)

Sends the sound key at position with volume and pitch to every playing client within the sound's range (its definition's range, longer for louder events). Unknown sounds are not sent, nor any sound during a sprint: it skips game time, its sounds would only be a burst of noise (decision E-249).

void QcServerSounds::playBlock(const QcBlockDefinition &definition, QcBlockSoundAction action, QcBlockPos pos)

Plays the sound of action of the block definition at the middle of pos.