From 0bd17be512fbf47600a7971208244e73424429f4 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 6 Oct 2009 22:16:12 -0700 Subject: Applied RLVa-1.0.3e_20091005_Imprudence-1.2.0-diff.patch by Kitty Barnett --- linden/indra/newview/CMakeLists.txt | 1 + linden/indra/newview/app_settings/settings.xml | 44 +++ linden/indra/newview/llfirstuse.cpp | 37 ++ linden/indra/newview/llfirstuse.h | 17 + linden/indra/newview/llviewermenu.cpp | 38 +-- linden/indra/newview/llviewermessage.cpp | 8 + linden/indra/newview/rlvevent.h | 19 +- linden/indra/newview/rlvextensions.cpp | 31 +- linden/indra/newview/rlvhandler.cpp | 73 ++-- linden/indra/newview/rlvhandler.h | 8 +- linden/indra/newview/rlvhelper.cpp | 374 ++++++++++----------- linden/indra/newview/rlvhelper.h | 338 ++++--------------- .../newview/skins/default/xui/en-us/alerts.xml | 17 + .../skins/default/xui/en-us/menu_viewer.xml | 40 ++- .../newview/skins/default/xui/en-us/notify.xml | 19 +- 15 files changed, 529 insertions(+), 535 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index e993564..3db96c4 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -856,6 +856,7 @@ set(viewer_HEADER_FILES randgauss.h VertexCache.h VorbisFramework.h + rlvdefines.h rlvevent.h rlvhandler.h rlvhelper.h diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 8a13b85..8ffcb19 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -100,6 +100,50 @@ Value 0 + WarnFirstRLVDetach + + Comment + Enables FirstRLVDetach warning dialog + Persist + 1 + Type + Boolean + Value + 1 + + WarnFirstRLVEnableWear + + Comment + Enables RLVEnableWear warning dialog + Persist + 1 + Type + Boolean + Value + 1 + + WarnFirstRLVFartouch + + Comment + Enables FirstRLVFartouch warning dialog + Persist + 1 + Type + Boolean + Value + 1 + + WarnFirstRLVGiveToRLV + + Comment + Enables FirstRLVGiveToRLV warning dialog + Persist + 1 + Type + Boolean + Value + 1 + AFKTimeout Comment diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index b807b17..7c611a3 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -44,6 +44,10 @@ #include "llappviewer.h" #include "lltracker.h" +// [RLVa:KB] - Version: 1.22.11 +#include "llviewerwindow.h" +// [/RLVa:KB] + // static std::set LLFirstUse::sConfigVariables; @@ -287,3 +291,36 @@ void LLFirstUse::useMedia() LLNotifyBox::showXml("FirstMedia"); } } + +// [RLVa:KB] - Version: 1.22.11 | Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a + +// SL-1.22.11 doesn't seem to have a way to check which notifications are currently open :( +bool rlvHasVisibleFirstUseNotification() +{ + return false; +} + +void LLFirstUse::showRlvFirstUseNotification(const std::string& strName) +{ + if ( (gSavedSettings.getWarning(strName)) && (!rlvHasVisibleFirstUseNotification()) ) + { + gSavedSettings.setWarning(strName, FALSE); + LLNotifyBox::showXml(strName); + } +} + +void LLFirstUse::warnRlvGiveToRLV() +{ + if ( (gSavedSettings.getWarning(RLV_SETTING_FIRSTUSE_GIVETORLV)) && (RlvSettings::getForbidGiveToRLV()) ) + gViewerWindow->alertXml(RLV_SETTING_FIRSTUSE_GIVETORLV, LLStringUtil::format_map_t(), &LLFirstUse::onRlvGiveToRLVConfirmation, NULL); +} + +void LLFirstUse::onRlvGiveToRLVConfirmation(S32 idxOption, void* /*pUserParam*/) +{ + gSavedSettings.setWarning(RLV_SETTING_FIRSTUSE_GIVETORLV, FALSE); + + if ( (0 == idxOption) || (1 == idxOption) ) + gSavedSettings.setBOOL(RLV_SETTING_FORBIDGIVETORLV, (idxOption == 1)); +} + +// [/RLVa:KB] diff --git a/linden/indra/newview/llfirstuse.h b/linden/indra/newview/llfirstuse.h index cbb31ab..7460067 100644 --- a/linden/indra/newview/llfirstuse.h +++ b/linden/indra/newview/llfirstuse.h @@ -35,6 +35,10 @@ #include #include "llstring.h" +// [RLVa:KB] +#include "rlvdefines.h" +// [/RLVa:KB] + /* 1. On first use of 'sit here', explain how to get up and rotate view. @@ -109,6 +113,19 @@ public: protected: static std::set sConfigVariables; + +// [RLVa:KB] - Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a +public: + static void showRlvFirstUseNotification(const std::string& strName); + + static void useRlvDetach() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_DETACH); } + static void useRlvEnableWear() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_ENABLEWEAR); } + static void useRlvFartouch() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_FARTOUCH); } + + static void warnRlvGiveToRLV(); +protected: + static void onRlvGiveToRLVConfirmation(S32 idxOption, void* pUserParam); +// [/RLVa:KB] }; #endif diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 98dd0ea..55cc2a6 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -953,7 +953,7 @@ void init_client_menu(LLMenuGL* menu) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e #ifdef RLV_ADVANCED_TOGGLE_RLVA if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) - menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvDbgToggleEnabled, NULL, &rlvDbgGetEnabled, NULL)); + menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); #endif // RLV_ADVANCED_TOGGLE_RLVA // [/RLVa:KB] @@ -1407,30 +1407,24 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g void init_debug_rlva_menu(LLMenuGL* menu) { - // Experimental feature toggles + // Debug options { - /* - #ifdef RLV_EXPERIMENTAL - LLMenuGL* sub_menu = new LLMenuGL("Experimental"); + LLMenuGL* pDbgMenu = new LLMenuGL("Debug"); - menu->appendMenu(sub_menu); - #endif // RLV_EXPERIMENTAL - */ - } + if (gSavedSettings.controlExists(RLV_SETTING_DEBUG)) + pDbgMenu->append(new LLMenuItemCheckGL("Show Debug Messages", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_DEBUG)); + pDbgMenu->appendSeparator(); + if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) + pDbgMenu->append(new LLMenuItemCheckGL("Enable Legacy Naming", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLELEGACYNAMING)); - // Unit tests - { - #ifdef RLV_DEBUG_TESTS - init_debug_rlva_tests_menu(menu); - #endif // RLV_DEBUG_TESTS + menu->appendMenu(pDbgMenu); + menu->appendSeparator(); } #ifdef RLV_EXTENSION_ENABLE_WEAR if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) - { menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); - menu->appendSeparator(); - } + menu->appendSeparator(); #endif // RLV_EXTENSION_ENABLE_WEAR #ifdef RLV_EXTENSION_HIDELOCKED @@ -1444,6 +1438,12 @@ void init_debug_rlva_menu(LLMenuGL* menu) } #endif // RLV_EXTENSION_HIDELOCKED + if (gSavedSettings.controlExists(RLV_SETTING_FORBIDGIVETORLV)) + menu->append(new LLMenuItemCheckGL("Forbid Give to #RLV", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_FORBIDGIVETORLV)); + if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) + menu->append(new LLMenuItemCheckGL("Show Name Tags", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_SHOWNAMETAGS)); + menu->appendSeparator(); + #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); @@ -10376,7 +10376,7 @@ class RLVaMainToggle : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - rlvDbgToggleEnabled(NULL); + rlvToggleEnabled(NULL); return true; } }; @@ -10385,7 +10385,7 @@ class RLVaMainCheck : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - bool new_value = rlvDbgGetEnabled(NULL); + bool new_value = rlvGetEnabled(NULL); std::string control_name = userdata["control"].asString(); gMenuHolder->findControl(control_name)->setValue(new_value); return true; diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 33d3d51..464d687 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1821,6 +1821,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-09-10 (RLVa-1.0.3a) + if ( (rlv_handler_t::isEnabled()) && (dialog == IM_TASK_INVENTORY_OFFERED) && + (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) && (gRlvHandler.getSharedRoot()) ) + { + LLFirstUse::warnRlvGiveToRLV(); + } +// [/RLVa:KB] + inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); } } diff --git a/linden/indra/newview/rlvevent.h b/linden/indra/newview/rlvevent.h index c3d9c45..a98996f 100644 --- a/linden/indra/newview/rlvevent.h +++ b/linden/indra/newview/rlvevent.h @@ -10,11 +10,8 @@ #include "rlvhelper.h" // ============================================================================ -/* - * RlvEvent - * ======== - * Passed to observer event handlers (contains the same paramaters as RlvHandler::processXXXCommand) - */ +// RlvEvent - Passed to observer event handlers (contains the same paramaters as RlvHandler::processXXXCommand) +// class RlvEvent { @@ -63,6 +60,7 @@ public: virtual BOOL onAddCommand(const EventType& rlvEvent) { return FALSE; } virtual BOOL onRemoveCommand(const EventType& rlvEvent) { return FALSE; } + virtual BOOL onClearCommand(const EventType& rlvEvent) { return FALSE; } virtual BOOL onReplyCommand(const EventType& rlvEvent) { return FALSE; } virtual BOOL onForceCommand(const EventType& rlvEvent) { return FALSE; } }; @@ -168,11 +166,16 @@ public: void changed(const RlvCommand& rlvCmd, bool fInternal) { - if ( (fInternal) || ((RLV_TYPE_ADD != rlvCmd.getParamType()) && (RLV_TYPE_REMOVE != rlvCmd.getParamType())) ) + if (fInternal) return; - std::string strCmd = rlvCmd.asString(); - std::string strNotify = llformat("/%s=%c", strCmd.c_str(), (RLV_TYPE_ADD == rlvCmd.getParamType()) ? 'n' : 'y'); + std::string strCmd = rlvCmd.asString(), strNotify; ERlvParamType eCmdType = rlvCmd.getParamType(); + if ( (RLV_TYPE_ADD == eCmdType) || (RLV_TYPE_REMOVE == eCmdType) ) + strNotify = llformat("/%s=%s", strCmd.c_str(), rlvCmd.getParam().c_str()); + else if (RLV_TYPE_CLEAR == eCmdType) + strNotify = llformat("/%s", strCmd.c_str()); + else + return; for (std::multimap::const_iterator itNotify = m_Notifications.begin(); itNotify != m_Notifications.end(); ++itNotify) diff --git a/linden/indra/newview/rlvextensions.cpp b/linden/indra/newview/rlvextensions.cpp index 6f79636..10d1c46 100644 --- a/linden/indra/newview/rlvextensions.cpp +++ b/linden/indra/newview/rlvextensions.cpp @@ -1,5 +1,6 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" +#include "llfloaterwindlight.h" #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llvoavatar.h" @@ -221,8 +222,18 @@ void RlvExtGetSet::onSetDebug(std::string strSetting, const std::string& strValu } } +// Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c std::string RlvExtGetSet::onGetEnv(std::string strSetting) { + // HACK: - create a LLFloaterWindLight instance if there isn't one already + // - isOpen() is actually instanceExists() + // - creating an instance results in showing the floater which is why we need to ->close() it + if (!LLFloaterWindLight::isOpen()) + { + LLFloaterWindLight::instance()->close(); + LLFloaterWindLight::instance()->syncMenu(); + } + LLWLParamManager* pWLParams = LLWLParamManager::instance(); F32 nValue = 0.0f; @@ -238,7 +249,7 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) else if ("cloudscale" == strSetting) nValue = pWLParams->mCloudScale; else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; - else if ("densitymultiplier" == strSetting) nValue = pWLParams->mDensityMult * 1000; + else if ("densitymultiplier" == strSetting) nValue = pWLParams->mDensityMult.x * pWLParams->mDensityMult.mult; else if ("distancemultiplier" == strSetting) nValue = pWLParams->mDistanceMult; else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; else if ("hazedensity" == strSetting) nValue = pWLParams->mHazeDensity.r; @@ -260,7 +271,7 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) { WLColorControl* pColour = NULL; - strSetting.erase(strSetting.length() - 2, 1); + strSetting.erase(strSetting.length() - 1, 1); if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; @@ -272,10 +283,10 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) if (pColour) { - if ('r' == ch) nValue = pColour->b; - else if ('g' == ch) nValue = pColour->b; + if ('r' == ch) nValue = pColour->r; + else if ('g' == ch) nValue = pColour->g; else if ('b' == ch) nValue = pColour->b; - else if (('i' == ch) && (pColour->hasSliderName)) nValue = pColour->i; + else if (('i' == ch) && (pColour->hasSliderName)) nValue = llmax(pColour->r, pColour->g, pColour->b); if (pColour->isBlueHorizonOrDensity) nValue /= 2.0f; else if (pColour->isSunOrAmbientColor) nValue /= 3.0f; @@ -286,8 +297,16 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) return llformat("%f", nValue); } +// Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) { + // HACK: see RlvExtGetSet::onGetEnv + if (!LLFloaterWindLight::isOpen()) + { + LLFloaterWindLight::instance()->close(); + LLFloaterWindLight::instance()->syncMenu(); + } + LLWLParamManager* pWLParams = LLWLParamManager::instance(); WLFloatControl* pFloat = NULL; WLColorControl* pColour = NULL; @@ -405,7 +424,7 @@ void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) { - strSetting.erase(strSetting.length() - 2, 1); + strSetting.erase(strSetting.length() - 1, 1); if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; 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 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" #include "lldrawpoolalpha.h" +#include "llfirstuse.h" #include "llfloaterbeacons.h" #include "llfloaterchat.h" #include "llfloaterdaycycle.h" @@ -96,7 +97,7 @@ static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, st boost_tokenizer::const_iterator itTok = tokens.begin(); // Extract and sanity check the first token (required) which is the channel - if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidChannel(nChannel)) ) + if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidReplyChannel(nChannel)) ) return false; // Second token (optional) is the filter @@ -284,6 +285,10 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe if (!fDetachable) { + #ifdef RLV_EXPERIMENTAL_FIRSTUSE + LLFirstUse::useRlvDetach(); + #endif // RLV_EXPERIMENTAL_FIRSTUSE + // NOTE: m_Attachments can contain duplicate pairs (ie @detach:spine=n,detach=n from an attachment on spine) m_Attachments.insert(std::pair(idxAttachPt, itObj->second.m_UUID)); return true; @@ -469,6 +474,10 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b } } break; + case RLV_TYPE_CLEAR: + fRet = processClearCommand(uuid, rlvCmd); + notifyBehaviourObservers(rlvCmd, !fFromObj); + break; case RLV_TYPE_FORCE: // Checked: fRet = processForceCommand(uuid, rlvCmd); break; @@ -476,32 +485,6 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b fRet = processReplyCommand(uuid, rlvCmd); break; case RLV_TYPE_UNKNOWN: // Checked: - { - if ("clear" == rlvCmd.getBehaviour()) - { - const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem; - - rlv_object_map_t::const_iterator itObj = m_Objects.find(uuid); - if (itObj != m_Objects.end()) // No sense in @clear'ing if we don't have any commands for this object - { - const RlvObject& rlvObj = itObj->second; bool fContinue = true; - for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd; - ((fContinue) && (itCmd != rlvObj.m_Commands.end())); ) - { - itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command - - const RlvCommand& rlvCmdRem = *itCurCmd; - if ( (strFilter.empty()) || (std::string::npos != rlvCmdRem.asString().find(strFilter)) ) - { - fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command - strCmdRem = rlvCmdRem.getBehaviour() + ":" + rlvCmdRem.getOption() + "=y"; - processCommand(uuid, strCmdRem, false); - } - } - fRet = TRUE; - } - } - } break; #ifdef LL_GNUC default: @@ -663,6 +646,13 @@ BOOL RlvHandler::processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false); } break; + case RLV_BHVR_FARTOUCH: + { + #ifdef RLV_EXPERIMENTAL_FIRSTUSE + LLFirstUse::useRlvFartouch(); + #endif // RLV_EXPERIMENTAL_FIRSTUSE + } + break; case RLV_BHVR_FLY: // @fly=n - Checked: 2009-07-05 (RLVa-1.0.0c) { // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()] @@ -900,6 +890,35 @@ BOOL RlvHandler::processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvC return TRUE; // Remove commands don't fail, doesn't matter what we return here } +BOOL RlvHandler::processClearCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) +{ + const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem; + + rlv_object_map_t::const_iterator itObj = m_Objects.find(idObj); + if (itObj != m_Objects.end()) // No sense in clearing if we don't have any commands for this object + { + const RlvObject& rlvObj = itObj->second; bool fContinue = true; + for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd; + ((fContinue) && (itCmd != rlvObj.m_Commands.end())); ) + { + itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command + + const RlvCommand& rlvCmdRem = *itCurCmd; strCmdRem = rlvCmdRem.asString(); + if ( (strFilter.empty()) || (std::string::npos != strCmdRem.find(strFilter)) ) + { + fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command + processCommand(idObj, strCmdRem.append("=y"), false); + } + } + } + + // Let our observers know about clear commands + RlvEvent rlvEvent(idObj, rlvCmd); + m_Emitter.update(&RlvObserver::onClearCommand, rlvEvent); + + return TRUE; // Don't fail clear commands even if the object didn't exist since it confuses people +} + BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const { const std::string& strOption = rlvCmd.getOption(); diff --git a/linden/indra/newview/rlvhandler.h b/linden/indra/newview/rlvhandler.h index 505bfd5..4470632 100644 --- a/linden/indra/newview/rlvhandler.h +++ b/linden/indra/newview/rlvhandler.h @@ -14,17 +14,11 @@ #include "rlvmultistringsearch.h" // ============================================================================ -/* - * RlvHandler - * ========== - * - */ typedef std::map rlv_object_map_t; typedef std::multimap rlv_detach_map_t; typedef std::map rlv_reattach_map_t; typedef std::multimap rlv_exception_map_t; -typedef std::map rlv_redir_map_t; class RlvHandler { @@ -195,6 +189,7 @@ public: protected: BOOL processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); BOOL processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); + BOOL processClearCommand(const LLUUID& idObj, const RlvCommand& rlvCmd); BOOL processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; BOOL processForceCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; @@ -235,7 +230,6 @@ protected: rlv_retained_list_t m_Retained; rlv_reattach_map_t m_AttachPending; rlv_reattach_map_t m_DetachPending; - rlv_redir_map_t m_Redirections; RlvGCTimer* m_pGCTimer; RlvWLSnapshot* m_pWLSnapshot; diff --git a/linden/indra/newview/rlvhelper.cpp b/linden/indra/newview/rlvhelper.cpp index 429a527..f495384 100644 --- a/linden/indra/newview/rlvhelper.cpp +++ b/linden/indra/newview/rlvhelper.cpp @@ -1,5 +1,6 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" +#include "llfloaterwindlight.h" #include "llviewerobject.h" #include "llviewerstats.h" #include "llviewerwindow.h" @@ -14,31 +15,33 @@ // Static variable initialization // -RlvMultiStringSearch RlvCommand::m_BhvrLookup; +RlvCommand::RlvBhvrTable RlvCommand::m_BhvrMap; // ============================================================================ +// RlvCommmand +// -// Checked: +// Checked: 2009-09-10 (RLVa-1.0.3a) | Modified: RLVa-1.0.3a RlvCommand::RlvCommand(const std::string& strCommand) : m_eBehaviour(RLV_BHVR_UNKNOWN), m_eParamType(RLV_TYPE_UNKNOWN) { if ((m_fValid = parseCommand(strCommand, m_strBehaviour, m_strOption, m_strParam))) { + S32 nTemp = 0; if ( ("n" == m_strParam) || ("add" == m_strParam) ) m_eParamType = RLV_TYPE_ADD; else if ( ("y" == m_strParam) || ("rem" == m_strParam) ) m_eParamType = RLV_TYPE_REMOVE; else if ("force" == m_strParam) m_eParamType = RLV_TYPE_FORCE; + else if (LLStringUtil::convertToS32(m_strParam, nTemp)) // Assume it's a reply command if we can convert to an S32 + m_eParamType = RLV_TYPE_REPLY; + else if (m_strBehaviour == "clear") // clear is the odd one out so just make it its own type + m_eParamType = RLV_TYPE_CLEAR; else { - m_eParamType = RLV_TYPE_REPLY; // Assume it's a reply command until we encounter a non-digit - - if ( (m_strParam.empty()) || (-1 != m_strParam.find_first_not_of("0123456789")) ) - { - m_eParamType = RLV_TYPE_UNKNOWN; - m_fValid = ("clear" == m_strBehaviour); - } + m_eParamType = RLV_TYPE_UNKNOWN; + m_fValid = false; } } @@ -48,50 +51,16 @@ RlvCommand::RlvCommand(const std::string& strCommand) return; } - U16 nBehaviour; - if (m_BhvrLookup.getExactMatchParam(m_strBehaviour, nBehaviour)) - { - m_eBehaviour = (ERlvBehaviour)nBehaviour; - } + RlvBhvrTable::const_iterator itBhvr = m_BhvrMap.find(m_strBehaviour); + if (itBhvr != m_BhvrMap.end()) + m_eBehaviour = itBhvr->second; } -RlvCommand::RlvCommand(const RlvCommand& rlvCmd) - : m_fValid(rlvCmd.m_fValid), - m_strBehaviour(rlvCmd.m_strBehaviour), m_eBehaviour(rlvCmd.m_eBehaviour), - m_strOption(rlvCmd.m_strOption), - m_strParam(rlvCmd.m_strParam), m_eParamType(rlvCmd.m_eParamType) -{ -} -// ============================================================================ - -/* - * ------------------------------ - * Command | RLV | RLVa - * ------------------------------ - * : | F | F (missing behaviour) - * :option | F | F (missing behaviour) - * := | T | F (missing behaviour) - * :option= | T | F (missing behaviour) - * :option=param | T | F (missing behaviour) - * = | T | F (missing behaviour) - * =param | T | F (missing behaviour) - * cmd | F | F (missing param) [T if == "clear"] - * cmd: | F | F (missing param) - * cmd:option | F | F (missing param) - * cmd:= | T | F (missing param) [1] - * cmd:option= | T | F (missing param) [1] - * cmd= | T | F (missing param) [1] - * cmd:option=param | T | T - * cmd=param | T | T - * cmd:=param | T | T - * - * [1] 'clear:=', 'clear:option=' and 'clear=' are "valid" variations of 'clear' - */ - -BOOL RlvCommand::parseCommand(/*[in]*/ const std::string& strCommand, - /*[out]*/ std::string& strBehaviour, /*[out]*/ std::string& strOption, /*[out]*/ std::string& strParam) +bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam) { + // (See behaviour notes for the command parsing truth table) + // Format: [: