#include "llviewerprecompiledheaders.h" #include "llagent.h" #include "llfloaterwindlight.h" #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llvoavatar.h" #include "llwlparammanager.h" #include "rlvextensions.h" #include "rlvhandler.h" // ============================================================================ std::map RlvExtGetSet::m_DbgAllowed; // Checked: 2009-06-03 (RLVa-0.2.0h) | Modified: RLVa-0.2.0h RlvExtGetSet::RlvExtGetSet() { if (!m_DbgAllowed.size()) // m_DbgAllowed is static and should only be initialized once { m_DbgAllowed.insert(std::pair("AvatarSex", DBG_READ | DBG_PSEUDO)); m_DbgAllowed.insert(std::pair("RenderResolutionDivisor", DBG_READ | DBG_WRITE)); #ifdef RLV_EXTENSION_CMD_GETSETDEBUG_EX m_DbgAllowed.insert(std::pair(RLV_SETTING_FORBIDGIVETORLV, DBG_READ)); m_DbgAllowed.insert(std::pair(RLV_SETTING_NOSETENV, DBG_READ)); m_DbgAllowed.insert(std::pair("WindLightUseAtmosShaders", DBG_READ)); #endif // RLV_EXTENSION_CMD_GETSETDEBUG_EX // Cache persistance of every setting LLControlVariable* pSetting; for (std::map::iterator itDbg = m_DbgAllowed.begin(); itDbg != m_DbgAllowed.end(); ++itDbg) { if ( ((pSetting = gSavedSettings.getControl(itDbg->first)) != NULL) && (pSetting->isPersisted()) ) itDbg->second |= DBG_PERSIST; } } } // Checked: 2009-05-17 (RLVa-0.2.0a) BOOL RlvExtGetSet::onForceCommand(const RlvEvent& rlvEvent) { return processCommand(rlvEvent.getSenderID(), rlvEvent.getCommand()); } // Checked: 2009-05-17 (RLVa-0.2.0a) BOOL RlvExtGetSet::onReplyCommand(const EventType& rlvEvent) { return processCommand(rlvEvent.getSenderID(), rlvEvent.getCommand()); } // Checked: 2009-06-18 (RLVa-0.2.1d) | Modified: RLVa-0.2.1d BOOL RlvExtGetSet::processCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) { std::string strBehaviour = rlvCmd.getBehaviour(), strGetSet, strSetting; int idxSetting = strBehaviour.find('_'); if ( (strBehaviour.length() >= 6) && (-1 != idxSetting) && ((int)strBehaviour.length() > idxSetting + 1) ) { strSetting = strBehaviour.substr(idxSetting + 1); strBehaviour.erase(idxSetting); // Get rid of "_" strGetSet = strBehaviour.substr(0, 3); strBehaviour.erase(0, 3); // Get rid of get/set if ("debug" == strBehaviour) { if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) { rlvSendChatReply(rlvCmd.getParam(), onGetDebug(strSetting)); return TRUE; } else if ( ("set" == strGetSet) && (RLV_TYPE_FORCE == rlvCmd.getParamType()) ) { if (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETDEBUG, idObj)) onSetDebug(strSetting, rlvCmd.getOption()); return TRUE; } } else if ("env" == strBehaviour) { if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) { rlvSendChatReply(rlvCmd.getParam(), onGetEnv(strSetting)); return TRUE; } else if ( ("set" == strGetSet) && (RLV_TYPE_FORCE == rlvCmd.getParamType()) ) { if (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETENV, idObj)) onSetEnv(strSetting, rlvCmd.getOption()); return TRUE; } } } else if ("setrot" == rlvCmd.getBehaviour()) { // NOTE: if