From 93837807ffb24e5811368063b9231a9d8b018d9d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 16 Feb 2009 19:15:16 +0000 Subject: * refactor: remove AssetCache field hanging off Scene * This is always available at Scene.CommsManager.AssetCache --- .../Framework/Scenes/Hypergrid/HGAssetMapper.cs | 2 +- .../Framework/Scenes/Hypergrid/HGScene.Inventory.cs | 4 ++-- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 20 ++++++++++---------- OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++--- OpenSim/Region/Framework/Scenes/SceneBase.cs | 8 -------- OpenSim/Region/Framework/Scenes/SceneManager.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 +++++--- .../Framework/Scenes/SceneObjectPartInventory.cs | 2 +- 9 files changed, 24 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index 4039288..1f01fa2 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs @@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid { AssetBase asset1 = new AssetBase(); Copy(asset, asset1); - m_scene.AssetCache.AssetServer.StoreAsset(asset1); + m_scene.CommsManager.AssetCache.AssetServer.StoreAsset(asset1); } return true; } diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs index ea03cf9..423acc1 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs @@ -49,10 +49,10 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid public HGScene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, - IAssetCache assetCach, StorageManager storeManager, + StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, moduleLoader, + : base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { m_log.Info("[HGScene]: Starting HGScene."); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 0c6ad0d..c98629b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -191,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); item.AssetID = asset.Metadata.FullID; userInfo.UpdateItem(item); @@ -277,7 +277,7 @@ namespace OpenSim.Region.Framework.Scenes } AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); if (isScriptRunning) { @@ -681,7 +681,7 @@ namespace OpenSim.Region.Framework.Scenes } AssetBase asset - = AssetCache.GetAsset( + = CommsManager.AssetCache.GetAsset( item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false)); if (asset != null) @@ -903,7 +903,7 @@ namespace OpenSim.Region.Framework.Scenes } AssetBase asset = CreateAsset(name, description, assetType, data); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); CreateNewInventoryItem(remoteClient, folderID, asset.Metadata.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); } @@ -1530,7 +1530,7 @@ namespace OpenSim.Region.Framework.Scenes return; AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}")); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); TaskInventoryItem taskItem = new TaskInventoryItem(); @@ -1952,7 +1952,7 @@ namespace OpenSim.Region.Framework.Scenes objectGroup.GetPartDescription(objectGroup.RootPart.LocalId), (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml)); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); assetID = asset.Metadata.FullID; if (DeRezAction.SaveToExistingUserInventoryItem == action) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.Framework.Scenes objectGroup.GetPartDescription(objectGroup.LocalId), (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml)); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); item.AssetID = asset.Metadata.FullID; item.Description = asset.Metadata.Description; @@ -2115,7 +2115,7 @@ namespace OpenSim.Region.Framework.Scenes grp.GetPartDescription(grp.LocalId), (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml)); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); item.Creator = grp.RootPart.CreatorID; @@ -2239,7 +2239,7 @@ namespace OpenSim.Region.Framework.Scenes if (item != null) { - AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); + AssetBase rezAsset = CommsManager.AssetCache.GetAsset(item.AssetID, false); if (rezAsset != null) { @@ -2407,7 +2407,7 @@ namespace OpenSim.Region.Framework.Scenes { UUID ownerID = item.OwnerID; - AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); + AssetBase rezAsset = CommsManager.AssetCache.GetAsset(item.AssetID, false); if (rezAsset != null) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0f57b7c..c3ab5e9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -268,7 +268,7 @@ namespace OpenSim.Region.Framework.Scenes public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, - IAssetCache assetCach, StorageManager storeManager, + StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) { @@ -281,7 +281,6 @@ namespace OpenSim.Region.Framework.Scenes CommsManager = commsMan; m_sceneGridService = sceneGridService; m_storageManager = storeManager; - AssetCache = assetCach; m_regInfo = regInfo; m_regionHandle = m_regInfo.RegionHandle; m_regionName = m_regInfo.RegionName; @@ -3543,7 +3542,7 @@ namespace OpenSim.Region.Framework.Scenes group.GetPartDescription(localID), (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml)); - AssetCache.AddAsset(asset); + CommsManager.AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); item.Creator = part.CreatorID; diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 3f5c781..3695b21 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -126,14 +126,6 @@ namespace OpenSim.Region.Framework.Scenes protected string m_datastore; - private IAssetCache m_assetCache; - - public IAssetCache AssetCache - { - get { return m_assetCache; } - set { m_assetCache = value; } - } - protected RegionStatus m_regStatus; public RegionStatus Region_Status diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index fe37dae..00b49a1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -642,7 +642,7 @@ namespace OpenSim.Region.Framework.Scenes { for (int i=0;i