diff options
author | Josh Bell <josh@lindenlab.com> | 2007-11-21 02:10:12 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-11-21 02:10:12 +0000 |
commit | 78aec043f35b8b07dc0f2ba39baba737dd57555e (patch) | |
tree | 1645378aaa34b02ffb6b4f864a4a83828f19c8ab /indra/newview/llviewermessage.cpp | |
parent | 11d85dac83e9d58f8f6e441dcea2d1f2b661c58d (diff) |
svn merge -r 73148:74186 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-5-Viewer --> release
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2fdc040684..2011275bdb 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -132,6 +132,7 @@ #include "llappviewer.h" #include "llfloaterworldmap.h" #include "llviewerdisplay.h" +#include "llkeythrottle.h" #include <boost/tokenizer.hpp> @@ -145,6 +146,12 @@ const F32 BIRD_AUDIBLE_RADIUS = 32.0f; const F32 SIT_DISTANCE_FROM_TARGET = 0.25f; static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting. + +// Determine how quickly residents' scripts can issue question dialogs +// Allow bursts of up to 5 dialogs in 10 seconds. 10*2=20 seconds recovery if throttle kicks in +static const U32 LLREQUEST_PERMISSION_THROTTLE_LIMIT = 5; // requests +static const F32 LLREQUEST_PERMISSION_THROTTLE_INTERVAL = 10.0f; // seconds + extern BOOL gDebugClicks; // function prototypes @@ -4457,6 +4464,27 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // don't display permission requests if this object is muted - JS. if (gMuteListp->isMuted(taskid)) return; + // throttle excessive requests from any specific user's scripts + LLString throttle_owner_name = owner_name; + typedef LLKeyThrottle<LLString> LLStringThrottle; + static LLStringThrottle question_throttle( LLREQUEST_PERMISSION_THROTTLE_LIMIT, LLREQUEST_PERMISSION_THROTTLE_INTERVAL ); + + switch (question_throttle.noteAction(throttle_owner_name)) + { + case LLStringThrottle::THROTTLE_NEWLY_BLOCKED: + llinfos << "process_script_question throttled" + << " owner_name:" << owner_name + << llendl; + // Fall through + + case LLStringThrottle::THROTTLE_BLOCKED: + // Escape altogether until we recover + return; + + case LLStringThrottle::THROTTLE_OK: + break; + } + LLString script_question; if (questions) { |