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 --- .../AssetTransaction/AgentAssetsTransactions.cs | 20 ++++++++--------- .../Agent/AssetTransaction/AssetXferUploader.cs | 26 +++++++++++----------- .../Agent/TextureSender/TextureSender.cs | 12 +++++----- .../Archiver/InventoryArchiveReadRequest.cs | 2 +- .../DynamicTexture/DynamicTextureModule.cs | 18 +++++++-------- .../Scripting/EMailModules/EmailModule.cs | 2 -- .../World/Archiver/ArchiveReadRequest.cs | 2 +- .../CoreModules/World/Archiver/AssetsArchiver.cs | 16 ++++++------- .../CoreModules/World/Archiver/AssetsDearchiver.cs | 4 ++-- .../World/Estate/EstateTerrainXferHandler.cs | 16 ++++++------- .../CoreModules/World/WorldMap/WorldMapModule.cs | 10 ++++----- 11 files changed, 63 insertions(+), 65 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 0bf91e0..eefcfe8 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -172,10 +172,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", item.Name, part.Name, transactionID); - asset.Metadata.Name = item.Name; - asset.Metadata.Description = item.Description; - asset.Metadata.Type = (sbyte)item.Type; - item.AssetID = asset.Metadata.FullID; + asset.Name = item.Name; + asset.Description = item.Description; + asset.Type = (sbyte)item.Type; + item.AssetID = asset.FullID; Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); @@ -207,14 +207,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction asset = GetTransactionAsset(transactionID); } - if (asset != null && asset.Metadata.FullID == assetID) + if (asset != null && asset.FullID == assetID) { // Assets never get updated, new ones get created - asset.Metadata.FullID = UUID.Random(); - asset.Metadata.Name = item.Name; - asset.Metadata.Description = item.Description; - asset.Metadata.Type = (sbyte)item.AssetType; - item.AssetID = asset.Metadata.FullID; + asset.FullID = UUID.Random(); + asset.Name = item.Name; + asset.Description = item.Description; + asset.Type = (sbyte)item.AssetType; + item.AssetID = asset.FullID; Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 9af764f..b71c2a6 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -111,13 +111,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { ourClient = remoteClient; m_asset = new AssetBase(); - m_asset.Metadata.FullID = assetID; - m_asset.Metadata.Type = type; + m_asset.FullID = assetID; + m_asset.Type = type; m_asset.Data = data; - m_asset.Metadata.Name = "blank"; - m_asset.Metadata.Description = "empty"; - m_asset.Metadata.Local = storeLocal; - m_asset.Metadata.Temporary = tempFile; + m_asset.Name = "blank"; + m_asset.Description = "empty"; + m_asset.Local = storeLocal; + m_asset.Temporary = tempFile; TransactionID = transaction; m_storeLocal = storeLocal; @@ -138,12 +138,12 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction protected void RequestStartXfer() { XferID = Util.GetNextXferID(); - ourClient.SendXferRequest(XferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]); + ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); } protected void SendCompleteMessage() { - ourClient.SendAssetUploadCompleteMessage(m_asset.Metadata.Type, true, m_asset.Metadata.FullID); + ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); m_finished = true; if (m_createItem) @@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction DateTime now = DateTime.Now; string filename = String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, - now.Hour, now.Minute, now.Second, m_asset.Metadata.Name, m_asset.Metadata.Type); + now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); SaveAssetToFile(filename, m_asset.Data); } } @@ -194,9 +194,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction this.invType = invType; this.wearableType = wearableType; nextPerm = nextOwnerMask; - m_asset.Metadata.Name = name; - m_asset.Metadata.Description = description; - m_asset.Metadata.Type = type; + m_asset.Name = name; + m_asset.Description = description; + m_asset.Type = type; if (m_finished) { @@ -223,7 +223,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction item.Owner = ourClient.AgentId; item.Creator = ourClient.AgentId; item.ID = UUID.Random(); - item.AssetID = m_asset.Metadata.FullID; + item.AssetID = m_asset.FullID; item.Description = m_description; item.Name = m_name; item.AssetType = type; diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs index dde8566..e02ea6d 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// private AssetBase m_asset; - //public UUID assetID { get { return m_asset.Metadata.FullID; } } + //public UUID assetID { get { return m_asset.FullID; } } // private bool m_cancel = false; @@ -116,7 +116,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender // See ITextureSender public bool SendTexturePacket() { - //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.Metadata.FullID); + //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); SendPacket(); counter++; @@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { if (NumPackets == 0) { - RequestUser.SendImageFirstPart(1, m_asset.Metadata.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); + RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); PacketCounter++; } else @@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); RequestUser.SendImageFirstPart( - (ushort)(NumPackets), m_asset.Metadata.FullID, (uint)m_asset.Data.Length, ImageData1, 2); + (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); PacketCounter++; } } @@ -178,11 +178,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender catch (ArgumentOutOfRangeException) { m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + - m_asset.Metadata.ID); + m_asset.ID); return; } - RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.Metadata.FullID, imageData); + RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); PacketCounter++; } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 7189e36..6b57ac5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver AssetBase asset = new AssetBase(new UUID(uuid), "RandomName"); - asset.Metadata.Type = assetType; + asset.Type = assetType; asset.Data = data; commsManager.AssetCache.AddAsset(asset); diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index d6f0713..a8f841b 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -231,21 +231,21 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // Create a new asset for user AssetBase asset = new AssetBase(); - asset.Metadata.FullID = UUID.Random(); + asset.FullID = UUID.Random(); asset.Data = assetData; - asset.Metadata.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); - asset.Metadata.Type = 0; - asset.Metadata.Description = "dynamic image"; - asset.Metadata.Local = false; - asset.Metadata.Temporary = true; + asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); + asset.Type = 0; + asset.Description = "dynamic image"; + asset.Local = false; + asset.Temporary = true; scene.CommsManager.AssetCache.AddAsset(asset); - LastAssetID = asset.Metadata.FullID; + LastAssetID = asset.FullID; IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface(); if (cacheLayerDecode != null) { - cacheLayerDecode.syncdecode(asset.Metadata.FullID, asset.Data); + cacheLayerDecode.syncdecode(asset.FullID, asset.Data); } cacheLayerDecode = null; @@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture UUID oldID = tmptex.DefaultTexture.TextureID; scene.CommsManager.AssetCache.ExpireAsset(oldID); - tmptex.DefaultTexture.TextureID = asset.Metadata.FullID; + tmptex.DefaultTexture.TextureID = asset.FullID; // I'm pretty sure we always want to force this to true tmptex.DefaultTexture.Fullbright = true; diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 43eccf3..f788433 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -326,8 +326,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules UUID toID = new UUID(address.Substring(0, address.IndexOf("@"))); - String unused; - if (IsLocal(toID)) // TODO FIX check to see if it is local { // object in this region diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 66fc43b..d7ab5fd 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); - asset.Metadata.Type = assetType; + asset.Type = assetType; asset.Data = data; m_scene.CommsManager.AssetCache.AddAsset(asset); diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index b3286f6..abd90de 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs @@ -86,16 +86,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver string extension = string.Empty; - if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type)) + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { - extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type]; + extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; } xtw.WriteElementString("filename", uuid.ToString() + extension); - xtw.WriteElementString("name", asset.Metadata.Name); - xtw.WriteElementString("description", asset.Metadata.Description); - xtw.WriteElementString("asset-type", asset.Metadata.Type.ToString()); + xtw.WriteElementString("name", asset.Name); + xtw.WriteElementString("description", asset.Description); + xtw.WriteElementString("asset-type", asset.Type.ToString()); xtw.WriteEndElement(); } @@ -123,15 +123,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver string extension = string.Empty; - if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type)) + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { - extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type]; + extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; } else { m_log.ErrorFormat( "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded", - asset.Metadata.Type, asset.Metadata.ID); + asset.Type, asset.ID); } archive.AddFile( diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 743f9a1..cb267d7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs @@ -157,8 +157,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); - asset.Metadata.Description = metadata.Description; - asset.Metadata.Type = metadata.AssetType; + asset.Description = metadata.Description; + asset.Type = metadata.AssetType; asset.Data = data; m_cache.AddAsset(asset); diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs index 1f2d5db..93e79f0 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs @@ -54,13 +54,13 @@ namespace OpenSim.Region.CoreModules.World.Estate { m_asset = new AssetBase(); - m_asset.Metadata.FullID = UUID.Zero; - m_asset.Metadata.Type = type; + m_asset.FullID = UUID.Zero; + m_asset.Type = type; m_asset.Data = new byte[0]; - m_asset.Metadata.Name = pClientFilename; - m_asset.Metadata.Description = "empty"; - m_asset.Metadata.Local = true; - m_asset.Metadata.Temporary = true; + m_asset.Name = pClientFilename; + m_asset.Description = "empty"; + m_asset.Local = true; + m_asset.Temporary = true; } @@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.World.Estate public void RequestStartXfer(IClientAPI pRemoteClient) { mXferID = Util.GetNextXferID(); - pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name)); + pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); } /// @@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Estate handlerTerrainUploadDone = TerrainUploadDone; if (handlerTerrainUploadDone != null) { - handlerTerrainUploadDone(m_asset.Metadata.Name, m_asset.Data, remoteClient); + handlerTerrainUploadDone(m_asset.Name, m_asset.Data, remoteClient); } } } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index e1c3d85..4f98e8b 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -985,14 +985,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; AssetBase asset = new AssetBase(); - asset.Metadata.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; + asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; asset.Data = data; - asset.Metadata.Name + asset.Name = "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); - asset.Metadata.Description = m_scene.RegionInfo.RegionName; + asset.Description = m_scene.RegionInfo.RegionName; - asset.Metadata.Type = 0; - asset.Metadata.Temporary = temporary; + asset.Type = 0; + asset.Temporary = temporary; m_scene.CommsManager.AssetCache.AddAsset(asset); } -- cgit v1.1