From 76c0935ec744f2d230489398f879eb7f42b11d37 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 17 Feb 2009 01:36:44 +0000 Subject: - remove the Metadata property from AssetBase and return all previous properties as before - prefix private variables with m_ in AssetBase.cs - related to Mantis #3122, as mentioned in https://lists.berlios.de/pipermail/opensim-dev/2009-February/005088.html - all services will likely need to be upgraded after this commit --- .../Framework/Scenes/Hypergrid/HGAssetMapper.cs | 28 +++++------ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 54 +++++++++++----------- OpenSim/Region/Framework/Scenes/Scene.cs | 8 ++-- 3 files changed, 45 insertions(+), 45 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index 1f01fa2..1a3c4c8 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs @@ -120,12 +120,12 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) { - m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Metadata.Name + " " + assetID); + m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Name + " " + assetID); // I think I need to store it in the asset DB too. // For now, let me just do it for textures and scripts - if (((AssetType)asset.Metadata.Type == AssetType.Texture) || - ((AssetType)asset.Metadata.Type == AssetType.LSLBytecode) || - ((AssetType)asset.Metadata.Type == AssetType.LSLText)) + if (((AssetType)asset.Type == AssetType.Texture) || + ((AssetType)asset.Type == AssetType.LSLBytecode) || + ((AssetType)asset.Type == AssetType.LSLText)) { AssetBase asset1 = new AssetBase(); Copy(asset, asset1); @@ -149,7 +149,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid if (asset1 != null) { // See long comment in AssetCache.AddAsset - if (!asset1.Metadata.Temporary || asset1.Metadata.Local) + if (!asset1.Temporary || asset1.Local) { // The asset cache returns instances of subclasses of AssetBase: // TextureImage or AssetInfo. So in passing them to the remote @@ -170,14 +170,14 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid private void Copy(AssetBase from, AssetBase to) { - to.Data = from.Data; - to.Metadata.Description = from.Metadata.Description; - to.Metadata.FullID = from.Metadata.FullID; - to.Metadata.ID = from.Metadata.ID; - to.Metadata.Local = from.Metadata.Local; - to.Metadata.Name = from.Metadata.Name; - to.Metadata.Temporary = from.Metadata.Temporary; - to.Metadata.Type = from.Metadata.Type; + to.Data = from.Data; + to.Description = from.Description; + to.FullID = from.FullID; + to.ID = from.ID; + to.Local = from.Local; + to.Name = from.Name; + to.Temporary = from.Temporary; + to.Type = from.Type; } @@ -235,7 +235,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid private Dictionary SniffUUIDs(AssetBase asset) { Dictionary uuids = new Dictionary(); - if ((asset != null) && ((AssetType)asset.Metadata.Type == AssetType.Object)) + if ((asset != null) && ((AssetType)asset.Type == AssetType.Object)) { string ass_str = Utils.BytesToString(asset.Data); SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c98629b..2800e9e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -193,11 +193,11 @@ namespace OpenSim.Region.Framework.Scenes CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); CommsManager.AssetCache.AddAsset(asset); - item.AssetID = asset.Metadata.FullID; + item.AssetID = asset.FullID; userInfo.UpdateItem(item); // remoteClient.SendInventoryItemCreateUpdate(item); - return (asset.Metadata.FullID); + return (asset.FullID); } } } @@ -285,7 +285,7 @@ namespace OpenSim.Region.Framework.Scenes } // Update item with new asset - item.AssetID = asset.Metadata.FullID; + item.AssetID = asset.FullID; group.UpdateInventoryItem(item); part.GetProperties(remoteClient); @@ -688,7 +688,7 @@ namespace OpenSim.Region.Framework.Scenes { if (newName != String.Empty) { - asset.Metadata.Name = newName; + asset.Name = newName; } else { @@ -728,10 +728,10 @@ namespace OpenSim.Region.Framework.Scenes private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) { AssetBase asset = new AssetBase(); - asset.Metadata.Name = name; - asset.Metadata.Description = description; - asset.Metadata.Type = assetType; - asset.Metadata.FullID = UUID.Random(); + asset.Name = name; + asset.Description = description; + asset.Type = assetType; + asset.FullID = UUID.Random(); asset.Data = (data == null) ? new byte[1] : data; return asset; @@ -831,11 +831,11 @@ namespace OpenSim.Region.Framework.Scenes item.Owner = remoteClient.AgentId; item.Creator = remoteClient.AgentId; item.ID = UUID.Random(); - item.AssetID = asset.Metadata.FullID; - item.Description = asset.Metadata.Description; + item.AssetID = asset.FullID; + item.Description = asset.Description; item.Name = name; item.Flags = flags; - item.AssetType = asset.Metadata.Type; + item.AssetType = asset.Type; item.InvType = invType; item.Folder = folderID; item.CurrentPermissions = currentMask; @@ -905,7 +905,7 @@ namespace OpenSim.Region.Framework.Scenes AssetBase asset = CreateAsset(name, description, assetType, data); CommsManager.AssetCache.AddAsset(asset); - CreateNewInventoryItem(remoteClient, folderID, asset.Metadata.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); + CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); } else { @@ -1553,7 +1553,7 @@ namespace OpenSim.Region.Framework.Scenes taskItem.Flags = itemBase.Flags; taskItem.PermsGranter = UUID.Zero; taskItem.PermsMask = 0; - taskItem.AssetID = asset.Metadata.FullID; + taskItem.AssetID = asset.FullID; part.Inventory.AddInventoryItem(taskItem, false); part.GetProperties(remoteClient); @@ -1953,16 +1953,16 @@ namespace OpenSim.Region.Framework.Scenes (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml)); CommsManager.AssetCache.AddAsset(asset); - assetID = asset.Metadata.FullID; + assetID = asset.FullID; if (DeRezAction.SaveToExistingUserInventoryItem == action) { - item.AssetID = asset.Metadata.FullID; + item.AssetID = asset.FullID; userInfo.UpdateItem(item); } else { - item.AssetID = asset.Metadata.FullID; + item.AssetID = asset.FullID; if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) { @@ -1995,9 +1995,9 @@ namespace OpenSim.Region.Framework.Scenes // TODO: add the new fields (Flags, Sale info, etc) item.CreationDate = Util.UnixTimeSinceEpoch(); - item.Description = asset.Metadata.Description; - item.Name = asset.Metadata.Name; - item.AssetType = asset.Metadata.Type; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; userInfo.AddItem(item); @@ -2080,10 +2080,10 @@ namespace OpenSim.Region.Framework.Scenes Utils.StringToBytes(sceneObjectXml)); CommsManager.AssetCache.AddAsset(asset); - item.AssetID = asset.Metadata.FullID; - item.Description = asset.Metadata.Description; - item.Name = asset.Metadata.Name; - item.AssetType = asset.Metadata.Type; + item.AssetID = asset.FullID; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; item.InvType = (int)InventoryType.Object; item.Folder = foundFolder; @@ -2121,10 +2121,10 @@ namespace OpenSim.Region.Framework.Scenes item.Creator = grp.RootPart.CreatorID; item.Owner = remoteClient.AgentId; item.ID = UUID.Random(); - item.AssetID = asset.Metadata.FullID; - item.Description = asset.Metadata.Description; - item.Name = asset.Metadata.Name; - item.AssetType = asset.Metadata.Type; + item.AssetID = asset.FullID; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; item.InvType = (int)InventoryType.Object; item.Folder = UUID.Zero; // Objects folder! diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5badd2d..1d2f37a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3555,10 +3555,10 @@ namespace OpenSim.Region.Framework.Scenes item.ID = UUID.Random(); item.Owner = remoteClient.AgentId; - item.AssetID = asset.Metadata.FullID; - item.Description = asset.Metadata.Description; - item.Name = asset.Metadata.Name; - item.AssetType = asset.Metadata.Type; + item.AssetID = asset.FullID; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; item.InvType = (int)InventoryType.Object; item.Folder = categoryID; -- cgit v1.1