aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-12-21 20:48:58 +0000
committerMelanie2010-12-21 20:48:58 +0000
commitc9aa420c2d87da6285007ca52f0defbe60239c91 (patch)
tree0f7d01d1d242357a3b6c203676af9c87bf44a99a
parentMake prim inventories a bit more sane (diff)
downloadopensim-SC-c9aa420c2d87da6285007ca52f0defbe60239c91.zip
opensim-SC-c9aa420c2d87da6285007ca52f0defbe60239c91.tar.gz
opensim-SC-c9aa420c2d87da6285007ca52f0defbe60239c91.tar.bz2
opensim-SC-c9aa420c2d87da6285007ca52f0defbe60239c91.tar.xz
Restore CM loking after core extract
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs129
1 files changed, 64 insertions, 65 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 74b4e54..8ec9d55 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -953,80 +953,79 @@ namespace OpenSim.Region.Framework.Scenes
953 953
954 InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); 954 InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
955 955
956 lock (m_items) 956 Items.LockItemsForRead(true);
957
958 if (m_inventorySerial == 0) // No inventory
957 { 959 {
958 if (m_inventorySerial == 0) // No inventory 960 client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
959 { 961 return;
960 client.SendTaskInventory(m_part.UUID, 0, new byte[0]); 962 }
961 return;
962 }
963 963
964 client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial, 964 client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial,
965 Util.StringToBytes256(m_inventoryFileName)); 965 Util.StringToBytes256(m_inventoryFileName));
966 966
967 if (!changed) 967 if (!changed)
968 {
969 if (m_inventoryFileData.Length > 2)
968 { 970 {
969 if (m_inventoryFileData.Length > 2) 971 xferManager.AddNewFile(m_inventoryFileName,
970 { 972 m_inventoryFileData);
971 xferManager.AddNewFile(m_inventoryFileName,
972 m_inventoryFileData);
973 }
974 } 973 }
974 }
975 975
976 bool includeAssets = false; 976 bool includeAssets = false;
977 if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId)) 977 if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId))
978 includeAssets = true; 978 includeAssets = true;
979 979
980 foreach (TaskInventoryItem item in m_items.Values) 980 foreach (TaskInventoryItem item in m_items.Values)
981 { 981 {
982 UUID ownerID = item.OwnerID; 982 UUID ownerID = item.OwnerID;
983 uint everyoneMask = 0; 983 uint everyoneMask = 0;
984 uint baseMask = item.BasePermissions; 984 uint baseMask = item.BasePermissions;
985 uint ownerMask = item.CurrentPermissions; 985 uint ownerMask = item.CurrentPermissions;
986 uint groupMask = item.GroupPermissions; 986 uint groupMask = item.GroupPermissions;
987 987
988 invString.AddItemStart(); 988 invString.AddItemStart();
989 invString.AddNameValueLine("item_id", item.ItemID.ToString()); 989 invString.AddNameValueLine("item_id", item.ItemID.ToString());
990 invString.AddNameValueLine("parent_id", m_part.UUID.ToString()); 990 invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
991 991
992 invString.AddPermissionsStart(); 992 invString.AddPermissionsStart();
993 993
994 invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); 994 invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
995 invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); 995 invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
996 invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask)); 996 invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
997 invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); 997 invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
998 invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); 998 invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
999 999
1000 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 1000 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
1001 invString.AddNameValueLine("owner_id", ownerID.ToString()); 1001 invString.AddNameValueLine("owner_id", ownerID.ToString());
1002 1002
1003 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); 1003 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
1004 1004
1005 invString.AddNameValueLine("group_id", item.GroupID.ToString()); 1005 invString.AddNameValueLine("group_id", item.GroupID.ToString());
1006 invString.AddSectionEnd(); 1006 invString.AddSectionEnd();
1007 1007
1008 if (includeAssets) 1008 if (includeAssets)
1009 invString.AddNameValueLine("asset_id", item.AssetID.ToString()); 1009 invString.AddNameValueLine("asset_id", item.AssetID.ToString());
1010 else 1010 else
1011 invString.AddNameValueLine("asset_id", UUID.Zero.ToString()); 1011 invString.AddNameValueLine("asset_id", UUID.Zero.ToString());
1012 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); 1012 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
1013 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); 1013 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
1014 invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); 1014 invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
1015 1015
1016 invString.AddSaleStart(); 1016 invString.AddSaleStart();
1017 invString.AddNameValueLine("sale_type", "not"); 1017 invString.AddNameValueLine("sale_type", "not");
1018 invString.AddNameValueLine("sale_price", "0"); 1018 invString.AddNameValueLine("sale_price", "0");
1019 invString.AddSectionEnd(); 1019 invString.AddSectionEnd();
1020 1020
1021 invString.AddNameValueLine("name", item.Name + "|"); 1021 invString.AddNameValueLine("name", item.Name + "|");
1022 invString.AddNameValueLine("desc", item.Description + "|"); 1022 invString.AddNameValueLine("desc", item.Description + "|");
1023 1023
1024 invString.AddNameValueLine("creation_date", item.CreationDate.ToString()); 1024 invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
1025 invString.AddSectionEnd(); 1025 invString.AddSectionEnd();
1026 }
1027 } 1026 }
1028 1027
1029 int count = m_items.Count; 1028 Items.LockItemsForRead(false);
1030 1029
1031 m_inventoryFileData = Utils.StringToBytes(invString.BuildString); 1030 m_inventoryFileData = Utils.StringToBytes(invString.BuildString);
1032 1031