diff options
author | Justin Clarke Casey | 2008-01-06 01:56:29 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-01-06 01:56:29 +0000 |
commit | 679923ec871d98e5aa514734b2e23f9a00c58433 (patch) | |
tree | c2591d0a336339dd7ce5ca26d39abde68d0b81be /OpenSim/Region | |
parent | Prim inventory phase 4. Properly recover the prim folder ID from storage. S... (diff) | |
download | opensim-SC_OLD-679923ec871d98e5aa514734b2e23f9a00c58433.zip opensim-SC_OLD-679923ec871d98e5aa514734b2e23f9a00c58433.tar.gz opensim-SC_OLD-679923ec871d98e5aa514734b2e23f9a00c58433.tar.bz2 opensim-SC_OLD-679923ec871d98e5aa514734b2e23f9a00c58433.tar.xz |
Factor out TaskInventoryItem
Diffstat (limited to 'OpenSim/Region')
3 files changed, 15 insertions, 83 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 4bbc2ed..a9b3fe9 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1178,15 +1178,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1178 | SceneObjectPart part = GetChildPart(localID); | 1178 | SceneObjectPart part = GetChildPart(localID); |
1179 | if (part != null) | 1179 | if (part != null) |
1180 | { | 1180 | { |
1181 | SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem(); | 1181 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
1182 | taskItem.item_id = item.inventoryID; | 1182 | taskItem.item_id = item.inventoryID; |
1183 | taskItem.asset_id = item.assetID; | 1183 | taskItem.asset_id = item.assetID; |
1184 | taskItem.name = item.inventoryName; | 1184 | taskItem.name = item.inventoryName; |
1185 | taskItem.desc = item.inventoryDescription; | 1185 | taskItem.desc = item.inventoryDescription; |
1186 | taskItem.owner_id = item.avatarID; | 1186 | taskItem.owner_id = item.avatarID; |
1187 | taskItem.creator_id = item.creatorsID; | 1187 | taskItem.creator_id = item.creatorsID; |
1188 | taskItem.type = SceneObjectPart.TaskInventoryItem.Types[item.assetType]; | 1188 | taskItem.type = TaskInventoryItem.Types[item.assetType]; |
1189 | taskItem.inv_type = SceneObjectPart.TaskInventoryItem.Types[item.invType]; | 1189 | taskItem.inv_type = TaskInventoryItem.Types[item.invType]; |
1190 | part.AddInventoryItem(taskItem); | 1190 | part.AddInventoryItem(taskItem); |
1191 | return true; | 1191 | return true; |
1192 | } | 1192 | } |
@@ -1200,15 +1200,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1200 | SceneObjectPart part = GetChildPart(localID); | 1200 | SceneObjectPart part = GetChildPart(localID); |
1201 | if (part != null) | 1201 | if (part != null) |
1202 | { | 1202 | { |
1203 | SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem(); | 1203 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
1204 | taskItem.item_id = copyItemID; | 1204 | taskItem.item_id = copyItemID; |
1205 | taskItem.asset_id = item.assetID; | 1205 | taskItem.asset_id = item.assetID; |
1206 | taskItem.name = item.inventoryName; | 1206 | taskItem.name = item.inventoryName; |
1207 | taskItem.desc = item.inventoryDescription; | 1207 | taskItem.desc = item.inventoryDescription; |
1208 | taskItem.owner_id = new LLUUID(item.avatarID.ToString()); | 1208 | taskItem.owner_id = new LLUUID(item.avatarID.ToString()); |
1209 | taskItem.creator_id = new LLUUID(item.creatorsID.ToString()); | 1209 | taskItem.creator_id = new LLUUID(item.creatorsID.ToString()); |
1210 | taskItem.type = SceneObjectPart.TaskInventoryItem.Types[item.assetType]; | 1210 | taskItem.type = TaskInventoryItem.Types[item.assetType]; |
1211 | taskItem.inv_type = SceneObjectPart.TaskInventoryItem.InvTypes[item.invType]; | 1211 | taskItem.inv_type = TaskInventoryItem.InvTypes[item.invType]; |
1212 | part.AddInventoryItem(taskItem); | 1212 | part.AddInventoryItem(taskItem); |
1213 | return true; | 1213 | return true; |
1214 | } | 1214 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2ddcf7b..b07b43c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -1736,73 +1736,5 @@ namespace OpenSim.Region.Environment.Scenes | |||
1736 | { | 1736 | { |
1737 | } | 1737 | } |
1738 | } | 1738 | } |
1739 | |||
1740 | public class TaskInventoryItem | ||
1741 | { | ||
1742 | /// <summary> | ||
1743 | /// Inventory types | ||
1744 | /// </summary> | ||
1745 | public static string[] InvTypes = new string[] | ||
1746 | { | ||
1747 | "texture", | ||
1748 | "sound", | ||
1749 | "", | ||
1750 | "", | ||
1751 | "", | ||
1752 | "", | ||
1753 | "", | ||
1754 | "", | ||
1755 | "", | ||
1756 | "", | ||
1757 | "lsl_text", | ||
1758 | "" | ||
1759 | }; | ||
1760 | |||
1761 | /// <summary> | ||
1762 | /// Asset types | ||
1763 | /// </summary> | ||
1764 | public static string[] Types = new string[] | ||
1765 | { | ||
1766 | "texture", | ||
1767 | "sound", | ||
1768 | "", | ||
1769 | "", | ||
1770 | "", | ||
1771 | "", | ||
1772 | "", | ||
1773 | "", | ||
1774 | "", | ||
1775 | "", | ||
1776 | "lsltext", | ||
1777 | "" | ||
1778 | }; | ||
1779 | |||
1780 | public LLUUID item_id = LLUUID.Zero; | ||
1781 | public LLUUID parent_id = LLUUID.Zero; //parent folder id | ||
1782 | |||
1783 | public uint base_mask = FULL_MASK_PERMISSIONS_GENERAL; | ||
1784 | public uint owner_mask = FULL_MASK_PERMISSIONS_GENERAL; | ||
1785 | public uint group_mask = FULL_MASK_PERMISSIONS_GENERAL; | ||
1786 | public uint everyone_mask = FULL_MASK_PERMISSIONS_GENERAL; | ||
1787 | public uint next_owner_mask = FULL_MASK_PERMISSIONS_GENERAL; | ||
1788 | public LLUUID creator_id = LLUUID.Zero; | ||
1789 | public LLUUID owner_id = LLUUID.Zero; | ||
1790 | public LLUUID last_owner_id = LLUUID.Zero; | ||
1791 | public LLUUID group_id = LLUUID.Zero; | ||
1792 | |||
1793 | public LLUUID asset_id = LLUUID.Zero; | ||
1794 | public string type = ""; | ||
1795 | public string inv_type = ""; | ||
1796 | public uint flags = 0; | ||
1797 | public string name = ""; | ||
1798 | public string desc = ""; | ||
1799 | public uint creation_date = 0; | ||
1800 | |||
1801 | public LLUUID ParentPartID = LLUUID.Zero; | ||
1802 | |||
1803 | public TaskInventoryItem() | ||
1804 | { | ||
1805 | } | ||
1806 | } | ||
1807 | } | 1739 | } |
1808 | } | 1740 | } |
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 8bad730..b99b819 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -340,11 +340,11 @@ namespace OpenSim.DataStore.MonoSqlite | |||
340 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); | 340 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); |
341 | DataRow[] dbItemRows = dbItems.Select(sql); | 341 | DataRow[] dbItemRows = dbItems.Select(sql); |
342 | 342 | ||
343 | IList<SceneObjectPart.TaskInventoryItem> inventory = new List<SceneObjectPart.TaskInventoryItem>(); | 343 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
344 | 344 | ||
345 | foreach (DataRow row in dbItemRows) | 345 | foreach (DataRow row in dbItemRows) |
346 | { | 346 | { |
347 | SceneObjectPart.TaskInventoryItem item = buildItem(row); | 347 | TaskInventoryItem item = buildItem(row); |
348 | inventory.Add(item); | 348 | inventory.Add(item); |
349 | 349 | ||
350 | MainLog.Instance.Verbose("DATASTORE", "Restored item {0}, {1}", item.name, item.item_id); | 350 | MainLog.Instance.Verbose("DATASTORE", "Restored item {0}, {1}", item.name, item.item_id); |
@@ -897,9 +897,9 @@ namespace OpenSim.DataStore.MonoSqlite | |||
897 | /// </summary> | 897 | /// </summary> |
898 | /// <param name="row"></param> | 898 | /// <param name="row"></param> |
899 | /// <returns></returns> | 899 | /// <returns></returns> |
900 | private SceneObjectPart.TaskInventoryItem buildItem(DataRow row) | 900 | private TaskInventoryItem buildItem(DataRow row) |
901 | { | 901 | { |
902 | SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem(); | 902 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
903 | 903 | ||
904 | taskItem.item_id = new LLUUID((String)row["itemID"]); | 904 | taskItem.item_id = new LLUUID((String)row["itemID"]); |
905 | taskItem.ParentPartID = new LLUUID((String)row["primID"]); | 905 | taskItem.ParentPartID = new LLUUID((String)row["primID"]); |
@@ -1069,7 +1069,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
1069 | row["SitTargetOrientZ"] = sitTargetOrient.Z; | 1069 | row["SitTargetOrientZ"] = sitTargetOrient.Z; |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | private void fillItemRow(DataRow row, SceneObjectPart.TaskInventoryItem taskItem) | 1072 | private void fillItemRow(DataRow row, TaskInventoryItem taskItem) |
1073 | { | 1073 | { |
1074 | row["itemID"] = taskItem.item_id; | 1074 | row["itemID"] = taskItem.item_id; |
1075 | row["primID"] = taskItem.ParentPartID; | 1075 | row["primID"] = taskItem.ParentPartID; |
@@ -1271,7 +1271,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
1271 | /// <param name="primID"></param> | 1271 | /// <param name="primID"></param> |
1272 | /// <param name="items"></param> | 1272 | /// <param name="items"></param> |
1273 | /// <returns></returns> | 1273 | /// <returns></returns> |
1274 | private void addPrimInventory(LLUUID primID, IDictionary<LLUUID, SceneObjectPart.TaskInventoryItem> items) | 1274 | private void addPrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items) |
1275 | { | 1275 | { |
1276 | MainLog.Instance.Verbose("DATASTORE", "Entered addPrimInventory with prim ID {0}", primID); | 1276 | MainLog.Instance.Verbose("DATASTORE", "Entered addPrimInventory with prim ID {0}", primID); |
1277 | 1277 | ||
@@ -1283,8 +1283,8 @@ namespace OpenSim.DataStore.MonoSqlite | |||
1283 | 1283 | ||
1284 | // Build structures for manipulation purposes | 1284 | // Build structures for manipulation purposes |
1285 | IDictionary<String, DataRow> dbItemsToRemove = new Dictionary<String, DataRow>(); | 1285 | IDictionary<String, DataRow> dbItemsToRemove = new Dictionary<String, DataRow>(); |
1286 | ICollection<SceneObjectPart.TaskInventoryItem> itemsToAdd | 1286 | ICollection<TaskInventoryItem> itemsToAdd |
1287 | = new List<SceneObjectPart.TaskInventoryItem>(); | 1287 | = new List<TaskInventoryItem>(); |
1288 | 1288 | ||
1289 | foreach (DataRow row in dbItemRows) | 1289 | foreach (DataRow row in dbItemRows) |
1290 | { | 1290 | { |
@@ -1319,7 +1319,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | // Insert items not already present | 1321 | // Insert items not already present |
1322 | foreach (SceneObjectPart.TaskInventoryItem newItem in itemsToAdd) | 1322 | foreach (TaskInventoryItem newItem in itemsToAdd) |
1323 | { | 1323 | { |
1324 | MainLog.Instance.Verbose( | 1324 | MainLog.Instance.Verbose( |
1325 | "DATASTORE", | 1325 | "DATASTORE", |