From 1e981a7c1cbf6abf1e60cf2ddc3ce9074d6543a6 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 11 Jan 2008 14:55:27 +0000 Subject: Switch prim items type representation to use int rather than strings. --- .../Environment/Scenes/SceneObjectGroup.Inventory.cs | 4 ++-- .../Environment/Scenes/SceneObjectPart.Inventory.cs | 19 +++++++------------ OpenSim/Region/Environment/StorageManager.cs | 4 ++-- 3 files changed, 11 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index 4d25b5d..b188fdd 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -175,8 +175,8 @@ namespace OpenSim.Region.Environment.Scenes taskItem.desc = item.inventoryDescription; taskItem.owner_id = item.avatarID; taskItem.creator_id = item.creatorsID; - taskItem.type = TaskInventoryItem.Types[item.assetType]; - taskItem.inv_type = TaskInventoryItem.InvTypes[item.invType]; + taskItem.type = item.assetType; + taskItem.inv_type = item.invType; part.AddInventoryItem(taskItem); // It might seem somewhat crude to update the whole group for a single prim inventory change, diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 5d197e3..1dd7e35 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -89,7 +89,8 @@ namespace OpenSim.Region.Environment.Scenes { foreach (TaskInventoryItem item in m_taskInventory.Values) { - if ("lsltext" == item.type) + // XXX more hardcoding badness. Should be an enum in TaskInventoryItem + if (10 == item.type) { StartScript(item); } @@ -251,17 +252,11 @@ namespace OpenSim.Region.Environment.Scenes { if (m_taskInventory.ContainsKey(itemID)) { - string type = m_taskInventory[itemID].inv_type; + int type = m_taskInventory[itemID].inv_type; m_taskInventory.Remove(itemID); m_inventorySerial++; - if (type == "lsltext") - { - return 10; - } - else - { - return 0; - } + + return type; } else { @@ -317,8 +312,8 @@ namespace OpenSim.Region.Environment.Scenes invString.AddSectionEnd(); invString.AddNameValueLine("asset_id", item.asset_id.ToString()); - invString.AddNameValueLine("type", item.type); - invString.AddNameValueLine("inv_type", item.inv_type); + invString.AddNameValueLine("type", TaskInventoryItem.Types[item.type]); + invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.inv_type]); invString.AddNameValueLine("flags", "0x00"); invString.AddNameValueLine("name", item.name + "|"); invString.AddNameValueLine("desc", item.desc + "|"); diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs index 2c04309..5629483 100644 --- a/OpenSim/Region/Environment/StorageManager.cs +++ b/OpenSim/Region/Environment/StorageManager.cs @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment { IRegionDataStore plug = (IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(connectionstring, false); + plug.Initialise(connectionstring, true); m_dataStore = plug; @@ -74,4 +74,4 @@ namespace OpenSim.Region.Environment //TODO: Add checking and warning to make sure it initialised. } } -} \ No newline at end of file +} -- cgit v1.1