Initial AISv3 merge. New HTTP messages not plugged in yet.

This commit is contained in:
Shyotl
2015-06-25 20:16:30 -05:00
parent 09f4528bfb
commit 9f10d9510d
71 changed files with 4962 additions and 3452 deletions

View File

@@ -52,6 +52,7 @@ static const std::string INV_DESC_LABEL("desc");
static const std::string INV_PERMISSIONS_LABEL("permissions");
static const std::string INV_SHADOW_ID_LABEL("shadow_id");
static const std::string INV_ASSET_ID_LABEL("asset_id");
static const std::string INV_LINKED_ID_LABEL("linked_id");
static const std::string INV_SALE_INFO_LABEL("sale_info");
static const std::string INV_FLAGS_LABEL("flags");
static const std::string INV_CREATION_DATE_LABEL("created_at");
@@ -77,13 +78,15 @@ LLInventoryObject::LLInventoryObject(const LLUUID& uuid,
mUUID(uuid),
mParentUUID(parent_uuid),
mType(type),
mName(name)
mName(name),
mCreationDate(0)
{
correctInventoryName(mName);
}
LLInventoryObject::LLInventoryObject() :
mType(LLAssetType::AT_NONE)
mType(LLAssetType::AT_NONE),
mCreationDate(0)
{
}
@@ -249,13 +252,6 @@ BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) co
return TRUE;
}
void LLInventoryObject::removeFromServer()
{
// don't do nothin'
LL_WARNS() << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << LL_ENDL;
}
void LLInventoryObject::updateParentOnServer(BOOL) const
{
// don't do nothin'
@@ -277,6 +273,25 @@ void LLInventoryObject::correctInventoryName(std::string& name)
LLStringUtil::truncate(name, DB_INV_ITEM_NAME_STR_LEN);
}
time_t LLInventoryObject::getCreationDate() const
{
return mCreationDate;
}
void LLInventoryObject::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
}
const std::string& LLInventoryItem::getDescription() const
{
return mDescription;
}
const std::string& LLInventoryItem::getActualDescription() const
{
return mDescription;
}
///----------------------------------------------------------------------------
/// Class LLInventoryItem
@@ -299,9 +314,9 @@ LLInventoryItem::LLInventoryItem(const LLUUID& uuid,
mDescription(desc),
mSaleInfo(sale_info),
mInventoryType(inv_type),
mFlags(flags),
mCreationDate(creation_date_utc)
mFlags(flags)
{
mCreationDate = creation_date_utc;
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
LLStringUtil::replaceChar(mDescription, '|', ' ');
mPermissions.initMasks(inv_type);
@@ -314,9 +329,9 @@ LLInventoryItem::LLInventoryItem() :
mDescription(),
mSaleInfo(),
mInventoryType(LLInventoryType::IT_NONE),
mFlags(0),
mCreationDate(0)
mFlags(0)
{
mCreationDate = (time_t)0;
}
LLInventoryItem::LLInventoryItem(const LLInventoryItem* other) :
@@ -376,21 +391,6 @@ void LLInventoryItem::setAssetUUID(const LLUUID& asset_id)
}
const std::string& LLInventoryItem::getDescription() const
{
return mDescription;
}
const std::string& LLInventoryItem::getActualDescription() const
{
return mDescription;
}
time_t LLInventoryItem::getCreationDate() const
{
return mCreationDate;
}
U32 LLInventoryItem::getCRC32() const
{
// *FIX: Not a real crc - more of a checksum.
@@ -447,11 +447,6 @@ void LLInventoryItem::setFlags(U32 flags)
mFlags = flags;
}
void LLInventoryItem::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
}
// Currently only used in the Viewer to handle calling cards
// where the creator is actually used to store the target.
void LLInventoryItem::setCreator(const LLUUID& creator)
@@ -513,6 +508,12 @@ U32 LLInventoryItem::getFlags() const
return mFlags;
}
time_t LLInventoryItem::getCreationDate() const
{
return mCreationDate;
}
// virtual
void LLInventoryItem::packMessage(LLMessageSystem* msg) const
{
@@ -1047,11 +1048,17 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const
LLFastTimer::DeclareTimer FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize");
bool LLInventoryItem::fromLLSD(const LLSD& sd)
bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
{
LLFastTimer _(FTM_INVENTORY_SD_DESERIALIZE);
mInventoryType = LLInventoryType::IT_NONE;
mAssetUUID.setNull();
if (is_new)
{
// If we're adding LLSD to an existing object, need avoid
// clobbering these fields.
mInventoryType = LLInventoryType::IT_NONE;
mAssetUUID.setNull();
}
std::string w;
w = INV_ITEM_ID_LABEL;
@@ -1108,6 +1115,11 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
{
mAssetUUID = sd[w];
}
w = INV_LINKED_ID_LABEL;
if (sd.has(w))
{
mAssetUUID = sd[w];
}
w = INV_ASSET_TYPE_LABEL;
if (sd.has(w))
{

View File

@@ -73,6 +73,7 @@ public:
virtual LLAssetType::EType getType() const;
LLAssetType::EType getActualType() const; // bypasses indirection for linked items
BOOL getIsLinkType() const;
virtual time_t getCreationDate() const;
//--------------------------------------------------------------------
// Mutators
@@ -83,6 +84,7 @@ public:
virtual void rename(const std::string& new_name);
void setParent(const LLUUID& new_parent);
void setType(LLAssetType::EType type);
virtual void setCreationDate(time_t creation_date_utc); // only stored for items
// [RLVa:KB] - Checked: 2014-01-07 (RLVa-1.4.10)
// in place correction for inventory name string
@@ -103,7 +105,6 @@ public:
virtual BOOL importLegacyStream(std::istream& input_stream);
virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const;
virtual void removeFromServer();
virtual void updateParentOnServer(BOOL) const;
virtual void updateServer(BOOL) const;
@@ -115,6 +116,7 @@ protected:
LLUUID mParentUUID; // Parent category. Root categories have LLUUID::NULL.
LLAssetType::EType mType;
std::string mName;
time_t mCreationDate; // seconds from 1/1/1970, UTC
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -180,7 +182,6 @@ public:
void setPermissions(const LLPermissions& perm);
void setInventoryType(LLInventoryType::EType inv_type);
void setFlags(U32 flags);
void setCreationDate(time_t creation_date_utc);
void setCreator(const LLUUID& creator); // only used for calling cards
// Check for changes in permissions masks and sale info
@@ -214,7 +215,7 @@ public:
void unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size);
LLSD asLLSD() const;
void asLLSD( LLSD& sd ) const;
bool fromLLSD(const LLSD& sd);
bool fromLLSD(const LLSD& sd, bool is_new = true);
//--------------------------------------------------------------------
// Member Variables
@@ -226,7 +227,6 @@ protected:
LLSaleInfo mSaleInfo;
LLInventoryType::EType mInventoryType;
U32 mFlags;
time_t mCreationDate; // seconds from 1/1/1970, UTC
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -535,7 +535,7 @@ void LLPermissions::packMessage(LLMessageSystem* msg) const
msg->addBOOLFast(_PREHASH_GroupOwned, (BOOL)mIsGroupOwned);
}
void LLPermissions::unpackMessage(LLSD perms)
void LLPermissions::unpackMessage(const LLSD& perms)
{
mCreator = perms["creator-id"];
mOwner = perms["owner-id"];

View File

@@ -319,7 +319,7 @@ public:
//
LLSD packMessage() const;
void unpackMessage(LLSD perms);
void unpackMessage(const LLSD& perms);
// For messaging system support
void packMessage(LLMessageSystem* msg) const;

View File

@@ -236,7 +236,7 @@ void LLSaleInfo::packMessage(LLMessageSystem* msg) const
//msg->addU32Fast(_PREHASH_NextOwnerMask, mNextOwnerPermMask);
}
void LLSaleInfo::unpackMessage(LLSD sales)
void LLSaleInfo::unpackMessage(const LLSD& sales)
{
U8 sale_type = (U8)sales["sale-type"].asInteger();
mSaleType = static_cast<EForSale>(sale_type);

View File

@@ -102,7 +102,7 @@ public:
BOOL importStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask);
LLSD packMessage() const;
void unpackMessage(LLSD sales);
void unpackMessage(const LLSD& sales);
// message serialization
void packMessage(LLMessageSystem* msg) const;