diff options
Diffstat (limited to 'linden/indra/newview/rlvhelper.h')
-rw-r--r-- | linden/indra/newview/rlvhelper.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/linden/indra/newview/rlvhelper.h b/linden/indra/newview/rlvhelper.h index a0e040e..9ceb799 100644 --- a/linden/indra/newview/rlvhelper.h +++ b/linden/indra/newview/rlvhelper.h | |||
@@ -55,8 +55,8 @@ const S32 RLV_VERSION_PATCH = 0; | |||
55 | // Implementation version | 55 | // Implementation version |
56 | const S32 RLVa_VERSION_MAJOR = 1; | 56 | const S32 RLVa_VERSION_MAJOR = 1; |
57 | const S32 RLVa_VERSION_MINOR = 0; | 57 | const S32 RLVa_VERSION_MINOR = 0; |
58 | const S32 RLVa_VERSION_PATCH = 1; | 58 | const S32 RLVa_VERSION_PATCH = 2; |
59 | const S32 RLVa_VERSION_BUILD = 7; | 59 | const S32 RLVa_VERSION_BUILD = 2; |
60 | 60 | ||
61 | // The official viewer version we're patching against | 61 | // The official viewer version we're patching against |
62 | #define RLV_MAKE_TARGET(x, y, z) ((x << 16) | (y << 8) | z) | 62 | #define RLV_MAKE_TARGET(x, y, z) ((x << 16) | (y << 8) | z) |
@@ -249,7 +249,12 @@ typedef std::list<RlvCommand> rlv_command_list_t; | |||
249 | class RlvObject | 249 | class RlvObject |
250 | { | 250 | { |
251 | public: | 251 | public: |
252 | RlvObject(const LLUUID& uuid) : m_UUID(uuid), m_nLookupMisses(0) { m_fLookup = (NULL != gObjectList.findObject(uuid)); } | 252 | RlvObject(const LLUUID& uuid) : m_UUID(uuid), m_nLookupMisses(0) |
253 | { | ||
254 | LLViewerObject* pObj = gObjectList.findObject(uuid); | ||
255 | m_fLookup = (NULL != pObj); | ||
256 | m_idxAttachPt = (pObj) ? ATTACHMENT_ID_FROM_STATE(pObj->getState()) : 0; | ||
257 | } | ||
253 | 258 | ||
254 | BOOL addCommand(const RlvCommand& rlvCmd); | 259 | BOOL addCommand(const RlvCommand& rlvCmd); |
255 | BOOL removeCommand(const RlvCommand& rlvCmd); | 260 | BOOL removeCommand(const RlvCommand& rlvCmd); |
@@ -264,6 +269,7 @@ public: | |||
264 | const rlv_command_list_t* getCommandList() const { return &m_Commands; } | 269 | const rlv_command_list_t* getCommandList() const { return &m_Commands; } |
265 | protected: | 270 | protected: |
266 | LLUUID m_UUID; // The object's UUID | 271 | LLUUID m_UUID; // The object's UUID |
272 | S32 m_idxAttachPt; // The object's attachment point (or 0 if it's not an attachment) | ||
267 | bool m_fLookup; // TRUE if the object existed in gObjectList at one point in time | 273 | bool m_fLookup; // TRUE if the object existed in gObjectList at one point in time |
268 | S16 m_nLookupMisses; // Count of unsuccessful lookups in gObjectList by the GC | 274 | S16 m_nLookupMisses; // Count of unsuccessful lookups in gObjectList by the GC |
269 | rlv_command_list_t m_Commands; // List of behaviours held by this object (in the order they were received) | 275 | rlv_command_list_t m_Commands; // List of behaviours held by this object (in the order they were received) |
@@ -284,11 +290,16 @@ class RlvCriteriaCategoryCollector : public LLInventoryCollectFunctor | |||
284 | public: | 290 | public: |
285 | RlvCriteriaCategoryCollector(const std::string& strCriteria) | 291 | RlvCriteriaCategoryCollector(const std::string& strCriteria) |
286 | { | 292 | { |
287 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 293 | std::string::size_type idxIt, idxLast = 0; |
288 | boost::char_separator<char> sep("&&", "", boost::drop_empty_tokens); | 294 | while (idxLast < strCriteria.length()) |
289 | tokenizer tokens(strCriteria, sep); | 295 | { |
290 | for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) | 296 | idxIt = strCriteria.find("&&", idxLast); |
291 | m_Criteria.push_back(*itToken); | 297 | if (std::string::npos == idxIt) |
298 | idxIt = strCriteria.length(); | ||
299 | if (idxIt != idxLast) | ||
300 | m_Criteria.push_back(strCriteria.substr(idxLast, idxIt - idxLast)); | ||
301 | idxLast = idxIt + 2; | ||
302 | } | ||
292 | } | 303 | } |
293 | virtual ~RlvCriteriaCategoryCollector() {} | 304 | virtual ~RlvCriteriaCategoryCollector() {} |
294 | 305 | ||
@@ -304,7 +315,7 @@ public: | |||
304 | return false; | 315 | return false; |
305 | 316 | ||
306 | for (std::list<std::string>::const_iterator itCrit = m_Criteria.begin(); itCrit != m_Criteria.end(); ++itCrit) | 317 | for (std::list<std::string>::const_iterator itCrit = m_Criteria.begin(); itCrit != m_Criteria.end(); ++itCrit) |
307 | if (-1 == strFolderName.find(*itCrit)) // Return false on the first mismatch | 318 | if (std::string::npos == strFolderName.find(*itCrit)) // Return false on the first mismatch |
308 | return false; | 319 | return false; |
309 | return true; | 320 | return true; |
310 | } | 321 | } |
@@ -317,7 +328,7 @@ protected: | |||
317 | /* | 328 | /* |
318 | * RlvWearableItemCollector | 329 | * RlvWearableItemCollector |
319 | * ======================== | 330 | * ======================== |
320 | * Inventory item filter used by attach/detach/attachall/detachall/getinvworn (also used by "Add/Replace Outfit" and "Take Off Items") | 331 | * Inventory item filter used by attach/detach/attachall/detachall/getinvworn |
321 | * | 332 | * |
322 | */ | 333 | */ |
323 | 334 | ||
@@ -349,11 +360,8 @@ protected: | |||
349 | }; | 360 | }; |
350 | 361 | ||
351 | // ============================================================================ | 362 | // ============================================================================ |
352 | /* | 363 | // RlvRetainedCommand |
353 | * RlvRetainedCommand | 364 | // |
354 | * ================== | ||
355 | * | ||
356 | */ | ||
357 | 365 | ||
358 | struct RlvRetainedCommand | 366 | struct RlvRetainedCommand |
359 | { | 367 | { |
@@ -369,11 +377,8 @@ private: | |||
369 | typedef std::list<RlvRetainedCommand> rlv_retained_list_t; | 377 | typedef std::list<RlvRetainedCommand> rlv_retained_list_t; |
370 | 378 | ||
371 | // ============================================================================ | 379 | // ============================================================================ |
372 | /* | 380 | // RlvWLSnapshot |
373 | * RlvWLSnapshot | 381 | // |
374 | * ============= | ||
375 | * | ||
376 | */ | ||
377 | 382 | ||
378 | struct RlvWLSnapshot | 383 | struct RlvWLSnapshot |
379 | { | 384 | { |
@@ -389,11 +394,8 @@ private: | |||
389 | }; | 394 | }; |
390 | 395 | ||
391 | // ============================================================================ | 396 | // ============================================================================ |
392 | /* | 397 | // RlvSettings |
393 | * RlvSettings | 398 | // |
394 | * =========== | ||
395 | * | ||
396 | */ | ||
397 | 399 | ||
398 | #define RLV_SETTING_MAIN "RestrainedLife" | 400 | #define RLV_SETTING_MAIN "RestrainedLife" |
399 | #define RLV_SETTING_DEBUG "RestrainedLifeDebug" | 401 | #define RLV_SETTING_DEBUG "RestrainedLifeDebug" |
@@ -437,10 +439,8 @@ public: | |||
437 | }; | 439 | }; |
438 | 440 | ||
439 | // ============================================================================ | 441 | // ============================================================================ |
440 | /* | 442 | // State keeping classes/structure |
441 | * State keeping classes/structure | 443 | // |
442 | * | ||
443 | */ | ||
444 | 444 | ||
445 | struct RlvRedirInfo | 445 | struct RlvRedirInfo |
446 | { | 446 | { |
@@ -461,10 +461,8 @@ struct RlvReattachInfo | |||
461 | }; | 461 | }; |
462 | 462 | ||
463 | // ============================================================================ | 463 | // ============================================================================ |
464 | /* | 464 | // Various helper classes/timers/functors |
465 | * Various helper classes/timers/functors | 465 | // |
466 | * | ||
467 | */ | ||
468 | 466 | ||
469 | class RlvGCTimer : public LLEventTimer | 467 | class RlvGCTimer : public LLEventTimer |
470 | { | 468 | { |
@@ -504,10 +502,8 @@ struct RlvSelectIsSittingOn : public LLSelectedNodeFunctor | |||
504 | }; | 502 | }; |
505 | 503 | ||
506 | // ============================================================================ | 504 | // ============================================================================ |
507 | /* | 505 | // Various helper functions |
508 | * Various helper functions | 506 | // |
509 | * | ||
510 | */ | ||
511 | 507 | ||
512 | BOOL rlvAttachToEnabler(void* pParam); | 508 | BOOL rlvAttachToEnabler(void* pParam); |
513 | bool rlvCanDeleteOrReturn(); | 509 | bool rlvCanDeleteOrReturn(); |
@@ -525,6 +521,10 @@ void rlvStringReplace(std::string& strText, std::string strFrom, const std::stri | |||
525 | std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string::size_type* pidxMatch = NULL); | 521 | std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string::size_type* pidxMatch = NULL); |
526 | std::string rlvGetLastParenthesisedText(const std::string& strText, std::string::size_type* pidxStart = NULL); | 522 | std::string rlvGetLastParenthesisedText(const std::string& strText, std::string::size_type* pidxStart = NULL); |
527 | 523 | ||
524 | // ============================================================================ | ||
525 | // Debug helper functions | ||
526 | // | ||
527 | |||
528 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 528 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
529 | // "Advanced / RLVa / Enable RLV" menu option | 529 | // "Advanced / RLVa / Enable RLV" menu option |
530 | void rlvDbgToggleEnabled(void*); | 530 | void rlvDbgToggleEnabled(void*); |
@@ -561,10 +561,10 @@ inline bool rlvIsEmote(const std::string& strUTF8Text) | |||
561 | return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); | 561 | return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); |
562 | } | 562 | } |
563 | 563 | ||
564 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e | 564 | // Checked: 2009-09-05 (RLVa-1.0.2a) | Added: RLVa-1.0.2a |
565 | inline bool rlvIsValidChannel(S32 nChannel) | 565 | inline bool rlvIsValidChannel(S32 nChannel) |
566 | { | 566 | { |
567 | return (nChannel >= 0) && (CHAT_CHANNEL_DEBUG != nChannel); | 567 | return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); |
568 | } | 568 | } |
569 | 569 | ||
570 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e | 570 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e |