Merge branch 'DRTVWR-521-maint' of https://bitbucket.org/lindenlab/viewer
commit
4ee83d4263
|
|
@ -285,11 +285,6 @@ const LLUUID SND_STONE_DIRT_04 ("c8091652-e04b-4a11-84ba-15dba06e7a1b");
|
|||
const LLUUID SND_STONE_STONE_02 ("ba4ef5ac-7435-4240-b826-c24ba8fa5a78");
|
||||
const LLUUID SND_STONE_STONE_04 ("ea296329-0f09-4993-af1b-e6784bab1dc9");
|
||||
|
||||
// NaCl - Antispam Registry. The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official sounds.
|
||||
const std::string COLLISION_SOUNDS[] ={"dce5fdd4-afe4-4ea1-822f-dd52cac46b08","51011582-fbca-4580-ae9e-1a5593f094ec","68d62208-e257-4d0c-bbe2-20c9ea9760bb","75872e8c-bc39-451b-9b0b-042d7ba36cba","6a45ba0b-5775-4ea8-8513-26008a17f873","992a6d1b-8c77-40e0-9495-4098ce539694","2de4da5a-faf8-46be-bac6-c4d74f1e5767","6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d","14209133-4961-4acc-9649-53fc38ee1667","bc4a4348-cfcc-4e5e-908e-8a52a8915fe6","9e5c1297-6eed-40c0-825a-d9bcd86e3193","e534761c-1894-4b61-b20c-658a6fb68157","8761f73f-6cf9-4186-8aaa-0948ed002db1","874a26fd-142f-4173-8c5b-890cd846c74d","0e24a717-b97e-4b77-9c94-b59a5a88b2da","75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2","153c8bf7-fb89-4d89-b263-47e58b1b4774","55c3e0ce-275a-46fa-82ff-e0465f5e8703","24babf58-7156-4841-9a3f-761bdbb8e237","aca261d8-e145-4610-9e20-9eff990f2c12","0642fba6-5dcf-4d62-8e7b-94dbb529d117","25a863e8-dc42-4e8a-a357-e76422ace9b5","9538f37c-456e-4047-81be-6435045608d4","8c0f84c3-9afd-4396-b5f5-9bca2c911c20","be582e5d-b123-41a2-a150-454c39e961c8","c70141d4-ba06-41ea-bcbc-35ea81cb8335","7d1826f4-24c4-4aac-8c2e-eff45df37783","063c97d3-033a-4e9b-98d8-05c8074922cb","00000000-0000-0000-0000-000000000120"};
|
||||
const int COLLISION_SOUNDS_SIZE=29;
|
||||
// NaCl End
|
||||
|
||||
|
||||
|
||||
// extra guids
|
||||
|
|
|
|||
|
|
@ -286,9 +286,4 @@ extern const LLUUID SND_STONE_DIRT_04;
|
|||
extern const LLUUID SND_STONE_STONE_02;
|
||||
extern const LLUUID SND_STONE_STONE_04;
|
||||
|
||||
// NaCl - Antispam Registry
|
||||
extern const std::string COLLISION_SOUNDS[];
|
||||
extern const int COLLISION_SOUNDS_SIZE;
|
||||
// NaCl End
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -559,6 +559,23 @@ LLUUID LLMaterialTable::getCollisionSoundUUID(U8 mcode, U8 mcode2)
|
|||
}
|
||||
}
|
||||
|
||||
bool LLMaterialTable::isCollisionSound(const LLUUID &uuid)
|
||||
{
|
||||
for (U8 i = 0; i < LL_MCODE_END; i++)
|
||||
{
|
||||
for (U8 j = 0; j < LL_MCODE_END; j++)
|
||||
{
|
||||
i &= LL_MCODE_MASK;
|
||||
j &= LL_MCODE_MASK;
|
||||
if (mCollisionSoundMatrix[i * LL_MCODE_END + j] == uuid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
LLUUID LLMaterialTable::getSlidingSoundUUID(U8 mcode, U8 mcode2)
|
||||
{
|
||||
mcode &= LL_MCODE_MASK;
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@ public:
|
|||
F32 getDamageMod(U8 mcode);
|
||||
F32 getEPMod(U8 mcode);
|
||||
|
||||
bool isCollisionSound(const LLUUID &uuid);
|
||||
|
||||
LLUUID getCollisionSoundUUID(U8 mcode, U8 mcode2);
|
||||
LLUUID getSlidingSoundUUID(U8 mcode, U8 mcode2);
|
||||
LLUUID getRollingSoundUUID(U8 mcode, U8 mcode2);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "llviewerobjectlist.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llworld.h"
|
||||
#include "sound_ids.h"
|
||||
#include <time.h>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
|
|
@ -207,11 +206,6 @@ NACLAntiSpamRegistry::NACLAntiSpamRegistry() :
|
|||
{
|
||||
mQueues[queue] = new NACLAntiSpamQueue(mGlobalTime, mGlobalAmount);
|
||||
}
|
||||
|
||||
for (S32 i = 0; i < COLLISION_SOUNDS_SIZE; ++i)
|
||||
{
|
||||
mCollisionSounds.insert(LLUUID(COLLISION_SOUNDS[i]));
|
||||
}
|
||||
}
|
||||
|
||||
NACLAntiSpamRegistry::~NACLAntiSpamRegistry()
|
||||
|
|
@ -640,11 +634,6 @@ void NACLAntiSpamRegistry::purgeGlobalEntries()
|
|||
mGlobalEntries.clear();
|
||||
}
|
||||
|
||||
bool NACLAntiSpamRegistry::isCollisionSound(const LLUUID& sound_id)
|
||||
{
|
||||
return (mCollisionSounds.find(sound_id) != mCollisionSounds.end());
|
||||
}
|
||||
|
||||
void NACLAntiSpamRegistry::processObjectPropertiesFamily(LLMessageSystem* msg)
|
||||
{
|
||||
static LLCachedControl<bool> useAntiSpam(gSavedSettings, "UseAntiSpam");
|
||||
|
|
|
|||
|
|
@ -113,8 +113,6 @@ public:
|
|||
void clearAllQueues();
|
||||
void purgeAllQueues();
|
||||
|
||||
bool isCollisionSound(const LLUUID& sound_id);
|
||||
|
||||
void processObjectPropertiesFamily(LLMessageSystem* msg);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -5867,6 +5867,17 @@
|
|||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>EnableCollisionSounds</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Play sounds on collision</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>EnableMouselook</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -22475,17 +22486,6 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSPlayCollisionSounds</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Play collision sounds.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>FSFadeAudioStream</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "llfollowcamparams.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "lllslconstants.h"
|
||||
#include "llmaterialtable.h"
|
||||
#include "llregionhandle.h"
|
||||
#include "llsd.h"
|
||||
#include "llsdserialize.h"
|
||||
|
|
@ -4822,11 +4823,11 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
|
|||
// </FS>
|
||||
|
||||
// NaCl - Antispam Registry
|
||||
static LLCachedControl<U32> _NACL_AntiSpamSoundMulti(gSavedSettings, "_NACL_AntiSpamSoundMulti");
|
||||
static LLCachedControl<bool> FSPlayCollisionSounds(gSavedSettings, "FSPlayCollisionSounds");
|
||||
if (NACLAntiSpamRegistry::instance().isCollisionSound(sound_id))
|
||||
static LLCachedControl<U32> _NACL_AntiSpamSoundMulti(gSavedSettings, "_NACL_AntiSpamSoundMulti");
|
||||
static LLCachedControl<bool> EnableCollisionSounds(gSavedSettings, "EnableCollisionSounds");
|
||||
if (LLMaterialTable::basic.isCollisionSound(sound_id))
|
||||
{
|
||||
if (!FSPlayCollisionSounds)
|
||||
if (!EnableCollisionSounds)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -4875,28 +4876,32 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// AO: Hack for legacy radar script interface compatibility. Interpret certain
|
||||
|
||||
// <FS:AO> Hack for legacy radar script interface compatibility. Interpret certain
|
||||
// sound assets as a request for a full radar update to a channel
|
||||
if ((owner_id == gAgent.getID()) && (sound_id.asString() == gSavedSettings.getString("RadarLegacyChannelAlertRefreshUUID")))
|
||||
if ((owner_id == gAgentID) && (sound_id.asString() == gSavedSettings.getString("RadarLegacyChannelAlertRefreshUUID")))
|
||||
{
|
||||
FSRadar* radar = FSRadar::getInstance();
|
||||
if (radar)
|
||||
{
|
||||
radar->requestRadarChannelAlertSync();
|
||||
}
|
||||
FSRadar::getInstance()->requestRadarChannelAlertSync();
|
||||
return;
|
||||
}
|
||||
|
||||
// </FS:AO>
|
||||
|
||||
// Don't play sounds from gestures if they are not enabled.
|
||||
// ...TS: Unless they're your own.
|
||||
if ((!gSavedSettings.getBOOL("EnableGestureSounds")) &&
|
||||
(owner_id != gAgent.getID()) &&
|
||||
(owner_id == object_id)) return;
|
||||
|
||||
// NaCl - Sound Explorer
|
||||
// NaCl - Antispam Registry
|
||||
//if (LLMaterialTable::basic.isCollisionSound(sound_id) && !gSavedSettings.getBOOL("EnableCollisionSounds"))
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
// NaCl End
|
||||
|
||||
// NaCl - Sound Explorer
|
||||
gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global, object_id);
|
||||
// NaCl End
|
||||
// NaCl End
|
||||
}
|
||||
|
||||
void process_preload_sound(LLMessageSystem *msg, void **user_data)
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@
|
|||
width="16" />
|
||||
<check_box
|
||||
name="collisions_audio_play_btn"
|
||||
control_name="FSPlayCollisionSounds"
|
||||
control_name="EnableCollisionSounds"
|
||||
disabled_control="MuteAudio"
|
||||
height="16"
|
||||
layout="topleft"
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
height="16"
|
||||
width="16"
|
||||
layout="topleft"
|
||||
control_name="FSPlayCollisionSounds"
|
||||
control_name="EnableCollisionSounds"
|
||||
disabled_control="MuteAudio"
|
||||
/>
|
||||
<slider
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@
|
|||
width="16" />
|
||||
<check_box
|
||||
name="collisions_audio_play_btn"
|
||||
control_name="FSPlayCollisionSounds"
|
||||
control_name="EnableCollisionSounds"
|
||||
disabled_control="MuteAudio"
|
||||
height="16"
|
||||
layout="topleft"
|
||||
|
|
|
|||
Loading…
Reference in New Issue