mkrlinterface.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /**
  2. * @file mkrlinterface.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. #ifndef LL_MKRLINTERFACE_H
  24. #define LL_MKRLINTERFACE_H
  25. #include <deque>
  26. #include <map>
  27. #include "llframetimer.h"
  28. #include "llstring.h"
  29. #include "lluuid.h"
  30. #include "llwearabletype.h"
  31. #include "llchat.h"
  32. #define RL_VIEWER_NAME "RestrainedLife"
  33. #define RL_VIEWER_NAME_NEW "RestrainedLove"
  34. #define RL_VERSION_NUM "2092929"
  35. #define RL_VERSION "2.09.29.29"
  36. #define RL_PREFIX '@'
  37. #define RL_SHARED_FOLDER "#RLV"
  38. #define RL_RLV_REDIR_FOLDER_PREFIX "#RLV/~"
  39. // Length of the "#RLV/~" string constant in characters.
  40. #define RL_HRLVST_LENGTH 6
  41. // Length of the "#RLV/" string constant in characters.
  42. #define RL_HRLVS_LENGTH 5
  43. #define RL_PROTECTED_FOLDER_TAG "nostrip"
  44. #define RL_NORELAY_FOLDER_TAG "norelay"
  45. // Define to 1 if you wish to allow the user to attach/detach recently
  46. // received items/folders. This breaks restrictions imposed by items given by
  47. // force-transformation scripts, and this "feature" was more or less
  48. // implemented in Marine's RLV to work around failures to attach objects at
  49. // outfit restoration on login, something that does not affect us since the
  50. // Cool VL Viewer automatically queues RLV commands and delays their execution
  51. // until the avatar is fully rezzed.
  52. #define RL_ALLOW_ATTACH_DETACH_RECENTLY_RECEIVED_ITEMS 0
  53. // Wearable types as strings
  54. #define WS_ALL "all"
  55. #define WS_EYES "eyes"
  56. #define WS_SKIN "skin"
  57. #define WS_SHAPE "shape"
  58. #define WS_HAIR "hair"
  59. #define WS_GLOVES "gloves"
  60. #define WS_JACKET "jacket"
  61. #define WS_PANTS "pants"
  62. #define WS_SHIRT "shirt"
  63. #define WS_SHOES "shoes"
  64. #define WS_SKIRT "skirt"
  65. #define WS_SOCKS "socks"
  66. #define WS_UNDERPANTS "underpants"
  67. #define WS_UNDERSHIRT "undershirt"
  68. #define WS_ALPHA "alpha"
  69. #define WS_TATTOO "tattoo"
  70. #define WS_UNIVERSAL "universal"
  71. #define WS_PHYSICS "physics"
  72. #define EXTREMUM 1000000.f
  73. class LLColor3;
  74. class LLInventoryCategory;
  75. class LLInventoryItem;
  76. class LLJoint;
  77. class LLVector3;
  78. class LLViewerFetchedTexture;
  79. class LLViewerInventoryItem;
  80. class LLViewerInventoryCategory;
  81. class LLViewerJointAttachment;
  82. class LLViewerObject;
  83. class LLVOAvatar;
  84. extern bool gRLenabled;
  85. typedef std::multimap<std::string, std::string> rl_map_t;
  86. typedef std::multimap<std::string, std::string>::iterator rl_map_it_t;
  87. class RLInterface
  88. {
  89. protected:
  90. LOG_CLASS(RLInterface);
  91. public:
  92. RLInterface();
  93. ~RLInterface();
  94. // Methods called from llappviewer.cpp:
  95. static void init();
  96. void idleTasks();
  97. void refreshTPflag(bool save); // Called when the viewer is closing.
  98. // Method called from llstartup.cpp
  99. static void usePerAccountSettings();
  100. // If all is false, do not clear rules attached to NULL_KEY as they are
  101. // issued from external objects (only cleared when changing parcel)
  102. // Method used internally but also called by hbfloaterrlv.cpp
  103. bool garbageCollector(bool all = true);
  104. // Called from llviewermessage.cpp:
  105. void queueCommands(const LLUUID& id, const std::string& name,
  106. const std::string& cmd_line);
  107. std::string getVersion(); // returns "RestrainedLife Viewer .../..."
  108. std::string getVersion2(); // returns "RestrainedLove Viewer .../..."
  109. // These methods return true if the action is part of the restrictions
  110. bool contains(std::string action);
  111. bool containsSubstr(std::string action);
  112. // Returns true if the action or action+"_sec" is part of the restrictions
  113. // and either there is no global exception, or there is no local exception
  114. // when the match is action+"_sec".
  115. bool containsWithoutException(std::string action,
  116. const std::string& except = LLStringUtil::null);
  117. // Returns true if cat or one of its parents is locked, or not shared while
  118. // @unshared is active
  119. bool isFolderLocked(LLInventoryCategory* cat);
  120. void replace(const LLUUID& src_id, const LLUUID& by_id);
  121. // Scans the list of restrictions and when finding "notify" tells the
  122. // restriction on the specified channel
  123. void notify(const std::string& action,
  124. const std::string& suffix = LLStringUtil::null);
  125. std::string crunchEmote(const std::string& msg, U32 truncate_to = 0);
  126. std::string getOutfitLayerAsString(LLWearableType::EType layer);
  127. std::string getCommandsByType(S32 type, bool blacklist = false);
  128. std::string getRlvRestrictions(const std::string& filter = LLStringUtil::null);
  129. std::string getWornItems(LLInventoryCategory* cat);
  130. // Returns the pointer to the #RLV folder or NULL if does not exist
  131. LLInventoryCategory* getRlvShare();
  132. bool isUnderRlvShare(LLInventoryItem* item);
  133. bool isUnderRlvShare(LLInventoryCategory* cat);
  134. bool shouldMoveToSharedSubFolder(LLViewerInventoryCategory* catp);
  135. void moveToSharedSubFolder(LLViewerInventoryCategory* catp);
  136. #if RL_ALLOW_ATTACH_DETACH_RECENTLY_RECEIVED_ITEMS
  137. bool isInventoryFolderNew(LLInventoryCategory* folder);
  138. bool isInventoryItemNew(LLInventoryItem* item);
  139. #endif
  140. LLViewerJointAttachment* findAttachmentPointFromName(std::string obj_name,
  141. bool exact_name = false);
  142. LLViewerJointAttachment* findAttachmentPointFromParentName(LLInventoryItem* item);
  143. S32 findAttachmentPointNumber(LLViewerJointAttachment* attachment);
  144. void addAttachmentPointName(LLViewerObject* vobj);
  145. bool canDetachAllObjectsFromAttachment(LLViewerJointAttachment* attachment);
  146. void fetchInventory(LLInventoryCategory* root = NULL);
  147. LL_INLINE bool getAllowCancelTp() { return mAllowCancelTp; }
  148. LL_INLINE void setAllowCancelTp(bool newval) { mAllowCancelTp = newval; }
  149. void storeLastStandingLoc(bool force = false);
  150. void validateLastStandingLoc();
  151. void restoreLastStandingLoc();
  152. void backToLastStandingLoc();
  153. // Returns "someone", "unknown" etc according to the length of the name
  154. // (when shownames is on)
  155. std::string getDummyName(std::string name,
  156. EChatAudible audible = CHAT_AUDIBLE_FULLY);
  157. // Replaces names by dummy names
  158. std::string getCensoredMessage(std::string str);
  159. // Censors region and parcel names
  160. std::string getCensoredLocation(std::string str);
  161. LL_INLINE void setSitTargetId(const LLUUID& newval)
  162. {
  163. mSitTargetId = newval;
  164. }
  165. LL_INLINE void setLastLoadedPreset(const std::string& newval)
  166. {
  167. mLastLoadedPreset = newval;
  168. }
  169. LLInventoryItem* getItem(const LLUUID& worn_object_id);
  170. void attachObjectByUUID(const LLUUID& asset_id, S32 attach_pt_num = 0,
  171. bool kick = false);
  172. bool canDetachAllSelectedObjects();
  173. bool isSittingOnAnySelectedObject();
  174. bool isRestoringOutfit();
  175. bool canAttachCategory(LLInventoryCategory* folder,
  176. bool with_exceptions = true);
  177. bool canDetachCategory(LLInventoryCategory* folder,
  178. bool with_exceptions = true);
  179. bool canUnwear(LLViewerInventoryItem* item);
  180. bool canUnwear(LLWearableType::EType type);
  181. bool canWear(LLViewerInventoryItem* item);
  182. bool canWear(LLWearableType::EType type);
  183. bool canDetach(LLViewerInventoryItem* item);
  184. bool canDetach(LLViewerObject* attached_object);
  185. bool canDetach(std::string attachpt);
  186. bool canAttach(LLViewerObject* object_to_attach, std::string attachpt);
  187. bool canAttach(LLViewerInventoryItem* item);
  188. bool canStartIM(const LLUUID& to_id);
  189. bool canSendIM(const LLUUID& to_id);
  190. bool canReceiveIM(const LLUUID& from_id);
  191. bool canSendGroupIM(std::string group_name);
  192. bool canReceiveGroupIM(std::string group_name);
  193. bool canEdit(LLViewerObject* object);
  194. // Sets pick_intersection to force the check on this position
  195. bool canTouch(LLViewerObject* object,
  196. LLVector3 pick_intersection = LLVector3::zero);
  197. // Sets pick_intersection to force the check on this position
  198. bool canTouchFar(LLViewerObject* object,
  199. LLVector3 pick_intersection = LLVector3::zero);
  200. void updateLimits();
  201. bool checkCameraLimits(bool and_correct = false);
  202. bool updateCameraLimits();
  203. void drawRenderLimit(bool force_opaque);
  204. LLJoint* getCamDistDrawFromJoint();
  205. LL_INLINE void setCamDistDrawFromJoint(LLJoint* joint)
  206. {
  207. mCamDistDrawFromJoint = joint;
  208. }
  209. // Returns 1 is the avatar can be fully visible, 0 if it should be fully
  210. // invisible or -1 is it should be rendered as a jelly doll, based on RLV
  211. // current restriction and its distance from the agent avatar. HB
  212. S32 avatarVisibility(LLVOAvatar* avatarp);
  213. private:
  214. std::string getVersionNum(); // returns "RL_VERSION_NUM[,blacklist]"
  215. std::deque<std::string> parse(std::string str, std::string sep);
  216. bool parseCommand(const std::string& command, std::string& behaviour,
  217. std::string& option, std::string& param);
  218. // Executes queued commands, in chronological order
  219. void fireCommands();
  220. // Executes a single command
  221. bool handleCommand(const LLUUID& id, std::string command);
  222. // Queues a single command (or executes it for version* commands)
  223. void queueCommand(const LLUUID& id, const std::string& name,
  224. const std::string& command);
  225. bool force(const LLUUID& obj_id, std::string command, std::string option);
  226. bool add(const LLUUID& obj_id, std::string action, std::string option);
  227. bool remove(const LLUUID& obj_id, std::string action, std::string option);
  228. bool clear(const LLUUID& obj_id,
  229. const std::string& command = LLStringUtil::null);
  230. bool isBlacklisted(const LLUUID& id, std::string command,
  231. const std::string& option, bool force = false);
  232. bool answerOnChat(const LLUUID& obj_id, const std::string& channel,
  233. std::string msg);
  234. void refreshCachedVariable(const std::string& var);
  235. bool isAllowed(LLUUID object_id, std::string action, bool log_it = true);
  236. // Note: this method is costly, so it is only used internally to refresh
  237. // the public mHasLockedHuds boolean when appropriate. Use the latter for
  238. // testing for locked HUDs.
  239. bool hasLockedHuds();
  240. // Returns the max value of all the @action:...=n restrictions
  241. F32 getMax(std::string action, F32 dflt = EXTREMUM);
  242. // Returns the min value of all the @action:...=n restrictions
  243. F32 getMin(std::string action, F32 dflt = -EXTREMUM);
  244. // Returns the product of all the colors specified by actions "action"
  245. LLColor3 getMixedColors(std::string action,
  246. LLColor3 dflt = LLColor3::black);
  247. void removeWearableItemFromAvatar(LLViewerInventoryItem* item);
  248. // Type of the lock of a folder
  249. typedef enum EFolderLock {
  250. FolderNotLocked = 0,
  251. FolderLockedWithException,
  252. FolderLockedNoException,
  253. FolderLockCount
  254. } EFolderLock;
  255. // Helper method used by isFolderLocked(). attach_or_detach must be either
  256. // "attach" or "detach"
  257. EFolderLock isFolderLockedWithoutException(LLInventoryCategory* cat,
  258. std::string attach_or_detach);
  259. // Helper method used by isFolderLockedWithoutException()
  260. EFolderLock isFolderLockedWithoutExceptionAux(LLInventoryCategory* cat,
  261. std::string attach_or_detach,
  262. std::deque<std::string> list);
  263. LLWearableType::EType getOutfitLayerAsType(const std::string& layer);
  264. std::string getOutfit(const std::string& layer);
  265. std::string getAttachments(const std::string& attachpt);
  266. // If obj_id is null, returns everything
  267. std::string getStatus(const LLUUID& obj_id, std::string rule);
  268. std::string getCommand(std::string match, bool blacklist = false);
  269. std::deque<std::string> getBlacklist(std::string filter = "");
  270. bool forceDetach(const std::string& attachpt);
  271. bool forceDetachByUuid(const std::string& object_id);
  272. std::deque<LLInventoryItem*> getListOfLockedItems(LLInventoryCategory* root);
  273. std::deque<std::string> getListOfRestrictions(const LLUUID& obj_id,
  274. const std::string& rule = LLStringUtil::null);
  275. std::string getInventoryList(const std::string& path,
  276. bool with_worn_info = false);
  277. // Returns true if cat_child is a child of cat_parent
  278. bool isUnderFolder(LLInventoryCategory* cat_parent,
  279. LLInventoryCategory* cat_child);
  280. LLInventoryCategory* getCategoryUnderRlvShare(std::string cat_name,
  281. LLInventoryCategory* root = NULL);
  282. LLInventoryCategory* findCategoryUnderRlvShare(std::string cat_name,
  283. LLInventoryCategory* root = NULL);
  284. std::deque<LLInventoryCategory*> findCategoriesUnderRlvShare(std::string cat_name,
  285. LLInventoryCategory* root = NULL);
  286. void detachObject(LLViewerObject* object);
  287. void detachAllObjectsFromAttachment(LLViewerJointAttachment* attachment);
  288. // How to call @attach:outfit=force(useful for multi-attachments and
  289. // multi-wearables
  290. typedef enum EAttachMethod {
  291. AttachReplace = 0, // Always replace other attachments (default)
  292. AttachOver, // Attach over, not replacing other attachments
  293. // Attach over if the name of the outfit begins with a special sign,
  294. // otherwise replace
  295. AttachOverOrReplace,
  296. AttachMethodsCount
  297. } EAttachMethod;
  298. void forceAttach(const std::string& category, bool recursive,
  299. EAttachMethod how);
  300. bool forceDetachByName(const std::string& category, bool recursive);
  301. // If keep_lookat is true, the TP uses LLAgent::teleportViaLocationLookAt()
  302. // instead of LLAgent::teleportViaLocation(), so to keep facing in the same
  303. // direction on arrival than on departure.
  304. bool forceTeleport(const std::string& location, bool keep_lookat = false);
  305. std::string stringReplace(std::string s, std::string what_str,
  306. const std::string& by_str,
  307. bool case_sensitive = false);
  308. // 'command' is "setenv_<something>", option is a list of floats (separated
  309. // by "/")
  310. bool forceEnvironment(std::string command, std::string option);
  311. // command is "getenv_<something>"
  312. std::string getEnvironment(std::string command);
  313. // 'command' is "setdebug_<something>", option is a list of values
  314. // (separated by "/")
  315. bool forceDebugSetting(std::string command, std::string option);
  316. // 'command' is "getdebug_<something>"
  317. std::string getDebugSetting(std::string command);
  318. std::string getFullPath(LLInventoryCategory* cat);
  319. std::string getFullPath(LLInventoryItem* item,
  320. const std::string& option = LLStringUtil::null,
  321. bool full_list = true);
  322. // Various helper methods
  323. LLInventoryItem* getItemAux(LLViewerObject* attached_object,
  324. LLInventoryCategory* root);
  325. bool canAttachCategoryAux(LLInventoryCategory* folder, bool in_parent,
  326. bool in_no_mod, bool with_exceptions = true);
  327. bool canDetachCategoryAux(LLInventoryCategory* folder, bool in_parent,
  328. bool in_no_mod, bool with_exceptions = true);
  329. void drawSphere(const LLVector3& center, F32 scale, const LLColor3& color,
  330. F32 alpha);
  331. public:
  332. enum RLBehaviourType {
  333. RL_INFO, // Information commands, not-blacklistable.
  334. RL_MISCELLANEOUS, // Miscellaneous not-blacklistable commands.
  335. RL_INSTANTMESSAGE, // Instant Messaging commands.
  336. RL_SENDCHAT, // Chat sending commands.
  337. RL_RECEIVECHAT, // Chat receiving commands.
  338. RL_CHANNEL, // Chat on private channels commands.
  339. RL_EMOTE, // Emote/pose commands.
  340. RL_REDIRECTION, // Emote/pose redirection commands.
  341. RL_MOVE, // Movement commands.
  342. RL_SIT, // Sitting/unsitting commands.
  343. RL_TELEPORT, // Teleportation commands.
  344. RL_TOUCH, // Touch commands.
  345. RL_LOCK, // Locking/unlocking commands.
  346. RL_ATTACH, // Attach/wear commands.
  347. RL_DETACH, // Detach/remove commands.
  348. RL_INVENTORY, // Inventory commands.
  349. RL_INVENTORYLOCK, // Inventory locking commands.
  350. RL_BUILD, // Rezing/editing commands.
  351. RL_LOCATION, // Location commands.
  352. RL_NAME, // Name commands.
  353. RL_GROUP, // Group commands.
  354. RL_SHARE, // Sharing commands.
  355. RL_PERM, // Permissions/extra-restriction commands.
  356. RL_CAMERA, // Camera restriction commands.
  357. RL_DEBUG, // Debug settings commands.
  358. RL_ENVIRONMENT, // Environment/rendering commands.
  359. };
  360. typedef std::pair<std::string, S32> rl_command_entry_t;
  361. typedef std::map<std::string, S32> rl_command_map_t;
  362. typedef std::map<std::string, S32>::iterator rl_command_map_it_t;
  363. static rl_command_map_t sCommandsMap;
  364. // User-blacklisted RestrainedLove commands.
  365. static std::string sBlackList;
  366. // Standard blacklist for role-players
  367. static std::string sRolePlayBlackList;
  368. // Standard blacklist for non-BDSM folks
  369. static std::string sVanillaBlackList;
  370. // Message to replace an incoming IM, when under recvim
  371. static std::string sRecvimMessage;
  372. // Message to replace an outgoing IM, when under sendim
  373. static std::string sSendimMessage;
  374. F32 mTplocalMax;
  375. F32 mSittpMax;
  376. F32 mFartouchMax;
  377. F32 mCamZoomMax;
  378. F32 mCamZoomMin;
  379. F32 mCamDistMax;
  380. F32 mCamDistMin;
  381. F32 mCamDistDrawMax;
  382. F32 mCamDistDrawMin;
  383. F32 mCamDistDrawAlphaMin;
  384. F32 mCamDistDrawAlphaMax;
  385. F32 mShowavsDistMax;
  386. // Must be a LLPointer, else the texture may get removed from memory if not
  387. // used elsewhere, and cause a crash when used by the RLV code...
  388. LLPointer<LLViewerFetchedTexture> mCamTexturesCustom;
  389. // For convenience (gAgent does not retain the name of the current parcel):
  390. std::string mParcelName;
  391. // Allowed debug settings(initialized in the ctor)
  392. std::vector<std::string> mAllowedGetDebug;
  393. std::vector<std::string> mAllowedSetDebug;
  394. // Public, because also used by other classes in llchatbar.cpp,
  395. // hbfloaterrlv.cpp and hbviewerautomation.cpp
  396. rl_map_t mSpecialObjectBehaviours;
  397. #if RL_ALLOW_ATTACH_DETACH_RECENTLY_RECEIVED_ITEMS
  398. // List of items received during the session
  399. typedef std::set<std::string> received_list_t;
  400. received_list_t mReceivedInventoryFolders;
  401. #endif
  402. // When a locked attachment is kicked off by another one with
  403. // llAttachToAvatar() in a script, retain its UUID here, to reattach it
  404. // later.
  405. struct RLAttachment
  406. {
  407. RLAttachment()
  408. {
  409. }
  410. RLAttachment(const LLUUID& id, const std::string& name)
  411. : mId(id),
  412. mName(name)
  413. {
  414. }
  415. LLUUID mId;
  416. std::string mName;
  417. };
  418. typedef std::deque<RLAttachment> reattach_queue_t;
  419. reattach_queue_t mAssetsToReattach;
  420. // Reset each time a locked attachment is kicked by a "Wear", and on
  421. // auto-reattachment timeout.
  422. LLFrameTimer mReattachTimer;
  423. // We need this to inhibit the removeObject event that occurs right after
  424. // addObject in the case of a replacement
  425. RLAttachment mJustDetached;
  426. #if 0 // Not needed, actually...
  427. // We need this to inhibit the removeObject event that occurs right after
  428. // addObject in the case of a replacement
  429. RLAttachment mJustReattached;
  430. #endif
  431. // true when llappviewer.cpp asked for a reattachment. false when
  432. // llviewerjointattachment.cpp detected a reattachment.
  433. bool mReattaching;
  434. // true when llappviewer.cpp detects a reattachment timeout, false when
  435. // llviewerjointattachment.cpp detected a reattachment.
  436. bool mReattachTimeout;
  437. // Set this to true when restoring an outfit after logging in, to override
  438. // attach/detach restictions
  439. bool mRestoringOutfit;
  440. // true when already rendered the vision spheres during the current frame
  441. bool mRenderLimitRenderedThisFrame;
  442. // true when we are teleporting back to the last standing location, in
  443. // order to bypass the usual checks
  444. bool mSnappingBackToLastStandingLocation;
  445. // true while waiting to stand up from a seat before executing @sitground
  446. bool mSitGroundOnStandUp;
  447. // Some cache variables to accelerate common checks
  448. bool mHasLockedHuds;
  449. bool mContainsDetach;
  450. bool mContainsShowinv;
  451. bool mContainsUnsit;
  452. bool mContainsStandtp;
  453. bool mContainsInteract;
  454. bool mContainsShowworldmap;
  455. bool mContainsShowminimap;
  456. bool mContainsShowloc;
  457. bool mContainsShownames;
  458. bool mContainsShownametags;
  459. bool mContainsShowNearby;
  460. bool mContainsViewscript;
  461. bool mContainsSetenv;
  462. bool mContainsSetdebug;
  463. bool mContainsFly;
  464. bool mContainsEdit;
  465. bool mContainsRez;
  466. bool mContainsShowhovertextall;
  467. bool mContainsShowhovertexthud;
  468. bool mContainsShowhovertextworld;
  469. bool mContainsDefaultwear;
  470. bool mContainsPermissive;
  471. bool mContainsRun;
  472. bool mContainsAlwaysRun;
  473. bool mContainsTp;
  474. bool mContainsCamTextures;
  475. bool mNeedsVisibilityRefresh;
  476. bool mVisionRestricted;
  477. private:
  478. // true after executing @sit=force
  479. bool mGotSit;
  480. // true after executing @unsit=force
  481. bool mGotUnsit;
  482. // Used to force-queue commands after and including @sit=force in a
  483. // command line that comes while @unsit=force was just executed and also
  484. // part of that same command line.
  485. bool mSkipAll;
  486. // true while logging in and attempting to snap back to last standing
  487. // location before last logout
  488. bool mHandleBackToLastStanding;
  489. // true while processing RestrainedLove commands, to prevent stripping
  490. // items which name contains "nostrip"
  491. bool mHandleNoStrip;
  492. // true when a command just got black-listed in by add() or force()
  493. bool mLastCmdBlacklisted;
  494. // true while processing RestrainedLove commands following a @relayed
  495. // command, to prevent passing folder names which contain "norelay"
  496. bool mHandleNoRelay;
  497. // false at first, used to fetch RL Share inventory once upon login
  498. bool mInventoryFetched;
  499. // true unless forced to TP with @tpto (=> receive TP order from server,
  500. // act like it is a lure from a Linden => don't show the cancel button)
  501. bool mAllowCancelTp;
  502. F32 mNextGarbageCollection;
  503. // Time stamp of the beginning of this session
  504. U32 mLaunchTimestamp;
  505. // Number of spheres to draw when restricting the camera view
  506. U32 mCamDistNbGradients;
  507. // mHeadp by default, but can be set it to another joint so the user can
  508. // "see" the world with vision spheres centered around that joint instead.
  509. LLJoint* mCamDistDrawFromJoint;
  510. LLColor3 mCamDistDrawColor;
  511. LLFrameTimer mSitUnsitDelayTimer;
  512. LLUUID mSitTargetId;
  513. // This is the global position we had when we sat down on something, and we
  514. // will be teleported back there when we stand up if we are prevented from
  515. // "sit-tp by rezzing stuff"
  516. LLVector3d mLastStandingLocation;
  517. // contains the name of the latest loaded Windlight preset
  518. std::string mLastLoadedPreset;
  519. struct RLCommand
  520. {
  521. RLCommand(const LLUUID& id, const std::string& name,
  522. const std::string& command)
  523. : mId(id),
  524. mName(name),
  525. mCommand(command)
  526. {
  527. }
  528. LLUUID mId;
  529. std::string mName;
  530. std::string mCommand;
  531. };
  532. std::deque<RLCommand> mQueuedCommands;
  533. // List of avatar UUIDs for which the name sensoring is not applied
  534. uuid_list_t mExceptions;
  535. // List of relay object UUIDs
  536. uuid_list_t mRelays;
  537. // When true, the user can bypass a sendchat restriction by surrounding
  538. // with (( and ))
  539. static bool sCanOoc;
  540. // When true, the user's emotes are never truncated.
  541. static bool sUntruncatedEmotes;
  542. // When true, the @setnev command is disabled
  543. static bool sRLNoSetEnv;
  544. };
  545. typedef RLInterface::reattach_queue_t::iterator rl_reattach_it_t;
  546. extern RLInterface gRLInterface;
  547. #endif // LL_MKRLINTERFACE_H