diff options
Diffstat (limited to 'linden/indra/llinventory')
-rw-r--r-- | linden/indra/llinventory/llinventory.cpp | 43 | ||||
-rw-r--r-- | linden/indra/llinventory/llparcel.cpp | 14 | ||||
-rw-r--r-- | linden/indra/llinventory/llsaleinfo.cpp | 11 |
3 files changed, 59 insertions, 9 deletions
diff --git a/linden/indra/llinventory/llinventory.cpp b/linden/indra/llinventory/llinventory.cpp index 457a0cb..0c7e0ed 100644 --- a/linden/indra/llinventory/llinventory.cpp +++ b/linden/indra/llinventory/llinventory.cpp | |||
@@ -60,6 +60,9 @@ static const std::string INV_SALE_INFO_LABEL("sale_info"); | |||
60 | static const std::string INV_FLAGS_LABEL("flags"); | 60 | static const std::string INV_FLAGS_LABEL("flags"); |
61 | static const std::string INV_CREATION_DATE_LABEL("created_at"); | 61 | static const std::string INV_CREATION_DATE_LABEL("created_at"); |
62 | 62 | ||
63 | // key used by agent-inventory-service | ||
64 | static const std::string INV_ASSET_TYPE_LABEL_WS("type_default"); | ||
65 | static const std::string INV_FOLDER_ID_LABEL_WS("category_id"); | ||
63 | ///---------------------------------------------------------------------------- | 66 | ///---------------------------------------------------------------------------- |
64 | /// Local function declarations, constants, enums, and typedefs | 67 | /// Local function declarations, constants, enums, and typedefs |
65 | ///---------------------------------------------------------------------------- | 68 | ///---------------------------------------------------------------------------- |
@@ -949,11 +952,13 @@ LLSD LLInventoryItem::asLLSD() const | |||
949 | sd[INV_SHADOW_ID_LABEL] = shadow_id; | 952 | sd[INV_SHADOW_ID_LABEL] = shadow_id; |
950 | } | 953 | } |
951 | sd[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType); | 954 | sd[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType); |
955 | sd[INV_INVENTORY_TYPE_LABEL] = mInventoryType; | ||
952 | const char* inv_type_str = LLInventoryType::lookup(mInventoryType); | 956 | const char* inv_type_str = LLInventoryType::lookup(mInventoryType); |
953 | if(inv_type_str) | 957 | if(inv_type_str) |
954 | { | 958 | { |
955 | sd[INV_INVENTORY_TYPE_LABEL] = inv_type_str; | 959 | sd[INV_INVENTORY_TYPE_LABEL] = inv_type_str; |
956 | } | 960 | } |
961 | //sd[INV_FLAGS_LABEL] = (S32)mFlags; | ||
957 | sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags); | 962 | sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags); |
958 | sd[INV_SALE_INFO_LABEL] = mSaleInfo; | 963 | sd[INV_SALE_INFO_LABEL] = mSaleInfo; |
959 | sd[INV_NAME_LABEL] = mName; | 964 | sd[INV_NAME_LABEL] = mName; |
@@ -1026,17 +1031,40 @@ bool LLInventoryItem::fromLLSD(LLSD& sd) | |||
1026 | w = INV_ASSET_TYPE_LABEL; | 1031 | w = INV_ASSET_TYPE_LABEL; |
1027 | if (sd.has(w)) | 1032 | if (sd.has(w)) |
1028 | { | 1033 | { |
1029 | mType = LLAssetType::lookup(sd[w].asString()); | 1034 | if (sd[w].isString()) |
1035 | { | ||
1036 | mType = LLAssetType::lookup(sd[w].asString().c_str()); | ||
1037 | } | ||
1038 | else if (sd[w].isInteger()) | ||
1039 | { | ||
1040 | S8 type = (U8)sd[w].asInteger(); | ||
1041 | mType = static_cast<LLAssetType::EType>(type); | ||
1042 | } | ||
1030 | } | 1043 | } |
1031 | w = INV_INVENTORY_TYPE_LABEL; | 1044 | w = INV_INVENTORY_TYPE_LABEL; |
1032 | if (sd.has(w)) | 1045 | if (sd.has(w)) |
1033 | { | 1046 | { |
1034 | mInventoryType = LLInventoryType::lookup(sd[w].asString()); | 1047 | if (sd[w].isString()) |
1048 | { | ||
1049 | mInventoryType = LLInventoryType::lookup(sd[w].asString().c_str()); | ||
1050 | } | ||
1051 | else if (sd[w].isInteger()) | ||
1052 | { | ||
1053 | S8 type = (U8)sd[w].asInteger(); | ||
1054 | mInventoryType = static_cast<LLInventoryType::EType>(type); | ||
1055 | } | ||
1035 | } | 1056 | } |
1036 | w = INV_FLAGS_LABEL; | 1057 | w = INV_FLAGS_LABEL; |
1037 | if (sd.has(w)) | 1058 | if (sd.has(w)) |
1038 | { | 1059 | { |
1039 | mFlags = ll_U32_from_sd(sd[w]); | 1060 | if (sd[w].isBinary()) |
1061 | { | ||
1062 | mFlags = ll_U32_from_sd(sd[w]); | ||
1063 | } | ||
1064 | else if(sd[w].isInteger()) | ||
1065 | { | ||
1066 | mFlags = sd[w].asInteger(); | ||
1067 | } | ||
1040 | } | 1068 | } |
1041 | w = INV_NAME_LABEL; | 1069 | w = INV_NAME_LABEL; |
1042 | if (sd.has(w)) | 1070 | if (sd.has(w)) |
@@ -1394,7 +1422,7 @@ bool LLInventoryCategory::fromLLSD(LLSD& sd) | |||
1394 | { | 1422 | { |
1395 | std::string w; | 1423 | std::string w; |
1396 | 1424 | ||
1397 | w = INV_ITEM_ID_LABEL; | 1425 | w = INV_FOLDER_ID_LABEL_WS; |
1398 | if (sd.has(w)) | 1426 | if (sd.has(w)) |
1399 | { | 1427 | { |
1400 | mUUID = sd[w]; | 1428 | mUUID = sd[w]; |
@@ -1410,6 +1438,13 @@ bool LLInventoryCategory::fromLLSD(LLSD& sd) | |||
1410 | S8 type = (U8)sd[w].asInteger(); | 1438 | S8 type = (U8)sd[w].asInteger(); |
1411 | mPreferredType = static_cast<LLAssetType::EType>(type); | 1439 | mPreferredType = static_cast<LLAssetType::EType>(type); |
1412 | } | 1440 | } |
1441 | w = INV_ASSET_TYPE_LABEL_WS; | ||
1442 | if (sd.has(w)) | ||
1443 | { | ||
1444 | S8 type = (U8)sd[w].asInteger(); | ||
1445 | mPreferredType = static_cast<LLAssetType::EType>(type); | ||
1446 | } | ||
1447 | |||
1413 | w = INV_NAME_LABEL; | 1448 | w = INV_NAME_LABEL; |
1414 | if (sd.has(w)) | 1449 | if (sd.has(w)) |
1415 | { | 1450 | { |
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp index 2b9c201..911e257 100644 --- a/linden/indra/llinventory/llparcel.cpp +++ b/linden/indra/llinventory/llparcel.cpp | |||
@@ -1398,7 +1398,7 @@ void LLParcel::unpackMessage(LLMessageSystem* msg) | |||
1398 | 1398 | ||
1399 | // New Media Data | 1399 | // New Media Data |
1400 | // Note: the message has been converted to TCP | 1400 | // Note: the message has been converted to TCP |
1401 | if(msg->getNumberOfBlocks("MediaData") > 0) | 1401 | if(msg->has("MediaData")) |
1402 | { | 1402 | { |
1403 | msg->getString("MediaData", "MediaDesc", buffer); | 1403 | msg->getString("MediaData", "MediaDesc", buffer); |
1404 | setMediaDesc(buffer); | 1404 | setMediaDesc(buffer); |
@@ -1761,7 +1761,11 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) | |||
1761 | setCleanOtherTime(0); | 1761 | setCleanOtherTime(0); |
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | void LLParcel::expireSale(U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id) | 1764 | void LLParcel::expireSale( |
1765 | U32& type, | ||
1766 | U8& flags, | ||
1767 | LLUUID& from_id, | ||
1768 | LLUUID& to_id) | ||
1765 | { | 1769 | { |
1766 | mSaleTimerExpires.setTimerExpirySec(0.0); | 1770 | mSaleTimerExpires.setTimerExpirySec(0.0); |
1767 | mSaleTimerExpires.stop(); | 1771 | mSaleTimerExpires.stop(); |
@@ -1777,8 +1781,10 @@ void LLParcel::expireSale(U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id) | |||
1777 | to_id.setNull(); | 1781 | to_id.setNull(); |
1778 | } | 1782 | } |
1779 | 1783 | ||
1780 | void LLParcel::completeSale(U32& type, U8& flags, | 1784 | void LLParcel::completeSale( |
1781 | LLUUID& to_id) | 1785 | U32& type, |
1786 | U8& flags, | ||
1787 | LLUUID& to_id) | ||
1782 | { | 1788 | { |
1783 | mSaleTimerExpires.setTimerExpirySec(0.0); | 1789 | mSaleTimerExpires.setTimerExpirySec(0.0); |
1784 | mSaleTimerExpires.stop(); | 1790 | mSaleTimerExpires.stop(); |
diff --git a/linden/indra/llinventory/llsaleinfo.cpp b/linden/indra/llinventory/llsaleinfo.cpp index 4895378..fef6b05 100644 --- a/linden/indra/llinventory/llsaleinfo.cpp +++ b/linden/indra/llinventory/llsaleinfo.cpp | |||
@@ -114,7 +114,16 @@ bool LLSaleInfo::fromLLSD(LLSD& sd, BOOL& has_perm_mask, U32& perm_mask) | |||
114 | { | 114 | { |
115 | const char *w; | 115 | const char *w; |
116 | 116 | ||
117 | mSaleType = lookup(sd["sale_type"].asString().c_str()); | 117 | if (sd["sale_type"].isString()) |
118 | { | ||
119 | mSaleType = lookup(sd["sale_type"].asString().c_str()); | ||
120 | } | ||
121 | else if(sd["sale_type"].isInteger()) | ||
122 | { | ||
123 | S8 type = (U8)sd["sale_type"].asInteger(); | ||
124 | mSaleType = static_cast<LLSaleInfo::EForSale>(type); | ||
125 | } | ||
126 | |||
118 | mSalePrice = llclamp(sd["sale_price"].asInteger(), 0, S32_MAX); | 127 | mSalePrice = llclamp(sd["sale_price"].asInteger(), 0, S32_MAX); |
119 | w = "perm_mask"; | 128 | w = "perm_mask"; |
120 | if (sd.has(w)) | 129 | if (sd.has(w)) |