diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/llcommon/llchat.h linden/indra/llcommon/llchat.h --- linden/indra/llcommon/llchat.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/llcommon/llchat.h 2009-08-07 19:30:24.828125000 +0200 @@ -70,10 +70,14 @@ public: LLChat(const std::string& text = LLStringUtil::null) : mText(text), mFromName(), mFromID(), +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + mRlvLocFiltered(FALSE), + mRlvNamesFiltered(FALSE), +// [/RLVa:KB] mSourceType(CHAT_SOURCE_AGENT), mChatType(CHAT_TYPE_NORMAL), mAudible(CHAT_AUDIBLE_FULLY), mMuted(FALSE), mTime(0.0), @@ -81,10 +85,14 @@ { } std::string mText; // UTF-8 line of text std::string mFromName; // agent or object name LLUUID mFromID; // agent id or object id +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + BOOL mRlvLocFiltered; + BOOL mRlvNamesFiltered; +// [/RLVa:KB] EChatSourceType mSourceType; EChatType mChatType; EChatAudible mAudible; BOOL mMuted; // pass muted chat to maintain list of chatters F64 mTime; // viewer only, seconds from viewer start diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/CMakeLists.txt linden/indra/newview/CMakeLists.txt --- linden/indra/newview/CMakeLists.txt 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/CMakeLists.txt 2009-08-07 19:30:24.859375000 +0200 @@ -429,10 +429,15 @@ llworldmap.cpp llworldmapview.cpp llxmlrpctransaction.cpp noise.cpp pipeline.cpp + rlvhandler.cpp + rlvhelper.cpp + rlvmultistringsearch.cpp + rlvextensions.cpp + rlvfloaterbehaviour.cpp ) set(VIEWER_BINARY_NAME "secondlife-bin" CACHE STRING "The name of the viewer executable to create.") @@ -832,10 +837,16 @@ noise.h pipeline.h randgauss.h VertexCache.h VorbisFramework.h + rlvevent.h + rlvhandler.h + rlvhelper.h + rlvmultistringsearch.h + rlvextensions.h + rlvfloaterbehaviour.h ) source_group("CMake Rules" FILES ViewerInstall.cmake) if (DARWIN) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/app_settings/settings.xml linden/indra/newview/app_settings/settings.xml --- linden/indra/newview/app_settings/settings.xml 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/app_settings/settings.xml 2009-08-13 12:32:20.656250000 +0200 @@ -1,9 +1,108 @@ - AFKTimeout + RestrainedLife + + Comment + Toggles the RestrainedLife features (BDSM lockable toys support). Needs a restart of the viewer. + Persist + 1 + Type + Boolean + Value + 0 + + RestrainedLifeDebug + + Comment + Toggles the RestrainedLife debug mode (displays the commands when in debug mode). + Persist + 1 + Type + Boolean + Value + 0 + + RestrainedLifeNoSetEnv + + Comment + When TRUE, forbids to set the environment (time of day and Windlight settings) via RestrainedLife. Needs a restart of the viewer. + Persist + 1 + Type + Boolean + Value + 0 + + RestrainedLifeForbidGiveToRLV + + Comment + When FALSE, allows to give sub-folders to the #RLV RestrainedLife folder. + Persist + 1 + Type + Boolean + Value + 1 + + RLVaEnableLegacyNaming + + Comment + Enables legacy naming convention for folders + Persist + 1 + Type + Boolean + Value + 1 + + RLVaEnableWear + + Comment + When TRUE, enables the "Wear" option on the inventory item context menu for attachments. + Persist + 1 + Type + Boolean + Value + 0 + + RLVaHideLockedLayers + + Comment + When TRUE, hides worn but "remove outfit" restricted clothing layers from @getoufit + Persist + 1 + Type + Boolean + Value + 0 + + RLVaHideLockedAttachments + + Comment + When TRUE, hides worn but "no detach" restricted attachments from @getattach + Persist + 1 + Type + Boolean + Value + 0 + + RLVaShowNameTags + + Comment + Display of names above avatars is subject to the general "Show Names" setting when @shownames=n restricted + Persist + 1 + Type + Boolean + Value + 0 + + AFKTimeout Comment Time before automatically setting AFK (away from keyboard) mode (seconds) Persist 1 diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/app_settings/settings_per_account.xml linden/indra/newview/app_settings/settings_per_account.xml --- linden/indra/newview/app_settings/settings_per_account.xml 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/app_settings/settings_per_account.xml 2009-08-07 19:30:24.890625000 +0200 @@ -1,8 +1,19 @@ - BusyModeResponse + RLVaLoginLastLocation + + Comment + Determines whether the next login will be forced to the last logoff location (set by the viewer) + Persist + 1 + Type + Boolean + Value + 1 + + BusyModeResponse Comment Auto response to instant messages while in busy mode. Persist 1 diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llagent.cpp linden/indra/newview/llagent.cpp --- linden/indra/newview/llagent.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llagent.cpp 2009-08-09 15:07:09.531250000 +0200 @@ -755,10 +755,13 @@ // Does this parcel allow you to fly? BOOL LLAgent::canFly() { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) + if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) return FALSE; +// [/RLVa:KB] if (isGodlike()) return TRUE; LLViewerRegion* regionp = getRegion(); if (regionp && regionp->getBlockFly()) return FALSE; @@ -794,10 +797,17 @@ } } if (fly) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) + if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) + { + return; + } +// [/RLVa:KB] + BOOL was_flying = getFlying(); if (!canFly() && !was_flying) { // parcel doesn't let you start fly // gods can always fly @@ -4211,10 +4221,17 @@ if (LLViewerJoystick::getInstance()->getOverrideCamera()) { return; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (mAvatarObject.notNull()) && (mAvatarObject->mIsSitting) ) + { + return; + } +// [/RLVa:KB] + setControlFlags(AGENT_CONTROL_STAND_UP); // force stand up gViewerWindow->getWindow()->resetBusyCount(); if (gFaceEditToolset) { @@ -5005,10 +5022,18 @@ } // utility to build a location string void LLAgent::buildLocationString(std::string& str) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + str = rlv_handler_t::cstrHidden; + return; + } +// [/RLVa:KB] + const LLVector3& agent_pos_region = getPositionAgent(); S32 pos_x = S32(agent_pos_region.mV[VX]); S32 pos_y = S32(agent_pos_region.mV[VY]); S32 pos_z = S32(agent_pos_region.mV[VZ]); @@ -5892,10 +5917,19 @@ } // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasBehaviour("tplm")) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (mAvatarObject.notNull()) && (mAvatarObject->mIsSitting)) )) + { + return; + } +// [/RLVa:KB] + LLViewerRegion *regionp = getRegion(); if(regionp && teleportCore()) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_TeleportLandmarkRequest); @@ -5956,10 +5990,21 @@ } void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { +// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-07 (RLVa-1.0.0d) + // If we're getting teleported due to @tpto we should disregard any @tploc=n or @unsit=n restrictions from the same object + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasBehaviourExcept("tploc", gRlvHandler.getCurrentObject())) || + ( (mAvatarObject.notNull()) && (mAvatarObject->mIsSitting) && + (gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) ) ) + { + return; + } +// [/RLVa:KB] + LLViewerRegion* regionp = getRegion(); LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); if(regionp && info) { U32 x_pos; @@ -6008,10 +6053,16 @@ if (mTeleportState == TELEPORT_MOVING) { // We're outa here. Save "back" slurl. mTeleportSourceSLURL = getSLURL(); } +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (rlv_handler_t::isEnabled()) && (TELEPORT_NONE == mTeleportState) ) + { + gRlvHandler.setCanCancelTp(true); + } +// [/RLVa:KB] } void LLAgent::fidget() { if (!getAFK()) @@ -6599,21 +6650,37 @@ lldebugs << " " << LLWearable::typeToTypeLabel(type) << llendl; } // now that we have the asset ids...request the wearable assets +// [RLVa:KB] - Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g + LLInventoryFetchObserver::item_ref_t rlvItems; +// [/RLVa:KB] for( i = 0; i < WT_COUNT; i++ ) { if( !gAgent.mWearableEntry[i].mItemID.isNull() ) { +// [RLVa:KB] - Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g + if (rlv_handler_t::isEnabled()) + rlvItems.push_back(gAgent.mWearableEntry[i].mItemID); +// [/RLVa:KB] gWearableList.getAsset( asset_id_array[i], LLStringUtil::null, LLWearable::typeToAssetType( (EWearableType) i ), LLAgent::onInitialWearableAssetArrived, (void*)(intptr_t)i ); } } + +// [RLVa:KB] - Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g + // TODO-RLVa: checking that we're in STATE_STARTED is probably not needed, but leave it until we can be absolutely sure + if ( (rlv_handler_t::isEnabled()) && (LLStartUp::getStartupState() == STATE_STARTED) ) + { + RlvCurrentlyWorn f; + f.fetchItems(rlvItems); + } +// [/RLVa:KB] } } // A single wearable that the avatar was wearing on start-up has arrived from the database. // static @@ -7107,10 +7174,17 @@ { // Can't take off underclothing in simple UI mode or on PG accounts return; } +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isRemovable(type)) ) + { + return; + } +// [/RLVa:KB] + if( old_wearable ) { if( old_wearable->isDirty() ) { // Bring up view-modal dialog: Save changes? Yes, No, Cancel @@ -7229,19 +7303,21 @@ BOOL wearables_to_remove[WT_COUNT]; wearables_to_remove[WT_SHAPE] = FALSE; wearables_to_remove[WT_SKIN] = FALSE; wearables_to_remove[WT_HAIR] = FALSE; wearables_to_remove[WT_EYES] = FALSE; - wearables_to_remove[WT_SHIRT] = remove; - wearables_to_remove[WT_PANTS] = remove; - wearables_to_remove[WT_SHOES] = remove; - wearables_to_remove[WT_SOCKS] = remove; - wearables_to_remove[WT_JACKET] = remove; - wearables_to_remove[WT_GLOVES] = remove; - wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove; - wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove; - wearables_to_remove[WT_SKIRT] = remove; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a + wearables_to_remove[WT_SHIRT] = remove && gRlvHandler.isRemovable(WT_SHIRT); + wearables_to_remove[WT_PANTS] = remove && gRlvHandler.isRemovable(WT_PANTS); + wearables_to_remove[WT_SHOES] = remove && gRlvHandler.isRemovable(WT_SHOES); + wearables_to_remove[WT_SOCKS] = remove && gRlvHandler.isRemovable(WT_SOCKS); + wearables_to_remove[WT_JACKET] = remove && gRlvHandler.isRemovable(WT_JACKET); + wearables_to_remove[WT_GLOVES] = remove && gRlvHandler.isRemovable(WT_GLOVES); + wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) && remove && gRlvHandler.isRemovable(WT_UNDERSHIRT); + wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) && remove && gRlvHandler.isRemovable(WT_UNDERPANTS); + wearables_to_remove[WT_SKIRT] = remove && gRlvHandler.isRemovable(WT_SKIRT); +// [/RLVa:KB] S32 count = wearables.count(); llassert( items.count() == count ); S32 i; @@ -7329,10 +7405,19 @@ void LLAgent::setWearable( LLInventoryItem* new_item, LLWearable* new_wearable ) { EWearableType type = new_wearable->getType(); LLWearable* old_wearable = mWearableEntry[ type ].mWearable; + +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) + // Block if: we can't wear on that layer; or we're already wearing something there we can't take off + if ( (rlv_handler_t::isEnabled()) && ((!gRlvHandler.isWearable(type)) || ((old_wearable) && (!gRlvHandler.isRemovable(type)))) ) + { + return; + } +// [/RLVa:KB] + if( old_wearable ) { const LLUUID& old_item_id = mWearableEntry[ type ].mItemID; if( (old_wearable->getID() == new_wearable->getID()) && (old_item_id == new_item->getUUID()) ) @@ -7518,28 +7603,98 @@ { llwarns << "No avatar found." << llendl; return; } - gMessageSystem->newMessage("ObjectDetach"); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.0c + // NOTE-RLVa: This function is called from inside RlvHandler as well, hence the rather heavy modifications + std::list rlvAttachments; + // TODO-RLVa: Once we have the improved "removeWearable" logic implemented we can just get rid of the whole "rlvCompFolders" hassle + #ifdef RLV_EXPERIMENTAL_COMPOSITES + std::list rlvCompFolders; + #endif // RLV_EXPERIMENTAL_COMPOSITES for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; LLViewerObject* objectp = attachment->getObject(); if (objectp) { + if (rlv_handler_t::isEnabled()) + { + if (!gRlvHandler.isDetachable(curiter->first)) + continue; + + // Check if we're being called in response to an RLV command (that would be @detach=force) + if ( (gRlvHandler.getCurrentCommand()) && (attachment->getItemID().notNull()) ) + { + if (!gRlvHandler.isStrippable(attachment->getItemID())) // "nostrip" can be taken off by the user but not @detach + continue; + + #ifdef RLV_EXPERIMENTAL_COMPOSITES + LLViewerInventoryCategory* pFolder; + if (gRlvHandler.getCompositeInfo(attachment->getItemID(), NULL, &pFolder)) + { + #ifdef RLV_EXPERIMENTAL_COMPOSITE_LOCKING + if (!gRlvHandler.canTakeOffComposite(pFolder)) + continue; + #endif // RLV_EXPERIMENTAL_COMPOSITE_LOCKING + + // The attachment belongs to a composite folder so there may be additional things we need to take off + if (std::find(rlvCompFolders.begin(), rlvCompFolders.end(), pFolder->getUUID()) != rlvCompFolders.end()) + rlvCompFolders.push_back(pFolder->getUUID()); + } + #endif // RLV_EXPERIMENTAL_COMPOSITES + } + } + rlvAttachments.push_back(objectp->getLocalID()); + } + } + + // Only send the message if we actually have something to detach + if (rlvAttachments.size() > 0) + { + gMessageSystem->newMessage("ObjectDetach"); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + for (std::list::const_iterator itAttach = rlvAttachments.begin(); itAttach != rlvAttachments.end(); ++itAttach) + { gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); + gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, *itAttach); } + + gMessageSystem->sendReliable( gAgent.getRegionHost() ); } - gMessageSystem->sendReliable( gAgent.getRegionHost() ); + + #ifdef RLV_EXPERIMENTAL_COMPOSITES + if (rlv_handler_t::isEnabled) + { + // If we encountered any composite folders then we need to @detach all of them + for (std::list::const_iterator itFolder = rlvCompFolders.begin(); itFolder != rlvCompFolders.end(); ++itFolder) + { + std::string strFolder = gRlvHandler.getSharedPath(*itFolder); + + // It shouldn't happen but make absolutely sure that we don't issue @detach:=force and reenter this function + if (!strFolder.empty()) + { + std::string strCmd = "detach:" + strFolder + "=force"; + #ifdef RLV_DEBUG + RLV_INFOS << "\t- detaching composite folder: @" << strCmd << LL_ENDL; + #endif // RLV_DEBUG + + // HACK-RLV: executing a command while another command is currently executing isn't the best thing to do, however + // in this specific case it is safe (and still better than making processForceCommand public) + gRlvHandler.processCommand(gRlvHandler.getCurrentObject(), strCmd); + } + } + } + #endif // RLV_EXPERIMENTAL_COMPOSITES +// [/RLVa:KB] } void LLAgent::observeFriends() { if(!mFriendObserver) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llagent.h linden/indra/newview/llagent.h --- linden/indra/newview/llagent.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llagent.h 2009-08-07 19:30:24.937500000 +0200 @@ -65,10 +65,14 @@ // Ventrella #include "llfollowcam.h" // end Ventrella +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) +#include "rlvhandler.h" +// [/RLVa:KB] + const U8 AGENT_STATE_TYPING = 0x04; // Typing indication const U8 AGENT_STATE_EDITING = 0x10; // Set when agent has objects selected const BOOL ANIMATE = TRUE; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llappviewer.cpp linden/indra/newview/llappviewer.cpp --- linden/indra/newview/llappviewer.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llappviewer.cpp 2009-08-09 15:07:09.640625000 +0200 @@ -3817,6 +3817,23 @@ if(LLAppViewer::instance()->mMainloopTimeout) { gDebugInfo["MainloopTimeoutState"] = LLAppViewer::instance()->mMainloopTimeout->getState(); } writeDebugInfo(); + +// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e + // TODO-RLVa: find some way to initialize the lookup table when we need them *and* support toggling RLVa at runtime + gRlvHandler.initLookupTables(); + + if (rlv_handler_t::isEnabled()) + { + RlvCurrentlyWorn::fetchWorn(); + rlv_handler_t::fetchSharedInventory(); + + #ifdef RLV_EXTENSION_STARTLOCATION + RlvSettings::updateLoginLastLocation(); + #endif // RLV_EXTENSION_STARTLOCATION + + gRlvHandler.processRetainedCommands(); + } +// [/RLVa:KB] } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llchatbar.cpp linden/indra/newview/llchatbar.cpp --- linden/indra/newview/llchatbar.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llchatbar.cpp 2009-08-07 19:30:51.156250000 +0200 @@ -75,11 +75,14 @@ LLChatBar *gChatBar = NULL; // legacy calllback glue void toggleChatHistory(void* user_data); -void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); +//void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.2a +void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel); +// [/RLVa:KB] class LLChatBarGestureObserver : public LLGestureManagerObserver { public: @@ -479,11 +482,14 @@ // to eat trailing spaces that might be part of a gesture. LLWStringUtil::trimHead(raw_text); S32 length = raw_text.length(); - if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences + //if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) + if ( (length > 0) && (raw_text[0] != '/') && (!gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT)) ) +// [/RLVa:KB] { gAgent.startTyping(); } else { @@ -583,10 +589,25 @@ if (!utf8_text.empty()) { utf8_text = utf8str_truncate(utf8_text, MAX_STRING - 1); } +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + if ( (0 == channel) && (rlv_handler_t::isEnabled()) ) + { + // Adjust the (public) chat "volume" on chat and gestures (also takes care of playing the proper animation) + if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour("chatnormal")) ) + type = CHAT_TYPE_WHISPER; + else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour("chatshout")) ) + type = CHAT_TYPE_NORMAL; + else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour("chatwhisper")) ) + type = CHAT_TYPE_NORMAL; + + animate &= !gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT); + } +// [/RLVa:KB] + // Don't animate for chats people can't hear (chat to scripts) if (animate && (channel == 0)) { if (type == CHAT_TYPE_WHISPER) { @@ -618,12 +639,61 @@ } send_chat_from_viewer(utf8_out_text, type, channel); } -void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) -{ +// void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.2a +void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel) +// [/RLVa:KB] +{ +// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e + // Only process chat messages (ie not CHAT_TYPE_START, CHAT_TYPE_STOP, etc) + if ( (rlv_handler_t::isEnabled()) && ( (CHAT_TYPE_WHISPER == type) || (CHAT_TYPE_NORMAL == type) || (CHAT_TYPE_SHOUT == type) ) ) + { + if (0 == channel) + { + // (We already did this before, but LLChatHandler::handle() calls this directly) + if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour("chatnormal")) ) + type = CHAT_TYPE_WHISPER; + else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour("chatshout")) ) + type = CHAT_TYPE_NORMAL; + else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour("chatwhisper")) ) + type = CHAT_TYPE_NORMAL; + + // Redirect chat if needed + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT) || (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE)) ) && + (gRlvHandler.redirectChatOrEmote(utf8_out_text)) ) ) + { + return; + } + + // Filter public chat if sendchat restricted (and filter anything that redirchat didn't redirect) + if ( (gRlvHandler.hasBehaviour("sendchat")) || (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT)) ) + gRlvHandler.filterChat(utf8_out_text, true); + } + else + { + // Don't allow chat on a non-public channel if sendchannel restricted (unless the channel is an exception) + if ( (gRlvHandler.hasBehaviour("sendchannel")) && (!gRlvHandler.hasBehaviour("sendchannel", llformat("%d", channel))) ) + return; + + // Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers) + if (channel >= CHAT_CHANNEL_DEBUG) + { + bool fIsEmote = rlvIsEmote(utf8_out_text); + if ( (gRlvHandler.hasBehaviour("sendchat")) || + ((!fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT))) || + ((fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE))) ) + { + return; + } + } + } + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ChatFromViewer); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterabout.cpp linden/indra/newview/llfloaterabout.cpp --- linden/indra/newview/llfloaterabout.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterabout.cpp 2009-08-07 19:30:24.968750000 +0200 @@ -121,11 +121,19 @@ std::string support; support.append("\n\n"); // Position LLViewerRegion* region = gAgent.getRegion(); - if (region) +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + support.append(rlv_handler_t::cstrHidden); + support.append("\n\n"); + } + else if (region) +// [/RLVa:KB] +// if (region) { LLStyleSP server_link_style(new LLStyle); server_link_style->setVisible(true); server_link_style->setFontName(LLStringUtil::null); server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes")); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloateractivespeakers.cpp linden/indra/newview/llfloateractivespeakers.cpp --- linden/indra/newview/llfloateractivespeakers.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloateractivespeakers.cpp 2009-08-07 19:30:24.984375000 +0200 @@ -96,10 +96,15 @@ delete (LLHandle*)user_data; if (speaker_ptr) { speaker_ptr->mDisplayName = first + " " + last; +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g + // TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + speaker_ptr->mDisplayName = gRlvHandler.getAnonym(speaker_ptr->mDisplayName); +// [/RLVa:KB] } } LLSpeakerTextModerationEvent::LLSpeakerTextModerationEvent(LLSpeaker* source) : LLEvent(source, "Speaker text moderation event") @@ -708,19 +713,33 @@ } //static void LLPanelActiveSpeakers::onClickProfile(void* user_data) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return; + } +// [/RLVa:KB] + LLPanelActiveSpeakers* panelp = (LLPanelActiveSpeakers*)user_data; LLUUID speaker_id = panelp->mSpeakerList->getValue().asUUID(); LLFloaterAvatarInfo::showFromDirectory(speaker_id); } //static void LLPanelActiveSpeakers::onDoubleClickSpeaker(void* user_data) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return; + } +// [/RLVa:KB] + LLPanelActiveSpeakers* panelp = (LLPanelActiveSpeakers*)user_data; LLUUID speaker_id = panelp->mSpeakerList->getValue().asUUID(); LLPointer speakerp = panelp->mSpeakerMgr->findSpeaker(speaker_id); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterbeacons.cpp linden/indra/newview/llfloaterbeacons.cpp --- linden/indra/newview/llfloaterbeacons.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterbeacons.cpp 2009-08-07 19:30:24.984375000 +0200 @@ -35,10 +35,13 @@ #include "llviewercontrol.h" #include "lluictrlfactory.h" #include "llcheckboxctrl.h" #include "pipeline.h" +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) +#include "llagent.h" +// [/RLVa:KB] LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_beacons.xml"); @@ -70,10 +73,17 @@ // Needed to make the floater visibility toggle the beacons. // Too bad we can't just add control_name="BeaconAlwaysOn" to the XML. void LLFloaterBeacons::open() { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return; + } +// [/RLVa:KB] + LLFloater::open(); gSavedSettings.setBOOL( "BeaconAlwaysOn", TRUE); } void LLFloaterBeacons::close(bool app_quitting) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterchat.cpp linden/indra/newview/llfloaterchat.cpp --- linden/indra/newview/llfloaterchat.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterchat.cpp 2009-08-07 19:30:25.000000000 +0200 @@ -201,11 +201,15 @@ // If the msg is not from an agent (not yourself though), // extract out the sender name and replace it with the hotlinked name. if (chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID != LLUUID::null && - (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) +// (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) + (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0) && +// [RLVa] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa] { std::string start_line = line.substr(0, chat.mFromName.length() + 1); line = line.substr(chat.mFromName.length() + 1); const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID); edit->appendStyledText(start_line, false, prepend_newline, &sourceStyle); @@ -225,10 +229,34 @@ LLLogChat::saveHistory(std::string("chat"),histstr); } // static void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (rlv_handler_t::isEnabled()) + { + // TODO-RLVa: we might cast too broad a net by filtering here, needs testing + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) ) + { + LLChat& rlvChat = const_cast(chat); + gRlvHandler.filterLocation(rlvChat.mText); + rlvChat.mRlvLocFiltered = TRUE; + } + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) ) + { + // NOTE: this will also filter inventory accepted/declined text in the chat history + LLChat& rlvChat = const_cast(chat); + if (CHAT_SOURCE_AGENT != chat.mSourceType) + { + // Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup) + gRlvHandler.filterNames(rlvChat.mText); + } + rlvChat.mRlvNamesFiltered = TRUE; + } + } +// [/RLVa:KB] + if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) { log_chat_text(chat); } @@ -355,10 +383,34 @@ BOOL invisible_script_debug_chat = chat.mChatType == CHAT_TYPE_DEBUG_MSG && !gSavedSettings.getBOOL("ScriptErrorsAsChat"); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (rlv_handler_t::isEnabled()) + { + // TODO-RLVa: we might cast too broad a net by filtering here, needs testing + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) ) + { + LLChat& rlvChat = const_cast(chat); + if (!from_instant_message) + gRlvHandler.filterLocation(rlvChat.mText); + rlvChat.mRlvLocFiltered = TRUE; + } + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) ) + { + LLChat& rlvChat = const_cast(chat); + if ( (!from_instant_message) && (CHAT_SOURCE_AGENT != chat.mSourceType) ) + { + // Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup) + gRlvHandler.filterNames(rlvChat.mText); + } + rlvChat.mRlvNamesFiltered = TRUE; + } + } +// [/RLVa:KB] + #if LL_LCD_COMPILE // add into LCD displays if (!invisible_script_debug_chat) { if (!from_instant_message) @@ -508,11 +560,15 @@ // static void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) { LLFloaterChat* self = (LLFloaterChat*)userdata; - self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + self->childSetVisible("active_speakers_panel", + (!self->childIsVisible("active_speakers_panel")) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ); +// [/RLVa:KB] + //self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); } //static bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterinspect.cpp linden/indra/newview/llfloaterinspect.cpp --- linden/indra/newview/llfloaterinspect.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llfloaterinspect.cpp 2009-08-07 19:30:25.015625000 +0200 @@ -40,10 +40,14 @@ #include "lltoolmgr.h" #include "llviewercontrol.h" #include "llviewerobject.h" #include "lluictrlfactory.h" +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +#include "rlvhandler.h" +// [/RLVa:KB] + LLFloaterInspect* LLFloaterInspect::sInstance = NULL; LLFloaterInspect::LLFloaterInspect(void) : LLFloater(std::string("Inspect Object")), mDirty(FALSE) @@ -143,11 +147,17 @@ } func(selected_id); LLSelectNode* node = sInstance->mObjectSelection->getFirstNode(&func); if(node) { const LLUUID& owner_id = node->mPermissions->getOwner(); - LLFloaterAvatarInfo::showFromDirectory(owner_id); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + LLFloaterAvatarInfo::showFromDirectory(owner_id); + } +// [/RLVa:KB] +// LLFloaterAvatarInfo::showFromDirectory(owner_id); } } } BOOL LLFloaterInspect::postBuild() @@ -161,11 +171,14 @@ void LLFloaterInspect::onSelectObject(LLUICtrl* ctrl, void* user_data) { if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) { - sInstance->childSetEnabled("button owner", true); + //sInstance->childSetEnabled("button owner", true); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e + sInstance->childSetEnabled("button owner", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] sInstance->childSetEnabled("button creator", true); } } LLUUID LLFloaterInspect::getSelectedUUID() @@ -221,10 +234,17 @@ time_t timestamp = (time_t) (obj->mCreationDate/1000000); LLStringUtil::copy(time, ctime(×tamp), MAX_STRING); time[24] = '\0'; gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + // TODO-RLVa: shouldn't filter if this is a group-owned prim (will show "(nobody)") + owner_name = gRlvHandler.getAnonym(owner_name); + } +// [/RLVa:KB] gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; row["columns"][0]["type"] = "text"; // make sure we're either at the top of the link chain diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterland.cpp linden/indra/newview/llfloaterland.cpp --- linden/indra/newview/llfloaterland.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterland.cpp 2009-08-07 19:30:25.031250000 +0200 @@ -803,10 +803,16 @@ } // static void LLPanelLandGeneral::onClickBuyLand(void* data) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + return; + } +// [/RLVa:KB] BOOL* for_group = (BOOL*)data; LLViewerParcelMgr::getInstance()->startBuyLand(*for_group); } BOOL LLPanelLandGeneral::enableDeedToGroup(void* data) @@ -2769,5 +2775,43 @@ { LLTextBox* editor = self->getChild("estate_owner_text"); if (editor) editor->setText(name); } } + +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) +void LLFloaterLand::open() +{ + // We'll allow "About Land" as long as you have the ability to return prims (through ownership or through group powers) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + LLParcelSelection* pParcelSel = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection(); + if ( (!pParcelSel) || (pParcelSel->hasOthersSelected()) ) + return; + LLParcel* pParcel = pParcelSel->getParcel(); + if (!pParcel) + return; + + // Ideally we could just use LLViewerParcelMgr::isParcelOwnedByAgent(), but that has that sneaky exemption + // for fake god like (aka View Admin Options) + const LLUUID& idOwner = pParcel->getOwnerID(); + if ( (idOwner != gAgent.getID()) ) + { + // *sighs* LLAgent::hasPowerInGroup() has it too so copy/paste from there + S32 count = gAgent.mGroups.count(); bool fShow = false; + for (S32 i = 0; i < count; ++i) + { + if (gAgent.mGroups.get(i).mID == idOwner) + { + fShow |= ((gAgent.mGroups.get(i).mPowers & GP_LAND_RETURN) > 0); + break; + } + } + + if (!fShow) + return; + } + } + + LLFloater::open(); +} +// [/RLVa:KB] diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterland.h linden/indra/newview/llfloaterland.h --- linden/indra/newview/llfloaterland.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llfloaterland.h 2009-08-07 19:30:25.031250000 +0200 @@ -80,10 +80,14 @@ // Destroys itself on close. virtual void onClose(bool app_quitting); virtual void onOpen(); virtual BOOL postBuild(); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + virtual void open(); +// [/RLVa:KB] + protected: // Does its own instance management, so clients not allowed // to allocate or destroy. LLFloaterLand(const LLSD& seed); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloatermap.cpp linden/indra/newview/llfloatermap.cpp --- linden/indra/newview/llfloatermap.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llfloatermap.cpp 2009-08-07 19:30:25.046875000 +0200 @@ -212,5 +212,15 @@ { gFloaterMap->open(); /* Flawfinder: ignore */ } } } + +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-05 (RLVa-1.0.0c) +void LLFloaterMap::open() +{ + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP)) + { + LLFloater::open(); + } +} +// [/RLVa:KB] diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloatermap.h linden/indra/newview/llfloatermap.h --- linden/indra/newview/llfloatermap.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llfloatermap.h 2009-08-07 19:30:25.062500000 +0200 @@ -50,10 +50,13 @@ /*virtual*/ void setVisible(BOOL visible); /*virtual*/ void draw(); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ BOOL canClose(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-05 (RLVa-1.0.0c) + /*virtual*/ void open(); +// [/RLVa:KB] protected: LLNetMap* mMap; }; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloateropenobject.cpp linden/indra/newview/llfloateropenobject.cpp --- linden/indra/newview/llfloateropenobject.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloateropenobject.cpp 2009-08-07 19:30:25.062500000 +0200 @@ -205,11 +205,22 @@ // static void LLFloaterOpenObject::onClickMoveAndWear(void* data) { LLFloaterOpenObject* self = (LLFloaterOpenObject*)data; - self->moveToInventory(true); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Deprecated: RLVa-0.2.2a + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + // TODO-RLVa: once we have "Add to Outfit" and "Replace Outfit" working we don't need this anymore + self->moveToInventory(false); + } + else + { + self->moveToInventory(true); + } +// [/RLVa:KB] +// self->moveToInventory(true); self->close(); } //static void* LLFloaterOpenObject::createPanelInventory(void* data) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterproperties.cpp linden/indra/newview/llfloaterproperties.cpp --- linden/indra/newview/llfloaterproperties.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterproperties.cpp 2009-08-07 19:30:25.078125000 +0200 @@ -352,12 +352,21 @@ gCacheName->getGroupName(perm.getGroup(), name); } else { gCacheName->getFullName(perm.getOwner(), name); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + name = gRlvHandler.getAnonym(name); + } +// [/RLVa:KB] } - childSetEnabled("BtnOwner",TRUE); + //childSetEnabled("BtnOwner",TRUE); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e + childSetEnabled("BtnOwner", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] childSetEnabled("LabelOwnerTitle",TRUE); childSetEnabled("LabelOwnerName",TRUE); childSetText("LabelOwnerName",name); } else @@ -600,11 +609,14 @@ { LLFloaterGroupInfo::showFromUUID(item->getPermissions().getGroup()); } else { - if(!item->getPermissions().getOwner().isNull()) +// if(!item->getPermissions().getOwner().isNull()) +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (!item->getPermissions().getOwner().isNull()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { LLFloaterAvatarInfo::showFromObject(item->getPermissions().getOwner()); } } } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterregioninfo.cpp linden/indra/newview/llfloaterregioninfo.cpp --- linden/indra/newview/llfloaterregioninfo.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterregioninfo.cpp 2009-08-07 19:30:25.109375000 +0200 @@ -3190,5 +3190,24 @@ } } return true; } + +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) +void LLFloaterRegionInfo::open() +{ + // We'll allow access to the estate tools for estate managers (and for the sim owner) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + LLViewerRegion* pRegion = gAgent.getRegion(); + if (!pRegion) + return; + + // Should be able to call LLRegion::canManageEstate() but then we can fake god like + if ( (!pRegion->isEstateManager()) && (pRegion->getOwner() != gAgent.getID()) ) + return; + } + + LLFloater::open(); +} +// [/RLVa:KB] diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterregioninfo.h linden/indra/newview/llfloaterregioninfo.h --- linden/indra/newview/llfloaterregioninfo.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llfloaterregioninfo.h 2009-08-07 19:30:25.125000000 +0200 @@ -64,10 +64,13 @@ public: ~LLFloaterRegionInfo(); /*virtual*/ void onOpen(); /*virtual*/ BOOL postBuild(); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + /*virtual*/ void open(); +// [/RLVa:KB] static void processEstateOwnerRequest(LLMessageSystem* msg, void**); // get and process region info if necessary. static void processRegionInfo(LLMessageSystem* msg); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterreporter.cpp linden/indra/newview/llfloaterreporter.cpp --- linden/indra/newview/llfloaterreporter.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterreporter.cpp 2009-08-07 19:30:25.125000000 +0200 @@ -131,10 +131,27 @@ LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); } childSetText("abuse_location_edit", gAgent.getSLURL() ); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0a + if (rlv_handler_t::isEnabled()) + { + // Can't filter these since they get sent as part of the report so just hide them instead + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + childSetVisible("abuse_location_edit", false); + childSetVisible("pos_field", false); + } + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + childSetVisible("owner_name", false); + childSetVisible("abuser_name_edit", false); + } + } +// [/RLVa:KB] + LLButton* pick_btn = getChild("pick_btn"); if (pick_btn) { // XUI: Why aren't these in viewerart.ini? pick_btn->setImages( std::string("UIImgFaceUUID"), @@ -298,10 +315,16 @@ // correct the region and position information LLViewerRegion *regionp = objectp->getRegion(); if (regionp) { childSetText("sim_field", regionp->getName()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + childSetText("sim_field", rlv_handler_t::cstrHiddenRegion); + } +// [/RLVa:KB] LLVector3d global_pos; global_pos.setVec(objectp->getPositionRegion()); setPosBox(global_pos); } @@ -321,10 +344,16 @@ else { object_owner.append("Unknown"); } childSetText("object_name", object_owner); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RVLa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + childSetVisible("object_name", false); // Hide the object name if the picked object represents an avataz + } +// [/RLVa:KB] childSetText("owner_name", object_owner); childSetText("abuser_name_edit", object_owner); mAbuserID = object_id; } else @@ -593,10 +622,16 @@ void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) { childSetText("object_name", object_name); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RVLa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + childSetVisible("object_name", true); // Show the object name if the picked object is actually an object + } +// [/RLVa:KB] childSetText("owner_name", owner_name); childSetText("abuser_name_edit", owner_name); mAbuserID = owner_id; } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloatersettingsdebug.cpp linden/indra/newview/llfloatersettingsdebug.cpp --- linden/indra/newview/llfloatersettingsdebug.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloatersettingsdebug.cpp 2009-08-07 19:30:25.140625000 +0200 @@ -37,10 +37,15 @@ #include "llcombobox.h" #include "llspinctrl.h" #include "llcolorswatch.h" #include "llviewercontrol.h" +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0g) +#include "rlvhandler.h" +#include "rlvextensions.h" +// [/RLVa:KB] + LLFloaterSettingsDebug* LLFloaterSettingsDebug::sInstance = NULL; LLFloaterSettingsDebug::LLFloaterSettingsDebug() : LLFloater(std::string("Configuration Editor")) { } @@ -237,10 +242,36 @@ childSetVisible("val_text", FALSE); mComment->setText(LLStringUtil::null); if (controlp) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.1d + if (rlv_handler_t::isEnabled()) + { + // Don't allow changing DBG_WRITE debug settings under @setdebug=n + bool fEnable = !( (gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG)) && + (RlvExtGetSet::getDebugSettingFlags(controlp->getName()) & RlvExtGetSet::DBG_WRITE) ); + // Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n + fEnable &= !((gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) && + (("VertexShaderEnable" == controlp->getName()) || ("WindLightUseAtmosShaders" == controlp->getName()))); + #ifdef RLV_EXTENSION_STARTLOCATION + // Don't allow toggling RestrainedLifeLoginLastLocation + fEnable &= !(RLV_SETTING_LOGINLASTLOCATION == controlp->getName()); + #endif // RLV_EXTENSION_STARTLOCATION + + // NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault() + spinner1->setEnabled(fEnable); + spinner2->setEnabled(fEnable); + spinner3->setEnabled(fEnable); + spinner4->setEnabled(fEnable); + color_swatch->setEnabled(fEnable); + childSetEnabled("val_text", fEnable); + childSetEnabled("boolean_combo", fEnable); + childSetEnabled("default_btn", fEnable); + } +// [/RLVa:KB] + eControlType type = controlp->type(); //hide combo box only for non booleans, otherwise this will result in the combo box closing every frame childSetVisible("boolean_combo", type == TYPE_BOOLEAN); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterwindlight.cpp linden/indra/newview/llfloaterwindlight.cpp --- linden/indra/newview/llfloaterwindlight.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llfloaterwindlight.cpp 2009-08-07 19:30:25.156250000 +0200 @@ -315,10 +315,19 @@ LLWLParamManager * param_mgr = LLWLParamManager::instance(); LLWLParamSet& currentParams = param_mgr->mCurParams; //std::map & currentParams = param_mgr->mCurParams.mParamValues; +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Fixes LL "bug" (preset name isn't kept synchronized) + LLComboBox* comboBox = getChild("WLPresetsCombo"); + if (comboBox->getSelectedItemLabel() != currentParams.mName) + { + comboBox->setSimple(currentParams.mName); + } +// [/RLVa:KB] + // blue horizon param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0); childSetValue("WLBlueHorizonG", param_mgr->mBlueHorizon.g / 2.0); childSetValue("WLBlueHorizonB", param_mgr->mBlueHorizon.b / 2.0); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llfloaterworldmap.cpp linden/indra/newview/llfloaterworldmap.cpp --- linden/indra/newview/llfloaterworldmap.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llfloaterworldmap.cpp 2009-08-07 19:30:25.171875000 +0200 @@ -278,10 +278,17 @@ } // static void LLFloaterWorldMap::show(void*, BOOL center_on_target) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP)) + { + return; + } +// [/RLVa:KB] + BOOL was_visible = gFloaterWorldMap->getVisible(); gFloaterWorldMap->mIsClosing = FALSE; gFloaterWorldMap->open(); /* Flawfinder: ignore */ @@ -639,11 +646,14 @@ std::string sim_name; LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); std::string full_name = llformat("%s (%d, %d, %d)", - sim_name.c_str(), +// sim_name.c_str(), +// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-04 (RLVa-1.0.0a) + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? sim_name.c_str() : rlv_handler_t::cstrHiddenRegion.c_str(), +// [/RLVa:KB] llround(region_x), llround(region_y), llround((F32)pos_global.mdV[VZ])); std::string tooltip(""); @@ -693,10 +703,18 @@ childSetValue("spin y", LLSD(agent_y) ); childSetValue("spin z", LLSD(agent_z) ); // Set the current SLURL mSLURL = LLURLDispatcher::buildSLURL(agent_sim_name, agent_x, agent_y, agent_z); + +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + childSetValue("location", rlv_handler_t::cstrHiddenRegion); + mSLURL.clear(); + } +// [/RLVa:KB] } } return; // invalid location } @@ -735,10 +753,18 @@ } else { // Empty SLURL will disable the "Copy SLURL to clipboard" button mSLURL = ""; } + +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + childSetValue("location", rlv_handler_t::cstrHiddenRegion); + mSLURL.clear(); + } +// [/RLVa:KB] } } void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llglsandbox.cpp linden/indra/newview/llglsandbox.cpp --- linden/indra/newview/llglsandbox.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llglsandbox.cpp 2009-08-07 19:30:25.203125000 +0200 @@ -164,10 +164,17 @@ extern BOOL gDebugSelect; // Returns true if you got at least one object void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return; + } +// [/RLVa:KB] + LLVector3 av_pos = gAgent.getPositionAgent(); F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance"); select_dist_squared = select_dist_squared * select_dist_squared; BOOL deselect = (mask == MASK_CONTROL); @@ -228,10 +235,31 @@ new_near = llmax(new_near, 0.1f); LLViewerCamera::getInstance()->setFar(new_far); LLViewerCamera::getInstance()->setNear(new_near); } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) + { + // We'll allow drag selection under fartouch, but only within the fartouch range + // (just copy/paste the code above us to make that work, thank you Lindens!) + LLVector3 relative_av_pos = av_pos; + relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); + + F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + 1.5f; + F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - 1.5f; + + new_near = llmax(new_near, 0.1f); + + LLViewerCamera::getInstance()->setFar(new_far); + LLViewerCamera::getInstance()->setNear(new_near); + + // Usurp these two + limit_select_distance = TRUE; + select_dist_squared = 1.5f * 1.5f; + } +// [/RLVa:KB] LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, center_x-width/2, center_y-height/2, width, height, limit_select_distance); if (shrink_selection) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llhoverview.cpp linden/indra/newview/llhoverview.cpp --- linden/indra/newview/llhoverview.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llhoverview.cpp 2009-08-07 19:30:25.218750000 +0200 @@ -242,18 +242,29 @@ LLNameValue* title = hit_object->getNVPair("Title"); LLNameValue* firstname = hit_object->getNVPair("FirstName"); LLNameValue* lastname = hit_object->getNVPair("LastName"); if (firstname && lastname) { - if (title) +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - line.append(title->getString()); + line = gRlvHandler.getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString())); + } + else + { +// [/RLVa:KB] + if (title) + { + line.append(title->getString()); + line.append(1, ' '); + } + line.append(firstname->getString()); line.append(1, ' '); + line.append(lastname->getString()); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) } - line.append(firstname->getString()); - line.append(1, ' '); - line.append(lastname->getString()); +// [/RLVa:KB] } else { line.append(LLTrans::getString("TooltipPerson")); } @@ -305,10 +316,17 @@ { line.append(LLTrans::getString("TooltipPublic")); } else if(gCacheName->getFullName(owner, name)) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + name = gRlvHandler.getAnonym(name); + } +// [/RLVa:KB] + line.append(name); } else { line.append(LLTrans::getString("RetrievingData")); @@ -466,11 +484,14 @@ // Line: "Land" line.clear(); line.append(LLTrans::getString("TooltipLand")); if (hover_parcel) { - line.append(hover_parcel->getName()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0b + line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? hover_parcel->getName() : rlv_handler_t::cstrHiddenParcel ); +// [/RLVa:KB] + //line.append(hover_parcel->getName()); } mText.push_back(line); // Line: "Owner: James Linden" line.clear(); @@ -495,11 +516,14 @@ line.append(LLTrans::getString("RetrievingData")); } } else if(gCacheName->getFullName(owner, name)) { - line.append(name); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? name : gRlvHandler.getAnonym(name)); +// [/RLVa:KB] + //line.append(name); } else { line.append(LLTrans::getString("RetrievingData")); } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llhudtext.cpp linden/indra/newview/llhudtext.cpp --- linden/indra/newview/llhudtext.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llhudtext.cpp 2009-08-07 19:30:25.234375000 +0200 @@ -563,10 +563,34 @@ } } void LLHUDText::setStringUTF8(const std::string &wtext) { +// [RLVa:KB] - Checked: 2009-07-09 (RLVa-1.0.0f) + // NOTE: setString() is only called for debug beacons and the floating name tags (which we don't want to censor + // because you'd see "(Region hidden) LastName" if you happen to go to a sim who's name is your first name :p + if (rlv_handler_t::isEnabled()) + { + std::string text(wtext); + + if (gRlvHandler.canShowHoverText(mSourceObject)) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + gRlvHandler.filterLocation(text); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + gRlvHandler.filterNames(text); + } + else + { + text = ""; + } + + setString(utf8str_to_wstring(text)); + return; + } +// [/RLVa:KB] + setString(utf8str_to_wstring(wtext)); } void LLHUDText::setString(const LLWString &wtext) { @@ -1145,5 +1169,20 @@ F32 width = font->getWidthF32(mText.c_str()); mFontWidthMap[font] = width; return width; } } + +// [RLVa:KB] - Checked: 2009-07-09 (RLVa-1.0.0f) | Added: RLVa-1.0.0f +void LLHUDText::refreshAllObjectText() +{ + for (TextObjectIterator itText = sTextObjects.begin(); itText != sTextObjects.end(); itText++) + { + LLHUDText* pText = *itText; + if ( (pText) && (!pText->mObjText.empty() && ("" != pText->mObjText) ) && + (pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) ) + { + pText->setStringUTF8(pText->mObjText); + } + } +} +// [/RLVa:KB] \ No newline at end of file diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llhudtext.h linden/indra/newview/llhudtext.h --- linden/indra/newview/llhudtext.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llhudtext.h 2009-08-07 19:30:25.250000000 +0200 @@ -128,10 +128,15 @@ static void shiftAll(const LLVector3& offset); static void renderAllHUD(); static void addPickable(std::set &pick_list); static void reshape(); static void setDisplayText(BOOL flag) { sDisplayText = flag ; } +// [RLVa:KB] - Checked: 2009-07-09 (RLVa-1.0.0f) | Added: RLVa-1.0.0f + const std::string& getObjectText() const { return mObjText; } + void setObjectText(const std::string &utf8string) { mObjText = utf8string; } + static void refreshAllObjectText(); +// [/RLVa:KB] protected: LLHUDText(const U8 type); /*virtual*/ void render(); /*virtual*/ void renderForSelect(); @@ -173,10 +178,13 @@ LLFrameTimer mResizeTimer; ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; S32 mLOD; BOOL mHidden; +// [RLVa:KB] - Checked: 2009-07-09 (RLVa-1.0.0f) | Added: RLVa-1.0.0f + std::string mObjText; +// [/RLVa:KB] static BOOL sDisplayText ; static std::set > sTextObjects; static std::vector > sVisibleTextObjects; static std::vector > sVisibleHUDTextObjects; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llimpanel.cpp linden/indra/newview/llimpanel.cpp --- linden/indra/newview/llimpanel.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llimpanel.cpp 2009-08-07 19:30:25.265625000 +0200 @@ -1979,10 +1979,46 @@ { // Truncate and convert to UTF8 for transport std::string utf8_text = wstring_to_utf8str(text); utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) + { + if (IM_NOTHING_SPECIAL == mDialog) // One-on-one IM: allow if recipient is a sendim exception + { + if (!gRlvHandler.isException(RLV_BHVR_SENDIM, mOtherParticipantUUID)) + utf8_text = rlv_handler_t::cstrBlockedSendIM; + } + else if (gAgent.isInGroup(mSessionUUID)) // Group chat: allow if recipient is a sendim exception + { + if (!gRlvHandler.isException(RLV_BHVR_SENDIM, mSessionUUID)) + utf8_text = rlv_handler_t::cstrBlockedSendIM; + } + else if (mSpeakers) // Conference chat: allow if all participants are sendim exceptions + { + LLSpeakerMgr::speaker_list_t speakers; + mSpeakers->getSpeakerList(&speakers, TRUE); + + for (LLSpeakerMgr::speaker_list_t::const_iterator itSpeaker = speakers.begin(); + itSpeaker != speakers.end(); ++itSpeaker) + { + LLSpeaker* pSpeaker = *itSpeaker; + if ( (gAgent.getID() != pSpeaker->mID) && (!gRlvHandler.isException(RLV_BHVR_SENDIM, pSpeaker->mID)) ) + { + utf8_text = rlv_handler_t::cstrBlockedSendIM; + break; + } + } + } + else // Catch all fall-through + { + utf8_text = rlv_handler_t::cstrBlockedSendIM; + } + } +// [/RLVa:KB] + if ( mSessionInitialized ) { deliver_message(utf8_text, mSessionUUID, mOtherParticipantUUID, diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llimview.cpp linden/indra/newview/llimview.cpp --- linden/indra/newview/llimview.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llimview.cpp 2009-08-07 19:30:25.281250000 +0200 @@ -1540,10 +1540,23 @@ if (!is_linden && (is_busy || is_muted)) { return; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // TODO-RLVa: duplicate from process_improved_im()? + if (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) + { + if (gAgent.isInGroup(session_id)) + { + if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id)) + return; + } + else if (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } +// [/RLVa:KB] // standard message, not from system std::string saved; if(offline == IM_OFFLINE) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llinventorybridge.cpp linden/indra/newview/llinventorybridge.cpp --- linden/indra/newview/llinventorybridge.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llinventorybridge.cpp 2009-08-07 19:30:25.296875000 +0200 @@ -1855,10 +1855,16 @@ LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Fixes LL bug + mItems.clear(); + mDisabledItems.clear(); +// [/RLVa:KB] + if (lost_and_found_id == mUUID) { // This is the lost+found folder. mItems.push_back(std::string("Empty Lost And Found")); } @@ -2868,10 +2874,17 @@ const LLUUID& object_id, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("viewnote")) ) + { + return; + } +// [/RLVa:KB] + // See if we can bring an existing preview to the front if(!LLPreview::show(inv_item->getUUID(), take_focus)) { // There isn't one, so make a new preview S32 left, top; @@ -3193,11 +3206,18 @@ LLUUID object_id = mUUID; LLViewerInventoryItem* item; item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) { - rez_attachment(item, NULL); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // User picked "Wear" so either nothing is locked, or we need to look up the specific attach point from its name + // (NOTE: rez_attachment will take care of deciding whether or not we *can* attach) + rez_attachment(item, + ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear())) + ? NULL : gRlvHandler.getAttachPoint(item, true)); +// [/RLVa:KB] +// rez_attachment(item, NULL); } else if(item && item->isComplete()) { // must be in library. copy it to our inventory and put it on. LLPointer cb = new RezAttachmentCallback(0); @@ -3212,10 +3232,19 @@ gFocusMgr.setKeyboardFocus(NULL); } else if ("detach" == action) { LLInventoryItem* item = gInventory.getItem(mUUID); + +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // Fall-through: if there's a "Detach from yourself" code path we missed then we'll still disallow the detach here + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) + { + return; + } +// [/RLVa:KB] + if( item ) { gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); @@ -3292,15 +3321,28 @@ } } rez_action->mAttachPt = attach_pt; if (attachment && attachment->getObject()) { - gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attach_pt)) ) + gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); + else + delete rez_action; +// [/RLVa] +// gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); } else { - confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) + // Don't allow wear to default attach point if there are any locked attachments + if ( (!rlv_handler_t::isEnabled()) || (0 != attach_pt) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear()) ) + confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); + else + delete rez_action; +// [/RLVa] +// confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); } } void confirm_replace_attachment_rez(S32 option, void* user_data) { @@ -3365,19 +3407,34 @@ } if( avatarp->isWearingAttachment( mUUID ) ) { items.push_back(std::string("Detach From Yourself")); + +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) + disabled_items.push_back(std::string("Detach From Yourself")); +// [/RLVa:KB] } else if( !isInTrash() ) { items.push_back(std::string("Attach Separator")); items.push_back(std::string("Object Wear")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c + // Only enable "Wear" if there is an attach point name *and* there isn't a worn attachment there that's currently locked + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); + if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) + disabled_items.push_back(std::string("Object Wear")); + } +// [/RLVa:KB] + LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE); LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE); LLVOAvatar *avatarp = gAgent.getAvatarObject(); if (attach_menu && (attach_menu->getChildCount() == 0) && attach_hud_menu && (attach_hud_menu->getChildCount() == 0) && @@ -3389,19 +3446,31 @@ LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; LLMenuItemCallGL *new_item; if (attachment->getIsHUDAttachment()) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) attach_hud_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), NULL, //&LLObjectBridge::attachToAvatar, - NULL, &attach_label, (void*)attachment)); + (rlv_handler_t::isEnabled()) ? &rlvAttachToEnabler : NULL, + &attach_label, (void*)attachment)); +// [/RLVa:KB] + //attach_hud_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), + // NULL, //&LLObjectBridge::attachToAvatar, + // NULL, &attach_label, (void*)attachment)); } else { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) attach_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), NULL, //&LLObjectBridge::attachToAvatar, - NULL, &attach_label, (void*)attachment)); + (rlv_handler_t::isEnabled()) ? &rlvAttachToEnabler : NULL, + &attach_label, (void*)attachment)); +// [/RLVa:KB] + //attach_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), + // NULL, //&LLObjectBridge::attachToAvatar, + // NULL, &attach_label, (void*)attachment)); } LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachObject"); if (callback) @@ -3877,10 +3946,24 @@ gest_item_array, LLInventoryModel::EXCLUDE_TRASH, is_gesture); S32 gest_count = gest_item_array.count(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) ) + { + // Filter anything that doesn't specify an attachment point (or that specifies one that's currently locked) + for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) + { + LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); + if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject()))) ) + obj_item_array.remove(idxObj); + } + obj_count = obj_item_array.count(); + } +// [/RLVa:KB] + if( !wearable_count && !obj_count && !gest_count) { gViewerWindow->alertXml("CouldNotPutOnOutfit"); delete wear_info; return; @@ -3981,18 +4064,28 @@ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_HeaderData); msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); msg->addU8Fast(_PREHASH_TotalObjects, obj_count ); - msg->addBOOLFast(_PREHASH_FirstDetachAll, !wear_info->mAppend ); +// msg->addBOOLFast(_PREHASH_FirstDetachAll, !wear_info->mAppend ); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a + // This really should just *always* be FALSE since TRUE can result in loss of the current asset state + msg->addBOOLFast(_PREHASH_FirstDetachAll, (!wear_info->mAppend) && (!gRlvHandler.hasLockedAttachment()) ); +// [/RLVa:KB] } LLInventoryItem* item = obj_item_array.get(i); msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point +// msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a + msg->addU8Fast(_PREHASH_AttachmentPt, + ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) ) + ? 0 + : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true))); +// [/RLVa:KB] pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); msg->addStringFast(_PREHASH_Name, item->getName()); msg->addStringFast(_PREHASH_Description, item->getDescription()); if( (i+1 == obj_count) || ((OBJECTS_PER_PACKET-1) == (i % OBJECTS_PER_PACKET)) ) @@ -4064,10 +4157,17 @@ // // item, update the item to point to the new // // asset. // item->setAssetUUID(wearable->getID()); // item->updateAssetOnServer(); // } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c + if ( (!gRlvHandler.isWearable(wearable->getType())) || + ( (!gRlvHandler.isRemovable(wearable->getType())) && (gAgent.getWearable(wearable->getType())) ) ) + { + continue; + } +// [/RLVa:KB] items.put(item); wearables.put(wearable); } break; } @@ -4152,11 +4252,15 @@ if (wearable_count > 0) //Loop through wearables. If worn, remove. { for(i = 0; i < wearable_count; ++i) { - if( gAgent.isWearingItem (item_array.get(i)->getUUID()) ) +// if( gAgent.isWearingItem (item_array.get(i)->getUUID()) ) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.2a + LLWearable* pWearable = gAgent.getWearableFromWearableItem(item_array.get(i)->getUUID()); + if ( (pWearable) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isRemovable(pWearable->getType()))) ) +// [/RLVa:KB] { gWearableList.getAsset(item_array.get(i)->getAssetUUID(), item_array.get(i)->getName(), item_array.get(i)->getType(), LLWearableBridge::onRemoveFromAvatarArrived, @@ -4169,10 +4273,22 @@ if (obj_count > 0) { for(i = 0; i < obj_count; ++i) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.2a + // TODO-RLVa: is there a reason why LL doesn't bother checking to see if you're actually wearing the object? + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (!pAvatar) || (!pAvatar->isWearingAttachment(obj_item_array.get(i)->getUUID())) || + (!gRlvHandler.isDetachable(obj_item_array.get(i).get())) ) // Why does LLPointer have a cast to BOOL aka S32??? + { + continue; + } + } +// [/RVLa:KB] gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); gMessageSystem->addUUIDFast(_PREHASH_ItemID, obj_item_array.get(i)->getUUID() ); @@ -4558,12 +4674,15 @@ { if( gAgent.isWearingItem( *item_id ) ) { EWearableType type = wearable->getType(); - if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& + //if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.2a | SL big fix + if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES) ) +// [/RLVa:KB] { gAgent.removeWearable( type ); } } } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llinventorymodel.cpp linden/indra/newview/llinventorymodel.cpp --- linden/indra/newview/llinventorymodel.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llinventorymodel.cpp 2009-08-09 15:07:09.656250000 +0200 @@ -2874,10 +2874,18 @@ else { llinfos << "LLInventoryModel::processSaveAssetIntoInventory item" " not found: " << item_id << llendl; } + +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0e + if (rlv_handler_t::isEnabled()) + { + gRlvHandler.onSavedAssetIntoInventory(item_id); + } +// [/RLVa:KB] + if(gViewerWindow) { gViewerWindow->getWindow()->decBusyCount(); } } @@ -2916,10 +2924,27 @@ //llinfos << "unpaked folder '" << tfolder->getName() << "' (" // << tfolder->getUUID() << ") in " << tfolder->getParentUUID() // << llendl; if(tfolder->getUUID().notNull()) { +// [RLVa:KB] - Checked: 2009-08-07 (RLVa-1.0.1f) | Added: RLVa-1.0.0f + // TODO-RLVa: this really shouldn't go here, but if the inventory offer spans multiple BulkUpdateInventory messages + // then the second message will cause the viewer to show the folder under its original name even though + // it is renamed properly on the inventory server + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) ) + { + LLViewerInventoryCategory* pRlvRoot = gRlvHandler.getSharedRoot(); + std::string strName = tfolder->getName(); + if ((pRlvRoot) && (pRlvRoot->getUUID() == tfolder->getParentUUID() ) && (strName.find(RLV_PUTINV_PREFIX) == 0)) + { + strName.erase(0, strName.find(RLV_FOLDER_PREFIX_PUTINV)); // Strips the prefix while retaining while the '~' + tfolder->rename(strName); + tfolder->updateServer(FALSE); + } + } +// [/RLVa:KB] + folders.push_back(tfolder); LLViewerInventoryCategory* folderp = gInventory.getCategory(tfolder->getUUID()); if(folderp) { if(tfolder->getParentUUID() == folderp->getParentUUID()) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llinventoryview.cpp linden/indra/newview/llinventoryview.cpp --- linden/indra/newview/llinventoryview.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llinventoryview.cpp 2009-08-07 19:30:25.328125000 +0200 @@ -702,11 +702,21 @@ } // Destroy all but the last floater, which is made invisible. void LLInventoryView::onClose(bool app_quitting) { - S32 count = sActiveViews.count(); +// S32 count = sActiveViews.count(); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // See LLInventoryView::closeAll() on why we're doing it this way + S32 count = 0; + for (S32 idx = 0, cnt = sActiveViews.count(); idx < cnt; idx++) + { + if (!sActiveViews.get(idx)->isDead()) + count++; + } +// [/RLVa:KB] + if (count > 1) { destroy(); } else @@ -780,10 +790,17 @@ if (gDisconnected || gNoRender) { return NULL; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV)) + { + return NULL; + } +// [/RLVa:KB] + LLInventoryView* iv = LLInventoryView::getActiveInventory(); #if 0 && !LL_RELEASE_FOR_DOWNLOAD if (sActiveViews.count() == 1) { delete iv; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llinventoryview.h linden/indra/newview/llinventoryview.h --- linden/indra/newview/llinventoryview.h 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llinventoryview.h 2009-08-07 19:30:25.359375000 +0200 @@ -215,10 +215,38 @@ // This method calls showAgentInventory() if no views are visible, // or hides/destroyes them all if any are visible. static void toggleVisibility(); static void toggleVisibility(void*) { toggleVisibility(); } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + static void closeAll() + { + // If there are mulitple inventory floaters open then clicking the "Inventory" button will close + // them one by one (see LLToolBar::onClickInventory() => toggleVisibility() ) until we get to the + // last one which will just be hidden instead of closed/destroyed (see LLInventoryView::onClose) + // + // However the view isn't removed from sActiveViews until its destructor is called and since + // 'LLMortician::sDestroyImmediate == FALSE' while the viewer is running the destructor won't be + // called right away + // + // Result: we can't call close() on the last (sActiveViews.count() will still be > 1) because + // onClose() would take the wrong branch and destroy() it as well + // + // Workaround: "fix" onClose() to count only views that aren't marked as "dead" + + LLInventoryView* pView; U8 flagsSound; + for (S32 idx = sActiveViews.count() - 1; idx >= 0; idx--) + { + pView = sActiveViews.get(idx); + flagsSound = pView->getSoundFlags(); + pView->setSoundFlags(LLView::SILENT); // Suppress the window close sound + pView->close(); // onClose() protects against closing the last inventory floater + pView->setSoundFlags(flagsSound); // One view won't be destroy()'ed so it needs its sound flags restored + } + } +// [/RLVa:KB] + // Final cleanup, destroy all open inventory views. static void cleanup(); // LLView & LLFloater functionality virtual void onClose(bool app_quitting); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llmaniptranslate.cpp linden/indra/newview/llmaniptranslate.cpp --- linden/indra/newview/llmaniptranslate.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llmaniptranslate.cpp 2009-08-07 19:30:25.375000000 +0200 @@ -461,12 +461,19 @@ mMouseOutsideSlop = TRUE; // If holding down shift, leave behind a copy. if (mask == MASK_COPY) { // ...we're trying to make a copy - LLSelectMgr::getInstance()->selectDuplicate(LLVector3::zero, FALSE); - mCopyMadeThisDrag = TRUE; +// LLSelectMgr::getInstance()->selectDuplicate(LLVector3::zero, FALSE); +// mCopyMadeThisDrag = TRUE; +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + LLSelectMgr::getInstance()->selectDuplicate(LLVector3::zero, FALSE); + mCopyMadeThisDrag = TRUE; + } +// [/RLVa:KB] // When we make the copy, we don't want to do any other processing. // If so, the object will also be moved, and the copy will be offset. lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (made copy)" << llendl; gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llnetmap.cpp linden/indra/newview/llnetmap.cpp --- linden/indra/newview/llnetmap.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llnetmap.cpp 2009-08-07 19:30:25.390625000 +0200 @@ -403,11 +403,14 @@ pos_global += origin_global; pos_map = globalPosToView(pos_global); BOOL show_as_friend = FALSE; - if( i < regionp->mMapAvatarIDs.count()) + //if( i < regionp->mMapAvatarIDs.count()) +// [RLVa:KB] - Version: 1.22.11 | Alternate: Snowglobe-1.0 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + if ( (i < regionp->mMapAvatarIDs.count()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [/RLVa:KB] { show_as_friend = is_agent_friend(regionp->mMapAvatarIDs.get(i)); } LLWorldMapView::drawAvatar( pos_map.mV[VX], pos_map.mV[VY], @@ -588,11 +591,14 @@ return FALSE; } LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); if( region ) { - msg.assign( region->getName() ); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-0.2.0b + msg.assign( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : rlv_handler_t::cstrHidden ); +// [/RLVa:KB] + //msg.assign( region->getName() ); #ifndef LL_RELEASE_FOR_DOWNLOAD std::string buffer; msg.append("\n"); buffer = region->getHost().getHostName(); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llnotify.cpp linden/indra/newview/llnotify.cpp --- linden/indra/newview/llnotify.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llnotify.cpp 2009-08-07 19:30:25.406250000 +0200 @@ -52,10 +52,14 @@ #include "llviewerimagelist.h" #include "llfloaterchat.h" // for add_chat_history() #include "lloverlaybar.h" // for gOverlayBar #include "lluictrlfactory.h" +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0e) | Added: RLVa-0.2.0b +#include "rlvhandler.h" +// [/RLVa:KB] + // Globals LLNotifyBoxView* gNotifyBoxView = NULL; const F32 ANIMATION_TIME = 0.333f; @@ -326,10 +330,17 @@ if (mIsTip) { // TODO: Make a separate archive for these. LLChat chat(mMessage); chat.mSourceType = CHAT_SOURCE_SYSTEM; +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + if (rlv_handler_t::isEnabled()) + { + // Notices should already have their contents filtered where necessary + chat.mRlvLocFiltered = chat.mRlvNamesFiltered = TRUE; + } +// [/RLVa:KB] LLFloaterChat::getInstance(LLSD())->addChatHistory(chat); } else { LLButton* btn; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lloverlaybar.cpp linden/indra/newview/lloverlaybar.cpp --- linden/indra/newview/lloverlaybar.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/lloverlaybar.cpp 2009-08-07 19:30:25.421875000 +0200 @@ -223,11 +223,14 @@ } BOOL sitting = FALSE; if (gAgent.getAvatarObject()) { - sitting = gAgent.getAvatarObject()->mIsSitting; +// sitting = gAgent.getAvatarObject()->mIsSitting; +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + sitting = gAgent.getAvatarObject()->mIsSitting && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); +// [/RLVa:KB] } button = getChild("Stand Up"); if (button && button->getVisible() != sitting) { @@ -296,10 +299,17 @@ } //static void LLOverlayBar::onClickStandUp(void*) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) + { + return; + } +// [/RLVa:KB] + LLSelectMgr::getInstance()->deselectAllForStandingUp(); gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } //////////////////////////////////////////////////////////////////////////////// diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelavatar.cpp linden/indra/newview/llpanelavatar.cpp --- linden/indra/newview/llpanelavatar.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpanelavatar.cpp 2009-08-07 19:30:25.437500000 +0200 @@ -787,10 +787,13 @@ LLTabContainer* tabs = getChild("classified tab"); S32 tab_count = tabs ? tabs->getTabCount() : 0; bool allow_new = tab_count < MAX_CLASSIFIEDS; +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + allow_new &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); +// [/RLVa:KB] bool allow_delete = (tab_count > 0); bool show_help = (tab_count == 0); // *HACK: Don't allow making new classifieds from inside the directory. // The logic for save/don't save when closing is too hairy, and the @@ -922,10 +925,16 @@ // Create a new classified panel. It will automatically handle generating // its own id when it's time to save. // static void LLPanelAvatarClassified::onClickNew(void* data) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; gViewerWindow->alertXml("AddClassified",callbackNew,self); } @@ -1018,11 +1027,14 @@ void LLPanelAvatarPicks::refresh() { BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); LLTabContainer* tabs = getChild("picks tab"); S32 tab_count = tabs ? tabs->getTabCount() : 0; - childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ); +// [/RLVa:KB] + //childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS); childSetEnabled("Delete...", self && tab_count > 0); childSetVisible("New...", self && getPanelAvatar()->isEditable()); childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); @@ -1096,10 +1108,16 @@ // Create a new pick panel. It will automatically handle generating // its own id when it's time to save. // static void LLPanelAvatarPicks::onClickNew(void* data) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; LLPanelPick* panel_pick = new LLPanelPick(FALSE); LLTabContainer* tabs = self->getChild("picks tab"); panel_pick->initNewPick(); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelclassified.cpp linden/indra/newview/llpanelclassified.cpp --- linden/indra/newview/llpanelclassified.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llpanelclassified.cpp 2009-08-07 19:30:25.453125000 +0200 @@ -758,11 +758,14 @@ mClickThroughText->setEnabled(is_self); mClickThroughText->setVisible(is_self); mSetBtn->setVisible(is_self); - mSetBtn->setEnabled(is_self); + //mSetBtn->setEnabled(is_self); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + mSetBtn->setEnabled(is_self && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ); +// [/RLVa:KB] mUpdateBtn->setEnabled(is_self && checkDirty()); mUpdateBtn->setVisible(is_self); } } @@ -962,10 +965,16 @@ */ // static void LLPanelClassified::onClickSet(void* data) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] LLPanelClassified* self = (LLPanelClassified*)data; // Save location for later. self->mPosGlobal = gAgent.getPositionGlobal(); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelcontents.cpp linden/indra/newview/llpanelcontents.cpp --- linden/indra/newview/llpanelcontents.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llpanelcontents.cpp 2009-08-07 19:30:25.468750000 +0200 @@ -64,10 +64,14 @@ #include "lltool.h" #include "lltoolmgr.h" #include "lltoolcomp.h" #include "llpanelinventory.h" +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +#include "llvoavatar.h" +// [/RLVa:KB] + // // Imported globals // @@ -115,10 +119,28 @@ BOOL editable = gAgent.isGodlike() || (objectp->permModify() && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g + if ( (rlv_handler_t::isEnabled()) && (editable) ) + { + // Don't allow creation of new scripts if it's undetachable + editable = gRlvHandler.isDetachable(objectp); + + // Don't allow creation of new scripts if we're @unsit=n or @sittp=n restricted and we're sitting on the selection + if ( (editable) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + // Only check the first (non-)root object because nothing else would result in enabling the button (see below) + LLViewerObject* pObj = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(TRUE); + + editable = (pObj) && (pAvatar) && ((!pAvatar->mIsSitting) || (pAvatar->getRoot() != pObj->getRootEdit())); + } + } +// [/RLVa:KB] + // Edit script button - ok if object is editable and there's an // unambiguous destination for the object. if( editable && all_volume && ((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1) @@ -158,10 +180,26 @@ { const BOOL children_ok = TRUE; LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); if(object) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if (rlv_handler_t::isEnabled()) // Fallback code [see LLPanelContents::getState()] + { + if (!gRlvHandler.isDetachable(object)) + { + return; // Disallow creating new scripts in a locked attachment + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) ) + return; // .. or in a linkset the avie is sitting on under @unsit=n/@sittp=n + } + } +// [/RLVa:KB] + LLPermissions perm; perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); perm.initMasks( PERM_ALL, PERM_ALL, diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpaneldisplay.cpp linden/indra/newview/llpaneldisplay.cpp --- linden/indra/newview/llpaneldisplay.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpaneldisplay.cpp 2009-08-07 19:30:25.484375000 +0200 @@ -473,11 +473,16 @@ { mCtrlAvatarCloth->setEnabled(true); } // Vertex Shaders - mCtrlShaderEnable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); +// mCtrlShaderEnable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0a + // "Basic Shaders" can't be disabled - but can be enabled - under @setenv=n + bool fCtrlShaderEnable = LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"); + mCtrlShaderEnable->setEnabled(fCtrlShaderEnable && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV) || !mShaderEnable)); +// [/RLVa:KB] BOOL shaders = mCtrlShaderEnable->get(); if (shaders) { mRadioTerrainDetail->setValue(1); @@ -488,11 +493,16 @@ mRadioTerrainDetail->setEnabled(TRUE); } // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight - mCtrlWindLight->setEnabled(mCtrlShaderEnable->getEnabled() && shaders); +// mCtrlWindLight->setEnabled(mCtrlShaderEnable->getEnabled() && shaders); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0a + // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n + bool fCtrlWindLightEnable = fCtrlShaderEnable && shaders; + mCtrlWindLight->setEnabled(fCtrlWindLightEnable && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV) || !mWindLight)); +// [/RLVa:KB] // turn off sky detail if atmostpherics isn't on mCtrlSkyFactor->setEnabled(gSavedSettings.getBOOL("WindLightUseAtmosShaders")); mSkyFactorText->setEnabled(gSavedSettings.getBOOL("WindLightUseAtmosShaders")); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelinventory.cpp linden/indra/newview/llpanelinventory.cpp --- linden/indra/newview/llpanelinventory.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpanelinventory.cpp 2009-08-07 19:30:25.500000000 +0200 @@ -79,10 +79,14 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llwearable.h" +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) +#include "llvoavatar.h" +// [/RLVa:KB] + ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- @@ -361,12 +365,20 @@ openItem(); } BOOL LLTaskInvFVBridge::isItemRenameable() const { - if(gAgent.isGodlike()) return TRUE; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + { + return FALSE; + } +// [/RLVa:KB] + + if(gAgent.isGodlike()) return TRUE; +// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { LLInventoryItem* item; item = (LLInventoryItem*)(object->getInventoryObject(mUUID)); if(item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), @@ -379,10 +391,16 @@ } BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + { + return TRUE; // Fallback code [see LLTaskInvFVBridge::isItemRenameable()] + } +// [/RLVa:KB] if(object) { LLViewerInventoryItem* item = NULL; item = (LLViewerInventoryItem*)object->getInventoryObject(mUUID); if(item && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), @@ -405,16 +423,51 @@ //if(object && (object->permModify() || gAgent.isGodlike())) //{ // return TRUE; //} //return FALSE; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g + if (rlv_handler_t::isEnabled()) + { + LLViewerObject* pObj = gObjectList.findObject(mPanel->getTaskUUID()); + if (pObj) + { + if (!gRlvHandler.isDetachable(pObj)) + { + return FALSE; + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == pObj->getRootEdit()) ) + return FALSE; + } + } + } +// [/RLVa:KB] return TRUE; } BOOL LLTaskInvFVBridge::isItemRemovable() { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g + if ( (object) && (rlv_handler_t::isEnabled()) ) + { + if (!gRlvHandler.isDetachable(object)) + { + return FALSE; + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) ) + return FALSE; + } + } +// [/RLVa:KB] + if(object && (object->permModify() || object->permYouOwner())) { return TRUE; } @@ -555,10 +608,17 @@ if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) { const LLPermissions& perm = inv->getPermissions(); bool can_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // Kind of redundant due to the note below, but in case that ever gets fixed + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + { + return FALSE; + } +// [/RLVa:KB] if (object->isAttachment() && !can_copy) { //RN: no copy contents of attachments cannot be dragged out // due to a race condition and possible exploit where // attached objects do not update their inventory items @@ -672,10 +732,18 @@ items.push_back(std::string("Task Open")); if (!isItemCopyable()) { disabled_items.push_back(std::string("Task Open")); } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + else if ( (rlv_handler_t::isEnabled()) && + ((LLAssetType::AT_LSL_TEXT == item->getType()) || (LLAssetType::AT_NOTECARD == item->getType())) && + (!gRlvHandler.isDetachable(gObjectList.findObject(mPanel->getTaskUUID()))) ) + { + disabled_items.push_back(std::string("Task Open")); + } +// [/RLVa:KB] } items.push_back(std::string("Task Properties")); if(isItemRenameable()) { items.push_back(std::string("Task Rename")); @@ -1177,16 +1245,24 @@ { } void LLTaskLSLBridge::openItem() { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + { + return; + } +// [/RLVa:KB] + llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl; if(LLLiveLSLEditor::show(mUUID, mPanel->getTaskUUID())) { return; } - LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); +// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(!object || object->isInventoryPending()) { return; } if(object->permModify() || gAgent.isGodlike()) @@ -1297,10 +1373,16 @@ LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(!object || object->isInventoryPending()) { return; } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour("viewnote")) || (!gRlvHandler.isDetachable(object))) ) + { + return; + } +// [/RLVa:KB] if(object->permModify() || gAgent.isGodlike()) { S32 left, top; gFloaterView->getNewFloaterPosition(&left, &top); LLRect rect = gSavedSettings.getRect("PreviewScriptRect"); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelland.cpp linden/indra/newview/llpanelland.cpp --- linden/indra/newview/llpanelland.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llpanelland.cpp 2009-08-07 19:30:25.515625000 +0200 @@ -220,10 +220,16 @@ //static void LLPanelLandInfo::onClickClaim(void*) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] LLViewerParcelMgr::getInstance()->startBuyLand(); } //static diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanellogin.cpp linden/indra/newview/llpanellogin.cpp --- linden/indra/newview/llpanellogin.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llpanellogin.cpp 2009-08-07 19:30:25.531250000 +0200 @@ -74,10 +74,14 @@ #include "llfloaterhtmlhelp.h" #include "llfloatertos.h" #include "llglheaders.h" +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) +#include "rlvhandler.h" +// [/RLVa:KB] + #define USE_VIEWER_AUTH 0 std::string load_password_from_disk(void); void save_password_to_disk(const char* hashed_password); @@ -859,10 +863,20 @@ BOOL show_start = TRUE; if ( ! force_visible ) show_start = gSavedSettings.getBOOL("ShowStartLocation"); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + // TODO-RLVa: figure out some way to make this work with RLV_EXTENSION_STARTLOCATION + #ifndef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + show_start = FALSE; + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] + sInstance->childSetVisible("start_location_combo", show_start); sInstance->childSetVisible("start_location_text", show_start); #if LL_RELEASE_FOR_DOWNLOAD BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelobject.cpp linden/indra/newview/llpanelobject.cpp --- linden/indra/newview/llpanelobject.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpanelobject.cpp 2009-08-07 19:30:25.531250000 +0200 @@ -72,10 +72,14 @@ #include "lluictrlfactory.h" #include "llfirstuse.h" #include "lldrawpool.h" +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) +#include "llvoavatar.h" +// [/RLVa:KB] + // // Constants // enum { MI_BOX, @@ -374,10 +378,19 @@ enable_move = FALSE; enable_scale = FALSE; enable_rotate = FALSE; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == objectp->getRootEdit()) ) + enable_move = enable_scale = enable_rotate = FALSE; + } +// [/RLVa:KB] + LLVector3 vec; if (enable_move) { vec = objectp->getPositionEdit(); mCtrlPosX->set( vec.mV[VX] ); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelpermissions.cpp linden/indra/newview/llpanelpermissions.cpp --- linden/indra/newview/llpanelpermissions.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpanelpermissions.cpp 2009-08-07 19:30:25.546875000 +0200 @@ -320,13 +320,30 @@ owner_name.append( last_owner_name ); } } } +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + bool fRlvEnableOwner = true; + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + { + // Only filter the owner name if: the selection is all owned by the same avie and not group owned + if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) ) + { + owner_name = gRlvHandler.getAnonym(owner_name); + fRlvEnableOwner = false; + } + } +// [/RLVa:KB] + childSetText("Owner Name",owner_name); childSetEnabled("Owner Name",TRUE); - childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); +// childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + childSetEnabled("button owner profile", + fRlvEnableOwner && owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); +// [/RLVa:KB] // update group text field childSetEnabled("Group:",true); childSetText("Group Name",LLStringUtil::null); LLUUID group_id; @@ -859,11 +876,17 @@ LLSelectMgr::getInstance()->selectGetGroup(group_id); LLFloaterGroupInfo::showFromUUID(group_id); } else { - LLFloaterAvatarInfo::showFromObject(self->mOwnerID); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + LLFloaterAvatarInfo::showFromObject(self->mOwnerID); + } +// [/RLVa:KB] +// LLFloaterAvatarInfo::showFromObject(self->mOwnerID); } } void LLPanelPermissions::onClickGroup(void* data) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpanelpick.cpp linden/indra/newview/llpanelpick.cpp --- linden/indra/newview/llpanelpick.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpanelpick.cpp 2009-08-07 19:30:25.546875000 +0200 @@ -398,11 +398,14 @@ mEnabledCheck->setVisible(godlike); mEnabledCheck->setEnabled(godlike); mSetBtn->setVisible(godlike); - mSetBtn->setEnabled(godlike); + //mSetBtn->setEnabled(godlike); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + mSetBtn->setEnabled(godlike && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ); +// [/RLVa:KB] } else { mSnapshotCtrl->setEnabled(is_self); mNameEditor->setEnabled(is_self); @@ -415,11 +418,14 @@ mEnabledCheck->setVisible(FALSE); mEnabledCheck->setEnabled(FALSE); mSetBtn->setVisible(is_self); - mSetBtn->setEnabled(is_self); + //mSetBtn->setEnabled(is_self); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + mSetBtn->setEnabled(is_self && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ); +// [/RLVa] } } // static @@ -453,10 +459,16 @@ */ // static void LLPanelPick::onClickSet(void* data) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] LLPanelPick* self = (LLPanelPick*)data; // Save location for later. self->mPosGlobal = gAgent.getPositionGlobal(); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llprefsim.cpp linden/indra/newview/llprefsim.cpp --- linden/indra/newview/llprefsim.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llprefsim.cpp 2009-08-07 19:30:25.562500000 +0200 @@ -253,10 +253,16 @@ //RN: get wide string so replace char can work (requires fixed-width encoding) LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") ); LLWStringUtil::replaceChar(busy_response, '^', '\n'); LLWStringUtil::replaceChar(busy_response, '%', ' '); childSetText("busy_response", wstring_to_utf8str(busy_response)); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) + { + childDisable("busy_response"); + } +// [/RLVa:KB] enableHistory(); // Truncate the e-mail address if it's too long (to prevent going off // the edge of the dialog). diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llpreviewscript.cpp linden/indra/newview/llpreviewscript.cpp --- linden/indra/newview/llpreviewscript.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llpreviewscript.cpp 2009-08-07 19:30:25.578125000 +0200 @@ -1923,10 +1923,16 @@ LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; LLViewerObject* object = gObjectList.findObject( self->mObjectID ); LLCheckBoxCtrl* runningCheckbox = self->getChild("running"); BOOL running = runningCheckbox->get(); //self->mRunningCheckbox->get(); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + { + return; + } +// [/RLVa:KB] if( object ) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); msg->nextBlockFast(_PREHASH_AgentData); @@ -1948,10 +1954,16 @@ void LLLiveLSLEditor::onReset(void *userdata) { LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; LLViewerObject* object = gObjectList.findObject( self->mObjectID ); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) ) + { + return; + } +// [/RLV:KB] if(object) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); msg->nextBlockFast(_PREHASH_AgentData); @@ -2369,10 +2381,18 @@ // static void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save) { LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; + +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(gObjectList.findObject(self->mObjectID))) ) + { + return; + } +// [/RLV:KB] + self->mCloseAfterSave = close_after_save; self->saveIfNeeded(); } // static diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llselectmgr.cpp linden/indra/newview/llselectmgr.cpp --- linden/indra/newview/llselectmgr.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llselectmgr.cpp 2009-08-07 19:30:25.609375000 +0200 @@ -3448,16 +3448,24 @@ { return; } LLVector3d selectionCenter = getSelectionCenterGlobal(); - if (gSavedSettings.getBOOL("LimitSelectDistance") + +// if (gSavedSettings.getBOOL("LimitSelectDistance") +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible(); + if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) ) +// [/RLVa:KB] && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) && !mSelectedObjects->isAttachment() && !selectionCenter.isExactlyZero()) { - F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); +// F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5f; +// [/RLVa:KB] F32 deselect_dist_sq = deselect_dist * deselect_dist; LLVector3d select_delta = gAgent.getPositionGlobal() - selectionCenter; F32 select_dist_sq = (F32) select_delta.magVecSquared(); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llstartup.cpp linden/indra/newview/llstartup.cpp --- linden/indra/newview/llstartup.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llstartup.cpp 2009-08-07 19:30:25.640625000 +0200 @@ -382,10 +382,15 @@ ///////////////////////////////////////////////// // // Initialize stuff that doesn't need data from simulators // +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.1d + if ( (gSavedSettings.controlExists(RLV_SETTING_MAIN)) && (gSavedSettings.getBOOL(RLV_SETTING_MAIN)) ) + rlv_handler_t::setEnabled(TRUE); +// [/RLVa:KB] + if (LLFeatureManager::getInstance()->isSafe()) { gViewerWindow->alertXml("DisplaySetToSafe"); } else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && @@ -921,10 +926,27 @@ // on startup the user can request to go to their home, // their last location, or some URL "-url //sim/x/y[/z]" // 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: 2009-07-08 (RLVa-1.0.0e) | 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 + agent_location_id = START_LOCATION_ID_LAST; + location_which = START_LOCATION_ID_LAST; + gSavedSettings.setBOOL("LoginLastLocation", FALSE); + + // Clear some things that would cause us to divert to a user-specified location + LLURLSimString::setString(LLURLSimString::sLocationStringLast); + LLStartUp::sSLURLCommand.clear(); + } else +// [/RLVa:KB] if (LLURLSimString::parse()) { // a startup URL was specified agent_location_id = START_LOCATION_ID_URL; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llstatusbar.cpp linden/indra/newview/llstatusbar.cpp --- linden/indra/newview/llstatusbar.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llstatusbar.cpp 2009-08-07 19:30:25.656250000 +0200 @@ -566,10 +566,19 @@ mRegionDetails.mForSale = FALSE; mRegionDetails.mOwner = "Unknown"; mRegionDetails.mTraffic = 0.0f; } +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a + if ( (region) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) // region == NULL if we loose our connection to the grid + { + // TODO-RLVa: find out whether the LCD code is still used because if so then we need to filter that as well + location_name = llformat("%s (%s) - %s", + rlv_handler_t::cstrHiddenRegion.c_str(), region->getSimAccessString().c_str(), rlv_handler_t::cstrHidden.c_str()); + } +// [/RLVa:KB] + mTextParcelName->setText(location_name); // x = right edge @@ -812,10 +821,16 @@ } } static void onClickBuyLand(void*) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + return; + } +// [/RLVa:KB] LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); LLViewerParcelMgr::getInstance()->startBuyLand(); } // sets the static variables necessary for the date diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltoolbar.cpp linden/indra/newview/lltoolbar.cpp --- linden/indra/newview/lltoolbar.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/lltoolbar.cpp 2009-08-07 19:30:25.671875000 +0200 @@ -305,10 +305,24 @@ { build_mode = FALSE; } gSavedSettings.setBOOL("BuildBtnState", build_mode); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) + // Called per-frame so this really can't be slow + if (rlv_handler_t::isEnabled()) + { + // If we're rez-restricted, we can still edit => allow build floater + // If we're edit-restricted, we can still rez => allow build floater + childSetEnabled("build_btn", !(gRlvHandler.hasBehaviour(RLV_BHVR_REZ) && gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ); + + childSetEnabled("map_btn", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP) ); + childSetEnabled("radar_btn", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP) ); + childSetEnabled("inventory_btn", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV) ); + } +// [/RLVa:KB] + updateCommunicateList(); } void LLToolBar::updateCommunicateList() { @@ -477,10 +491,18 @@ // Might be first sit LLFirstUse::useSit(); } else { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // NOTE-RLVa: dead code? + if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + { + return; + } +// [/RLVa:KB] + // stand up gAgent.setFlying(FALSE); gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltooldraganddrop.cpp linden/indra/newview/lltooldraganddrop.cpp --- linden/indra/newview/lltooldraganddrop.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/lltooldraganddrop.cpp 2009-08-07 19:30:25.687500000 +0200 @@ -1259,10 +1259,19 @@ { llwarns << "Couldn't find region to rez object" << llendl; return; } + +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // Fallback in case there's a new code path that leads here (see behaviour notes) + if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return; + } +// [/RLVa:KB] + //llinfos << "Rezzing object" << llendl; make_ui_sound("UISndObjectRezIn"); LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); @@ -1925,10 +1934,27 @@ transfer = TRUE; } BOOL volume = (LL_PCODE_VOLUME == obj->getPCode()); BOOL attached = obj->isAttachment(); BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; + +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if (rlv_handler_t::isEnabled()) + { + if (!gRlvHandler.isDetachable(obj)) + { + return ACCEPT_NO_LOCKED; // Disallow inventory drops on a locked attachment + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == obj->getRootEdit()) ) + return ACCEPT_NO_LOCKED; // ... or on a linkset the avie is sitting on under @unsit=n/@sittp=n + } + } +// [/RLVa:KB] + if(attached && !unrestricted) { return ACCEPT_NO_LOCKED; } else if(modify && transfer && volume && !worn) @@ -1980,10 +2006,19 @@ if( !avatar || avatar->isWearingAttachment(item->getUUID()) ) { return ACCEPT_NO; } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c + LLViewerJointAttachment* pAttachPt = NULL; + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && + ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) ) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + if( drop ) { if(mSource == SOURCE_LIBRARY) { LLPointer cb = new RezAttachmentCallback(0); @@ -1995,20 +2030,30 @@ std::string(), cb); } else { - rez_attachment(item, 0); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-1.0.0c + rez_attachment(item, pAttachPt); +// [/RLVa:KB] + //rez_attachment(item, 0); } } return ACCEPT_YES_SINGLE; } EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + if (mSource == SOURCE_WORLD) { return dad3dRezFromObjectOnLand(obj, face, mask, drop); } @@ -2068,10 +2113,18 @@ } EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: if (mask & MASK_CONTROL) then it's a drop rather than a rez, so we let that pass through + if ( !(mask & MASK_CONTROL) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + // handle objects coming from object inventory if (mSource == SOURCE_WORLD) { return dad3dRezFromObjectOnObject(obj, face, mask, drop); } @@ -2273,10 +2326,24 @@ if( gInventory.isObjectDescendentOf( item->getUUID(), trash_id ) ) { return ACCEPT_NO; } +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) + // (See behaviour notes for the "code path", this is just to give a visual indication on whether or not the drop is allowed) + if (rlv_handler_t::isEnabled()) + { + EWearableType type = (EWearableType)item->getFlags(); + + // Block if: 1) we can't wear on that layer; 2) or if we're already wearing something there we can't take off + if ( (!gRlvHandler.isWearable(type)) || ((gAgent.getWearable(type)) && (!gRlvHandler.isRemovable(type))) ) + { + return ACCEPT_NO_LOCKED; + } + } +// [/RLVa:KB] + if( drop ) { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. if (!gAgent.areWearablesLoaded()) @@ -2637,10 +2704,18 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnLand() making this a bit redundant + if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl; LLViewerInventoryItem* item = NULL; LLViewerInventoryCategory* cat = NULL; locateInventory(item, cat); if(!item || !item->isComplete()) return ACCEPT_NO; @@ -2658,10 +2733,18 @@ } EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnObject) making this a bit redundant + if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return ACCEPT_NO_LOCKED; + } +// [/RLVa:KB] + lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl; LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); if(!item || !item->isComplete()) return ACCEPT_NO; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltoolface.cpp linden/indra/newview/lltoolface.cpp --- linden/indra/newview/lltoolface.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/lltoolface.cpp 2009-08-07 19:30:25.703125000 +0200 @@ -97,10 +97,20 @@ { // ...clicked on an avatar, so don't do anything return; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!hit_obj->isAttachment()) || (!hit_obj->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), hit_obj->getPositionRegion() + pick_info.mObjectOffset) > 1.5f * 1.5f) ))) + { + return; + } +// [/RLVa:KB] + // ...clicked on a world object, try to pick the appropriate face if (pick_info.mKeyMask & MASK_SHIFT) { // If object not selected, need to inform sim diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltoolgrab.cpp linden/indra/newview/lltoolgrab.cpp --- linden/indra/newview/lltoolgrab.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/lltoolgrab.cpp 2009-08-07 19:30:25.734375000 +0200 @@ -183,11 +183,16 @@ { llwarns << "objectp was NULL; returning FALSE" << llendl; return FALSE; } - if (objectp->isAvatar()) + //if (objectp->isAvatar()) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + if ( (objectp->isAvatar()) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!objectp->isAttachment()) || (!objectp->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), mGrabPick.mIntersection) > 1.5f * 1.5f) ) ) +// [/RLVa:KB] { if (gGrabTransientTool) { gBasicToolset->selectTool( gGrabTransientTool ); gGrabTransientTool = NULL; @@ -418,10 +423,27 @@ gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); setMouseCapture(FALSE); return TRUE; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + // Don't allow dragging beyond 1.5m under @fartouch=n + LLViewerObject* pObj; + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (GRAB_INACTIVE != mMode) && (hasMouseCapture()) && + ((pObj = mGrabPick.getObject()) != NULL) && (!pObj->isDead()) && (!pObj->isHUDAttachment()) && + (dist_vec_squared(gAgent.getPositionAgent(), pObj->getPositionRegion() + mGrabPick.mObjectOffset) > 1.5f * 1.5f) ) + { + if (gGrabTransientTool) + { + // Prevent the grab tool from popping up as soon as we kill the drag operation + gBasicToolset->selectTool(gGrabTransientTool); + gGrabTransientTool = NULL; + } + setMouseCapture(FALSE); + } +// [/RLVa:KB] + // Do the right hover based on mode switch( mMode ) { case GRAB_ACTIVE_CENTER: handleHoverActive( x, y, mask ); // cursor hidden diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltoolpie.cpp linden/indra/newview/lltoolpie.cpp --- linden/indra/newview/lltoolpie.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/lltoolpie.cpp 2009-08-07 19:30:25.765625000 +0200 @@ -163,10 +163,19 @@ || (parent && parent->flagHandleTouch()); // If it's a left-click, and we have a special action, do it. if (useClickAction(always_show, mask, object, parent)) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + // Block left-click special actions (fallback code really since LLToolSelect::handleObjectSelection() wouldn't select it anyway) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && + (dist_vec_squared(gAgent.getPositionAgent(), mPick.mIntersection) > 1.5f * 1.5f) ) + { + return TRUE; + } +// [/RLVa:KB] + mClickAction = 0; if (object && object->getClickAction()) { mClickAction = object->getClickAction(); } @@ -332,11 +341,26 @@ { gMenuHolder->childSetText("Avatar Mute", std::string("Mute")); // *TODO:Translate //gMutePieMenu->setLabel("Mute"); } - gPieAvatar->show(x, y, mPieMouseButtonDown); + //gPieAvatar->show(x, y, mPieMouseButtonDown); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK + // If we have an empty selection under @fartouch=n don't show the pie menu but play the "operation block" sound + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ) + { + #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK + gPieAvatar->show(x, y, mPieMouseButtonDown); + #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK + } + else + { + make_ui_sound("UISndInvalidOp"); + } + #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK +// [/RLVa:KB] } else if (object->isAttachment()) { gPieAttachment->show(x, y, mPieMouseButtonDown); } @@ -358,19 +382,36 @@ { gMenuHolder->childSetText("Object Mute", std::string("Mute")); // *TODO:Translate //gMuteObjectPieMenu->setLabel("Mute"); } - gPieObject->show(x, y, mPieMouseButtonDown); - - // VEFFECT: ShowPie object - // Don't show when you click on someone else, it freaks them - // out. - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); - effectp->setPositionGlobal(mPick.mPosGlobal); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - effectp->setDuration(0.25f); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK + // If we have an empty selection under @fartouch=n don't show the pie menu but play the "operation block" sound + // (not entirely accurate in case of Tools / Select Only XXX [see LLToolSelect::handleObjectSelection()] + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ) + { + #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK +// [/RLVa:KB] + gPieObject->show(x, y, mPieMouseButtonDown); + + // VEFFECT: ShowPie object + // Don't show when you click on someone else, it freaks them + // out. + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); + effectp->setPositionGlobal(mPick.mPosGlobal); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + effectp->setDuration(0.25f); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK + } + else + { + make_ui_sound("UISndInvalidOp"); + } + #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK +// [/RLVa:KB] } } if (always_show) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltoolplacer.cpp linden/indra/newview/lltoolplacer.cpp --- linden/indra/newview/lltoolplacer.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/lltoolplacer.cpp 2009-08-07 19:30:25.796875000 +0200 @@ -122,10 +122,18 @@ if( dist_to_surface_sq > (max_dist_from_camera * max_dist_from_camera) ) { return FALSE; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + // NOTE: don't use surface_pos_global since for prims it will be the center of the prim while we need center + offset + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (dist_vec_squared(gAgent.getPositionGlobal(), pick.mPosGlobal) > 1.5f * 1.5f) ) + { + return FALSE; + } +// [/RLVa:KB] + // Find the sim where the surface lives. LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(surface_pos_global); if (!regionp) { llwarns << "Trying to add object outside of all known regions!" << llendl; @@ -239,11 +247,14 @@ U32 flags = 0; // not selected if (use_physics) { flags |= FLAGS_USE_PHYSICS; } - if (create_selected) + //if (create_selected) +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | Added: RLVa-1.0.0b + if ( (create_selected) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) +// [/RLVa:KB] { flags |= FLAGS_CREATE_SELECTED; } gMessageSystem->addU32Fast(_PREHASH_AddFlags, flags ); @@ -497,10 +508,17 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) { BOOL added = TRUE; +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return TRUE; // Callers seem to expect a "did you handle it?" so we return TRUE rather than FALSE + } +// [/RLVa:KB] + if (gSavedSettings.getBOOL("CreateToolCopySelection")) { added = addDuplicate(x, y); } else diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltoolselect.cpp linden/indra/newview/lltoolselect.cpp --- linden/indra/newview/lltoolselect.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/lltoolselect.cpp 2009-08-07 19:30:25.828125000 +0200 @@ -48,10 +48,14 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llvoavatar.h" #include "llworld.h" +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) +#include "llfloatertools.h" +// [/RLVa:KB] + // Globals extern BOOL gAllowSelectAvatar; const F32 SELECTION_ROTATION_TRESHOLD = 0.1f; @@ -80,10 +84,55 @@ LLViewerObject* object = pick.getObject(); if (select_root) { object = object->getRootEdit(); } + +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + if (rlv_handler_t::isEnabled()) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + if (!temp_select) + { + return LLSelectMgr::getInstance()->getSelection(); + } + else + { + // Temporary selection, but if the build floater is open then it'll be permanent so get rid of the floater + if (gFloaterTools->getVisible()) + { + // Copy/paste from toggle_build_mode() + gAgent.resetView(false); + gFloaterTools->close(); + gViewerWindow->showCursor(); + } + } + } + + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (object) && ((!object->isAttachment()) || (!object->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) ) + { + // NOTE-RLVa: see behaviour notes for a rather lengthy explanation of why we're doing things this way + //if (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion() + pick.mObjectOffset) > 1.5f * 1.5f) + if (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) + { + if ( (gFloaterTools->getVisible()) && (pick.mKeyMask != MASK_SHIFT) && (pick.mKeyMask != MASK_CONTROL) ) + LLSelectMgr::getInstance()->deselectAll(); + return LLSelectMgr::getInstance()->getSelection(); + } + else if (gFloaterTools->getVisible()) + { + // Copy/paste from toggle_build_mode() + gAgent.resetView(false); + gFloaterTools->close(); + gViewerWindow->showCursor(); + } + } + } +// [/RLVa:KB] + BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly"); BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly"); // *NOTE: These settings must be cleaned up at bottom of function. if (temp_select || gAllowSelectAvatar) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/lltracker.cpp linden/indra/newview/lltracker.cpp --- linden/indra/newview/lltracker.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/lltracker.cpp 2009-08-07 19:30:25.859375000 +0200 @@ -178,12 +178,16 @@ { instance()->stopTrackingLocation(); } else { - renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, - instance()->mBeaconText, instance()->mTrackedLocationName ); + //renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, + // instance()->mBeaconText, instance()->mTrackedLocationName ); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a + renderBeacon(instance()->mTrackedPositionGlobal, gTrackColor, instance()->mBeaconText, + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? instance()->mTrackedLocationName : rlv_handler_t::cstrHidden); +// [/RLVa:KB] } } // Landmark beacon else if( !instance()->mTrackedLandmarkAssetID.isNull() ) @@ -220,12 +224,16 @@ // disappear when they're created only a few meters // away, yet disappear when the agent wanders away // and back again instance()->mHasReachedLandmark = FALSE; } - renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, - instance()->mBeaconText, instance()->mTrackedLandmarkName ); + //renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, + // instance()->mBeaconText, instance()->mTrackedLandmarkName ); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a + renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, instance()->mBeaconText, + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? instance()->mTrackedLandmarkName : rlv_handler_t::cstrHidden); +// [/RLVa:KB] } } else { // probably just finished downloading the asset @@ -249,12 +257,16 @@ { instance()->stopTrackingAvatar(); } else { - renderBeacon( av_tracker.getGlobalPos(), gTrackColor, - instance()->mBeaconText, av_tracker.getName() ); + //renderBeacon( av_tracker.getGlobalPos(), gTrackColor, + // instance()->mBeaconText, av_tracker.getName() ); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a + renderBeacon( av_tracker.getGlobalPos(), gTrackColor, instance()->mBeaconText, + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_tracker.getName() : rlv_handler_t::cstrHidden); +// [/RLVa:KB] } } else { BOOL stop_tracking = FALSE; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewercontrol.cpp linden/indra/newview/llviewercontrol.cpp --- linden/indra/newview/llviewercontrol.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llviewercontrol.cpp 2009-08-13 12:32:20.671875000 +0200 @@ -427,10 +427,24 @@ gVoiceClient->updateSettings(); } return true; } +// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h +bool rlvHandleEnableLegacyNamingChanged(const LLSD& newvalue) +{ + rlv_handler_t::fLegacyNaming = newvalue.asBoolean(); + return true; +} + +bool rlvHandleShowNameTagsChanged(const LLSD& newvalue) +{ + RlvSettings::fShowNameTags = newvalue.asBoolean(); + return true; +} +// [/RLVa:KB] + //////////////////////////////////////////////////////////////////////////// void settings_setup_listeners() { gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _1)); @@ -554,10 +568,17 @@ gSavedSettings.getControl("VoiceEarLocation")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); + +// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h + if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) + gSavedSettings.getControl(RLV_SETTING_ENABLELEGACYNAMING)->getSignal()->connect(boost::bind(&rlvHandleEnableLegacyNamingChanged, _1)); + if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS)) + gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&rlvHandleShowNameTagsChanged, _1)); +// [/RLVa:KB] } template <> eControlType get_control_type(const U32& in, LLSD& out) { out = (LLSD::Integer)in; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewerdisplay.cpp linden/indra/newview/llviewerdisplay.cpp --- linden/indra/newview/llviewerdisplay.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llviewerdisplay.cpp 2009-08-07 19:30:25.875000000 +0200 @@ -673,11 +673,14 @@ LLAppViewer::instance()->pingMainloopTimeout("Display:Sky"); LLFastTimer t(LLFastTimer::FTM_UPDATE_SKY); gSky.updateSky(); } - if(gUseWireframe) +// if(gUseWireframe) +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (gUseWireframe) && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment()) ) ) +// [/RLVa:KB] { glClearColor(0.5f, 0.5f, 0.5f, 0.f); glClear(GL_COLOR_BUFFER_BIT); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); } @@ -800,11 +803,16 @@ glh::matrix4f current_proj = glh_get_current_projection(); glh::matrix4f current_mod = glh_get_current_modelview(); // clamp target zoom level to reasonable values - gAgent.mHUDTargetZoom = llclamp(gAgent.mHUDTargetZoom, 0.1f, 1.f); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // TODO-RLVa: while hasLockedHUD() isn't slow this is called per frame so find a better way + gAgent.mHUDTargetZoom = llclamp(gAgent.mHUDTargetZoom, + ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedHUD()) ) ? 0.1f : 0.85f, 1.f); +// [/RLVa:KB] + //gAgent.mHUDTargetZoom = llclamp(gAgent.mHUDTargetZoom, 0.1f, 1.f); // smoothly interpolate current zoom level gAgent.mHUDCurZoom = lerp(gAgent.mHUDCurZoom, gAgent.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices()) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewermenu.cpp linden/indra/newview/llviewermenu.cpp --- linden/indra/newview/llviewermenu.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llviewermenu.cpp 2009-08-07 19:30:25.921875000 +0200 @@ -215,10 +215,17 @@ void init_debug_rendering_menu(LLMenuGL* menu); void init_debug_ui_menu(LLMenuGL* menu); void init_debug_xui_menu(LLMenuGL* menu); void init_debug_avatar_menu(LLMenuGL* menu); void init_debug_baked_texture_menu(LLMenuGL* menu); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +#ifdef RLV_DEBUG_TESTS + #include "rlvtest.h" +#endif // RLV_DEBUG_TESTS +#include "rlvfloaterbehaviour.h" +void init_debug_rlva_menu(LLMenuGL* menu); +// [/RLVa:KB] BOOL enable_land_build(void*); BOOL enable_object_build(void*); LLVOAvatar* find_avatar_from_object( LLViewerObject* object ); @@ -825,10 +832,23 @@ sub_menu = new LLMenuGL("World"); init_debug_world_menu(sub_menu); menu->appendMenu(sub_menu); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b + #ifdef RLV_ADVANCED_MENU + if (rlv_handler_t::isEnabled()) + { + sub_menu = new LLMenuGL("RLVa"); + init_debug_rlva_menu(sub_menu); + menu->appendMenu(sub_menu); + sub_menu->setVisible(rlv_handler_t::isEnabled()); + sub_menu->setEnabled(rlv_handler_t::isEnabled()); + } + #endif // RLV_ADVANCED_MENU +// [/RLVa:KB] + sub_menu = new LLMenuGL("UI"); init_debug_ui_menu(sub_menu); menu->appendMenu(sub_menu); sub_menu = new LLMenuGL("XUI"); @@ -925,10 +945,17 @@ &menu_toggle_control, NULL, &menu_check_control, (void*)"ShowConsoleWindow")); +// [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)); + #endif // RLV_ADVANCED_TOGGLE_RLVA +// [/RLVa:KB] + if(gSavedSettings.getBOOL("QAMode")) { LLMenuGL* sub = NULL; sub = new LLMenuGL("Debugging"); #if LL_WINDOWS @@ -1372,10 +1399,57 @@ menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_LOWER_BAKED)); menu->append(new LLMenuItemCallGL("Skirt", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_SKIRT_BAKED)); menu->createJumpKeys(); } +// [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 + { + /* + #ifdef RLV_EXPERIMENTAL + LLMenuGL* sub_menu = new LLMenuGL("Experimental"); + + menu->appendMenu(sub_menu); + #endif // RLV_EXPERIMENTAL + */ + } + + // Unit tests + { + #ifdef RLV_DEBUG_TESTS + init_debug_rlva_tests_menu(menu); + #endif // RLV_DEBUG_TESTS + } + + #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(); + } + #endif // RLV_EXTENSION_ENABLE_WEAR + + #ifdef RLV_EXTENSION_HIDELOCKED + if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && + (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) + { + menu->append(new LLMenuItemCheckGL("Hide locked layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); + menu->append(new LLMenuItemCheckGL("Hide locked attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); + //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); + menu->appendSeparator(); + } + #endif // RLV_EXTENSION_HIDELOCKED + + #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)); + #endif // RLV_EXTENSION_FLOATER_RESTRICTIONS +} +// [/RLVa:KB] + void init_server_menu(LLMenuGL* menu) { { LLMenuGL* sub = new LLMenuGL("Object"); menu->appendMenu(sub); @@ -1521,10 +1595,20 @@ LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return true; LLPickInfo pick = LLToolPie::getInstance()->getPick(); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for + // [msg->addVector3("Position", pick.mIntersection) <- see llDetectedTouchPos()] + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) ) + { + return true; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n + } +// [/RLVa:KB] + LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectGrab); msg->nextBlockFast( _PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -1569,10 +1653,18 @@ { bool handleEvent(LLPointer event, const LLSD& userdata) { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); bool new_value = obj && obj->flagHandleTouch(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f + // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for + if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!obj->isAttachment()) || (!obj->permYouOwner())) && + (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) + { + new_value = false; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); // Update label based on the node touch name if available. LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node && node->mValid && !node->mTouchName.empty()) @@ -1612,10 +1704,18 @@ class LLObjectOpen : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + // TODO-RLVa: shouldn't we be checking for fartouch here as well? + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return true; + } +// [/RLVa:KB] + return handle_object_open(); } }; class LLObjectEnableOpen : public view_listener_t @@ -1630,10 +1730,16 @@ { LLViewerObject* root = obj->getRootEdit(); if (!root) new_value = false; else new_value = root->allowOpen(); } + +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b + // TODO-RLV: shouldn't we be checking for fartouch here as well? (and LLViewerObject::allowOpen() makes this redundant?) + new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT); +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -1692,11 +1798,17 @@ gAgent.cameraZoomIn(0.666f); gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); } } - +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (LLSelectMgr::getInstance()) ) + { + LLSelectMgr::getInstance()->deselectAll(); + } +// [/RLVa:KB] + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use LLFirstUse::useBuild(); @@ -1792,10 +1904,27 @@ { bool handleEvent(LLPointer event, const LLSD& userdata) { LLViewerParcelMgr::getInstance()->deselectLand(); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f + if (rlv_handler_t::isEnabled()) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return true; // Can't edit any object under @edit=n + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && + (SELECT_TYPE_WORLD == LLSelectMgr::getInstance()->getSelection()->getSelectType()) && + (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) + { + // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for + return true; // Can't edit in-world objects farther than 1.5m away under @fartouch=n + } + } +// [/RLVa:KB] + if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) @@ -1941,10 +2070,26 @@ if (gAgent.inPrelude()) { enable = LLViewerParcelMgr::getInstance()->agentCanBuild() || LLSelectMgr::getInstance()->getSelection()->isAttachment(); } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // TODO-RLV: include fartouch here? + if ( (rlv_handler_t::isEnabled()) && (enable) ) + { + // We have no way of knowing whether we're being called for "Create" or for "Edit", but we can + // make an educated guess based on the currently active selection which puts us halfway there. + BOOL fActiveSelection = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) + enable = false; // Edit and rez restricted, disable them both + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (fActiveSelection) ) + enable = false; // Edit restricted and there's an active selection => disable Edit and Create + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && (!fActiveSelection) ) + enable = false; // Rez restricted and there's no active selection => disable Create + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); return true; } }; @@ -1968,11 +2113,14 @@ for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getObject()) +// if (attachment->getObject()) +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c + if ( (attachment->getObject()) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(curiter->first)) ) ) +// [/RLVa:KB] { new_value = true; break; } } @@ -2015,10 +2163,13 @@ // It's an avatar LLNameValue *lastname = avatar->getNVPair("LastName"); BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); BOOL is_self = avatar->isSelf(); new_value = !is_linden && !is_self; +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] } } gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -2035,10 +2186,16 @@ std::string name; LLMute::EType type; LLVOAvatar* avatar = find_avatar_from_object(object); if (avatar) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; // Fallback code [see LLObjectEnableMute::handleEvent()] + } +// [/RLVa:KB] id = avatar->getID(); LLNameValue *firstname = avatar->getNVPair("FirstName"); LLNameValue *lastname = avatar->getNVPair("LastName"); if (firstname && lastname) @@ -2079,10 +2236,17 @@ } }; bool handle_go_to() { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && gAgent.forwardGrabbed() && (gRlvHandler.hasLockedAttachment()) ) + { + return true; + } +// [/RLVa:KB] + // JAMESDEBUG try simulator autopilot std::vector strings; std::string val; LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; val = llformat("%g", pos.mdV[VX]); @@ -2161,10 +2325,16 @@ LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if( avatar ) { LLUUID* avatar_id = new LLUUID( avatar->getID() ); std::string fullname = avatar->getFullname(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) + { + fullname = gRlvHandler.getAnonym(fullname); + } +// [/RLVa:KB] if (!fullname.empty()) { LLStringUtil::format_map_t args; args["[AVATAR_NAME]"] = fullname; @@ -2186,11 +2356,15 @@ class LLAvatarVisibleDebug : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - bool new_value = gAgent.isGodlike(); + //bool new_value = gAgent.isGodlike(); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + // TODO-RLVa: can you actually use this to cheat anything? + bool new_value = gAgent.isGodlike() && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -2298,10 +2472,16 @@ if( avatar ) { MenuCallbackData *data = new MenuCallbackData; (*data).avatar_id = avatar->getID(); std::string fullname = avatar->getFullname(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) + { + fullname = gRlvHandler.getAnonym(fullname); + } +// [/RLVa:KB] const LLVector3d& pos = avatar->getPositionGlobal(); LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel(); if (LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_MANAGE_BANNED)) @@ -2379,10 +2559,17 @@ class LLAvatarGiveCard : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + llinfos << "handle_give_card()" << llendl; LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if(dest && dest->isAvatar()) { bool found_name = false; @@ -2628,20 +2815,30 @@ class LLSelfStandUp : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + { + return true; + } +// [/RLVa:KB] + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); return true; } }; class LLSelfEnableStandUp : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; +// bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -2812,10 +3009,15 @@ { bool handleEvent(LLPointer event, const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); bool new_value = avatar && !is_agent_friend(avatar->getID()); + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -2870,20 +3072,38 @@ if (!object || pick.mPickType == LLPickInfo::PICK_FLORA) { return true; } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting)) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) ) ) + { + return true; + } +// [/RLVa:KB] + if (sitting_on_selection()) { gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); return true; } // get object selection offset if (object && object->getPCode() == LL_PCODE_VOLUME) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && + (dist_vec_squared(gAgent.getPositionGlobal(), object->getPositionGlobal() + LLVector3d(pick.mObjectOffset)) > 1.5f * 1.5f) ) + { + return true; // Don't allow sitting farther away than 1.5m under @sittp=n or @fartouch=n + } +// [/RLVa:KB] + gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); gMessageSystem->nextBlockFast(_PREHASH_TargetObject); @@ -2917,10 +3137,17 @@ class LLLandSit : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + { + return true; + } +// [/RLVa:KB] + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); LLViewerParcelMgr::getInstance()->deselectLand(); LLVector3d posGlobal = LLToolPie::getInstance()->getPick().mPosGlobal; @@ -3238,10 +3465,18 @@ class LLEditDuplicate : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && + (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) + { + return true; + } +// [/RLVa:KB] + if(LLEditMenuHandler::gEditMenuHandler) { LLEditMenuHandler::gEditMenuHandler->duplicate(); } return true; @@ -3251,10 +3486,17 @@ class LLEditEnableDuplicate : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (new_value) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && + (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) + { + new_value = false; + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -3636,10 +3878,15 @@ class LLToolsTakeCopy : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-1.0.0b + // NOTE: we need to handle "Take Copy" because it will force a sim-side unsit if we're sitting on the selection, + // but we do want to allow "Take Copy" under @rez=n so that's why we explicitly check for @unsit=n here + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (!rlvCanDeleteOrReturn()) ) return true; +// [/RLVa:KB] const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); return true; @@ -3651,10 +3898,13 @@ class LLObjectReturn : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) return true; +// [/RLVa:KB] mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); gViewerWindow->alertXml("ReturnToOwner", onReturnToOwner, @@ -3720,10 +3970,18 @@ new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } } #endif + +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (new_value) && (rlv_handler_t::isEnabled()) ) + { + new_value = rlvCanDeleteOrReturn(); + } +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -3741,10 +3999,17 @@ if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) { return; } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return; + } +// [/RLVa:KB] + BOOL you_own_everything = TRUE; BOOL locked_but_takeable_object = FALSE; LLUUID category_id; for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); @@ -3862,10 +4127,17 @@ if (sitting_on_selection()) { return FALSE; } +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return FALSE; + } +// [/RLVa:KB] + for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* object = node->getObject(); @@ -4266,19 +4538,41 @@ bool handleEvent(LLPointer event, const LLSD& userdata) { bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment(); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && + (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) + { + // Allow if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); + if (handleSel->getFirstRootNode(&func, TRUE)) + new_value = false; + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; class LLToolsUnlink : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) + { + // Allow if the avie isn't sitting on any of the selected objects + LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); + RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); + if (handleSel->getFirstRootNode(&func, TRUE)) + return true; + } +// [/RLVa:KB] + LLSelectMgr::getInstance()->sendDelink(); return true; } }; @@ -4299,21 +4593,32 @@ class LLToolsReleaseKeys : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + return true; + } +// [/RLVa:KB] + gAgent.forceReleaseControls(); return true; } }; class LLToolsEnableReleaseKeys : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + gMenuHolder->findControl(userdata["control"].asString())->setValue( + gAgent.anyControlGrabbed() && ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment() ) ) ); +// [/RLVa:KB] + //gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); return true; } }; //void handle_hinge(void*) @@ -4417,19 +4722,37 @@ class LLEditEnableDelete : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); + +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: we want to disable delete on objects but not disable delete on text + if ( (new_value) && (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) ) + { + new_value = rlvCanDeleteOrReturn(); + } +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; class LLEditDelete : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + // NOTE: we want to disable delete on objects but not disable delete on text + if ( (rlv_handler_t::isEnabled()) && (LLEditMenuHandler::gEditMenuHandler == LLSelectMgr::getInstance()) && + (!rlvCanDeleteOrReturn()) ) + { + return true; + } +// [/RLVa:KB] + // If a text field can do a deletion, it gets precedence over deleting // an object in the world. if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) { LLEditMenuHandler::gEditMenuHandler->doDelete(); @@ -4457,10 +4780,16 @@ (!LLViewerLogin::getInstance()->isInProductionGrid() && gAgent.isGodlike()) || # endif LLSelectMgr::getInstance()->canDoDelete(); #endif +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (new_value) && (rlv_handler_t::isEnabled()) ) + { + new_value = rlvCanDeleteOrReturn(); + } +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -4475,10 +4804,17 @@ class LLObjectDelete : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn()) ) + { + return true; + } +// [/RLVa:KB] + if (LLSelectMgr::getInstance()) { LLSelectMgr::getInstance()->doDelete(); } @@ -4821,10 +5157,16 @@ class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return true; + } +// [/RLVa:KB] LLViewerRegion* agent_region = gAgent.getRegion(); if(!agent_region) { llwarns << "No agent region" << llendl; return true; @@ -4921,10 +5263,17 @@ class LLAvatarInviteToGroup : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) { invite_to_group(avatar->getID()); } @@ -4934,10 +5283,17 @@ class LLAvatarAddFriend : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; // Fallback code [see LLAvatarEnableAddFriend::handleEvent()] + } +// [/RLVa:KB] + LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar && !is_agent_friend(avatar->getID())) { request_friendship(avatar->getID()); } @@ -5021,10 +5377,16 @@ { new_value = true; } } } + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + // Don't enable "Pay..." on the avatar pie menu under @shownames=n + new_value &= (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (avatar == NULL); +// [/RLVa:KB] + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -5209,10 +5571,16 @@ LLFloaterLand::showInstance(); } else if (floater_name == "buy land") { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return true; + } +// [/RLVa:KB] if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); } @@ -5382,10 +5750,17 @@ { agent_id = gAgent.getID(); } else if (userdata.asString() == "hit object") { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) { agent_id = objectp->getID(); } @@ -5441,10 +5816,17 @@ class LLLandEdit : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) ) + { + return true; + } +// [/RLVa:KB] + if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) { // zoom in if we're looking at the avatar gAgent.setFocusOnAvatar(FALSE, ANIMATE); gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); @@ -5526,10 +5908,22 @@ { S32 index = userdata.asInteger(); LLViewerJointAttachment* attachment_point = NULL; if (index > 0) attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); + +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point + ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" + { + setObjectSelection(NULL); // Clear the selection or it'll get stuck + return true; + } +// [/RLVa:KB] + confirm_replace_attachment(0, attachment_point); } return true; } @@ -5633,10 +6027,28 @@ { llwarns << "Trying to detach avatar from avatar." << llendl; return true; } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if (rlv_handler_t::isEnabled()) + { + if (gRlvHandler.hasLockedAttachment()) + { + // NOTE: copy/paste of the code in enable_detach() + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + return true; + } + else if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) + { + return true; + } + } +// [/RLVa:KB] + // The sendDropAttachment() method works on the list of selected // objects. Thus we need to clear the list, make sure it only // contains the object the user clicked, send the message, // then clear the list. LLSelectMgr::getInstance()->sendDropAttachment(); @@ -5651,10 +6063,17 @@ LLViewerObject* attached_object = attachment->getObject(); if (attached_object) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0d + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(attached_object)) ) + { + return; + } +// [/RLVa:KB] + gMessageSystem->newMessage("ObjectDetach"); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); @@ -5733,10 +6152,21 @@ { llwarns << "Trying to detach avatar from avatar." << llendl; return true; } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // NOTE: copy/paste of the code in enable_detach() + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + return FALSE; + } +// [/RLVa:KB] + // The sendDetach() method works on the list of selected // objects. Thus we need to clear the list, make sure it only // contains the object the user clicked, send the message, // then clear the list. // We use deselectAll to update the simulator's notion of what's @@ -5816,11 +6246,14 @@ } } } //now check to make sure that the item is actually in the inventory before we enable dropping it - bool new_value = enable_detach(NULL) && can_build && item; +// bool new_value = enable_detach(NULL) && can_build && item; +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -5836,10 +6269,24 @@ while (avatar) { // ...if it's you, good to detach if (avatar->getID() == gAgent.getID()) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // NOTE: this code is reused as-is in LLAttachmentDetach::handleEvent() and LLAttachmentDrop::handleEvent() + // so any changes here should be reflected there as well (I think it's in a number of other places as well by now) + + // RELEASE-RLVa: LLSelectMgr::sendDetach() and LLSelectMgr::sendDropAttachment() call sendListToRegions with + // SEND_ONLY_ROOTS so we only need to examine the roots which saves us time + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&functor, FALSE)) ) + return FALSE; + } +// [/RLVa:KB] return TRUE; } avatar = (LLViewerObject*)avatar->getParent(); } @@ -5858,10 +6305,29 @@ }; // Used to tell if the selected object can be attached to your avatar. BOOL object_selected_and_point_valid(void *user_data) { +// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) + if (rlv_handler_t::isEnabled()) + { + // RELEASE-RLVa: look at the caller graph for this function on every new release + // -> 1.22.11 and 1.23.4 + // - object_is_wearable() => dead code [user_data == NULL => default attach point => OK!] + // - LLObjectEnableWear::handleEvent() => Rezzed prim / right-click / "Wear" [user_data == NULL => see above] + // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] + // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] + LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; + if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point + ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" + { + return FALSE; + } + } +// [/RLVa:KB] + //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::root_iterator iter = selection->root_begin(); iter != selection->root_end(); iter++) { @@ -5925,18 +6391,30 @@ BOOL object_attached(void *user_data) { LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; - return attachment->getObject() != NULL; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + return ( + (attachment->getObject() != NULL) && + ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attachment->getObject())) ) + ); +// [/RLVa:KB] +// return attachment->getObject() != NULL; } class LLAvatarSendIM : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + return true; + } +// [/RLVa:KB] if(avatar) { std::string name("IM"); LLNameValue *first = avatar->getNVPair("FirstName"); LLNameValue *last = avatar->getNVPair("LastName"); @@ -6058,10 +6536,20 @@ class LLToolsSelectedScriptAction : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); + RlvSelectHasLockedAttach functor; + if ( (selectHandle->isAttachment()) && (selectHandle->getFirstNode(&functor)) ) + return true; + } +// [/RLVa:KB] + std::string action = userdata.asString(); if (action == "compile mono") { handle_compile_queue("mono"); } @@ -6139,16 +6627,34 @@ gImageList.dump(); } void handle_test_male(void*) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasLockedAttachment()) || + (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) + { + return; + } +// [/RLVa:KB] + wear_outfit_by_name("Male Shape & Outfit"); //gGestureList.requestResetFromServer( TRUE ); } void handle_test_female(void*) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && + ( (gRlvHandler.hasLockedAttachment()) || + (gRlvHandler.hasBehaviour(RLV_BHVR_ADDOUTFIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REMOUTFIT)) ) ) + { + return; + } +// [/RLVa:KB] + wear_outfit_by_name("Female Shape & Outfit"); //gGestureList.requestResetFromServer( FALSE ); } void handle_toggle_pg(void*) @@ -6297,10 +6803,26 @@ return (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); } static bool is_editable_selected() { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c + // RELEASE-RLVa: check that this still isn't called by anything but script actions in the Tools menu + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) + { + LLObjectSelectionHandle selectHandle = LLSelectMgr::getInstance()->getSelection(); + + // NOTE: this is called for 5 different menu items so we'll trade accuracy for efficiency and only + // examine root nodes (LLToolsSelectedScriptAction::handleEvent() will catch what we miss) + RlvSelectHasLockedAttach functor; + if ( (selectHandle->isAttachment()) && (selectHandle->getFirstRootNode(&functor)) ) + { + return false; + } + } +// [/RLVa:KB] + return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); } class LLEditableSelected : public view_listener_t { @@ -6343,11 +6865,16 @@ { struct f : public LLSelectedObjectFunctor { virtual bool apply(LLViewerObject* obj) { - return (!obj->permCopy() || obj->isAttachment()); +// return (!obj->permCopy() || obj->isAttachment()); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + return (!obj->permCopy() || obj->isAttachment()) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && + (gAgent.getAvatarObject()->getRoot() == obj) ); +// [/RLVa:KB] } } func; const bool firstonly = true; bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); all_valid = !any_invalid; @@ -6546,10 +7073,13 @@ { bool handleEvent(LLPointer event, const LLSD& userdata) { bool new_value = gAgent.isGodlike() || (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } }; @@ -6598,11 +7128,15 @@ return gAgent.getGodLevel() >= GOD_CUSTOMER_SERVICE; } BOOL enable_god_basic(void*) { - return gAgent.getGodLevel() > GOD_NOT; +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + // RELEASE-RLVa: check that this function isn't used for anything other than to enable/disable showing the "God Tools..." floater + return (gAgent.getGodLevel() > GOD_NOT) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] + //return gAgent.getGodLevel() > GOD_NOT; } #if 0 // 1.9.2 void toggle_vertex_shaders(void *) { @@ -7091,10 +7625,17 @@ // TomY TODO: Get rid of these? class LLViewHighlightTransparent : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + { + return true; + } +// [/RLVa:KB] + LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; return true; } }; @@ -7138,10 +7679,17 @@ class LLViewShowHUDAttachments : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (LLPipeline::sShowHUDAttachments) && (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedHUD()) ) + { + return true; + } +// [/RLVa:KB] + LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; return true; } }; @@ -7196,10 +7744,19 @@ } if (clothing == "skirt") { new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); } + +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) + // Why aren't they using LLWearable::typeNameToType()? *confuzzled* + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isRemovable(LLWearable::typeNameToType(clothing))) ) + { + new_value = false; + } +// [/RLVa:KB] + gMenuHolder->findControl(control_name)->setValue(new_value); return true; } }; @@ -7293,10 +7850,17 @@ /// WINDLIGHT callbacks class LLWorldEnvSettings : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return true; + } +// [/RLVa:KB] + std::string tod = userdata.asString(); LLVector3 sun_direction; if (tod == "editor") { @@ -7370,10 +7934,17 @@ /// Water Menu callbacks class LLWorldWaterSettings : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return true; + } +// [/RLVa:KB] + // if not there or is hidden, show it if( !LLFloaterWater::isOpen() || !LLFloaterWater::instance()->getVisible()) { LLFloaterWater::show(); @@ -7400,10 +7971,17 @@ /// Day Cycle callbacks class LLWorldDayCycle : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { + return true; + } +// [/RLVa:KB] + LLFloaterDayCycle::show(); return true; } }; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewermessage.cpp linden/indra/newview/llviewermessage.cpp --- linden/indra/newview/llviewermessage.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llviewermessage.cpp 2009-08-07 19:30:51.218750000 +0200 @@ -139,10 +139,15 @@ #if LL_WINDOWS // For Windows specific error handler #include "llwindebug.h" // For the invalid message handler #endif +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +#include "llfloateravatarinfo.h" +extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp +// [/RLVa:KB] + // // Constants // const F32 BIRD_AUDIBLE_RADIUS = 32.0f; const F32 SIT_DISTANCE_FROM_TARGET = 0.25f; @@ -1006,12 +1011,21 @@ else { std::string first_name, last_name; if (gCacheName->getName(info->mFromID, first_name, last_name)) { - from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; - chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + std::string full_name = first_name + " " + last_name; + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + full_name = gRlvHandler.getAnonym(full_name); + } + from_string = std::string("An object named '") + info->mFromName + "' owned by " + full_name; + chatHistory_string = info->mFromName + " owned by " + full_name; +// [/RLVa:KB] + //from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; + //chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; } else { from_string = std::string("An object named '") + info->mFromName + "' owned by an unknown user"; chatHistory_string = info->mFromName + " owned by an unknown user"; @@ -1026,10 +1040,25 @@ bool busy=FALSE; switch(button) { case IOR_ACCEPT: +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.2a + // Only change the inventory offer's destination folder to the shared root if: + // - the user has enabled the feature + // - the inventory offer came from a script (and specifies a folder) + // - the name starts with the prefix [mDesc format (quotes are part of the string): "[OBJECTNAME] ( http://slurl.com/... )"] + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) && + (IM_TASK_INVENTORY_OFFERED == info->mIM) && (LLAssetType::AT_CATEGORY == info->mType) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) ) + { + LLViewerInventoryCategory* pRlvRoot = gRlvHandler.getSharedRoot(); + if (pRlvRoot) + { + info->mFolderID = pRlvRoot->getUUID(); + } + } +// [/RLVa:KB] // ACCEPT. The math for the dialog works, because the accept // for inventory_offered, task_inventory_offer or // group_notice_inventory is 1 greater than the offer integer value. // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED, // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED @@ -1188,10 +1217,17 @@ std::string msg = info->mDesc; int indx = msg.find(" ( http://slurl.com/secondlife/"); if(indx >= 0) { LLStringUtil::truncate(msg, indx); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a + // TODO-RLVa: needs revisiting when LL saves open notifications to disk to accept them on the next relog + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + gRlvHandler.filterLocation(info->mDesc); + } +// [/RLVa:KB] } LLStringUtil::format_map_t args; args["[OBJECTNAME]"] = msg; @@ -1228,10 +1264,17 @@ else { std::string first_name, last_name; if (gCacheName->getName(info->mFromID, first_name, last_name)) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + first_name = gRlvHandler.getAnonym(first_name.append(" ").append(last_name)); + last_name.clear(); + } +// [/RLVa:KB] args["[FIRST]"] = first_name; args["[LAST]"] = last_name; name_found = TRUE; } } @@ -1242,11 +1285,17 @@ args, &inventory_offer_callback, (void*)info); } else { // *TODO:translate -> [FIRST] [LAST] - args["[NAME]"] = info->mFromName; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + args["[NAME]"] = gRlvHandler.getAnonym(info->mFromName); + } +// [/RLVa:KB] + //args["[NAME]"] = info->mFromName; LLNotifyBox::showXml("UserGiveItem", args, &inventory_offer_callback, (void*)info); } } @@ -1410,11 +1459,24 @@ && to_id.isNull() ) { // do nothing -- don't distract newbies in // Prelude with global IMs } - else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) ) + { + rlvSendBusyMessage(from_id, gRlvHandler.getVersionString(), session_id); + // We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg) + LLPointer im_info = new LLIMInfo(gMessageSystem); + gIMMgr->processIMTypingStop(im_info); + } +// [/RLVa:KB] +// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, from_id))) ) +// [/RLVa:KB] { // return a standard "busy" message, but only do it to online IM // (i.e. not other auto responses and not store-and-forward IM) if (!gIMMgr->hasSession(session_id)) { @@ -1467,10 +1529,25 @@ chat.mText = name + ": " + message; LLFloaterChat::addChat(chat, FALSE, FALSE); } else if (to_id.isNull()) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + // Filter region messages that weren't sent by a Linden + if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) && + (!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + gRlvHandler.filterLocation(message); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + name = gRlvHandler.getAnonym(name); + gRlvHandler.filterNames(message); + } + } +// [/RLVa:KB] + // Message to everyone from GOD args["[NAME]"] = name; args["[MESSAGE]"] = message; LLNotifyBox::showXml("GodMessage", args); @@ -1482,10 +1559,19 @@ LLFloaterChat::addChat(chat, FALSE, local_agent); } else { // standard message, not from system +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) + { + rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgRecvIM, session_id); + + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } +// [/RLVa:KB] + std::string saved; if(offline == IM_OFFLINE) { saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str()); } @@ -1687,10 +1773,17 @@ break; } bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; info->mType = (LLAssetType::EType) bucketp->asset_type; info->mObjectID = bucketp->object_id; + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) ) + { + name = gRlvHandler.getAnonym(name); + } +// [/RLVa:KB] } else { if (sizeof(S8) != binary_bucket_size) { @@ -1731,17 +1824,27 @@ } break; case IM_INVENTORY_ACCEPTED: { - args["[NAME]"] = name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); + args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); +// [/RLVa:KB] +// args["[NAME]"] = name; LLNotifyBox::showXml("InventoryAccepted", args); break; } case IM_INVENTORY_DECLINED: { - args["[NAME]"] = name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); + args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); +// [/RLVa:KB] +// args["[NAME]"] = name; LLNotifyBox::showXml("InventoryDeclined", args); break; } case IM_GROUP_VOTE: { @@ -1771,10 +1874,26 @@ if ( !gIMMgr->hasSession(session_id) ) { return; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) ) + { + if (gAgent.isInGroup(session_id)) + { + if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id)) + return; + } + else + { + if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } + } +// [/RLVa:KB] + // standard message, not from system std::string saved; if(offline == IM_OFFLINE) { saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str()); @@ -1817,10 +1936,21 @@ if (is_busy && !is_owned_by_me) { return; } { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + // TODO-RLVa: what actually generates this? + if (rlv_handler_t::isEnabled()) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + gRlvHandler.filterLocation(message); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + gRlvHandler.filterNames(message); + } +// [/RLVa:KB] + // Construct a viewer alert for this message. args["[NAME]"] = name; args["[MESSAGE]"] = message; LLNotifyBox::showXml("ObjectMessage", args); } @@ -1849,16 +1979,52 @@ { busy_message(msg,from_id); } else { - // *TODO:translate -> [FIRST] [LAST] (maybe) - LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); - args["[NAME]"] = name; - args["[MESSAGE]"] = message; - LLNotifyBox::showXml("OfferTeleport", args, - lure_callback, (void*)info); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) + if (rlv_handler_t::isEnabled()) + { + // Disallow if: 1) @tplure=n restricted (sender isn't an exception), or 2) @unsit=n restricted and currently sitting + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) ) + { + rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgTpLure); + return; + } + + // Censor teleport message if: 1) @revcim=n restricted (sender isn't an exception), or 2) @showloc=n restricted + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + message = rlv_handler_t::cstrHidden; + } + } +// [/RLVa:KB] + +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) ) + { + gRlvHandler.setCanCancelTp(false); + // (see IM_GODLIKE_LURE_USER below) + LLLureInfo* info = new LLLureInfo(from_id, session_id, TRUE); + lure_callback(0, (void*)info); + } + else + { +// [/RLVa:KB] + // *TODO:translate -> [FIRST] [LAST] (maybe) + LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); + args["[NAME]"] = name; + args["[MESSAGE]"] = message; + LLNotifyBox::showXml("OfferTeleport", args, + lure_callback, (void*)info); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + } +// [/RLVa:KB] } } break; case IM_GODLIKE_LURE_USER: @@ -2199,12 +2365,17 @@ if (chatter) { chat.mPosAgent = chatter->getPositionAgent(); // Make swirly things only for talking objects. (not script debug messages, though) - if (chat.mSourceType == CHAT_SOURCE_OBJECT - && chat.mChatType != CHAT_TYPE_DEBUG_MSG) +// if (chat.mSourceType == CHAT_SOURCE_OBJECT +// && chat.mChatType != CHAT_TYPE_DEBUG_MSG) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Don't show swirly things for llOwnerSay() chat here because we handle those further down + if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) && + ((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) ) +// [/RLVa:KB] { LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); psc->setSourceObject(chatter); psc->setColor(color); //We set the particles to be owned by the object's owner, @@ -2233,10 +2404,54 @@ std::string verb; color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); +// [RLVa:KB] - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d + if ( (rlv_handler_t::isEnabled()) && + (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) ) + { + // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment) + BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE; + + // Filtering "rules": + // avatar => filter all avie text (unless it's this avie or they're an exemption) + // objects => filter everything except attachments this avie owns + if ( ((CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID())) || (!is_owned_by_me) || (!is_attachment) ) + { + if (!rlvIsEmote(mesg)) + { + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) ) + gRlvHandler.filterChat(mesg, false); + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) ) + { + mesg = "/me ..."; + } + } + + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + // Filtering "rules": + // avatar => filter only their name (unless it's this avie) + // other => filter everything except attachments this avie owns but then we still do filter their text + if (CHAT_SOURCE_AGENT == chat.mSourceType) + { + if (chat.mFromID != gAgent.getID()) + from_name = gRlvHandler.getAnonym(from_name); + } + else + { + if ( (!is_owned_by_me) || (!is_attachment) ) + gRlvHandler.filterNames(from_name); + gRlvHandler.filterNames(mesg); + } + chat.mRlvNamesFiltered = true; + } + } +// [/RLVa:KB] + BOOL ircstyle = FALSE; // Look for IRC-style emotes here so chatbubbles work std::string prefix = mesg.substr(0, 4); if (prefix == "/me " || prefix == "/me'") @@ -2297,12 +2512,80 @@ switch(chat.mChatType) { case CHAT_TYPE_WHISPER: verb = " " + LLTrans::getString("whisper") + " "; break; - case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: +// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e + if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) ) + { + mesg.erase(0, 1); + LLStringUtil::toLower(mesg); + + std::string strExecuted, strFailed, strRetained, *pstr; + + typedef boost::tokenizer > tokenizer; + boost::char_separator sep(",", "", boost::drop_empty_tokens); + tokenizer tokens(mesg, sep); + for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + { + if (LLStartUp::getStartupState() == STATE_STARTED) + { + if (gRlvHandler.processCommand(from_id, *itToken, true)) + pstr = &strExecuted; + else + pstr = &strFailed; + } + else + { + gRlvHandler.retainCommand(from_name, from_id, *itToken); + pstr = &strRetained; + } + + if (!pstr->empty()) + pstr->push_back(','); + pstr->append(*itToken); + } + + if (!RlvSettings::getDebug()) + return; + + // Silly people want comprehensive debug messages, blah :p + if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) ) + verb = " executes: @"; + else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) ) + verb = " failed: @"; + else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) ) + verb = " retained: @"; + else + { + verb = ": @"; + if (!strExecuted.empty()) + mesg += "\n - executed: @" + strExecuted; + if (!strFailed.empty()) + mesg += "\n - failed: @" + strFailed; + if (!strRetained.empty()) + mesg += "\n - retained: @" + strRetained; + } + + break; + } +// [/RLVa:KB] +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Copy/paste from above + if ( (chatter) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG) ) + { + LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); + psc->setSourceObject(chatter); + psc->setColor(color); + //We set the particles to be owned by the object's owner, + //just in case they should be muted by the mute list + psc->setOwnerUUID(owner_id); + LLViewerPartSim::getInstance()->addPartSource(psc); + } +// [/RLVa:KB] + case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_NORMAL: verb = ": "; break; case CHAT_TYPE_SHOUT: verb = " " + LLTrans::getString("shout") + " "; @@ -2367,11 +2650,14 @@ void process_teleport_start(LLMessageSystem *msg, void**) { U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) + //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } else { @@ -2402,11 +2688,14 @@ LL_WARNS("Messaging") << "Unexpected teleport progress message." << LL_ENDL; return; } U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) + //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } else { @@ -2739,11 +3028,14 @@ // set the appearance on teleport since the new sim does not // know what you look like. gAgent.sendAgentSetAppearance(); - if (avatarp) +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (avatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] +// if (avatarp) { // Chat the "back" SLURL. (DEV-4907) LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChatHistory(chat); @@ -4309,11 +4601,17 @@ // try to lookup the name of the region the object is in LLViewerRegion* viewregion = viewobj->getRegion(); if (viewregion) { // got the region, so include the region and 3d coordinates of the object - notice.setArg("[REGIONNAME]", viewregion->getName()); + notice.setArg("[REGIONNAME]", viewregion->getName()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + notice.setArg("[REGIONNAME]", rlv_handler_t::cstrHiddenRegion); + } +// [/RLVa:KB] std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); notice.setArg("[REGIONPOS]", formatpos); foundpos = TRUE; } @@ -4514,12 +4812,35 @@ } args["[QUESTIONS]"] = script_question; LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e + S32 rlvQuestionsOther = questions; + + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("acceptpermission")) ) + { + LLViewerObject* pObj = gObjectList.findObject(taskid); + if (pObj) + { + if (pObj->permYouOwner()) + { + // PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns + rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] | + LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]); + } + } + } + + if ( (!caution) && (!rlvQuestionsOther) ) + { + script_question_cb(0, cbdata); + } + else if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// [/RLVa:KB] // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + //if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { if (caution) { // display the caution permissions prompt LLNotifyBox::showXml("ScriptQuestionCaution", args, TRUE, script_question_cb, cbdata); @@ -4807,18 +5128,36 @@ { LLDynamicArray* invitees = (LLDynamicArray*)userdata; if(0 == option) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b + bool fRlvCensorMessage = false; + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) + { + for (LLDynamicArray::iterator it = invitees->begin(); it != invitees->end(); ++it) + { + if (!gRlvHandler.isException(RLV_BHVR_SENDIM, *it)) + { + fRlvCensorMessage = true; + break; + } + } + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_StartLure); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Info); msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. - msg->addStringFast(_PREHASH_Message, text); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b + msg->addStringFast(_PREHASH_Message, (!fRlvCensorMessage) ? text : rlv_handler_t::cstrHidden); +// [/RLVa:KB] + //msg->addStringFast(_PREHASH_Message, text); for(LLDynamicArray::iterator itr = invitees->begin(); itr != invitees->end(); ++itr) { msg->nextBlockFast(_PREHASH_TargetData); msg->addUUIDFast(_PREHASH_TargetID, *itr); } @@ -4844,12 +5183,32 @@ // Prompt for a message to the invited user. void handle_lure(LLDynamicArray& ids) { LLDynamicArray* userdata = new LLDynamicArray(ids); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a + // Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + for (LLDynamicArray::iterator it = ids.begin(); it != ids.end(); ++it) + { + const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it); + if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it)) && + ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) + { + delete userdata; + return; + } + } + } +// [/RLVa:KB] + LLStringUtil::format_map_t edit_args; - edit_args["[REGION]"] = gAgent.getRegion()->getName(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a + edit_args["[REGION]"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : rlv_handler_t::cstrHidden; +// [/RLVa:KB] + //edit_args["[REGION]"] = gAgent.getRegion()->getName(); if (gAgent.isGodlike()) { gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args, &handle_lure_callback_godlike, userdata, NULL, NULL, edit_args); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewerobject.cpp linden/indra/newview/llviewerobject.cpp --- linden/indra/newview/llviewerobject.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llviewerobject.cpp 2009-08-07 19:30:25.984375000 +0200 @@ -1005,10 +1005,16 @@ // alpha was flipped so that it zero encoded better coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); mText->setStringUTF8(temp_string); +// [RLVa:KB] - Checked: 2009-07-09 (RLVa-1.0.0f) | Added: RLVa-1.0.0f + if (rlv_handler_t::isEnabled()) + { + mText->setObjectText(temp_string); + } +// [/RLVa:KB] if (mDrawable.notNull()) { setChanged(MOVED | SILHOUETTE); gPipeline.markMoved(mDrawable, FALSE); // undamped @@ -1422,10 +1428,16 @@ LLColor4U coloru; dp->unpackBinaryDataFixed(coloru.mV, 4, "Color"); coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); mText->setStringUTF8(temp_string); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-09 (RLVa-1.0.0f) | Added: RLVa-1.0.0f + if (rlv_handler_t::isEnabled()) + { + mText->setObjectText(temp_string); + } +// [/RLVa:KB] setChanged(TEXTURE); } else { @@ -4794,11 +4806,14 @@ // Can only open objects that you own, or that someone has // given you modify rights to. JC BOOL LLViewerObject::allowOpen() const { - return !flagInventoryEmpty() && (permYouOwner() || permModify()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) + return !flagInventoryEmpty() && (permYouOwner() || permModify()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)); +// [/RLVa:KB] +// return !flagInventoryEmpty() && (permYouOwner() || permModify()); } LLViewerObject::LLInventoryCallbackInfo::~LLInventoryCallbackInfo() { if (mListener) diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewertexteditor.cpp linden/indra/newview/llviewertexteditor.cpp --- linden/indra/newview/llviewertexteditor.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llviewertexteditor.cpp 2009-08-07 19:30:26.000000000 +0200 @@ -93,10 +93,17 @@ { llwarns << "Item add reported, but not found in inventory!: " << inv_item << llendl; } else { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("viewnote")) ) + { + return; + } +// [/RLVa:KB] + // See if we can bring an existing preview to the front if(!LLPreview::show(item->getUUID(), true)) { if(!gSavedSettings.getBOOL("ShowNewInventory")) { diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llviewerwindow.cpp linden/indra/newview/llviewerwindow.cpp --- linden/indra/newview/llviewerwindow.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/llviewerwindow.cpp 2009-08-07 19:30:26.015625000 +0200 @@ -3266,10 +3266,20 @@ BOOL this_object_movable = FALSE; if (object->permMove() && (object->permModify() || selecting_linked_set)) { moveable_object_selected = TRUE; this_object_movable = TRUE; + +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) + { + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) ) + moveable_object_selected = this_object_movable = FALSE; + } +// [/RLVa:KB] } all_selected_objects_move = all_selected_objects_move && this_object_movable; all_selected_objects_modify = all_selected_objects_modify && object->permModify(); } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llvoavatar.cpp linden/indra/newview/llvoavatar.cpp --- linden/indra/newview/llvoavatar.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llvoavatar.cpp 2009-08-13 12:46:31.343750000 +0200 @@ -123,10 +123,14 @@ #include "llgesturemgr.h" //needed to trigger the voice gesticulations #include "llvoicevisualizer.h" #include "llvoiceclient.h" +// [RLVa:KB] +#include "llstartup.h" +// [/RLVa:KB] + LLXmlTree LLVOAvatar::sXMLTree; LLXmlTree LLVOAvatar::sSkeletonXMLTree; LLVOAvatarSkeletonInfo* LLVOAvatar::sSkeletonInfo = NULL; LLVOAvatarInfo* LLVOAvatar::sAvatarInfo = NULL; @@ -2091,13 +2095,19 @@ attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; if (attachment->getGroup() == i) { LLMenuItemCallGL* item; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // We need the userdata param to disable options in this pie menu later on (Left Hand / Right Hand option) item = new LLMenuItemCallGL(attachment->getName(), NULL, - object_selected_and_point_valid); + object_selected_and_point_valid, attachment); +// [/RLVa:KB] +// item = new LLMenuItemCallGL(attachment->getName(), +// NULL, +// object_selected_and_point_valid); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); gAttachPieMenu->append(item); attachment_found = TRUE; @@ -2148,13 +2158,19 @@ attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; if (attachment->getGroup() == 8) { LLMenuItemCallGL* item; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // We need the userdata param to disable options in this pie menu later on item = new LLMenuItemCallGL(attachment->getName(), NULL, - object_selected_and_point_valid); + object_selected_and_point_valid, attachment); +// [/RLVa:KB] +// item = new LLMenuItemCallGL(attachment->getName(), +// NULL, +// object_selected_and_point_valid); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); gAttachScreenPieMenu->append(item); gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(), &handle_detach_from_avatar, object_attached, attachment)); } @@ -2169,10 +2185,11 @@ LLViewerJointAttachment* attachment = curiter->second; if (attachment->getIsHUDAttachment() != (pass == 1)) { continue; } + // RELEASE-RLVa: random comment because we want know if LL ever changes this to not include "attachment" as userdata LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), NULL, &object_selected_and_point_valid, &attach_label, attachment); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); gAttachSubMenu->append(item); @@ -2228,12 +2245,17 @@ } LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL); if (attachment) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // We need the userdata param to disable options in this pie menu later on LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), - NULL, object_selected_and_point_valid); + NULL, object_selected_and_point_valid, attachment); +// [/RLVa:KB] +// LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), +// NULL, object_selected_and_point_valid); gAttachBodyPartPieMenus[group]->append(item); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", attach_index); gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(), &handle_detach_from_avatar, object_attached, attachment)); @@ -3087,14 +3109,20 @@ } const F32 time_visible = mTimeVisible.getElapsedTimeF32(); const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); BOOL render_name = visible_chat || (visible_avatar && +// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h + ( (!fRlvShowNames) || (RlvSettings::fShowNameTags) ) && +// [/RLVa:KB] ((sRenderName == RENDER_NAME_ALWAYS) || (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); // If it's your own avatar, don't draw in mouselook, and don't // draw if we're specifically hiding our own name. if (mIsSelf) @@ -3111,11 +3139,22 @@ { mVisibleChat = visible_chat; new_name = TRUE; } - if (sRenderGroupTitles != mRenderGroupTitles) +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + if (fRlvShowNames) + { + if (mRenderGroupTitles) + { + mRenderGroupTitles = FALSE; + new_name = TRUE; + } + } + else if (sRenderGroupTitles != mRenderGroupTitles) +// [/RLVa] + //if (sRenderGroupTitles != mRenderGroupTitles) { mRenderGroupTitles = sRenderGroupTitles; new_name = TRUE; } @@ -3216,33 +3255,50 @@ (title && mTitle != title->getString()) || (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) || is_appearance != mNameAppearance) { char line[MAX_STRING]; /* Flawfinder: ignore */ - if (!sRenderGroupTitles) +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + if (!fRlvShowNames) { - // If all group titles are turned off, stack first name - // on a line above last name - strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ - line[MAX_STRING -1] = '\0'; - strcat(line, "\n"); - } - else if (title && title->getString() && title->getString()[0] != '\0') - { - strncpy(line, title->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ - line[MAX_STRING -1] = '\0'; - strcat(line, "\n"); /* Flawfinder: ignore */ - strncat(line, firstname->getString(), MAX_STRING - strlen(line) -1 ); /* Flawfinder: ignore */ +// [/RLVa:KB] + if (!sRenderGroupTitles) + { + // If all group titles are turned off, stack first name + // on a line above last name + strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ + line[MAX_STRING -1] = '\0'; + strcat(line, "\n"); + } + else if (title && title->getString() && title->getString()[0] != '\0') + { + strncpy(line, title->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ + line[MAX_STRING -1] = '\0'; + strcat(line, "\n"); /* Flawfinder: ignore */ + strncat(line, firstname->getString(), MAX_STRING - strlen(line) -1 ); /* Flawfinder: ignore */ + } + else + { + strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ + line[MAX_STRING -1] = '\0'; + } + + strcat(line, " "); /* Flawfinder: ignore */ + strncat(line, lastname->getString(), MAX_STRING - strlen(line) -1); /* Flawfinder: ignore */ +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b } else { - strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ + strncpy(line, firstname->getString(), MAX_STRING - 1); line[MAX_STRING -1] = '\0'; + strcat(line, " "); + strncat(line, lastname->getString(), MAX_STRING - strlen(line) - 1); + + strncpy(line, gRlvHandler.getAnonym(line).c_str(), MAX_STRING - 1); + line[MAX_STRING - 1] = '\0'; } - - strcat(line, " "); /* Flawfinder: ignore */ - strncat(line, lastname->getString(), MAX_STRING - strlen(line) -1); /* Flawfinder: ignore */ +// [/RLVa:KB] BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) { strcat(line, " ("); /* Flawfinder: ignore */ @@ -6333,10 +6389,44 @@ if (mIsSelf) { updateAttachmentVisibility(gAgent.getCameraMode()); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (rlv_handler_t::isEnabled()) + { + static bool fRlvFullyLoaded = false; + static LLFrameTimer* pRlvFullyLoadedTimer = NULL; + + // There's no way to know when we're done reattaching what was attached at log-off but this ugly evil bad hack tries anyway + if (!fRlvFullyLoaded) + { + if (pRlvFullyLoadedTimer) + { + if (pRlvFullyLoadedTimer->getElapsedTimeF32() > 30.0f) + { + fRlvFullyLoaded = true; + delete pRlvFullyLoadedTimer; + pRlvFullyLoadedTimer = NULL; + } + else + { + pRlvFullyLoadedTimer->reset(); + } + } + else if ( (!pRlvFullyLoadedTimer) && + ( (0 == mPendingAttachment.size()) || + ((1 == mPendingAttachment.size()) && (mPendingAttachment[0] == viewer_object)) ) ) + { + pRlvFullyLoadedTimer = new LLFrameTimer(); + } + } + + gRlvHandler.onAttach(attachment, fRlvFullyLoaded); + } +// [/RLVa:KB] + // Then make sure the inventory is in sync with the avatar. gInventory.addChangedMask( LLInventoryObserver::LABEL, attachment->getItemID() ); gInventory.notifyObservers(); } @@ -6388,10 +6478,18 @@ attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; // only one object per attachment point for now if (attachment->getObject() == viewer_object) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // URGENT-RLV: it looks like LLApp::isExiting() isn't always accurate so find something better (if it exists) + if ( (rlv_handler_t::isEnabled()) && (!LLApp::isExiting()) && (mIsSelf) ) + { + gRlvHandler.onDetach(attachment); + } +// [/RLVa:KB] + LLUUID item_id = attachment->getItemID(); attachment->removeObject(viewer_object); if (mIsSelf) { // the simulator should automatically handle @@ -6446,10 +6544,18 @@ mDrawable->mXform.setPosition(rel_pos); mDrawable->mXform.setRotation(mDrawable->getWorldRotation() * inv_obj_rot); gPipeline.markMoved(mDrawable, TRUE); mIsSitting = TRUE; +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d + #ifdef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + RlvSettings::updateLoginLastLocation(); + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject mRoot.setPosition(getPosition()); mRoot.updateWorldMatrixChildren(); stopMotion(ANIM_AGENT_BODY_NOISE); @@ -6507,10 +6613,18 @@ mDrawable->mXform.setRotation(cur_rotation_world); gPipeline.markMoved(mDrawable, TRUE); mIsSitting = FALSE; +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d + #ifdef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + RlvSettings::updateLoginLastLocation(); + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] mRoot.getXform()->setParent(NULL); // LLVOAvatar::getOffObject mRoot.setPosition(cur_position_world); mRoot.setRotation(cur_rotation_world); mRoot.getXform()->update(); diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llvovolume.cpp linden/indra/newview/llvovolume.cpp --- linden/indra/newview/llvovolume.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llvovolume.cpp 2009-08-07 19:30:26.062500000 +0200 @@ -1940,11 +1940,15 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face, BOOL pick_transparent, S32 *face_hitp, LLVector3* intersection,LLVector2* tex_coord, LLVector3* normal, LLVector3* bi_normal) { if (!mbCanSelect || - (gHideSelectedObjects && isSelected()) || +// (gHideSelectedObjects && isSelected()) || +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + ( (gHideSelectedObjects && isSelected()) && + ((!rlv_handler_t::isEnabled()) || (!isHUDAttachment()) || (gRlvHandler.isDetachable(this))) ) || +// [/RLVa:KB] mDrawable->isDead() || !gPipeline.hasRenderType(mDrawable->getRenderType())) { return FALSE; } @@ -2082,14 +2086,22 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type) { LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - if (facep->getViewerObject()->isSelected() && gHideSelectedObjects) +// if (facep->getViewerObject()->isSelected() && gHideSelectedObjects) +// { +// return; +// } +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + LLViewerObject* pObj = facep->getViewerObject(); + if ( (pObj->isSelected() && gHideSelectedObjects) && + ((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (gRlvHandler.isDetachable(pObj))) ) { return; } +// [/RVLa:KB] //add face to drawmap LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[type]; S32 idx = draw_vec.size()-1; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/llworldmapview.cpp linden/indra/newview/llworldmapview.cpp --- linden/indra/newview/llworldmapview.cpp 2009-03-11 09:47:00.000000000 +0100 +++ linden/indra/newview/llworldmapview.cpp 2009-08-07 19:30:26.093750000 +0200 @@ -637,11 +637,18 @@ { //mesg = llformat("%d / %s (%s)", // info->mAgents, // info->mName.c_str(), // LLViewerRegion::accessToShortString(info->mAccess).c_str() ); - if (info->mAccess == SIM_ACCESS_DOWN) +// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + mesg = rlv_handler_t::cstrHidden; + } + else if (info->mAccess == SIM_ACCESS_DOWN) +// [/RLVa:KB] +// if (info->mAccess == SIM_ACCESS_DOWN) { mesg = llformat( "%s (%s)", info->mName.c_str(), sStringsMap["offline"].c_str()); } else { @@ -1050,11 +1057,14 @@ const S32 TEXT_PADDING = DEFAULT_TRACKING_ARROW_SIZE + 2; S32 half_text_width = llfloor(font->getWidthF32(label) * 0.5f); text_x = llclamp(text_x, half_text_width + TEXT_PADDING, getRect().getWidth() - half_text_width - TEXT_PADDING); text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - llround(font->getLineHeight()) - TEXT_PADDING - vert_offset); - if (label != "") + //if (label != "") +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a + if ( (label != "") && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] { font->renderUTF8( label, 0, text_x, text_y, @@ -1110,11 +1120,14 @@ { LLViewerRegion *region = gAgent.getRegion(); std::string message = llformat("%s (%s)", - info->mName.c_str(), + //info->mName.c_str(), +// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-04 (RLVa-1.0.0a) + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? info->mName.c_str() : rlv_handler_t::cstrHidden.c_str(), +// [/RLVa:KB] LLViewerRegion::accessToString(info->mAccess).c_str()); if (info->mAccess != SIM_ACCESS_DOWN) { S32 agent_count = LLWorldMap::getInstance()->mNumAgents[info->mHandle]; diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/pipeline.cpp linden/indra/newview/pipeline.cpp --- linden/indra/newview/pipeline.cpp 2009-03-11 09:46:58.000000000 +0100 +++ linden/indra/newview/pipeline.cpp 2009-08-07 19:30:26.125000000 +0200 @@ -1793,12 +1793,17 @@ return; } if (gHideSelectedObjects) { - if (drawablep->getVObj().notNull() && - drawablep->getVObj()->isSelected()) +// if (drawablep->getVObj().notNull() && +// drawablep->getVObj()->isSelected()) +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + LLViewerObject* pObj = drawablep->getVObj(); + if ( (pObj) && (pObj->isSelected()) && + ((!rlv_handler_t::isEnabled()) || (!pObj->isHUDAttachment()) || (gRlvHandler.isDetachable(pObj))) ) +// [/RVLa:KB] { return; } } diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/rlvevent.h linden/indra/newview/rlvevent.h --- linden/indra/newview/rlvevent.h 1970-01-01 01:00:00.000000000 +0100 +++ linden/indra/newview/rlvevent.h 2009-08-07 19:30:51.218750000 +0200 @@ -0,0 +1,224 @@ +#ifndef RLV_EVENTEMITTER_H +#define RLV_EVENTEMITTER_H + +#include +#include +#include + +#include "lluuid.h" + +#include "rlvhelper.h" + +// ============================================================================ +/* + * RlvEvent + * ======== + * Passed to observer event handlers (contains the same paramaters as RlvHandler::processXXXCommand) + */ + +class RlvEvent +{ +public: + RlvEvent(const LLUUID& uuid, const RlvCommand& rlvCmd) : m_UUID(uuid), m_rlvCmd(rlvCmd) {} + virtual ~RlvEvent() {} + + const LLUUID& getSenderID() const { return m_UUID; }; + const RlvCommand& getCommand() const { return m_rlvCmd; }; + +protected: + LLUUID m_UUID; + RlvCommand m_rlvCmd; +}; + +// ============================================================================ +/* + * RlvObserver + * =========== + * Provides a way to extend the existing command set without changing the main RlvHandler class + * + * Steps: + * - derive your class from RlvObserver + * - override any of the event functions you need + * - add it as an observer: gRlvHandler.addObserver(new RlbObserverDerivedClass()); + * - done + * + * Notes: + * - as long as you don't call gRlvHandler.remObserver() your class will be cleaned up from + * RlvEventEmitter destructor (see below) + * - event handlers are called only if RlvHandler didn't handle it so while you can + * add a new command @foobar=n, you won't get called for @detach=n + * - event handlers are called *after* the command is added so a call to + * RlvHandler::hasBehaviour("foobar") would return TRUE + * - return TRUE if you handled the command (won't get passed on to the next observer) + * return FALSE if you didn't handle the command (gets passed on to the next observer) + * + */ + +class RlvObserver +{ +public: + virtual ~RlvObserver() {} + + typedef RlvEvent EventType; + + virtual BOOL onAddCommand(const EventType& rlvEvent) { return FALSE; } + virtual BOOL onRemoveCommand(const EventType& rlvEvent) { return FALSE; } + virtual BOOL onReplyCommand(const EventType& rlvEvent) { return FALSE; } + virtual BOOL onForceCommand(const EventType& rlvEvent) { return FALSE; } +}; + +// ============================================================================ +/* + * RlvEventEmitter + * =============== + * Essentially a slightly modified eventEmitter (see lleventemitter.h) + * + * Changes: + * - if an event handler returns TRUE then no further observers are notified + * - cleans up the (remaining) observers in the destructor + */ + +template < class T > +class RlvEventEmitter +{ + public: + typedef typename T::EventType EventType; + typedef std::list< T* > ObserverContainer; + typedef BOOL ( T::*observerMethod )( const EventType& ); + + protected: + ObserverContainer observers; + + public: + RlvEventEmitter() { }; + + ~RlvEventEmitter() + { + clearObservers(); + } + + BOOL addObserver ( T* observerIn ) + { + if ( ! observerIn ) + return FALSE; + + // check if observer already exists + if ( std::find ( observers.begin (), observers.end (), observerIn ) != observers.end () ) + return FALSE; + + // save it + observers.push_back ( observerIn ); + + return true; + } + + BOOL remObserver ( T* observerIn ) + { + if ( ! observerIn ) + return FALSE; + + observers.remove ( observerIn ); + + return TRUE; + } + + void clearObservers() + { + typename std::list< T* >::iterator iter = observers.begin (); + + while (iter != observers.end ()) + { + delete *iter; + ++iter; + }; + + observers.clear(); + } + + BOOL update ( observerMethod method, const EventType& msgIn ) + { + typename std::list< T* >::iterator iter = observers.begin (); + + BOOL fContinue = TRUE; + while ( (iter != observers.end ()) && (fContinue) ) + { + fContinue = !( ( ( *iter )->*method ) ( msgIn ) ); + ++iter; + }; + + return !fContinue; + } +}; + +// ============================================================================ + +class RlvBehaviourObserver +{ +public: + virtual ~RlvBehaviourObserver() {} + virtual void changed(const RlvCommand& rlvCmd, bool fInternal) = 0; +}; + +// ============================================================================ + +class RlvBehaviourNotifyObserver : public RlvBehaviourObserver +{ +public: + virtual ~RlvBehaviourNotifyObserver() { } + + void changed(const RlvCommand& rlvCmd, bool fInternal) + { + if ( (fInternal) || ((RLV_TYPE_ADD != rlvCmd.getParamType()) && (RLV_TYPE_REMOVE != rlvCmd.getParamType())) ) + return; + + std::string strCmd = rlvCmd.asString(); + std::string strNotify = llformat("/%s=%c", strCmd.c_str(), (RLV_TYPE_ADD == rlvCmd.getParamType()) ? 'n' : 'y'); + + for (std::multimap::const_iterator itNotify = m_Notifications.begin(); + itNotify != m_Notifications.end(); ++itNotify) + { + if ( (itNotify->second.strFilter.empty()) || (std::string::npos != strCmd.find(itNotify->second.strFilter)) ) + rlvSendChatReply(itNotify->second.nChannel, strNotify); + } + } + + void addNotify(const LLUUID& idObj, S32 nChannel, const std::string& strFilter) + { + m_Notifications.insert(std::pair(idObj, notifyData(nChannel, strFilter))); + } + + void clearNotify(const LLUUID& idObj) + { + m_Notifications.erase(idObj); + } + + bool hasNotify() + { + return (m_Notifications.size() != 0); + } + + void removeNotify(const LLUUID& idObj, S32 nChannel, const std::string& strFilter) + { + for (std::multimap::iterator itNotify = m_Notifications.lower_bound(idObj), + endNotify = m_Notifications.upper_bound(idObj); itNotify != endNotify; ++itNotify) + { + if ( (itNotify->second.nChannel == nChannel) && (itNotify->second.strFilter == strFilter) ) + { + m_Notifications.erase(itNotify); + break; + } + } + } +protected: + struct notifyData + { + S32 nChannel; + std::string strFilter; + notifyData(S32 channel, const std::string& filter) : nChannel(channel), strFilter(filter) {} + }; + std::multimap m_Notifications; +}; + +// ============================================================================ + +#endif // RLV_EVENTEMITTER_H diff -u5rN --strip-trailing-cr --ignore-blank-lines --ignore-tab-expansion linden/indra/newview/rlvextensions.cpp linden/indra/newview/rlvextensions.cpp --- linden/indra/newview/rlvextensions.cpp 1970-01-01 01:00:00.000000000 +0100 +++ linden/indra/newview/rlvextensions.cpp 2009-08-07 19:30:51.234375000 +0200 @@ -0,0 +1,454 @@ +#include "llviewerprecompiledheaders.h" +#include "llagent.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