diff options
author | Jacek Antonelli | 2009-10-09 10:32:27 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-10-09 10:32:27 -0500 |
commit | 9ff7664f124689843a36b60f04dcc81206b89d8c (patch) | |
tree | 48eb2ca38710518a36f1038e876ec60dc2649f24 /linden/indra | |
parent | Merge remote branch 'mccabe/next' into next (diff) | |
parent | Added missing RLVa header file: rlvdefines.h (diff) | |
download | meta-impy-9ff7664f124689843a36b60f04dcc81206b89d8c.zip meta-impy-9ff7664f124689843a36b60f04dcc81206b89d8c.tar.gz meta-impy-9ff7664f124689843a36b60f04dcc81206b89d8c.tar.bz2 meta-impy-9ff7664f124689843a36b60f04dcc81206b89d8c.tar.xz |
Merge remote branch 'mccabe/next' into next
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 22 | ||||
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 60 | ||||
-rw-r--r-- | linden/indra/newview/rlvdefines.h | 201 |
3 files changed, 283 insertions, 0 deletions
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 @@ | |||
8003 | <key>Value</key> | 8003 | <key>Value</key> |
8004 | <integer>0</integer> | 8004 | <integer>0</integer> |
8005 | </map> | 8005 | </map> |
8006 | <key>SpamCount</key> | ||
8007 | <map> | ||
8008 | <key>Comment</key> | ||
8009 | <string>Number of items spammed per time set in SpamTime. RECOMMENDED IS 4.000</string> | ||
8010 | <key>Persist</key> | ||
8011 | <integer>1</integer> | ||
8012 | <key>Type</key> | ||
8013 | <string>F32</string> | ||
8014 | <key>Value</key> | ||
8015 | <real>4.0</real> | ||
8016 | </map> | ||
8017 | <key>SpamTime</key> | ||
8018 | <map> | ||
8019 | <key>Comment</key> | ||
8020 | <string>Time of Evalulating spam. RECOMMENDED NUMBER IS 1.000</string> | ||
8021 | <key>Persist</key> | ||
8022 | <integer>1</integer> | ||
8023 | <key>Type</key> | ||
8024 | <string>F32</string> | ||
8025 | <key>Value</key> | ||
8026 | <real>1.0</real> | ||
8027 | </map> | ||
8006 | <key>SpeakingColor</key> | 8028 | <key>SpeakingColor</key> |
8007 | <map> | 8029 | <map> |
8008 | <key>Comment</key> | 8030 | <key>Comment</key> |
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, |
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 @@ | |||
1 | #ifndef RLV_DEFINES_H | ||
2 | #define RLV_DEFINES_H | ||
3 | |||
4 | // ============================================================================ | ||
5 | // Extensions | ||
6 | // | ||
7 | |||
8 | // Comment out if you don't want the Advanced / RLVa menu (may prevent enabling some extensions or experimental features - see below) | ||
9 | #define RLV_ADVANCED_MENU | ||
10 | // Comment out if you provide your own way to enable/disable RLVa | ||
11 | #define RLV_ADVANCED_TOGGLE_RLVA | ||
12 | |||
13 | // Provides access to "advanced" feature through the RLVa debug menu | ||
14 | #define RLV_EXTENSION_ENABLE_WEAR // "Enable Wear" | ||
15 | #define RLV_EXTENSION_FLOATER_RESTRICTIONS // Enables the Advanced / RLVa / Restrictions... floater | ||
16 | #define RLV_EXTENSION_HIDELOCKED // "Hide locked layers", "Hide locked attachments" and "Hide locked inventory" | ||
17 | |||
18 | // Extensions | ||
19 | #define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx | ||
20 | #define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders:<option>=<channel> - @findfolder with multiple results | ||
21 | #define RLV_EXTENSION_FLAG_NOSTRIP // Layers and attachments marked as "nostrip" are exempt from @detach/@remoutfit | ||
22 | #define RLV_EXTENSION_STARTLOCATION // Reenables "Start Location" at login if not @tploc=n or @unsit=n restricted at last logoff | ||
23 | #define RLV_EXPERIMENTAL // Enables/disables experimental features en masse | ||
24 | |||
25 | // Experimental features | ||
26 | #ifdef RLV_EXPERIMENTAL | ||
27 | // Stable (will mature to RLV_EXTENSION_XXX in next release if no bugs are found) | ||
28 | #define RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK // Enables "cleaner" UI responses when fartouch blocks something | ||
29 | |||
30 | // Under testing (stable, but requires further testing - safe for public release but may be quirky) | ||
31 | #define RLV_EXPERIMENTAL_FIRSTUSE // Enables a number of "first use" popups | ||
32 | |||
33 | // Under development (don't include in public release) | ||
34 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
35 | #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
36 | #endif // RLV_EXPERIMENTAL | ||
37 | |||
38 | // ============================================================================ | ||
39 | // Defines | ||
40 | // | ||
41 | |||
42 | // Version of the specifcation we support | ||
43 | const S32 RLV_VERSION_MAJOR = 1; | ||
44 | const S32 RLV_VERSION_MINOR = 20; | ||
45 | const S32 RLV_VERSION_PATCH = 2; | ||
46 | |||
47 | // Implementation version | ||
48 | const S32 RLVa_VERSION_MAJOR = 1; | ||
49 | const S32 RLVa_VERSION_MINOR = 0; | ||
50 | const S32 RLVa_VERSION_PATCH = 3; | ||
51 | const S32 RLVa_VERSION_BUILD = 4; | ||
52 | |||
53 | // The official viewer version we're patching against | ||
54 | #define RLV_MAKE_TARGET(x, y, z) ((x << 16) | (y << 8) | z) | ||
55 | #define RLV_TARGET RLV_MAKE_TARGET(1, 22, 11) | ||
56 | |||
57 | // Defining these makes it easier if we ever need to change our tag | ||
58 | #define RLV_WARNS LL_WARNS("RLV") | ||
59 | #define RLV_INFOS LL_INFOS("RLV") | ||
60 | #define RLV_DEBUGS LL_DEBUGS("RLV") | ||
61 | |||
62 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
63 | // Turn on extended debugging information | ||
64 | #define RLV_DEBUG | ||
65 | // Make sure we halt execution on errors | ||
66 | #define RLV_ERRS LL_ERRS("RLV") | ||
67 | // Uncomment to enable the Advanced / RLVa / Unit Tests menu (non-public) | ||
68 | //#define RLV_DEBUG_TESTS | ||
69 | #else | ||
70 | // Uncomment if you want extended debugging information on release builds | ||
71 | //#define RLV_DEBUG | ||
72 | // Don't halt execution on errors in release | ||
73 | #define RLV_ERRS LL_WARNS("RLV") | ||
74 | #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
75 | |||
76 | #define RLV_ROOT_FOLDER "#RLV" | ||
77 | #define RLV_CMD_PREFIX '@' | ||
78 | #define RLV_PUTINV_PREFIX "#RLV/~" | ||
79 | #define RLV_SETROT_OFFSET F_PI_BY_TWO // @setrot is off by 90° with the rest of SL | ||
80 | |||
81 | #define RLV_FOLDER_FLAG_NOSTRIP "nostrip" | ||
82 | #define RLV_FOLDER_PREFIX_HIDDEN '.' | ||
83 | #define RLV_FOLDER_PREFIX_PUTINV '~' | ||
84 | |||
85 | // ============================================================================ | ||
86 | // Enumeration declarations | ||
87 | // | ||
88 | |||
89 | // NOTE: any changes to this enumeration should be reflected in initLookupTable() | ||
90 | enum ERlvBehaviour { | ||
91 | RLV_BHVR_VERSION = 0, // "version" | ||
92 | RLV_BHVR_DETACH, // "detach" | ||
93 | RLV_BHVR_SENDCHAT, // "sendchat" | ||
94 | RLV_BHVR_EMOTE, // "emote" | ||
95 | RLV_BHVR_CHATSHOUT, // "chatshout" | ||
96 | RLV_BHVR_CHATNORMAL, // "chatnormal" | ||
97 | RLV_BHVR_CHATWHISPER, // "chatwhisper" | ||
98 | RLV_BHVR_REDIRCHAT, // "redirchat" | ||
99 | RLV_BHVR_REDIREMOTE, // "rediremote" | ||
100 | RLV_BHVR_SENDIM, // "sendim" | ||
101 | RLV_BHVR_RECVCHAT, // "recvchat" | ||
102 | RLV_BHVR_RECVEMOTE, // "recvemote" | ||
103 | RLV_BHVR_RECVIM, // "recvim" | ||
104 | RLV_BHVR_TPLM, // "tplm" | ||
105 | RLV_BHVR_TPLOC, // "tploc" | ||
106 | RLV_BHVR_TPLURE, // "tplure" | ||
107 | RLV_BHVR_SITTP, // "sittp" | ||
108 | RLV_BHVR_EDIT, // "edit" | ||
109 | RLV_BHVR_REZ, // "rez" | ||
110 | RLV_BHVR_ADDOUTFIT, // "addoutfit" | ||
111 | RLV_BHVR_REMOUTFIT, // "remoutfit" | ||
112 | RLV_BHVR_GETOUTFIT, // "getoutfit" | ||
113 | RLV_BHVR_GETATTACH, // "getattach" | ||
114 | RLV_BHVR_SHOWINV, // "showinv" | ||
115 | RLV_BHVR_VIEWNOTE, // "viewnote" | ||
116 | RLV_BHVR_UNSIT, // "unsit" | ||
117 | RLV_BHVR_SIT, // "sit" | ||
118 | RLV_BHVR_SENDCHANNEL, // "sendchannel" | ||
119 | RLV_BHVR_GETSTATUS, // "getstatus" | ||
120 | RLV_BHVR_GETSTATUSALL, // "getstatusall" | ||
121 | RLV_BHVR_GETINV, // "getinv" | ||
122 | RLV_BHVR_GETINVWORN, // "getinvworn" | ||
123 | RLV_BHVR_FINDFOLDER, // "findfolder" | ||
124 | RLV_BHVR_FINDFOLDERS, // "findfolders" | ||
125 | RLV_BHVR_ATTACH, // "attach" | ||
126 | RLV_BHVR_ATTACHALL, // "attachall" | ||
127 | RLV_BHVR_DETACHALL, // "detachall" | ||
128 | RLV_BHVR_GETPATH, // "getpath" | ||
129 | RLV_BHVR_ATTACHTHIS, // "attachthis" | ||
130 | RLV_BHVR_ATTACHALLTHIS, // "attachallthis" | ||
131 | RLV_BHVR_DETACHTHIS, // "detachthis" | ||
132 | RLV_BHVR_DETACHALLTHIS, // "detachallthis" | ||
133 | RLV_BHVR_FARTOUCH, // "fartouch" | ||
134 | RLV_BHVR_SHOWWORLDMAP, // "showworldmap" | ||
135 | RLV_BHVR_SHOWMINIMAP, // "showminimap" | ||
136 | RLV_BHVR_SHOWLOC, // "showloc" | ||
137 | RLV_BHVR_TPTO, // "tpto" | ||
138 | RLV_BHVR_ACCEPTTP, // "accepttp" | ||
139 | RLV_BHVR_SHOWNAMES, // "shownames" | ||
140 | RLV_BHVR_FLY, // "fly" | ||
141 | RLV_BHVR_GETSITID, // "getsitid" | ||
142 | RLV_BHVR_SETDEBUG, // "setdebug" | ||
143 | RLV_BHVR_SETENV, // "setenv" | ||
144 | RLV_BHVR_DETACHME, // "detachme" | ||
145 | RLV_BHVR_SHOWHOVERTEXTALL, // "showhovertextall" | ||
146 | RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld" | ||
147 | RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud" | ||
148 | RLV_BHVR_SHOWHOVERTEXT, // "showhovertext" | ||
149 | RLV_BHVR_NOTIFY, // "notify" | ||
150 | |||
151 | RLV_BHVR_COUNT, | ||
152 | RLV_BHVR_UNKNOWN | ||
153 | }; | ||
154 | |||
155 | enum ERlvParamType { | ||
156 | RLV_TYPE_UNKNOWN, | ||
157 | RLV_TYPE_ADD, // <param> == "n"|"add" | ||
158 | RLV_TYPE_REMOVE, // <param> == "y"|"rem" | ||
159 | RLV_TYPE_FORCE, // <param> == "force" | ||
160 | RLV_TYPE_REPLY, // <param> == <number> | ||
161 | RLV_TYPE_CLEAR | ||
162 | }; | ||
163 | |||
164 | enum ERlvCmdRet { | ||
165 | RLV_RET_NOERROR, // Command executed succesfully | ||
166 | RLV_RET_RETAINED, // Command was retained | ||
167 | RLV_RET_DISABLED, // Command is disabled (by user) | ||
168 | RLV_RET_FAILED, // Command failed (general failure) | ||
169 | RLV_RET_FAILED_SYNTAX, // Command failed (syntax error) | ||
170 | RLV_RET_FAILED_UNSET, // Command failed (unset restriction) | ||
171 | RLV_RET_FAILED_DUPLICATE, // Command failed (duplicate) | ||
172 | RLV_RET_FAILED_OPTION, // Command failed (invalid option) | ||
173 | RLV_RET_FAILED_PARAM, // Command failed (invalid param) | ||
174 | RLV_RET_UNKNOWN // Command unkown | ||
175 | }; | ||
176 | |||
177 | // ============================================================================ | ||
178 | // Settings | ||
179 | |||
180 | #define RLV_SETTING_MAIN "RestrainedLife" | ||
181 | #define RLV_SETTING_DEBUG "RestrainedLifeDebug" | ||
182 | #define RLV_SETTING_NOSETENV "RestrainedLifeNoSetEnv" | ||
183 | #define RLV_SETTING_FORBIDGIVETORLV "RestrainedLifeForbidGiveToRLV" | ||
184 | |||
185 | #define RLV_SETTING_ENABLEWEAR "RLVaEnableWear" | ||
186 | #define RLV_SETTING_ENABLELEGACYNAMING "RLVaEnableLegacyNaming" | ||
187 | #define RLV_SETTING_HIDELOCKEDLAYER "RLVaHideLockedLayers" | ||
188 | #define RLV_SETTING_HIDELOCKEDATTACH "RLVaHideLockedAttachments" | ||
189 | #define RLV_SETTING_HIDELOCKEDINVENTORY "RLVaHideLockedInventory" | ||
190 | #define RLV_SETTING_LOGINLASTLOCATION "RLVaLoginLastLocation" | ||
191 | #define RLV_SETTING_SHOWNAMETAGS "RLVaShowNameTags" | ||
192 | |||
193 | #define RLV_SETTING_FIRSTUSE_PREFIX "FirstRLV" | ||
194 | #define RLV_SETTING_FIRSTUSE_DETACH RLV_SETTING_FIRSTUSE_PREFIX"Detach" | ||
195 | #define RLV_SETTING_FIRSTUSE_ENABLEWEAR RLV_SETTING_FIRSTUSE_PREFIX"EnableWear" | ||
196 | #define RLV_SETTING_FIRSTUSE_FARTOUCH RLV_SETTING_FIRSTUSE_PREFIX"Fartouch" | ||
197 | #define RLV_SETTING_FIRSTUSE_GIVETORLV RLV_SETTING_FIRSTUSE_PREFIX"GiveToRLV" | ||
198 | |||
199 | // ============================================================================ | ||
200 | |||
201 | #endif // RLV_DEFINES_H | ||