diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 88f6b36..d784f52 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -146,6 +146,12 @@ | |||
146 | extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp | 146 | extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp |
147 | // [/RLVa:KB] | 147 | // [/RLVa:KB] |
148 | 148 | ||
149 | //silly spam define D: | ||
150 | bool dialogSpamOn; | ||
151 | static LLFrameTimer d_spam; | ||
152 | std::map< std::string , S32 > lastd_names; | ||
153 | LLDynamicArray< std::string > blacklisted_names; | ||
154 | |||
149 | // | 155 | // |
150 | // Constants | 156 | // Constants |
151 | // | 157 | // |
@@ -5470,6 +5476,21 @@ void process_script_dialog(LLMessageSystem* msg, void**) | |||
5470 | msg->getString("Data", "Message", message); | 5476 | msg->getString("Data", "Message", message); |
5471 | msg->getS32("Data", "ChatChannel", info->mChatChannel); | 5477 | msg->getS32("Data", "ChatChannel", info->mChatChannel); |
5472 | 5478 | ||
5479 | // Don't show lldialog boxes from muted avs -- McCabe | ||
5480 | std::string agent_name = first_name + " " + last_name; | ||
5481 | if (!first_name.empty()) | ||
5482 | { | ||
5483 | std::vector<LLMute> mutes = LLMuteList::getInstance()->getMutes(); | ||
5484 | for (U32 i = 0; i < mutes.size(); i++) | ||
5485 | { | ||
5486 | if (mutes[i].mName == agent_name) | ||
5487 | { | ||
5488 | delete info; | ||
5489 | return; | ||
5490 | } | ||
5491 | } | ||
5492 | } | ||
5493 | |||
5473 | // unused for now | 5494 | // unused for now |
5474 | LLUUID image_id; | 5495 | LLUUID image_id; |
5475 | msg->getUUID("Data", "ImageID", image_id); | 5496 | msg->getUUID("Data", "ImageID", image_id); |
@@ -5492,6 +5513,45 @@ void process_script_dialog(LLMessageSystem* msg, void**) | |||
5492 | args["[MESSAGE]"] = message; | 5513 | args["[MESSAGE]"] = message; |
5493 | if (!first_name.empty()) | 5514 | if (!first_name.empty()) |
5494 | { | 5515 | { |
5516 | // Dialog Spam Prevention by Cryogenic | ||
5517 | if(dialogSpamOn) | ||
5518 | { | ||
5519 | if(!d_spam.getStarted()) | ||
5520 | { | ||
5521 | d_spam.start(); | ||
5522 | } | ||
5523 | if(blacklisted_names.find(agent_name) != -1) | ||
5524 | { | ||
5525 | return; | ||
5526 | } | ||
5527 | std::map< std::string , S32 >::iterator itr = lastd_names.find(agent_name); | ||
5528 | if(itr != lastd_names.end()) | ||
5529 | { | ||
5530 | if(d_spam.getElapsedTimeF32() <= gSavedSettings.getF32("SpamTime")) | ||
5531 | { | ||
5532 | if((*itr).second > gSavedSettings.getF32("SpamCount")) | ||
5533 | { | ||
5534 | blacklisted_names.put(agent_name); | ||
5535 | LL_INFOS("process_script_dialog") << "blocked " << info->mObjectID.asString() << " owned by " << agent_name << LL_ENDL;//" (" << key.asString() << ")" <<LL_ENDL; | ||
5536 | return; | ||
5537 | } | ||
5538 | else | ||
5539 | { | ||
5540 | (*itr).second++; | ||
5541 | } | ||
5542 | } | ||
5543 | else | ||
5544 | { | ||
5545 | lastd_names.erase(lastd_names.begin(),lastd_names.end()); | ||
5546 | d_spam.reset(); | ||
5547 | } | ||
5548 | } | ||
5549 | else | ||
5550 | { | ||
5551 | //llinfos << "Added " << fullname << " to list" << llendl; | ||
5552 | lastd_names[agent_name] = 0; | ||
5553 | } | ||
5554 | } | ||
5495 | args["[FIRST]"] = first_name; | 5555 | args["[FIRST]"] = first_name; |
5496 | args["[LAST]"] = last_name; | 5556 | args["[LAST]"] = last_name; |
5497 | LLNotifyBox::showXml("ScriptDialog", args, | 5557 | LLNotifyBox::showXml("ScriptDialog", args, |