aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/rlvhandler.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-10-06 22:16:12 -0700
committerMcCabe Maxsted2009-10-06 22:16:12 -0700
commit0bd17be512fbf47600a7971208244e73424429f4 (patch)
tree4ea2e45dee3aeba79249b9a984e9db5582353bf5 /linden/indra/newview/rlvhandler.cpp
parentApplied RLVa-1.0.2c_20091005_Imprudence-1.2.0-diff.patch (diff)
downloadmeta-impy-0bd17be512fbf47600a7971208244e73424429f4.zip
meta-impy-0bd17be512fbf47600a7971208244e73424429f4.tar.gz
meta-impy-0bd17be512fbf47600a7971208244e73424429f4.tar.bz2
meta-impy-0bd17be512fbf47600a7971208244e73424429f4.tar.xz
Applied RLVa-1.0.3e_20091005_Imprudence-1.2.0-diff.patch by Kitty Barnett
Diffstat (limited to 'linden/indra/newview/rlvhandler.cpp')
-rw-r--r--linden/indra/newview/rlvhandler.cpp73
1 files changed, 46 insertions, 27 deletions
diff --git a/linden/indra/newview/rlvhandler.cpp b/linden/indra/newview/rlvhandler.cpp
index 987c62a..6044aa9 100644
--- a/linden/indra/newview/rlvhandler.cpp
+++ b/linden/indra/newview/rlvhandler.cpp
@@ -1,6 +1,7 @@
1#include "llviewerprecompiledheaders.h" 1#include "llviewerprecompiledheaders.h"
2#include "llagent.h" 2#include "llagent.h"
3#include "lldrawpoolalpha.h" 3#include "lldrawpoolalpha.h"
4#include "llfirstuse.h"
4#include "llfloaterbeacons.h" 5#include "llfloaterbeacons.h"
5#include "llfloaterchat.h" 6#include "llfloaterchat.h"
6#include "llfloaterdaycycle.h" 7#include "llfloaterdaycycle.h"
@@ -96,7 +97,7 @@ static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, st
96 boost_tokenizer::const_iterator itTok = tokens.begin(); 97 boost_tokenizer::const_iterator itTok = tokens.begin();
97 98
98 // Extract and sanity check the first token (required) which is the channel 99 // Extract and sanity check the first token (required) which is the channel
99 if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidChannel(nChannel)) ) 100 if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidReplyChannel(nChannel)) )
100 return false; 101 return false;
101 102
102 // Second token (optional) is the filter 103 // Second token (optional) is the filter
@@ -284,6 +285,10 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe
284 285
285 if (!fDetachable) 286 if (!fDetachable)
286 { 287 {
288 #ifdef RLV_EXPERIMENTAL_FIRSTUSE
289 LLFirstUse::useRlvDetach();
290 #endif // RLV_EXPERIMENTAL_FIRSTUSE
291
287 // NOTE: m_Attachments can contain duplicate <idxAttachPt, idRlvObj> pairs (ie @detach:spine=n,detach=n from an attachment on spine) 292 // NOTE: m_Attachments can contain duplicate <idxAttachPt, idRlvObj> pairs (ie @detach:spine=n,detach=n from an attachment on spine)
288 m_Attachments.insert(std::pair<S32, LLUUID>(idxAttachPt, itObj->second.m_UUID)); 293 m_Attachments.insert(std::pair<S32, LLUUID>(idxAttachPt, itObj->second.m_UUID));
289 return true; 294 return true;
@@ -469,6 +474,10 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b
469 } 474 }
470 } 475 }
471 break; 476 break;
477 case RLV_TYPE_CLEAR:
478 fRet = processClearCommand(uuid, rlvCmd);
479 notifyBehaviourObservers(rlvCmd, !fFromObj);
480 break;
472 case RLV_TYPE_FORCE: // Checked: 481 case RLV_TYPE_FORCE: // Checked:
473 fRet = processForceCommand(uuid, rlvCmd); 482 fRet = processForceCommand(uuid, rlvCmd);
474 break; 483 break;
@@ -476,32 +485,6 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b
476 fRet = processReplyCommand(uuid, rlvCmd); 485 fRet = processReplyCommand(uuid, rlvCmd);
477 break; 486 break;
478 case RLV_TYPE_UNKNOWN: // Checked: 487 case RLV_TYPE_UNKNOWN: // Checked:
479 {
480 if ("clear" == rlvCmd.getBehaviour())
481 {
482 const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem;
483
484 rlv_object_map_t::const_iterator itObj = m_Objects.find(uuid);
485 if (itObj != m_Objects.end()) // No sense in @clear'ing if we don't have any commands for this object
486 {
487 const RlvObject& rlvObj = itObj->second; bool fContinue = true;
488 for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd;
489 ((fContinue) && (itCmd != rlvObj.m_Commands.end())); )
490 {
491 itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command
492
493 const RlvCommand& rlvCmdRem = *itCurCmd;
494 if ( (strFilter.empty()) || (std::string::npos != rlvCmdRem.asString().find(strFilter)) )
495 {
496 fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command
497 strCmdRem = rlvCmdRem.getBehaviour() + ":" + rlvCmdRem.getOption() + "=y";
498 processCommand(uuid, strCmdRem, false);
499 }
500 }
501 fRet = TRUE;
502 }
503 }
504 }
505 break; 488 break;
506 #ifdef LL_GNUC 489 #ifdef LL_GNUC
507 default: 490 default:
@@ -663,6 +646,13 @@ BOOL RlvHandler::processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd)
663 LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false); 646 LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false);
664 } 647 }
665 break; 648 break;
649 case RLV_BHVR_FARTOUCH:
650 {
651 #ifdef RLV_EXPERIMENTAL_FIRSTUSE
652 LLFirstUse::useRlvFartouch();
653 #endif // RLV_EXPERIMENTAL_FIRSTUSE
654 }
655 break;
666 case RLV_BHVR_FLY: // @fly=n - Checked: 2009-07-05 (RLVa-1.0.0c) 656 case RLV_BHVR_FLY: // @fly=n - Checked: 2009-07-05 (RLVa-1.0.0c)
667 { 657 {
668 // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()] 658 // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()]
@@ -900,6 +890,35 @@ BOOL RlvHandler::processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvC
900 return TRUE; // Remove commands don't fail, doesn't matter what we return here 890 return TRUE; // Remove commands don't fail, doesn't matter what we return here
901} 891}
902 892
893BOOL RlvHandler::processClearCommand(const LLUUID& idObj, const RlvCommand& rlvCmd)
894{
895 const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem;
896
897 rlv_object_map_t::const_iterator itObj = m_Objects.find(idObj);
898 if (itObj != m_Objects.end()) // No sense in clearing if we don't have any commands for this object
899 {
900 const RlvObject& rlvObj = itObj->second; bool fContinue = true;
901 for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd;
902 ((fContinue) && (itCmd != rlvObj.m_Commands.end())); )
903 {
904 itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command
905
906 const RlvCommand& rlvCmdRem = *itCurCmd; strCmdRem = rlvCmdRem.asString();
907 if ( (strFilter.empty()) || (std::string::npos != strCmdRem.find(strFilter)) )
908 {
909 fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command
910 processCommand(idObj, strCmdRem.append("=y"), false);
911 }
912 }
913 }
914
915 // Let our observers know about clear commands
916 RlvEvent rlvEvent(idObj, rlvCmd);
917 m_Emitter.update(&RlvObserver::onClearCommand, rlvEvent);
918
919 return TRUE; // Don't fail clear commands even if the object didn't exist since it confuses people
920}
921
903BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const 922BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const
904{ 923{
905 const std::string& strOption = rlvCmd.getOption(); 924 const std::string& strOption = rlvCmd.getOption();