From 915593bfbc2f0d6729efe4dfe8d4c8a3f0fc9fbe Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 21 Nov 2008 21:16:42 +0000 Subject: * refactor: Rip out SOP inventory from the partial into a separate class * SceneObjectPartInventory.cs isn't a particularly good name but it's probably not got a long life * A proper inventory interface to follow * Parallel changes for other inventory partial classes to follow at a later date --- OpenSim/Data/MSSQL/MSSQLRegionData.cs | 2 +- OpenSim/Data/MySQL/MySQLRegionData.cs | 2 +- OpenSim/Data/NHibernate/NHibernateRegionData.cs | 2 +- OpenSim/Data/SQLite/SQLiteRegionData.cs | 2 +- OpenSim/Data/Tests/BasicRegionTest.cs | 16 ++++++++-------- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 6298a19..c29f566 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -718,7 +718,7 @@ VALUES //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); } - prim.RestoreInventoryItems(inventory); + prim.Inventory.RestoreInventoryItems(inventory); // XXX A nasty little hack to recover the folder id for the prim (which is currently stored in // every item). This data should really be stored in the prim table itself. diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 1daefe4..2e36123 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -511,7 +511,7 @@ namespace OpenSim.Data.MySQL //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); } - prim.RestoreInventoryItems(inventory); + prim.Inventory.RestoreInventoryItems(inventory); // XXX A nasty little hack to recover the folder id for the prim (which is currently stored in // every item). This data should really be stored in the prim table itself. diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 833f1b7..475cd71 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs @@ -261,7 +261,7 @@ namespace OpenSim.Data.NHibernate } if (inventory.Count > 0) - p.RestoreInventoryItems(inventory); + p.Inventory.RestoreInventoryItems(inventory); } foreach (SceneObjectGroup g in SOG.Values) { diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index a959d56..c436205 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -514,7 +514,7 @@ namespace OpenSim.Data.SQLite //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); } - prim.RestoreInventoryItems(inventory); + prim.Inventory.RestoreInventoryItems(inventory); // XXX A nasty little hack to recover the folder id for the prim (which is currently stored in // every item). This data should really be stored in the prim table itself. diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index a7d62d0..e68ec2e 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs @@ -255,8 +255,8 @@ namespace OpenSim.Data.Tests sop.GroupPosition = groupos; sop.RotationOffset = rotoff; sop.CreatorID = creator; - sop.InventorySerial = iserial; - sop.TaskInventory = dic; + sop.Inventory.Serial = iserial; + sop.Inventory.Items = dic; sop.ObjectFlags = objf; sop.Name = name; sop.Material = material; @@ -287,8 +287,8 @@ namespace OpenSim.Data.Tests Assert.That(rotoff,Is.EqualTo(sop.RotationOffset)); Assert.That(uuid,Is.EqualTo(sop.UUID)); Assert.That(creator,Is.EqualTo(sop.CreatorID)); - Assert.That(iserial,Is.EqualTo(sop.InventorySerial)); - Assert.That(dic,Is.EqualTo(sop.TaskInventory)); + Assert.That(iserial,Is.EqualTo(sop.Inventory.Serial)); + Assert.That(dic,Is.EqualTo(sop.Inventory.Items)); Assert.That(objf,Is.EqualTo(sop.ObjectFlags)); Assert.That(name,Is.EqualTo(sop.Name)); Assert.That(material,Is.EqualTo(sop.Material)); @@ -337,7 +337,7 @@ namespace OpenSim.Data.Tests Assert.That(uuid,Is.EqualTo(p.UUID)); Assert.That(creator,Is.EqualTo(p.CreatorID)); //Assert.That(iserial,Is.EqualTo(p.InventorySerial)); - Assert.That(dic,Is.EqualTo(p.TaskInventory)); + Assert.That(dic,Is.EqualTo(p.Inventory.Items)); //Assert.That(objf,Is.EqualTo(p.ObjectFlags)); Assert.That(name,Is.EqualTo(p.Name)); Assert.That(material,Is.EqualTo(p.Material)); @@ -415,7 +415,7 @@ namespace OpenSim.Data.Tests sog2.RootPart.GroupPosition = groupos; sog2.RootPart.RotationOffset = rotoff; sog2.RootPart.CreatorID = creator; - sog2.RootPart.TaskInventory = dic; + sog2.RootPart.Inventory.Items = dic; sog2.RootPart.Name = name; sog2.RootPart.Material = material; sog2.RootPart.ScriptAccessPin = pin; @@ -449,7 +449,7 @@ namespace OpenSim.Data.Tests Assert.That(name,Is.EqualTo(p.Name)); Assert.That(rotoff,Is.EqualTo(p.RotationOffset)); Assert.That(creator,Is.EqualTo(p.CreatorID)); - Assert.That(dic,Is.EqualTo(p.TaskInventory)); + Assert.That(dic,Is.EqualTo(p.Inventory.Items)); Assert.That(name,Is.EqualTo(p.Name)); Assert.That(material,Is.EqualTo(p.Material)); Assert.That(pin,Is.EqualTo(p.ScriptAccessPin)); @@ -534,7 +534,7 @@ namespace OpenSim.Data.Tests // TODO: seriously??? this is the way we need to loop to get this? List list = new List(); - foreach (UUID uuid in sog.RootPart.GetInventoryList()) + foreach (UUID uuid in sog.RootPart.Inventory.GetInventoryList()) { list.Add(sog.GetInventoryItem(sog.RootPart.LocalId, uuid)); } -- cgit v1.1