summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-08-31 13:47:47 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-08-31 13:47:47 -0700
commit30ff6cabd61f2f083df5df1e6e70cc94742af477 (patch)
tree631935f1cf59d19a91cdad65e9a75fe825afda7d /indra/llinventory
parentff11d74820c89822cd067b51727d9df1dc87d0d0 (diff)
parent3ac3a4b206c08ed06b889bdaa24074b6aa0e020a (diff)
Merge with trunk
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/lleconomy.h2
-rw-r--r--indra/llinventory/llinventory.cpp110
-rw-r--r--indra/llinventory/llinventory.h14
-rw-r--r--indra/llinventory/llinventorytype.cpp1
-rw-r--r--indra/llinventory/llinventorytype.h7
-rw-r--r--indra/llinventory/lllandmark.cpp22
-rw-r--r--indra/llinventory/lllandmark.h25
-rw-r--r--indra/llinventory/llnotecard.h2
-rw-r--r--indra/llinventory/llparcel.cpp130
-rw-r--r--indra/llinventory/llparcel.h32
-rw-r--r--indra/llinventory/llpermissions.cpp63
-rw-r--r--indra/llinventory/llpermissions.h9
-rw-r--r--indra/llinventory/llpermissionsflags.h3
-rw-r--r--indra/llinventory/llsaleinfo.cpp34
-rw-r--r--indra/llinventory/llsaleinfo.h3
15 files changed, 209 insertions, 248 deletions
diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h
index 2e2adc4d45..e480085453 100644
--- a/indra/llinventory/lleconomy.h
+++ b/indra/llinventory/lleconomy.h
@@ -32,7 +32,7 @@
#ifndef LL_LLECONOMY_H
#define LL_LLECONOMY_H
-#include "llmemory.h"
+#include "llsingleton.h"
class LLMessageSystem;
class LLVector3;
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 76de357e2b..5d3fbe5128 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -133,6 +133,11 @@ LLAssetType::EType LLInventoryObject::getActualType() const
return mType;
}
+BOOL LLInventoryObject::getIsLinkType() const
+{
+ return LLAssetType::lookupIsLinkType(mType);
+}
+
// See LLInventoryItem override.
// virtual
const LLUUID& LLInventoryObject::getLinkedUUID() const
@@ -1170,109 +1175,8 @@ fail:
}
-LLXMLNode *LLInventoryItem::exportFileXML(BOOL include_asset_key) const
-{
- LLMemType m1(LLMemType::MTYPE_INVENTORY);
- LLXMLNode *ret = new LLXMLNode("item", FALSE);
-
- ret->createChild("uuid", TRUE)->setUUIDValue(1, &mUUID);
- ret->createChild("parent_uuid", TRUE)->setUUIDValue(1, &mParentUUID);
-
- mPermissions.exportFileXML()->setParent(ret);
-
- // Check for permissions to see the asset id, and if so write it
- // out as an asset id. Otherwise, apply our cheesy encryption.
- if(include_asset_key)
- {
- U32 mask = mPermissions.getMaskBase();
- if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
- || (mAssetUUID.isNull()))
- {
- ret->createChild("asset_id", FALSE)->setUUIDValue(1, &mAssetUUID);
- }
- else
- {
- LLUUID shadow_id(mAssetUUID);
- LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
- cipher.encrypt(shadow_id.mData, UUID_BYTES);
-
- ret->createChild("shadow_id", FALSE)->setUUIDValue(1, &shadow_id);
- }
- }
-
- std::string type_str = LLAssetType::lookup(mType);
- std::string inv_type_str = LLInventoryType::lookup(mInventoryType);
-
- ret->createChild("asset_type", FALSE)->setStringValue(type_str);
- ret->createChild("inventory_type", FALSE)->setStringValue(inv_type_str);
- S32 tmp_flags = (S32) mFlags;
- ret->createChild("flags", FALSE)->setByteValue(4, (U8*)(&tmp_flags), LLXMLNode::ENCODING_HEX);
-
- mSaleInfo.exportFileXML()->setParent(ret);
-
- std::string temp;
- temp.assign(mName);
- ret->createChild("name", FALSE)->setStringValue(temp);
- temp.assign(mDescription);
- ret->createChild("description", FALSE)->setStringValue(temp);
- S32 date = mCreationDate;
- ret->createChild("creation_date", FALSE)->setIntValue(1, &date);
-
- return ret;
-}
-
-BOOL LLInventoryItem::importXML(LLXMLNode* node)
-{
- BOOL success = FALSE;
- if (node)
- {
- success = TRUE;
- LLXMLNodePtr sub_node;
- if (node->getChild("uuid", sub_node))
- success = (1 == sub_node->getUUIDValue(1, &mUUID));
- if (node->getChild("parent_uuid", sub_node))
- success = success && (1 == sub_node->getUUIDValue(1, &mParentUUID));
- if (node->getChild("permissions", sub_node))
- success = success && mPermissions.importXML(sub_node);
- if (node->getChild("asset_id", sub_node))
- success = success && (1 == sub_node->getUUIDValue(1, &mAssetUUID));
- if (node->getChild("shadow_id", sub_node))
- {
- success = success && (1 == sub_node->getUUIDValue(1, &mAssetUUID));
- LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
- cipher.decrypt(mAssetUUID.mData, UUID_BYTES);
- }
- if (node->getChild("asset_type", sub_node))
- mType = LLAssetType::lookup(sub_node->getValue());
- if (node->getChild("inventory_type", sub_node))
- mInventoryType = LLInventoryType::lookup(sub_node->getValue());
- if (node->getChild("flags", sub_node))
- {
- S32 tmp_flags = 0;
- success = success && (1 == sub_node->getIntValue(1, &tmp_flags));
- mFlags = (U32) tmp_flags;
- }
- if (node->getChild("sale_info", sub_node))
- success = success && mSaleInfo.importXML(sub_node);
- if (node->getChild("name", sub_node))
- mName = sub_node->getValue();
- if (node->getChild("description", sub_node))
- mDescription = sub_node->getValue();
- if (node->getChild("creation_date", sub_node))
- {
- S32 date = 0;
- success = success && (1 == sub_node->getIntValue(1, &date));
- mCreationDate = date;
- }
-
- if (!success)
- {
- lldebugs << "LLInventory::importXML() failed for node named '"
- << node->getName() << "'" << llendl;
- }
- }
- return success;
-}
+// Deleted LLInventoryItem::exportFileXML() and LLInventoryItem::importXML()
+// because I can't find any non-test code references to it. 2009-05-04 JC
S32 LLInventoryItem::packBinaryBucket(U8* bin_bucket, LLPermissions* perm_override) const
{
diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h
index 08e3958533..b953e91309 100644
--- a/indra/llinventory/llinventory.h
+++ b/indra/llinventory/llinventory.h
@@ -40,6 +40,7 @@
#include "llinventorytype.h"
#include "llmemtype.h"
#include "llpermissions.h"
+#include "llrefcount.h"
#include "llsaleinfo.h"
#include "llsd.h"
#include "lluuid.h"
@@ -92,11 +93,14 @@ public:
virtual const LLUUID& getUUID() const;
const LLUUID& getParentUUID() const;
virtual const LLUUID& getLinkedUUID() const; // get the inventoryID that this item points to, else this item's inventoryID
-
virtual const std::string& getName() const;
virtual LLAssetType::EType getType() const;
LLAssetType::EType getActualType() const; // bypasses indirection for linked items
+ virtual const std::string& getName() const;
+ virtual LLAssetType::EType getType() const;
+ LLAssetType::EType getActualType() const; // bypasses indirection for linked items
+ BOOL getIsLinkType() const;
// mutators - will not call updateServer();
void setUUID(const LLUUID& new_uuid);
void rename(const std::string& new_name);
@@ -219,6 +223,7 @@ protected:
~LLInventoryItem(); // ref counted
public:
+
MEM_TYPE_NEW(LLMemType::MTYPE_INVENTORY);
LLInventoryItem(const LLUUID& uuid,
const LLUUID& parent_uuid,
@@ -265,6 +270,10 @@ public:
// Check for changes in permissions masks and sale info
// and set the corresponding bits in mFlags
void accumulatePermissionSlamBits(const LLInventoryItem& old_item);
+
+ // This is currently only used in the Viewer to handle calling cards
+ // where the creator is actually used to store the target.
+ void setCreator(const LLUUID& creator) { mPermissions.setCreator(creator); }
// Put this inventory item onto the current outgoing mesage. It
// assumes you have already called nextBlock().
@@ -281,9 +290,6 @@ public:
virtual BOOL importLegacyStream(std::istream& input_stream);
virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const;
- virtual LLXMLNode *exportFileXML(BOOL include_asset_key = TRUE) const;
- BOOL importXML(LLXMLNode* node);
-
// helper functions
// pack all information needed to reconstruct this item into the given binary bucket.
diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp
index 866d6722a0..a445466b26 100644
--- a/indra/llinventory/llinventorytype.cpp
+++ b/indra/llinventory/llinventorytype.cpp
@@ -35,6 +35,7 @@
#include "llinventorytype.h"
#include "lldictionary.h"
#include "llmemory.h"
+#include "llsingleton.h"
static const std::string empty_string;
diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h
index 8961ff96e7..14b28bfe4b 100644
--- a/indra/llinventory/llinventorytype.h
+++ b/indra/llinventory/llinventorytype.h
@@ -92,11 +92,10 @@ private:
~LLInventoryType( void );
};
-// helper function which returns true if inventory type and asset type
+// helper function that returns true if inventory type and asset type
// are potentially compatible. For example, an attachment must be an
// object, but a wearable can be a bodypart or clothing asset.
-bool inventory_and_asset_types_match(
- LLInventoryType::EType inventory_type,
- LLAssetType::EType asset_type);
+bool inventory_and_asset_types_match(LLInventoryType::EType inventory_type,
+ LLAssetType::EType asset_type);
#endif
diff --git a/indra/llinventory/lllandmark.cpp b/indra/llinventory/lllandmark.cpp
index 13a63bc7d6..83b6392ca8 100644
--- a/indra/llinventory/lllandmark.cpp
+++ b/indra/llinventory/lllandmark.cpp
@@ -40,7 +40,7 @@
std::pair<LLUUID, U64> LLLandmark::mLocalRegion;
LLLandmark::region_map_t LLLandmark::mRegions;
-LLLandmark::region_callback_t LLLandmark::mRegionCallback;
+LLLandmark::region_callback_map_t LLLandmark::sRegionCallbackMap;
LLLandmark::LLLandmark() :
mGlobalPositionKnown(false)
@@ -177,7 +177,7 @@ void LLLandmark::requestRegionHandle(
LLMessageSystem* msg,
const LLHost& upstream_host,
const LLUUID& region_id,
- LLRegionHandleCallback* callback)
+ region_handle_callback_t callback)
{
if(region_id.isNull())
{
@@ -186,7 +186,7 @@ void LLLandmark::requestRegionHandle(
if(callback)
{
const U64 U64_ZERO = 0;
- callback->dataReady(region_id, U64_ZERO);
+ callback(region_id, U64_ZERO);
}
}
else
@@ -196,7 +196,7 @@ void LLLandmark::requestRegionHandle(
lldebugs << "requestRegionHandle: local" << llendl;
if(callback)
{
- callback->dataReady(region_id, mLocalRegion.second);
+ callback(region_id, mLocalRegion.second);
}
}
else
@@ -207,8 +207,8 @@ void LLLandmark::requestRegionHandle(
lldebugs << "requestRegionHandle: upstream" << llendl;
if(callback)
{
- region_callback_t::value_type vt(region_id, callback);
- mRegionCallback.insert(vt);
+ region_callback_map_t::value_type vt(region_id, callback);
+ sRegionCallbackMap.insert(vt);
}
lldebugs << "Landmark requesting information about: "
<< region_id << llendl;
@@ -221,7 +221,7 @@ void LLLandmark::requestRegionHandle(
{
// we have the answer locally - just call the callack.
lldebugs << "requestRegionHandle: ready" << llendl;
- callback->dataReady(region_id, (*it).second.mRegionHandle);
+ callback(region_id, (*it).second.mRegionHandle);
}
}
}
@@ -259,11 +259,11 @@ void LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**)
#endif
// make all the callbacks here.
- region_callback_t::iterator it;
- while((it = mRegionCallback.find(region_id)) != mRegionCallback.end())
+ region_callback_map_t::iterator it;
+ while((it = sRegionCallbackMap.find(region_id)) != sRegionCallbackMap.end())
{
- (*it).second->dataReady(region_id, info.mRegionHandle);
- mRegionCallback.erase(it);
+ (*it).second(region_id, info.mRegionHandle);
+ sRegionCallbackMap.erase(it);
}
}
diff --git a/indra/llinventory/lllandmark.h b/indra/llinventory/lllandmark.h
index cb0c11ab87..feaf1a0e9c 100644
--- a/indra/llinventory/lllandmark.h
+++ b/indra/llinventory/lllandmark.h
@@ -35,6 +35,7 @@
#define LL_LLLANDMARK_H
#include <map>
+#include <boost/function.hpp>
#include "llframetimer.h"
#include "lluuid.h"
#include "v3dmath.h"
@@ -42,24 +43,12 @@
class LLMessageSystem;
class LLHost;
-// virutal base class used for calling back interested parties when a
-// region handle comes back.
-class LLRegionHandleCallback
-{
-public:
- LLRegionHandleCallback() {}
- virtual ~LLRegionHandleCallback() {}
- virtual bool dataReady(
- const LLUUID& region_id,
- const U64& region_handle)
- {
- return true;
- }
-};
-
class LLLandmark
{
public:
+ // for calling back interested parties when a region handle comes back.
+ typedef boost::function<void(const LLUUID& region_id, const U64& region_handle)> region_handle_callback_t;
+
~LLLandmark() {}
// returns true if the position is known.
@@ -90,7 +79,7 @@ public:
LLMessageSystem* msg,
const LLHost& upstream_host,
const LLUUID& region_id,
- LLRegionHandleCallback* callback);
+ region_handle_callback_t callback);
// Call this method to create a lookup for this region. This
// simplifies a lot of the code.
@@ -118,8 +107,8 @@ private:
static std::pair<LLUUID, U64> mLocalRegion;
typedef std::map<LLUUID, CacheInfo> region_map_t;
static region_map_t mRegions;
- typedef std::multimap<LLUUID, LLRegionHandleCallback*> region_callback_t;
- static region_callback_t mRegionCallback;
+ typedef std::multimap<LLUUID, region_handle_callback_t> region_callback_map_t;
+ static region_callback_map_t sRegionCallbackMap;
};
#endif
diff --git a/indra/llinventory/llnotecard.h b/indra/llinventory/llnotecard.h
index b903f1fdb0..092ab2ce35 100644
--- a/indra/llinventory/llnotecard.h
+++ b/indra/llinventory/llnotecard.h
@@ -33,7 +33,7 @@
#ifndef LL_NOTECARD_H
#define LL_NOTECARD_H
-#include "llmemory.h"
+#include "llpointer.h"
#include "llinventory.h"
class LLNotecard
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index a0b27c788f..e48690908e 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -85,13 +85,13 @@ static const std::string PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] =
"None",
"Linden Location",
"Adult",
- "Arts & Culture",
+ "Arts and Culture",
"Business",
"Educational",
"Gaming",
"Hangout",
"Newcomer Friendly",
- "Parks & Nature",
+ "Parks and Nature",
"Residential",
"Shopping",
"Stage",
@@ -199,6 +199,12 @@ void LLParcel::init(const LLUUID &owner_id,
mObscureMusic = 1;
mMediaWidth = 0;
mMediaHeight = 0;
+ setMediaCurrentURL(LLStringUtil::null);
+ mMediaURLFilterEnable = FALSE;
+ mMediaURLFilterList = LLSD::emptyArray();
+ mMediaAllowNavigate = TRUE;
+ mMediaURLTimeout = 0.0f;
+ mMediaPreventCameraZoom = FALSE;
mGroupID.setNull();
@@ -314,6 +320,56 @@ void LLParcel::setMediaHeight(S32 height)
{
mMediaHeight = height;
}
+
+void LLParcel::setMediaCurrentURL(const std::string& url)
+{
+ mMediaCurrentURL = url;
+ // The escaping here must match the escaping in the database
+ // abstraction layer if it's ever added.
+ // This should really filter the url in some way. Other than
+ // simply requiring non-printable.
+ LLStringFn::replace_nonprintable_in_ascii(mMediaCurrentURL, LL_UNKNOWN_CHAR);
+
+}
+
+void LLParcel::setMediaURLResetTimer(F32 time)
+{
+ mMediaResetTimer.start();
+ mMediaResetTimer.setTimerExpirySec(time);
+}
+
+void LLParcel::setMediaURLFilterList(LLSD list)
+{
+ // sanity check LLSD
+ // must be array of strings
+ if (!list.isArray())
+ {
+ return;
+ }
+
+ for (S32 i = 0; i < list.size(); i++)
+ {
+ if (!list[i].isString())
+ return;
+ }
+
+ // can't be too big
+ const S32 MAX_SIZE = 50;
+ if (list.size() > MAX_SIZE)
+ {
+ LLSD new_list = LLSD::emptyArray();
+
+ for (S32 i = 0; i < llmin(list.size(), MAX_SIZE); i++)
+ {
+ new_list.append(list[i]);
+ }
+
+ list = new_list;
+ }
+
+ mMediaURLFilterList = list;
+}
+
// virtual
void LLParcel::setLocalID(S32 local_id)
{
@@ -568,6 +624,34 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
return input_stream.good();
}
+BOOL LLParcel::importMediaURLFilter(std::istream& input_stream, std::string& url)
+{
+ skip_to_end_of_next_keyword("{", input_stream);
+
+ while(input_stream.good())
+ {
+ skip_comments_and_emptyspace(input_stream);
+ std::string line, keyword, value;
+ get_line(line, input_stream, MAX_STRING);
+ get_keyword_and_value(keyword, value, line);
+
+ if ("}" == keyword)
+ {
+ break;
+ }
+ else if ("url" == keyword)
+ {
+ url = value;
+ }
+ else
+ {
+ llwarns << "Unknown keyword in parcel media url filter section: <"
+ << keyword << ">" << llendl;
+ }
+ }
+ return input_stream.good();
+}
+
// Assumes we are in a block "ParcelData"
void LLParcel::packMessage(LLMessageSystem* msg)
{
@@ -593,6 +677,7 @@ void LLParcel::packMessage(LLMessageSystem* msg)
// Assumes we are in a block "ParcelData"
void LLParcel::packMessage(LLSD& msg)
{
+ // used in the viewer, the sim uses it's own packer
msg["local_id"] = getLocalID();
msg["parcel_flags"] = ll_sd_from_U32(getParcelFlags());
msg["sale_price"] = getSalePrice();
@@ -606,9 +691,15 @@ void LLParcel::packMessage(LLSD& msg)
msg["media_height"] = getMediaHeight();
msg["auto_scale"] = getMediaAutoScale();
msg["media_loop"] = getMediaLoop();
+ msg["media_current_url"] = getMediaCurrentURL();
msg["obscure_media"] = getObscureMedia();
msg["obscure_music"] = getObscureMusic();
msg["media_id"] = getMediaID();
+ msg["media_allow_navigate"] = getMediaAllowNavigate();
+ msg["media_prevent_camera_zoom"] = getMediaPreventCameraZoom();
+ msg["media_url_timeout"] = getMediaURLTimeout();
+ msg["media_url_filter_enable"] = getMediaURLFilterEnable();
+ msg["media_url_filter_list"] = getMediaURLFilterList();
msg["group_id"] = getGroupID();
msg["pass_price"] = mPassPrice;
msg["pass_hours"] = mPassHours;
@@ -678,6 +769,21 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
mObscureMedia = true;
mObscureMusic = true;
}
+
+ if(msg->getNumberOfBlocks("MediaLinkSharing") > 0)
+ {
+ msg->getString("MediaLinkSharing", "MediaCurrentURL", buffer);
+ setMediaCurrentURL(buffer);
+ msg->getU8 ( "MediaLinkSharing", "MediaAllowNavigate", mMediaAllowNavigate );
+ msg->getU8 ( "MediaLinkSharing", "MediaURLFilterEnable", mMediaURLFilterEnable );
+ msg->getU8 ( "MediaLinkSharing", "MediaPreventCameraZoom", mMediaPreventCameraZoom );
+ msg->getF32( "MediaLinkSharing", "MediaURLTimeout", mMediaURLTimeout);
+ }
+ else
+ {
+ setMediaCurrentURL(LLStringUtil::null);
+ }
+
}
void LLParcel::packAccessEntries(LLMessageSystem* msg,
@@ -994,6 +1100,20 @@ BOOL LLParcel::isSaleTimerExpired(const U64& time)
return expired;
}
+BOOL LLParcel::isMediaResetTimerExpired(const U64& time)
+{
+ if (mMediaResetTimer.getStarted() == FALSE)
+ {
+ return FALSE;
+ }
+ BOOL expired = mMediaResetTimer.checkExpirationAndReset(0.0);
+ if (expired)
+ {
+ mMediaResetTimer.stop();
+ }
+ return expired;
+}
+
void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group)
{
@@ -1117,6 +1237,12 @@ void LLParcel::clearParcel()
mObscureMusic = 1;
mMediaWidth = 0;
mMediaHeight = 0;
+ setMediaCurrentURL(LLStringUtil::null);
+ setMediaURLFilterList(LLSD::emptyArray());
+ setMediaURLFilterEnable(FALSE);
+ setMediaAllowNavigate(TRUE);
+ setMediaPreventCameraZoom(FALSE);
+ setMediaURLTimeout(0.0f);
setMusicURL(LLStringUtil::null);
setInEscrow(FALSE);
setAuthorizedBuyerID(LLUUID::null);
diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h
index 5a865d27ba..2a9a596912 100644
--- a/indra/llinventory/llparcel.h
+++ b/indra/llinventory/llparcel.h
@@ -38,6 +38,7 @@
#include "lluuid.h"
#include "llparcelflags.h"
#include "llpermissions.h"
+#include "lltimer.h"
#include "v3math.h"
@@ -247,6 +248,14 @@ public:
void setObscureMusic( U8 flagIn ) { mObscureMusic = flagIn; }
void setMediaWidth(S32 width);
void setMediaHeight(S32 height);
+ void setMediaCurrentURL(const std::string& url);
+ void setMediaURLFilterEnable(U8 enable) { mMediaURLFilterEnable = enable; }
+ void setMediaURLFilterList(LLSD list);
+ void setMediaAllowNavigate(U8 enable) { mMediaAllowNavigate = enable; }
+ void setMediaURLTimeout(F32 timeout) { mMediaURLTimeout = timeout; }
+ void setMediaPreventCameraZoom(U8 enable) { mMediaPreventCameraZoom = enable; }
+
+ void setMediaURLResetTimer(F32 time);
virtual void setLocalID(S32 local_id);
// blow away all the extra crap lurking in parcels, including urls, access lists, etc
@@ -299,7 +308,8 @@ public:
// BOOL importStream(std::istream& input_stream);
BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry);
-// BOOL exportStream(std::ostream& output_stream);
+ BOOL importMediaURLFilter(std::istream& input_stream, std::string& url);
+ // BOOL exportStream(std::ostream& output_stream);
void packMessage(LLMessageSystem* msg);
void packMessage(LLSD& msg);
@@ -341,8 +351,15 @@ public:
S32 getMediaHeight() const { return mMediaHeight; }
U8 getMediaAutoScale() const { return mMediaAutoScale; }
U8 getMediaLoop() const { return mMediaLoop; }
+ const std::string& getMediaCurrentURL() const { return mMediaCurrentURL; }
U8 getObscureMedia() const { return mObscureMedia; }
U8 getObscureMusic() const { return mObscureMusic; }
+ U8 getMediaURLFilterEnable() const { return mMediaURLFilterEnable; }
+ LLSD getMediaURLFilterList() const { return mMediaURLFilterList; }
+ U8 getMediaAllowNavigate() const { return mMediaAllowNavigate; }
+ F32 getMediaURLTimeout() const { return mMediaURLTimeout; }
+ U8 getMediaPreventCameraZoom() const { return mMediaPreventCameraZoom; }
+
S32 getLocalID() const { return mLocalID; }
const LLUUID& getOwnerID() const { return mOwnerID; }
const LLUUID& getGroupID() const { return mGroupID; }
@@ -413,6 +430,10 @@ public:
void completeSale(U32& type, U8& flags, LLUUID& to_id);
void clearSale();
+
+ BOOL isMediaResetTimerExpired(const U64& time);
+
+
// more accessors
U32 getParcelFlags() const { return mParcelFlags; }
@@ -591,6 +612,8 @@ protected:
LLVector3 mUserLookAt;
ELandingType mLandingType;
LLTimer mSaleTimerExpires;
+ LLTimer mMediaResetTimer;
+
S32 mGraceExtension;
// This value is non-zero if there is an auction associated with
@@ -618,9 +641,15 @@ protected:
S32 mMediaHeight;
U8 mMediaAutoScale;
U8 mMediaLoop;
+ std::string mMediaCurrentURL;
U8 mObscureMedia;
U8 mObscureMusic;
LLUUID mMediaID;
+ U8 mMediaURLFilterEnable;
+ LLSD mMediaURLFilterList;
+ U8 mMediaAllowNavigate;
+ U8 mMediaPreventCameraZoom;
+ F32 mMediaURLTimeout;
S32 mPassPrice;
F32 mPassHours;
LLVector3 mAABBMin;
@@ -650,6 +679,7 @@ public:
std::map<LLUUID,LLAccessEntry> mBanList;
std::map<LLUUID,LLAccessEntry> mTempBanList;
std::map<LLUUID,LLAccessEntry> mTempAccessList;
+
};
diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp
index 036231ccf8..d2e5034734 100644
--- a/indra/llinventory/llpermissions.cpp
+++ b/indra/llinventory/llpermissions.cpp
@@ -853,67 +853,8 @@ BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const
return TRUE;
}
-
-LLXMLNode *LLPermissions::exportFileXML() const
-{
- LLXMLNode *ret = new LLXMLNode("permissions", FALSE);
-
- ret->createChild("group_owned", TRUE)->setBoolValue(mIsGroupOwned);
-
- ret->createChild("base_mask", FALSE)->setByteValue(4, (U8*)&mMaskBase, LLXMLNode::ENCODING_HEX);
- ret->createChild("owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskOwner, LLXMLNode::ENCODING_HEX);
- ret->createChild("group_mask", FALSE)->setByteValue(4, (U8*)&mMaskGroup, LLXMLNode::ENCODING_HEX);
- ret->createChild("everyone_mask", FALSE)->setByteValue(4, (U8*)&mMaskEveryone, LLXMLNode::ENCODING_HEX);
- ret->createChild("next_owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskNextOwner, LLXMLNode::ENCODING_HEX);
-
- ret->createChild("creator_id", FALSE)->setUUIDValue(1, &mCreator);
- ret->createChild("owner_id", FALSE)->setUUIDValue(1, &mOwner);
- ret->createChild("last_owner_id", FALSE)->setUUIDValue(1, &mLastOwner);
- ret->createChild("group_id", FALSE)->setUUIDValue(1, &mGroup);
-
- return ret;
-}
-
-bool LLPermissions::importXML(LLXMLNode* node)
-{
- bool success = false;
- if (node)
- {
- success = true;
- LLXMLNodePtr sub_node;
- if (node->getChild("base_mask", sub_node))
- success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskBase));
- if (node->getChild("owner_mask", sub_node))
- success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskOwner));
- if (node->getChild("group_mask", sub_node))
- success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskGroup));
- if (node->getChild("everyone_mask", sub_node))
- success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskEveryone));
- if (node->getChild("next_owner_mask", sub_node))
- success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskNextOwner));
-
- if (node->getChild("creator_id", sub_node))
- success = success && (1 == sub_node->getUUIDValue(1, &mCreator));
- if (node->getChild("owner_id", sub_node))
- success = success && (1 == sub_node->getUUIDValue(1, &mOwner));
- if (node->getChild("last_owner_id", sub_node))
- success = success && (1 == sub_node->getUUIDValue(1, &mLastOwner));
- if (node->getChild("group_id", sub_node))
- success = success && (1 == sub_node->getUUIDValue(1, &mGroup));
- if (node->getChild("group_owned", sub_node))
- {
- BOOL tmpbool = FALSE;
- success = success && (1 == sub_node->getBoolValue(1, &tmpbool));
- mIsGroupOwned = (bool)tmpbool;
- }
- if (!success)
- {
- lldebugs << "LLPermissions::importXML() failed for node named '"
- << node->getName() << "'" << llendl;
- }
- }
- return success;
-}
+// Deleted LLPermissions::exportFileXML() and LLPermissions::importXML()
+// because I can't find any non-test code references to it. 2009-05-04 JC
bool LLPermissions::operator==(const LLPermissions &rhs) const
{
diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h
index f03045e265..d5a0881c8f 100644
--- a/indra/llinventory/llpermissions.h
+++ b/indra/llinventory/llpermissions.h
@@ -256,7 +256,11 @@ public:
BOOL setGroupBits( const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits);
BOOL setEveryoneBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits);
BOOL setNextOwnerBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits);
-
+
+ // This is currently only used in the Viewer to handle calling cards
+ // where the creator is actually used to store the target. Use with care.
+ void setCreator(const LLUUID& creator) { mCreator = creator; }
+
//
// METHODS
//
@@ -321,9 +325,6 @@ public:
BOOL importLegacyStream(std::istream& input_stream);
BOOL exportLegacyStream(std::ostream& output_stream) const;
- LLXMLNode *exportFileXML() const;
- bool importXML(LLXMLNode* node);
-
bool operator==(const LLPermissions &rhs) const;
bool operator!=(const LLPermissions &rhs) const;
diff --git a/indra/llinventory/llpermissionsflags.h b/indra/llinventory/llpermissionsflags.h
index afa2adbd90..f810929d68 100644
--- a/indra/llinventory/llpermissionsflags.h
+++ b/indra/llinventory/llpermissionsflags.h
@@ -32,9 +32,6 @@
#ifndef LL_LLPERMISSIONSFLAGS_H
#define LL_LLPERMISSIONSFLAGS_H
-// llpermissionsflags.h
-// Copyright 2002, Linden Research, Inc.
-//
// Flags for various permissions bits.
// Shared between viewer and simulator.
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp
index b7afb28adf..930901f309 100644
--- a/indra/llinventory/llsaleinfo.cpp
+++ b/indra/llinventory/llsaleinfo.cpp
@@ -135,38 +135,8 @@ bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask)
return true;
}
-LLXMLNode *LLSaleInfo::exportFileXML() const
-{
- LLXMLNode *ret = new LLXMLNode("sale_info", FALSE);
- std::string type_str = ll_safe_string( lookup(mSaleType));
- ret->createChild("type", TRUE)->setStringValue(1, &type_str);
- ret->createChild("price", TRUE)->setIntValue(1, &mSalePrice);
- return ret;
-}
-
-BOOL LLSaleInfo::importXML(LLXMLNode* node)
-{
- BOOL success = FALSE;
- if (node)
- {
- success = TRUE;
- LLXMLNodePtr sub_node;
- if (node->getChild("type", sub_node))
- {
- mSaleType = lookup(sub_node->getValue().c_str());
- }
- if (node->getChild("price", sub_node))
- {
- success &= (1 == sub_node->getIntValue(1, &mSalePrice));
- }
- if (!success)
- {
- lldebugs << "LLSaleInfo::importXML() failed for node named '"
- << node->getName() << "'" << llendl;
- }
- }
- return success;
-}
+// Deleted LLSaleInfo::exportFileXML() and LLSaleInfo::importXML()
+// because I can't find any non-test code references to it. 2009-05-04 JC
BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask)
{
diff --git a/indra/llinventory/llsaleinfo.h b/indra/llinventory/llsaleinfo.h
index d546c49fd7..3461a128be 100644
--- a/indra/llinventory/llsaleinfo.h
+++ b/indra/llinventory/llsaleinfo.h
@@ -101,9 +101,6 @@ public:
bool fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask);
BOOL importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask);
- LLXMLNode *exportFileXML() const;
- BOOL importXML(LLXMLNode* node);
-
LLSD packMessage() const;
void unpackMessage(LLSD sales);