Annotation of /trunk/indra/newview/RRInterface.h
Parent Directory
|
Revision Log
Revision 138 - (view) (download)
| 1 : | mjm | 138 | /** |
| 2 : | * @file RRInterface.h | ||
| 3 : | * @author Marine Kelley | ||
| 4 : | * @brief The header for all RLV features | ||
| 5 : | * | ||
| 6 : | * RLV Source Code | ||
| 7 : | * The source code in this file ("Source Code") is provided by Marine Kelley | ||
| 8 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 9 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 10 : | * ("Other License"), formally executed by you and Marine Kelley. Terms of | ||
| 11 : | * the GPL can be found in doc/GPL-license.txt in the distribution of the | ||
| 12 : | * original source of the Second Life Viewer, or online at | ||
| 13 : | * http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 14 : | * | ||
| 15 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 16 : | * that you have read and understood your obligations described above, | ||
| 17 : | * and agree to abide by those obligations. | ||
| 18 : | * | ||
| 19 : | * ALL SOURCE CODE FROM MARINE KELLEY IS PROVIDED "AS IS." MARINE KELLEY | ||
| 20 : | * MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING | ||
| 21 : | * ITS ACCURACY, COMPLETENESS OR PERFORMANCE. | ||
| 22 : | */ | ||
| 23 : | |||
| 24 : | mjm | 135 | #ifndef LL_RRINTERFACE_H |
| 25 : | #define LL_RRINTERFACE_H | ||
| 26 : | |||
| 27 : | #define RR_VIEWER_NAME "RestrainedLife" | ||
| 28 : | mjm | 138 | #define RR_VIEWER_NAME_NEW "RestrainedLove" |
| 29 : | #define RR_VERSION_NUM "1230001" | ||
| 30 : | #define RR_VERSION "1.23a" | ||
| 31 : | #define RR_SLV_VERSION "Cool VL Viewer v1.23.5" | ||
| 32 : | mjm | 135 | |
| 33 : | #define RR_PREFIX "@" | ||
| 34 : | #define RR_SHARED_FOLDER "#RLV" | ||
| 35 : | #define RR_RLV_REDIR_FOLDER_PREFIX "#RLV/~" | ||
| 36 : | // Length of the "#RLV/" string constant in characters. | ||
| 37 : | #define RR_HRLVS_LENGTH 5 | ||
| 38 : | |||
| 39 : | mjm | 137 | // Set to 1 for Tattoo and Alpha wearables support |
| 40 : | #define ALPHA_AND_TATTOO 1 | ||
| 41 : | |||
| 42 : | mjm | 135 | // wearable types as strings |
| 43 : | #define WS_ALL "all" | ||
| 44 : | #define WS_EYES "eyes" | ||
| 45 : | #define WS_SKIN "skin" | ||
| 46 : | #define WS_SHAPE "shape" | ||
| 47 : | #define WS_HAIR "hair" | ||
| 48 : | #define WS_GLOVES "gloves" | ||
| 49 : | #define WS_JACKET "jacket" | ||
| 50 : | #define WS_PANTS "pants" | ||
| 51 : | #define WS_SHIRT "shirt" | ||
| 52 : | #define WS_SHOES "shoes" | ||
| 53 : | #define WS_SKIRT "skirt" | ||
| 54 : | #define WS_SOCKS "socks" | ||
| 55 : | #define WS_UNDERPANTS "underpants" | ||
| 56 : | #define WS_UNDERSHIRT "undershirt" | ||
| 57 : | mjm | 137 | #if ALPHA_AND_TATTOO |
| 58 : | #define WS_ALPHA "alpha" | ||
| 59 : | #define WS_TATTOO "tattoo" | ||
| 60 : | #endif | ||
| 61 : | mjm | 135 | |
| 62 : | //#include <set> | ||
| 63 : | #include <deque> | ||
| 64 : | #include <map> | ||
| 65 : | #include <string> | ||
| 66 : | |||
| 67 : | #include "lluuid.h" | ||
| 68 : | #include "llframetimer.h" | ||
| 69 : | |||
| 70 : | #include "llchat.h" | ||
| 71 : | #include "llchatbar.h" | ||
| 72 : | #include "llinventorymodel.h" | ||
| 73 : | #include "llviewermenu.h" | ||
| 74 : | #include "llwearable.h" | ||
| 75 : | |||
| 76 : | extern BOOL gRRenabled; | ||
| 77 : | |||
| 78 : | typedef std::multimap<std::string, std::string> RRMAP; | ||
| 79 : | typedef struct Command { | ||
| 80 : | LLUUID uuid; | ||
| 81 : | std::string command; | ||
| 82 : | } Command; | ||
| 83 : | |||
| 84 : | typedef struct AssetAndTarget { | ||
| 85 : | LLUUID uuid; | ||
| 86 : | std::string attachpt; | ||
| 87 : | } AssetAndTarget; | ||
| 88 : | |||
| 89 : | class RRInterface | ||
| 90 : | { | ||
| 91 : | public: | ||
| 92 : | |||
| 93 : | RRInterface (); | ||
| 94 : | ~RRInterface (); | ||
| 95 : | |||
| 96 : | mjm | 138 | std::string getVersion (); // returns "RestrainedLife Viewer blah blah" |
| 97 : | std::string getVersion2 (); // returns "RestrainedLove Viewer blah blah" | ||
| 98 : | mjm | 135 | BOOL isAllowed (LLUUID object_uuid, std::string action, BOOL log_it = TRUE); |
| 99 : | BOOL contains (std::string action); // return TRUE if the action is contained | ||
| 100 : | BOOL containsSubstr (std::string action); | ||
| 101 : | BOOL containsWithoutException (std::string action, std::string except = ""); // return TRUE if the action or action+"_sec" is contained, and either there is no global exception, or there is no local exception if we found action+"_sec" | ||
| 102 : | |||
| 103 : | BOOL add (LLUUID object_uuid, std::string action, std::string option); | ||
| 104 : | BOOL remove (LLUUID object_uuid, std::string action, std::string option); | ||
| 105 : | BOOL clear (LLUUID object_uuid, std::string command=""); | ||
| 106 : | void replace (LLUUID what, LLUUID by); | ||
| 107 : | BOOL garbageCollector (BOOL all=TRUE); // if false, don't clear rules attached to NULL_KEY as they are issued from external objects (only cleared when changing parcel) | ||
| 108 : | std::deque<std::string> parse (std::string str, std::string sep); // utility function | ||
| 109 : | void notify (LLUUID object_uuid, std::string action, std::string suffix); // scan the list of restrictions, when finding "notify" say the action on the specified channel | ||
| 110 : | |||
| 111 : | BOOL parseCommand (std::string command, std::string& behaviour, std::string& option, std::string& param); | ||
| 112 : | BOOL handleCommand (LLUUID uuid, std::string command); | ||
| 113 : | BOOL fireCommands (); // execute commands buffered while the viewer was initializing (mostly useful for force-sit as when the command is sent the object is not necessarily rezzed yet) | ||
| 114 : | BOOL force (LLUUID object_uuid, std::string command, std::string option); | ||
| 115 : | |||
| 116 : | BOOL answerOnChat (std::string channel, std::string msg); | ||
| 117 : | std::string crunchEmote (std::string msg, unsigned int truncateTo = 0); | ||
| 118 : | |||
| 119 : | std::string getOutfitLayerAsString (EWearableType layer); | ||
| 120 : | EWearableType getOutfitLayerAsType (std::string layer); | ||
| 121 : | std::string getOutfit (std::string layer); | ||
| 122 : | std::string getAttachments (std::string attachpt); | ||
| 123 : | |||
| 124 : | std::string getStatus (LLUUID object_uuid, std::string rule); // if object_uuid is null, return all | ||
| 125 : | BOOL forceDetach (std::string attachpt); | ||
| 126 : | BOOL forceDetachByUuid (std::string object_uuid); | ||
| 127 : | |||
| 128 : | BOOL hasLockedHuds (); | ||
| 129 : | std::deque<LLInventoryItem*> getListOfLockedItems (LLInventoryCategory* root); | ||
| 130 : | std::string getInventoryList (std::string path, BOOL withWornInfo = FALSE); | ||
| 131 : | std::string getWornItems (LLInventoryCategory* cat); | ||
| 132 : | LLInventoryCategory* getRlvShare (); // return pointer to #RLV folder or null if does not exist | ||
| 133 : | BOOL isUnderRlvShare (LLInventoryItem* item); | ||
| 134 : | void renameAttachment (LLInventoryItem* item, LLViewerJointAttachment* attachment); // DEPRECATED | ||
| 135 : | LLInventoryCategory* getCategoryUnderRlvShare (std::string catName, LLInventoryCategory* root = NULL); | ||
| 136 : | LLInventoryCategory* findCategoryUnderRlvShare (std::string catName, LLInventoryCategory* root = NULL); | ||
| 137 : | std::string findAttachmentNameFromPoint (LLViewerJointAttachment* attachpt); | ||
| 138 : | LLViewerJointAttachment* findAttachmentPointFromName (std::string objectName, BOOL exactName = FALSE); | ||
| 139 : | LLViewerJointAttachment* findAttachmentPointFromParentName (LLInventoryItem* item); | ||
| 140 : | S32 findAttachmentPointNumber (LLViewerJointAttachment* attachment); | ||
| 141 : | void fetchInventory (LLInventoryCategory* root = NULL); | ||
| 142 : | |||
| 143 : | BOOL forceAttach (std::string category, BOOL recursive = FALSE); | ||
| 144 : | BOOL forceDetachByName (std::string category, BOOL recursive = FALSE); | ||
| 145 : | |||
| 146 : | BOOL getAllowCancelTp() { return mAllowCancelTp; } | ||
| 147 : | void setAllowCancelTp(BOOL newval) { mAllowCancelTp = newval; } | ||
| 148 : | |||
| 149 : | std::string getParcelName () { return mParcelName; } | ||
| 150 : | void setParcelName (std::string newval) { mParcelName = newval; } | ||
| 151 : | |||
| 152 : | BOOL forceTeleport (std::string location); | ||
| 153 : | |||
| 154 : | std::string stringReplace (std::string s, std::string what, std::string by, BOOL caseSensitive = FALSE); | ||
| 155 : | |||
| 156 : | std::string getDummyName (std::string name, EChatAudible audible = CHAT_AUDIBLE_FULLY); // return "someone", "unknown" etc according to the length of the name (when shownames is on) | ||
| 157 : | std::string getCensoredMessage (std::string str); // replace names by dummy names | ||
| 158 : | |||
| 159 : | LLUUID getSitTargetId () { return mSitTargetId; } | ||
| 160 : | void setSitTargetId (LLUUID newval) { mSitTargetId = newval; } | ||
| 161 : | |||
| 162 : | BOOL forceEnvironment (std::string command, std::string option); // command is "setenv_<something>", option is a list of floats (separated by "/") | ||
| 163 : | std::string getEnvironment (std::string command); // command is "getenv_<something>" | ||
| 164 : | |||
| 165 : | std::string getLastLoadedPreset () { return mLastLoadedPreset; } | ||
| 166 : | void setLastLoadedPreset (std::string newval) { mLastLoadedPreset = newval; } | ||
| 167 : | |||
| 168 : | BOOL forceDebugSetting (std::string command, std::string option); // command is "setdebug_<something>", option is a list of values (separated by "/") | ||
| 169 : | std::string getDebugSetting (std::string command); // command is "getdebug_<something>" | ||
| 170 : | |||
| 171 : | std::string getFullPath (LLInventoryCategory* cat); | ||
| 172 : | std::string getFullPath (LLInventoryItem* item, std::string option = ""); | ||
| 173 : | LLInventoryItem* getItemAux (LLViewerObject* attached_object, LLInventoryCategory* root); | ||
| 174 : | LLInventoryItem* getItem (LLUUID wornObjectUuidInWorld); | ||
| 175 : | void attachObjectByUUID (LLUUID assetUUID, int attachPtNumber = 0); | ||
| 176 : | |||
| 177 : | bool canDetachAllSelectedObjects(); | ||
| 178 : | bool isSittingOnAnySelectedObject(); | ||
| 179 : | |||
| 180 : | bool canDetach(LLViewerObject* attached_object); | ||
| 181 : | bool canDetach(std::string attachpt); | ||
| 182 : | bool canAttach(LLViewerObject* object_to_attach, std::string attachpt); | ||
| 183 : | |||
| 184 : | // Some cache variables to accelerate common checks | ||
| 185 : | BOOL mHasLockedHuds; | ||
| 186 : | BOOL mContainsDetach; | ||
| 187 : | BOOL mContainsShowinv; | ||
| 188 : | BOOL mContainsUnsit; | ||
| 189 : | BOOL mContainsFartouch; | ||
| 190 : | BOOL mContainsShowworldmap; | ||
| 191 : | BOOL mContainsShowminimap; | ||
| 192 : | BOOL mContainsShowloc; | ||
| 193 : | BOOL mContainsShownames; | ||
| 194 : | BOOL mContainsSetenv; | ||
| 195 : | BOOL mContainsFly; | ||
| 196 : | BOOL mContainsEdit; | ||
| 197 : | BOOL mContainsRez; | ||
| 198 : | BOOL mContainsShowhovertextall; | ||
| 199 : | BOOL mContainsShowhovertexthud; | ||
| 200 : | BOOL mContainsShowhovertextworld; | ||
| 201 : | BOOL mContainsDefaultwear; | ||
| 202 : | BOOL mContainsPermissive; | ||
| 203 : | |||
| 204 : | static BOOL sRRNoSetEnv; | ||
| 205 : | mjm | 138 | static BOOL sRestrainedLoveDebug; |
| 206 : | mjm | 135 | |
| 207 : | // Allowed debug settings (initialized in the ctor) | ||
| 208 : | std::string mAllowedU32; | ||
| 209 : | std::string mAllowedS32; | ||
| 210 : | std::string mAllowedF32; | ||
| 211 : | std::string mAllowedBOOLEAN; | ||
| 212 : | std::string mAllowedSTRING; | ||
| 213 : | std::string mAllowedVEC3; | ||
| 214 : | std::string mAllowedVEC3D; | ||
| 215 : | std::string mAllowedRECT; | ||
| 216 : | std::string mAllowedCOL4; | ||
| 217 : | std::string mAllowedCOL3; | ||
| 218 : | std::string mAllowedCOL4U; | ||
| 219 : | |||
| 220 : | // These should be private but we may want to browse them from the outside world, so let's keep them public | ||
| 221 : | RRMAP mSpecialObjectBehaviours; | ||
| 222 : | std::deque<Command> mRetainedCommands; | ||
| 223 : | |||
| 224 : | // When a locked attachment is kicked off by another one with llAttachToAvatar() in a script, retain its UUID here, to reattach it later | ||
| 225 : | std::deque<AssetAndTarget> mAssetsToReattach; | ||
| 226 : | LLFrameTimer mReattachTimer; // Reset each time a locked attachment is kicked by a "Wear", and on auto-reattachment timeout. | ||
| 227 : | BOOL mReattaching; // TRUE when llappviewer.cpp asked for a reattachment. FALSE when llviewerjointattachment.cpp detected a reattachment. | ||
| 228 : | BOOL mReattachTimeout; // TRUE when llappviewer.cpp detects a reattachment timeout, FALSE when llviewerjointattachment.cpp detected a reattachment. | ||
| 229 : | AssetAndTarget mJustDetached; // we need this to inhibit the removeObject event that occurs right after addObject in the case of a replacement | ||
| 230 : | AssetAndTarget mJustReattached; // we need this to inhibit the removeObject event that occurs right after addObject in the case of a replacement | ||
| 231 : | |||
| 232 : | private: | ||
| 233 : | std::string mParcelName; // for convenience (gAgent does not retain the name of the current parcel) | ||
| 234 : | BOOL mInventoryFetched; // FALSE at first, used to fetch RL Share inventory once upon login | ||
| 235 : | BOOL mAllowCancelTp; // TRUE unless forced to TP with @tpto (=> receive TP order from server, act like it is a lure from a Linden => don't show the cancel button) | ||
| 236 : | LLUUID mSitTargetId; | ||
| 237 : | std::string mLastLoadedPreset; // contains the name of the latest loaded Windlight preset | ||
| 238 : | |||
| 239 : | }; | ||
| 240 : | |||
| 241 : | |||
| 242 : | #endif |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

