diff options
author | McCabe Maxsted | 2009-01-12 13:23:47 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-01-12 13:23:47 -0700 |
commit | 17fa13f1c96ce7f4d3ea58ecd55e7efa0d393b6c (patch) | |
tree | e434bed1acb30ce3409a3a2e245f96af43682d79 /linden/indra/llinventory | |
parent | Various pie menu improvements. (diff) | |
parent | Added inventory changes for one method of inventory loss and upcoming new inv... (diff) | |
download | meta-impy-17fa13f1c96ce7f4d3ea58ecd55e7efa0d393b6c.zip meta-impy-17fa13f1c96ce7f4d3ea58ecd55e7efa0d393b6c.tar.gz meta-impy-17fa13f1c96ce7f4d3ea58ecd55e7efa0d393b6c.tar.bz2 meta-impy-17fa13f1c96ce7f4d3ea58ecd55e7efa0d393b6c.tar.xz |
Added inventory changes to fix one method of inventory loss.
Diffstat (limited to 'linden/indra/llinventory')
-rw-r--r-- | linden/indra/llinventory/llinventory.cpp | 43 |
1 files changed, 39 insertions, 4 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 | { |