Code review: RLVa extensions are no longer optional features

-> @accepttprequest will auto-accept all incoming teleport requests (allows exceptions - see @accepttp)
  -> @allowidle (stays experimental - subject to change)
  -> @getcommand:<filter> can be used to discover which commands are part of the user's RLVa implementation (with user-defined separator)
  -> @findfolders:<filter> works like @findfolder but will return all matches (with user-defined separator)
  -> @getdebug:<setting> can be used to query (but not set) the "RestrainedLoveforbidGiveToRLV", "RestrainedLoveNoSetEnv" and "WindLightUseAtmosShaders" debug settings
  -> @interact will block world interaction but allows drag-drop, the camera tool, mouse steering and access to the "self" context menu
  -> @sharedwear is the counterpart of @unsharedwear and wear locks the shared #RLV folder
  -> @sharedunwear is the counterpart of @unsharedunwear and remove locks the shared #RLV folder
  -> @touchhud will prevent the user from touching/clicking on their HUD attachments (allows exceptions)
  -> @tprequest will prevent the user from requesting teleports (allows exceptions - see @tplure)
  -> force wear commands will activate/deactivate gestures as well
  -> force wear commands will collect from folder links as well
  -> [FIXED] Location on incoming teleport requests isn't censored when @showloc restricted
  -> [FIXED] Message on outgoing teleport offers isn't censored when @startim restricted
  -> [FIXED] Message on outgoing teleport requests isn't censored when @sendim or @startim restricted

--HG--
branch : RLVa
master
Kitty Barnett 2016-04-10 14:07:23 +02:00
parent 1f8896ff69
commit 75e217b82e
22 changed files with 75 additions and 148 deletions

View File

@ -2455,15 +2455,11 @@ void LLAgent::onAnimStop(const LLUUID& id)
}
else if (id == ANIM_AGENT_AWAY)
{
// clearAFK();
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g
#ifdef RLV_EXTENSION_CMD_ALLOWIDLE
if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE))
clearAFK();
#else
clearAFK();
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
// [/RLVa:KB]
// clearAFK();
}
else if (id == ANIM_AGENT_STANDUP)
{

View File

@ -491,15 +491,11 @@ void idle_afk_check()
{
// check idle timers
F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32();
// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout");
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
#ifdef RLV_EXTENSION_CMD_ALLOWIDLE
// Enforce an idle time of 30 minutes if @allowidle=n restricted
F32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? gSavedSettings.getS32("AFKTimeout") : 60 * 30;
#else
F32 afk_timeout = gSavedSettings.getS32("AFKTimeout");
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
// [/RLVa:KB]
// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout");
if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK())
{
LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;

View File

@ -208,7 +208,7 @@ void LLAvatarActions::startIM(const LLUUID& id)
return;
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
if ( (!RlvActions::canStartIM(id)) && (!RlvActions::hasOpenP2PSession(id)) )
if (!RlvActions::canStartIM(id))
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString()));
@ -253,7 +253,7 @@ void LLAvatarActions::startCall(const LLUUID& id)
}
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
if ( (!RlvActions::canStartIM(id)) && (!RlvActions::hasOpenP2PSession(id)) )
if (!RlvActions::canStartIM(id))
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString()));
@ -460,6 +460,17 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
{
LLMessageSystem* msg = gMessageSystem;
// [RLVa:KB] - Checked: RLVa-2.0.0
const LLUUID idRecipient = notification["substitutions"]["uuid"];
std::string strMessage = response["message"];
// Filter the request message if the recipients is IM-blocked
if ( (!RlvActions::isRlvEnabled()) || ((RlvActions::canStartIM(idRecipient)) && (RlvActions::canSendIM(idRecipient))) )
{
strMessage = RlvStrings::getString(RLV_STRING_HIDDEN);
}
// [/RLVa:KB]
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@ -477,7 +488,10 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, response["message"]);
// [RLVa:KB] - Checked: RLVa-2.0.0
msg->addStringFast(_PREHASH_Message, strMessage);
// [/RLVa:KB]
// msg->addStringFast(_PREHASH_Message, response["message"]);
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());

View File

@ -212,7 +212,7 @@ void LLGroupActions::startCall(const LLUUID& group_id)
}
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) )
if (!RlvActions::canStartIM(group_id))
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString()));
@ -452,7 +452,7 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id)
if (group_id.isNull()) return LLUUID::null;
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) )
if (!RlvActions::canStartIM(group_id))
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString()));

View File

@ -5548,7 +5548,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act
}
// [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9)
if ( (!RlvActions::canStartIM(item->getCreatorUUID())) && (!RlvActions::hasOpenP2PSession(item->getCreatorUUID())) )
if (!RlvActions::canStartIM(item->getCreatorUUID()))
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", item->getCreatorUUID(), "completename").getSLURLString()));

View File

@ -97,7 +97,7 @@ bool LLAlertHandler::processNotification(const LLNotificationPtr& notification)
// - LLHandlerUtil::logToIMP2P() below will still be called with to_file_only == false
// - LLHandlerUtil::logToIM() will eventually be called as a result and without an open IM session it will log the
// same message as it would for an open session whereas to_file_only == true would take a different code path
if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) )
if (RlvActions::canStartIM(from_id))
{
// [/RLVa:KB]
// firstly create session...

View File

@ -113,7 +113,7 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
// Don't spawn an IM session for non-chat related events
if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) )
if (RlvActions::canStartIM(from_id))
{
// [/RLVa:KB]
LLHandlerUtil::spawnIMSession(name, from_id);

View File

@ -4305,7 +4305,7 @@ void LLSelectMgr::convertTransient()
void LLSelectMgr::deselectAllIfTooFar()
{
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
// [RLVa:KB] - Checked: RLVa-1.3.0
if ( (!mSelectedObjects->isEmpty()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ))) )
{
struct NotTransientOrFocusedMediaOrEditable : public LLSelectedNodeFunctor
@ -4313,8 +4313,7 @@ void LLSelectMgr::deselectAllIfTooFar()
bool apply(LLSelectNode* pNode)
{
const LLViewerObject* pObj = pNode->getObject();
return (!pNode->isTransient()) && (pObj) && (!gRlvHandler.canEdit(pObj)) &&
(pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID());
return (!pNode->isTransient()) && (pObj) && (!gRlvHandler.canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID());
}
} f;
if (mSelectedObjects->getFirstRootNode(&f, TRUE))
@ -4327,15 +4326,13 @@ void LLSelectMgr::deselectAllIfTooFar()
return;
}
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.1.0l
#ifdef RLV_EXTENSION_CMD_INTERACT
// [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact=n restricted
// [RLVa:KB] - Checked: RLVa-1.2.0
// [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact restricted
if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))
{
deselectAll();
return;
}
#endif // RLV_EXTENSION_CMD_INTERACT
// [/RLVa:KB]
// HACK: Don't deselect when we're navigating to rate an object's

View File

@ -1006,11 +1006,7 @@ bool idle_startup()
// All accounts have both a home and a last location, and we don't support
// more locations than that. Choose the appropriate one. JC
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d
#ifndef RLV_EXTENSION_STARTLOCATION
if (rlv_handler_t::isEnabled())
#else
if ( (rlv_handler_t::isEnabled()) && (RlvSettings::getLoginLastLocation()) )
#endif // RLV_EXTENSION_STARTLOCATION
{
// Force login at the last location
LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST));

View File

@ -1271,14 +1271,17 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask)
{
if (!LLUI::sSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE;
if (!mHoverPick.isValid()) return TRUE;
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
#ifdef RLV_EXTENSION_CMD_INTERACT
if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) return TRUE;
#endif // RLV_EXTENSION_CMD_INTERACT
// [/RLVa:KB]
LLViewerObject* hover_object = mHoverPick.getObject();
// [RLVa:KB] - Checked: RLVa-1.2.0
// NOTE: handleTooltipObject() will block HUD tooltips anyway but technically interact should only interfere with world interaction
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (hover_object) && (!hover_object->isHUDAttachment()) )
{
return TRUE;
}
// [/RLVa:KB]
// update hover object and hover parcel
LLSelectMgr::getInstance()->setHoverObject(hover_object, mHoverPick.mObjectFace);

View File

@ -3244,7 +3244,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_LURE_USER:
case IM_TELEPORT_REQUEST:
{
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
// [RLVa:KB] - Checked: RLVa-1.4.9
// If we auto-accept the offer/request then this will override DnD status (but we'll still let the other party know later)
bool fRlvAutoAccept = (rlv_handler_t::isEnabled()) &&
( ((IM_LURE_USER == dialog) && (RlvActions::autoAcceptTeleportOffer(from_id))) ||
@ -3256,7 +3256,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
return;
}
// else if (is_do_not_disturb)
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
// [RLVa:KB] - Checked: RLVa-1.4.9
else if ( (is_do_not_disturb) && (!fRlvAutoAccept) )
// [/RLVa:KB]
{
@ -3321,7 +3321,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
}
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
// [RLVa:KB] - Checked: RLVa-1.4.9
if (rlv_handler_t::isEnabled())
{
if ( ((IM_LURE_USER == dialog) && (!RlvActions::canAcceptTpOffer(from_id))) ||
@ -3333,8 +3333,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
return;
}
// Censor lure message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer and @showloc=n restricted
if ( (!RlvActions::canReceiveIM(from_id)) || ((IM_LURE_USER == dialog) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) )
// Censor message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer/request and @showloc=n restricted
if ( (!RlvActions::canReceiveIM(from_id)) ||
((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (IM_LURE_USER == dialog || IM_TELEPORT_REQUEST == dialog)) )
{
message = RlvStrings::getString(RLV_STRING_HIDDEN);
}
@ -3390,8 +3391,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
params.substitutions = args;
params.payload = payload;
// [RLVa:KB] - Checked: 20103-11-08 (RLVa-1.4.9)
if ( (rlv_handler_t::isEnabled()) && (fRlvAutoAccept) )
// [RLVa:KB] - Checked: RLVa-1.4.9
if (fRlvAutoAccept)
{
if (IM_LURE_USER == dialog)
gRlvHandler.setCanCancelTp(false);
@ -7539,20 +7540,14 @@ void send_lures(const LLSD& notification, const LLSD& response)
LLAgentUI::buildSLURL(slurl);
text.append("\r\n").append(slurl.getSLURLString());
// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0)
if ( (RlvActions::hasBehaviour(RLV_BHVR_SENDIM)) || (RlvActions::hasBehaviour(RLV_BHVR_SENDIMTO)) )
{
// Filter the lure message if one of the recipients of the lure can't be sent an IM to
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray(); ++it)
{
if (!RlvActions::canSendIM(it->asUUID()))
{
text = RlvStrings::getString(RLV_STRING_HIDDEN);
break;
}
}
}
// [RLVa:KB] - Checked: RLVa-2.0.0
// Filter the lure message if any of the recipients are IM-blocked
const LLSD& sdRecipients = notification["payload"]["ids"];
if ( (gRlvHandler.isEnabled()) &&
(std::any_of(sdRecipients.beginArray(), sdRecipients.endArray(), [](const LLSD& id) { return !RlvActions::canStartIM(id.asUUID()) || !RlvActions::canSendIM(id.asUUID()); })) )
{
text = RlvStrings::getString(RLV_STRING_HIDDEN);
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;

View File

@ -4049,8 +4049,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
}
}
// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l
#ifdef RLV_EXTENSION_CMD_INTERACT
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (rlv_handler_t::isEnabled()) && (found) && (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) )
{
// Allow picking if:
@ -4059,14 +4058,13 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
// - the pie tool is active *and* we picked our own avie (allows "mouse steering" and the self pie menu)
LLTool* pCurTool = LLToolMgr::getInstance()->getCurrentTool();
if ( (LLToolDragAndDrop::getInstance() != pCurTool) &&
(!LLToolCamera::getInstance()->hasMouseCapture()) &&
((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) )
(!LLToolCamera::getInstance()->hasMouseCapture()) &&
((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) )
{
found = NULL;
}
#endif // RLV_EXTENSION_CMD_INTERACT
// [/RLVa:KB]
}
// [/RLVa:KB]
}
return found;

View File

@ -50,41 +50,38 @@ bool RlvActions::canSendIM(const LLUUID& idRecipient)
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) || (!gRlvHandler.isException(RLV_BHVR_SENDIMTO, idRecipient)) ) );
}
// Checked: 2011-04-12 (RLVa-1.3.0)
bool RlvActions::canStartIM(const LLUUID& idRecipient)
{
// User can start an IM session with "recipient" (could be an agent or a group) if:
// - not generally restricted from starting IM sessions (or the recipient is an exception)
// - not specifically restricted from starting an IM session with the recipient
// - the session already exists
return
(!rlv_handler_t::isEnabled()) ||
( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIM)) || (gRlvHandler.isException(RLV_BHVR_STARTIM, idRecipient)) ) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) );
( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) ) ||
( (hasOpenP2PSession(idRecipient)) || (hasOpenGroupSession(idRecipient)) );
}
// ============================================================================
// Movement
//
// Checked: 2010-12-11 (RLVa-1.2.2)
bool RlvActions::canAcceptTpOffer(const LLUUID& idSender)
{
return ((!gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) || (gRlvHandler.isException(RLV_BHVR_TPLURE, idSender))) && (canStand());
}
// Checked: 2013-11-08 (RLVa-1.4.9)
bool RlvActions::autoAcceptTeleportOffer(const LLUUID& idSender)
{
return ((idSender.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, idSender))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP));
}
// Checked: 2013-11-08 (RLVa-1.4.9)
bool RlvActions::canAcceptTpRequest(const LLUUID& idSender)
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_TPREQUEST)) || (gRlvHandler.isException(RLV_BHVR_TPREQUEST, idSender));
}
// Checked: 2013-11-08 (RLVa-1.4.9)
bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester)
{
return ((idRequester.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTPREQUEST, idRequester))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTPREQUEST));

View File

@ -40,9 +40,9 @@ public:
static bool canSendIM(const LLUUID& idRecipient);
/*
* Returns true if the user is allowed to start a - P2P or group - conversation with the specified UUID.
* Returns true if the user is allowed to start a - P2P or group - conversation with the specified UUID (or if the session already exists)
*/
static bool canStartIM(const LLUUID& idRecipient); // @startim and @startimto
static bool canStartIM(const LLUUID& idRecipient);
/*
* Returns true if an avatar's name should be hidden for the requested operation/context

View File

@ -96,11 +96,9 @@ void RlvSettings::initClass()
if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS))
gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags));
#ifdef RLV_EXTENSION_STARTLOCATION
// Don't allow toggling RLVaLoginLastLocation from the debug settings floater
if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION))
gSavedPerAccountSettings.getControl(RLV_SETTING_LOGINLASTLOCATION)->setHiddenFromSettingsEditor(true);
#endif // RLV_EXTENSION_STARTLOCATION
if (gSavedSettings.controlExists(RLV_SETTING_TOPLEVELMENU))
gSavedSettings.getControl(RLV_SETTING_TOPLEVELMENU)->getSignal()->connect(boost::bind(&onChangedMenuLevel));
@ -109,21 +107,19 @@ void RlvSettings::initClass()
}
}
#ifdef RLV_EXTENSION_STARTLOCATION
// Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d
void RlvSettings::updateLoginLastLocation()
// Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d
void RlvSettings::updateLoginLastLocation()
{
if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) )
{
if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) )
BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand());
if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue)
{
BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand());
if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue)
{
gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue);
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
}
gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue);
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
}
}
#endif // RLV_EXTENSION_STARTLOCATION
}
// Checked: 2011-08-16 (RLVa-1.4.0b) | Added: RLVa-1.4.0b
bool RlvSettings::onChangedMenuLevel()

View File

@ -98,10 +98,8 @@ public:
static bool getSharedInvAutoRename() { return rlvGetSetting<bool>(RLV_SETTING_SHAREDINVAUTORENAME, true); }
static bool getShowNameTags() { return fShowNameTags; }
#ifdef RLV_EXTENSION_STARTLOCATION
static bool getLoginLastLocation() { return rlvGetPerUserSetting<bool>(RLV_SETTING_LOGINLASTLOCATION, true); }
static void updateLoginLastLocation();
#endif // RLV_EXTENSION_STARTLOCATION
static void initClass();
static void onChangedSettingMain(const LLSD& sdValue);

View File

@ -17,40 +17,6 @@
#ifndef RLV_DEFINES_H
#define RLV_DEFINES_H
// ============================================================================
// Extensions
//
// Extensions
#define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx
#define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders:<option>=<channel> - @findfolder with multiple results
#define RLV_EXTENSION_FORCEWEAR_GESTURES // @attach*/detach* commands also (de)activate gestures
#define RLV_EXTENSION_STARTLOCATION // Reenables "Start Location" at login if not @tploc=n or @unsit=n restricted at last logoff
#define RLV_EXPERIMENTAL // Enables/disables experimental features en masse
#define RLV_EXPERIMENTAL_CMDS // Enables/disables experimental commands en masse
// Experimental features
#ifdef RLV_EXPERIMENTAL
// Stable (will mature to RLV_EXTENSION_XXX in next release if no bugs are found)
// Under testing (stable, but requires further testing - safe for public release but may be quirky)
#define RLV_EXTENSION_FORCEWEAR_FOLDERLINKS // @attach*/detach* commands will collect from folder links as well
// Under development (don't include in public release)
#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
// #define RLV_EXPERIMENTAL_COMPOSITEFOLDERS
#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
#endif // RLV_EXPERIMENTAL
// Experimental commands (not part of the RLV API spec, disabled on public releases)
#ifdef RLV_EXPERIMENTAL_CMDS
#define RLV_EXTENSION_CMD_ALLOWIDLE // Forces "Away" status when idle (effect is the same as setting AllowIdleAFK to TRUE)
#define RLV_EXTENSION_CMD_GETCOMMAND // @getcommand:<option>=<channel>
#define RLV_EXTENSION_CMD_GETXXXNAMES // @get[add|rem]attachnames:<option>=<channel> and @get[add|rem]outfitnames=<channel>
#define RLV_EXTENSION_CMD_INTERACT // @interact=n
#define RLV_EXTENSION_CMD_TOUCHXXX // @touch:uuid=n|y, @touchworld[:<uuid>]=n|y, @touchattach[:<uuid>]=n|y, @touchud[:<uuid>]=n|y
#endif // RLV_EXPERIMENTAL_CMDS
// ============================================================================
// Defines
//

View File

@ -385,11 +385,9 @@ RlvExtGetSet::RlvExtGetSet()
{
m_DbgAllowed.insert(std::pair<std::string, S16>("AvatarSex", DBG_READ | DBG_WRITE | DBG_PSEUDO));
m_DbgAllowed.insert(std::pair<std::string, S16>("RenderResolutionDivisor", DBG_READ | DBG_WRITE));
#ifdef RLV_EXTENSION_CMD_GETSETDEBUG_EX
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_FORBIDGIVETORLV, DBG_READ));
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_NOSETENV, DBG_READ));
m_DbgAllowed.insert(std::pair<std::string, S16>("WindLightUseAtmosShaders", DBG_READ));
#endif // RLV_EXTENSION_CMD_GETSETDEBUG_EX
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_FORBIDGIVETORLV, DBG_READ));
m_DbgAllowed.insert(std::pair<std::string, S16>(RLV_SETTING_NOSETENV, DBG_READ));
m_DbgAllowed.insert(std::pair<std::string, S16>("WindLightUseAtmosShaders", DBG_READ));
// Cache persistance of every setting
LLControlVariable* pSetting;

View File

@ -474,12 +474,10 @@ bool RlvHandler::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD&
// Checked: 2010-08-29 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c
void RlvHandler::onSitOrStand(bool fSitting)
{
#ifdef RLV_EXTENSION_STARTLOCATION
if (rlv_handler_t::isEnabled())
{
RlvSettings::updateLoginLastLocation();
}
#endif // RLV_EXTENSION_STARTLOCATION
if ( (hasBehaviour(RLV_BHVR_STANDTP)) && (!fSitting) && (!m_posSitSource.isExactlyZero()) )
{
@ -668,10 +666,7 @@ void RlvHandler::onLoginComplete()
{
RlvInventory::instance().fetchWornItems();
RlvInventory::instance().fetchSharedInventory();
#ifdef RLV_EXTENSION_STARTLOCATION
RlvSettings::updateLoginLastLocation();
#endif // RLV_EXTENSION_STARTLOCATION
LLViewerParcelMgr::getInstance()->setTeleportFailedCallback(boost::bind(&RlvHandler::onTeleportFailed, this));
LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&RlvHandler::onTeleportFinished, this, _1));
@ -739,13 +734,11 @@ bool RlvHandler::canTouch(const LLViewerObject* pObj, const LLVector3& posOffset
((!hasBehaviour(RLV_BHVR_TOUCHATTACH)) || (isException(RLV_BHVR_TOUCHATTACH, idRoot, RLV_CHECK_PERMISSIVE))) &&
((!hasBehaviour(RLV_BHVR_TOUCHATTACHSELF)) || (isException(RLV_BHVR_TOUCHATTACH, idRoot, RLV_CHECK_PERMISSIVE)));
}
#ifdef RLV_EXTENSION_CMD_TOUCHXXX
else
{
// HUD attachment
fCanTouch = (!hasBehaviour(RLV_BHVR_TOUCHHUD)) || (isException(RLV_BHVR_TOUCHHUD, idRoot, RLV_CHECK_PERMISSIVE));
}
#endif // RLV_EXTENSION_CMD_TOUCHXXX
}
if ( (!fCanTouch) && (hasBehaviour(RLV_BHVR_TOUCHME)) )
fCanTouch = hasBehaviourRoot(idRoot, RLV_BHVR_TOUCHME);
@ -1849,27 +1842,21 @@ ERlvCmdRet RlvHandler::processReplyCommand(const RlvCommand& rlvCmd) const
case RLV_BHVR_GETATTACH: // @getattach[:<layer>]=<channel>
eRet = onGetAttach(rlvCmd, strReply);
break;
#ifdef RLV_EXTENSION_CMD_GETXXXNAMES
case RLV_BHVR_GETATTACHNAMES: // @getattachnames[:<grp>]=<channel>
case RLV_BHVR_GETADDATTACHNAMES:// @getaddattachnames[:<grp>]=<channel>
case RLV_BHVR_GETREMATTACHNAMES:// @getremattachnames[:<grp>]=<channel>
eRet = onGetAttachNames(rlvCmd, strReply);
break;
#endif // RLV_EXTENSION_CMD_GETXXXNAMES
case RLV_BHVR_GETOUTFIT: // @getoutfit[:<layer>]=<channel>
eRet = onGetOutfit(rlvCmd, strReply);
break;
#ifdef RLV_EXTENSION_CMD_GETXXXNAMES
case RLV_BHVR_GETOUTFITNAMES: // @getoutfitnames=<channel>
case RLV_BHVR_GETADDOUTFITNAMES:// @getaddoutfitnames=<channel>
case RLV_BHVR_GETREMOUTFITNAMES:// @getremoutfitnames=<channel>
eRet = onGetOutfitNames(rlvCmd, strReply);
break;
#endif // RLV_EXTENSION_CMD_GETXXXNAMES
case RLV_BHVR_FINDFOLDER: // @findfolder:<criteria>=<channel>
#ifdef RLV_EXTENSION_CMD_FINDFOLDERS
case RLV_BHVR_FINDFOLDERS: // @findfolders:<criteria>=<channel>
#endif // RLV_EXTENSION_CMD_FINDFOLDERS
eRet = onFindFolder(rlvCmd, strReply);
break;
case RLV_BHVR_GETPATH: // @getpath[:<option>]=<channel>
@ -1898,7 +1885,6 @@ ERlvCmdRet RlvHandler::processReplyCommand(const RlvCommand& rlvCmd) const
strReply = idSitObj.asString();
}
break;
#ifdef RLV_EXTENSION_CMD_GETCOMMAND
case RLV_BHVR_GETCOMMAND: // @getcommand:<option>=<channel> - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
{
std::list<std::string> cmdList;
@ -1907,7 +1893,6 @@ ERlvCmdRet RlvHandler::processReplyCommand(const RlvCommand& rlvCmd) const
strReply.append("/").append(*itCmd);
}
break;
#endif // RLV_EXTENSION_CMD_GETCOMMAND
case RLV_BHVR_GETSTATUS: // @getstatus - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.1.0f
{
std::string strFilter, strSeparator;

View File

@ -170,7 +170,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourInfo("getaddoutfitnames", RLV_BHVR_GETADDOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvBehaviourInfo("getattach", RLV_BHVR_GETATTACH, RLV_TYPE_REPLY));
addEntry(new RlvBehaviourInfo("getattachnames", RLV_BHVR_GETATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvBehaviourInfo("getcommand", RLV_BHVR_GETCOMMAND, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL));
addEntry(new RlvBehaviourInfo("getcommand", RLV_BHVR_GETCOMMAND, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXTENDED));
addEntry(new RlvBehaviourInfo("getgroup", RLV_BHVR_GETGROUP, RLV_TYPE_REPLY));
addEntry(new RlvBehaviourInfo("getinv", RLV_BHVR_GETINV, RLV_TYPE_REPLY));
addEntry(new RlvBehaviourInfo("getinvworn", RLV_BHVR_GETINVWORN, RLV_TYPE_REPLY));
@ -778,7 +778,6 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc
}
break;
#ifdef RLV_EXTENSION_FORCEWEAR_GESTURES
case LLAssetType::AT_GESTURE:
if (isWearAction(eAction))
{
@ -791,7 +790,6 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc
m_remGestures.push_back(pRlvItem);
}
break;
#endif // RLV_EXTENSION_FORCEWEAR_GESTURES
default:
break;

View File

@ -809,12 +809,9 @@ bool RlvWearableItemCollector::onCollectItem(const LLInventoryItem* pItem)
(m_Folded.end() != std::find(m_Folded.begin(), m_Folded.end(), idParent)) ) &&
( (!fAttach) || (RlvAttachPtLookup::hasAttachPointName(pItem)) || (RlvSettings::getEnableSharedWear()) );
break;
#ifdef RLV_EXTENSION_FORCEWEAR_GESTURES
case LLAssetType::AT_GESTURE:
fRet = (m_Wearable.end() != std::find(m_Wearable.begin(), m_Wearable.end(), idParent));
break;
#endif // RLV_EXTENSION_FORCEWEAR_GESTURES
#ifdef RLV_EXTENSION_FORCEWEAR_FOLDERLINKS
case LLAssetType::AT_CATEGORY:
if (LLAssetType::AT_LINK_FOLDER == pItem->getActualType())
{
@ -831,7 +828,6 @@ bool RlvWearableItemCollector::onCollectItem(const LLInventoryItem* pItem)
}
}
break;
#endif // RLV_EXTENSION_FORCEWEAR_FOLDERLINKS
default:
break;
}

View File

@ -85,10 +85,8 @@ RlvUIEnabler::RlvUIEnabler()
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLM, boost::bind(&RlvUIEnabler::onToggleTp, this)));
// onUpdateLoginLastLocation
#ifdef RLV_EXTENSION_STARTLOCATION
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLOC, boost::bind(&RlvUIEnabler::onUpdateLoginLastLocation, this, _1)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onUpdateLoginLastLocation, this, _1)));
#endif // RLV_EXTENSION_STARTLOCATION
}
// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a