diff --git a/indra/llmessage/sound_ids.cpp b/indra/llmessage/sound_ids.cpp index 654efed127..2b8a0807c6 100644 --- a/indra/llmessage/sound_ids.cpp +++ b/indra/llmessage/sound_ids.cpp @@ -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 diff --git a/indra/llmessage/sound_ids.h b/indra/llmessage/sound_ids.h index 74bdc898cd..6a2e343ad3 100644 --- a/indra/llmessage/sound_ids.h +++ b/indra/llmessage/sound_ids.h @@ -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 diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp index 37c718b4c6..58b2d00d44 100644 --- a/indra/llprimitive/llmaterialtable.cpp +++ b/indra/llprimitive/llmaterialtable.cpp @@ -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; diff --git a/indra/llprimitive/llmaterialtable.h b/indra/llprimitive/llmaterialtable.h index a17e0103ff..0cf5e626ef 100644 --- a/indra/llprimitive/llmaterialtable.h +++ b/indra/llprimitive/llmaterialtable.h @@ -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); diff --git a/indra/newview/NACLantispam.cpp b/indra/newview/NACLantispam.cpp index 5fee4d0621..a72bbbffc8 100644 --- a/indra/newview/NACLantispam.cpp +++ b/indra/newview/NACLantispam.cpp @@ -10,7 +10,6 @@ #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llworld.h" -#include "sound_ids.h" #include #include @@ -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 useAntiSpam(gSavedSettings, "UseAntiSpam"); diff --git a/indra/newview/NACLantispam.h b/indra/newview/NACLantispam.h index 870bcf7e8a..d5cf7889a6 100644 --- a/indra/newview/NACLantispam.h +++ b/indra/newview/NACLantispam.h @@ -113,8 +113,6 @@ public: void clearAllQueues(); void purgeAllQueues(); - bool isCollisionSound(const LLUUID& sound_id); - void processObjectPropertiesFamily(LLMessageSystem* msg); private: diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 056ce942f0..d705a2bc36 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5867,6 +5867,17 @@ Value 1 + EnableCollisionSounds + + Comment + Play sounds on collision + Persist + 1 + Type + Boolean + Value + 0 + EnableMouselook Comment @@ -22475,17 +22486,6 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 - FSPlayCollisionSounds - - Comment - Play collision sounds. - Persist - 1 - Type - Boolean - Value - 1 - FSFadeAudioStream Comment diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 270e342ec3..6594118b18 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -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 **) // // NaCl - Antispam Registry - static LLCachedControl _NACL_AntiSpamSoundMulti(gSavedSettings, "_NACL_AntiSpamSoundMulti"); - static LLCachedControl FSPlayCollisionSounds(gSavedSettings, "FSPlayCollisionSounds"); - if (NACLAntiSpamRegistry::instance().isCollisionSound(sound_id)) + static LLCachedControl _NACL_AntiSpamSoundMulti(gSavedSettings, "_NACL_AntiSpamSoundMulti"); + static LLCachedControl 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 + + // 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; } - + // + // 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) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index 23589e936a..6fdf321af3 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -160,7 +160,7 @@ width="16" />