From f1616b1196f95c2768de35b0aa80101b57429d59 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 8 Oct 2009 14:36:57 -0700 Subject: Don't show lldialog boxes from muted avatars anymore --- ChangeLog.txt | 5 +++++ linden/indra/newview/llviewermessage.cpp | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 07701d5..d7122fd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,10 @@ 2009-10-08 McCabe Maxsted + * Don't show lldialog boxes from muted avatars anymore. + + modified: linden/indra/newview/llviewermessage.cpp + + * Fixed money change notification happening after logout/login. modified: linden/indra/newview/llviewermessage.cpp diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 88f6b36..f460996 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -5470,6 +5470,21 @@ void process_script_dialog(LLMessageSystem* msg, void**) msg->getString("Data", "Message", message); msg->getS32("Data", "ChatChannel", info->mChatChannel); + // Don't show lldialog boxes from muted avs -- McCabe + if (!first_name.empty()) + { + std::string agent_name = first_name + " " + last_name; + std::vector mutes = LLMuteList::getInstance()->getMutes(); + for (U32 i = 0; i < mutes.size(); i++) + { + if (mutes[i].mName == agent_name) + { + delete info; + return; + } + } + } + // unused for now LLUUID image_id; msg->getUUID("Data", "ImageID", image_id); -- cgit v1.1 From e34c28e09fc9db32f2e42c4070e60ee19a424994 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 8 Oct 2009 22:43:51 -0700 Subject: Applied lldialog spam throttle from Emerald viewer --- ChangeLog.txt | 6 ++++ linden/indra/newview/app_settings/settings.xml | 22 ++++++++++++ linden/indra/newview/llviewermessage.cpp | 47 +++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d7122fd..4298a71 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,11 @@ 2009-10-08 McCabe Maxsted + * Applied lldialog spam throttle from Emerald viewer. + + modified: linden/indra/newview/app_settings/settings.xml + modified: linden/indra/newview/llviewermessage.cpp + + * Don't show lldialog boxes from muted avatars anymore. modified: linden/indra/newview/llviewermessage.cpp diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index f167840..f148b80 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -8003,6 +8003,28 @@ Value 0 + SpamCount + + Comment + Number of items spammed per time set in SpamTime. RECOMMENDED IS 4.000 + Persist + 1 + Type + F32 + Value + 4.0 + + SpamTime + + Comment + Time of Evalulating spam. RECOMMENDED NUMBER IS 1.000 + Persist + 1 + Type + F32 + Value + 1.0 + SpeakingColor Comment diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index f460996..d784f52 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -146,6 +146,12 @@ extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp // [/RLVa:KB] +//silly spam define D: +bool dialogSpamOn; +static LLFrameTimer d_spam; +std::map< std::string , S32 > lastd_names; +LLDynamicArray< std::string > blacklisted_names; + // // Constants // @@ -5471,9 +5477,9 @@ void process_script_dialog(LLMessageSystem* msg, void**) msg->getS32("Data", "ChatChannel", info->mChatChannel); // Don't show lldialog boxes from muted avs -- McCabe + std::string agent_name = first_name + " " + last_name; if (!first_name.empty()) { - std::string agent_name = first_name + " " + last_name; std::vector mutes = LLMuteList::getInstance()->getMutes(); for (U32 i = 0; i < mutes.size(); i++) { @@ -5507,6 +5513,45 @@ void process_script_dialog(LLMessageSystem* msg, void**) args["[MESSAGE]"] = message; if (!first_name.empty()) { + // Dialog Spam Prevention by Cryogenic + if(dialogSpamOn) + { + if(!d_spam.getStarted()) + { + d_spam.start(); + } + if(blacklisted_names.find(agent_name) != -1) + { + return; + } + std::map< std::string , S32 >::iterator itr = lastd_names.find(agent_name); + if(itr != lastd_names.end()) + { + if(d_spam.getElapsedTimeF32() <= gSavedSettings.getF32("SpamTime")) + { + if((*itr).second > gSavedSettings.getF32("SpamCount")) + { + blacklisted_names.put(agent_name); + LL_INFOS("process_script_dialog") << "blocked " << info->mObjectID.asString() << " owned by " << agent_name << LL_ENDL;//" (" << key.asString() << ")" < + + * Added missing RLVa header file: rlvdefines.h. + + new file: linden/indra/newview/rlvdefines.h + + 2009-10-08 McCabe Maxsted * Applied lldialog spam throttle from Emerald viewer. diff --git a/linden/indra/newview/rlvdefines.h b/linden/indra/newview/rlvdefines.h new file mode 100644 index 0000000..4e6a4d4 --- /dev/null +++ b/linden/indra/newview/rlvdefines.h @@ -0,0 +1,201 @@ +#ifndef RLV_DEFINES_H +#define RLV_DEFINES_H + +// ============================================================================ +// Extensions +// + +// Comment out if you don't want the Advanced / RLVa menu (may prevent enabling some extensions or experimental features - see below) +#define RLV_ADVANCED_MENU +// Comment out if you provide your own way to enable/disable RLVa +#define RLV_ADVANCED_TOGGLE_RLVA + +// Provides access to "advanced" feature through the RLVa debug menu +#define RLV_EXTENSION_ENABLE_WEAR // "Enable Wear" +#define RLV_EXTENSION_FLOATER_RESTRICTIONS // Enables the Advanced / RLVa / Restrictions... floater +#define RLV_EXTENSION_HIDELOCKED // "Hide locked layers", "Hide locked attachments" and "Hide locked inventory" + +// Extensions +#define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx +#define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders: