From 7d89e122930be39e84a6d174548fa2d12ac0484a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 6 Sep 2008 07:52:41 +0000 Subject: * This is the fabled LibOMV update with all of the libOMV types from JHurliman * This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke. --- .../Modules/World/Archiver/ArchiveConstants.cs | 16 ++--------- .../Modules/World/Archiver/ArchiveReadRequest.cs | 15 +++++----- .../World/Archiver/ArchiveWriteRequestExecution.cs | 12 ++++---- .../Archiver/ArchiveWriteRequestPreparation.cs | 32 +++++++++++----------- .../Modules/World/Archiver/ArchiverModule.cs | 2 +- .../Modules/World/Archiver/AssetsArchiver.cs | 12 ++++---- .../Modules/World/Archiver/AssetsDearchiver.cs | 6 ++-- .../Modules/World/Archiver/AssetsRequest.cs | 14 +++++----- 8 files changed, 49 insertions(+), 60 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World/Archiver') diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index 012f8d4..8d74160 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -26,7 +26,7 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Modules.World.Archiver { @@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// The location of the archive control file /// - public static readonly string CONTROL_FILE_PATH = "archive.xml"; + public static readonly string CONTROL_FILE_PATH = "archive.Xml"; /// /// Path for the assets held in an archive @@ -48,7 +48,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Path for the assets metadata file /// - //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; + //public static readonly string ASSETS_METADATA_PATH = "assets.Xml"; /// /// Path for the prims file @@ -88,11 +88,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this -// disable warning: we know Script is obsolete, but need to support it -// anyhow -#pragma warning disable 0612 - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = ASSET_EXTENSION_SEPARATOR + "script.txt"; // Not sure if we'll ever see this -#pragma warning restore 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; @@ -116,11 +111,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder; -// disable warning: we know Script is obsolete, but need to support it -// anyhow -#pragma warning disable 0612 - EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.txt"] = (sbyte)AssetType.Script; -#pragma warning restore 0612 EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"] = (sbyte)AssetType.SnapshotFolder; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 89f5fd7..776ea78 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -31,13 +31,12 @@ using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Modules.World.Terrain; using OpenSim.Framework.Communications.Cache; using System; -using Axiom.Math; using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; namespace OpenSim.Region.Environment.Modules.World.Archiver @@ -57,7 +56,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Used to cache lookups for valid uuids. /// - private IDictionary m_validUserUuids = new Dictionary(); + private IDictionary m_validUserUuids = new Dictionary(); public ArchiveReadRequest(Scene scene, string loadPath) { @@ -137,8 +136,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // Try to retain the original creator/owner/lastowner if their uuid is present on this grid // otherwise, use the master avatar uuid instead - LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; foreach (SceneObjectPart part in sceneObject.Children.Values) { @@ -184,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - private bool resolveUserUuid(LLUUID uuid) + private bool resolveUserUuid(UUID uuid) { if (!m_validUserUuids.ContainsKey(uuid)) { @@ -209,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// true if asset was successfully loaded, false otherwise private bool LoadAsset(string assetPath, byte[] data) { - // Right now we're nastily obtaining the lluuid from the filename + // Right now we're nastily obtaining the UUID from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); @@ -231,7 +230,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); - AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); + AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); asset.Type = assetType; asset.Data = data; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 26d4797..6276d34 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -31,7 +31,7 @@ using System.IO; using System.IO.Compression; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Method called when all the necessary assets for an archive request have been received. /// - public delegate void AssetsRequestCallback(IDictionary assetsFound, ICollection assetsNotFoundUuids); + public delegate void AssetsRequestCallback(IDictionary assetsFound, ICollection assetsNotFoundUuids); /// /// Execute the write of an archive once we have received all the necessary data @@ -73,9 +73,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_savePath = savePath; } - protected internal void ReceivedAllAssets(IDictionary assetsFound, ICollection assetsNotFoundUuids) + protected internal void ReceivedAllAssets(IDictionary assetsFound, ICollection assetsNotFoundUuids) { - foreach (LLUUID uuid in assetsNotFoundUuids) + foreach (UUID uuid in assetsNotFoundUuids) { m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); } @@ -100,12 +100,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - LLVector3 position = sceneObject.AbsolutePosition; + Vector3 position = sceneObject.AbsolutePosition; string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); string filename = string.Format( - "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", + "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.Xml", ArchiveConstants.OBJECTS_PATH, sceneObject.Name, Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), sceneObject.UUID); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 20e15ab..a59148b 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -37,7 +37,7 @@ using System.Reflection; //using System.Text; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; @@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// The callback made when we request the asset for an object from the asset service. /// - public void AssetRequestCallback(LLUUID assetID, AssetBase asset) + public void AssetRequestCallback(UUID assetID, AssetBase asset) { lock (this) { @@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - protected AssetBase GetAsset(LLUUID uuid) + protected AssetBase GetAsset(UUID uuid) { m_waitingForObjectAsset = true; m_scene.AssetCache.GetAsset(uuid, AssetRequestCallback, true); @@ -128,20 +128,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// Dictionary in which to record the references - protected void GetScriptAssetUuids(LLUUID scriptUuid, IDictionary assetUuids) + protected void GetScriptAssetUuids(UUID scriptUuid, IDictionary assetUuids) { AssetBase scriptAsset = GetAsset(scriptUuid); if (null != scriptAsset) { - string script = Helpers.FieldToUTF8String(scriptAsset.Data); + string script = Utils.BytesToString(scriptAsset.Data); //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); MatchCollection uuidMatches = m_uuidRegex.Matches(script); //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); foreach (Match uuidMatch in uuidMatches) { - LLUUID uuid = new LLUUID(uuidMatch.Value); + UUID uuid = new UUID(uuidMatch.Value); //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); assetUuids[uuid] = 1; } @@ -153,17 +153,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// Dictionary in which to record the references - protected void GetWearableAssetUuids(LLUUID wearableAssetUuid, IDictionary assetUuids) + protected void GetWearableAssetUuids(UUID wearableAssetUuid, IDictionary assetUuids) { AssetBase assetBase = GetAsset(wearableAssetUuid); //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); - AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); + AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data); wearableAsset.Decode(); //m_log.DebugFormat( // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); - foreach (LLUUID uuid in wearableAsset.Textures.Values) + foreach (UUID uuid in wearableAsset.Textures.Values) { //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); assetUuids[uuid] = 1; @@ -176,14 +176,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// within this object). /// /// - /// - protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) + /// + protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary assetUuids) { AssetBase objectAsset = GetAsset(sceneObjectUuid); if (null != objectAsset) { - string xml = Helpers.FieldToUTF8String(objectAsset.Data); + string xml = Utils.BytesToString(objectAsset.Data); SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); GetSceneObjectAssetUuids(sog, assetUuids); } @@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - protected void GetSceneObjectAssetUuids(SceneObjectGroup sceneObject, IDictionary assetUuids) + protected void GetSceneObjectAssetUuids(SceneObjectGroup sceneObject, IDictionary assetUuids) { m_log.DebugFormat( "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.Name, sceneObject.UUID); @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver try { - LLObject.TextureEntry textureEntry = part.Shape.Textures; + Primitive.TextureEntry textureEntry = part.Shape.Textures; // Get the prim's default texture. This will be used for faces which don't have their own texture assetUuids[textureEntry.DefaultTexture.TextureID] = 1; @@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // XXX: Not a great way to iterate through face textures, but there's no // other method available to tell how many faces there actually are //int i = 0; - foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures) + foreach (Primitive.TextureEntryFace texture in textureEntry.FaceTextures) { if (texture != null) { @@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public void ArchiveRegion() { - Dictionary assetUuids = new Dictionary(); + Dictionary assetUuids = new Dictionary(); List entities = m_scene.GetEntities(); List sceneObjects = new List(); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index 69f712c..df17ad2 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs @@ -31,7 +31,7 @@ using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Scenes; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 73212ff..b49b2a4 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs @@ -29,7 +29,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; @@ -45,9 +45,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Archive assets /// - protected IDictionary m_assets; + protected IDictionary m_assets; - public AssetsArchiver(IDictionary assets) + public AssetsArchiver(IDictionary assets) { m_assets = assets; } @@ -76,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteStartElement("assets"); - foreach (LLUUID uuid in m_assets.Keys) + foreach (UUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteEndDocument(); - archive.AddFile("assets.xml", sw.ToString()); + archive.AddFile("assets.Xml", sw.ToString()); } /// @@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar //archive.AddDir("assets"); - foreach (LLUUID uuid in m_assets.Keys) + foreach (UUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 17abb24..b26fe4c 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// protected void ResolveAssetData(string assetPath, byte[] data) { - // Right now we're nastily obtaining the lluuid from the filename + // Right now we're nastily obtaining the UUID from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); if (m_metadata.ContainsKey(filename)) @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); - AssetBase asset = new AssetBase(new LLUUID(filename), metadata.Name); + AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); asset.Description = metadata.Description; asset.Type = metadata.AssetType; asset.Data = data; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 2164f7e..41fbc16 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs @@ -32,7 +32,7 @@ using OpenSim.Region.Environment.Scenes; using System.Collections.Generic; //using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; //using log4net; namespace OpenSim.Region.Environment.Modules.World.Archiver @@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// uuids to request /// - protected ICollection m_uuids; + protected ICollection m_uuids; /// /// Callback used when all the assets requested have been received. @@ -57,12 +57,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Assets retrieved in this request /// - protected Dictionary m_assets = new Dictionary(); + protected Dictionary m_assets = new Dictionary(); /// /// Maintain a list of assets that could not be found. This will be passed back to the requester. /// - protected List m_notFoundAssetUuids = new List(); + protected List m_notFoundAssetUuids = new List(); /// /// Record the number of asset replies required so we know when we've finished @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// protected AssetCache m_assetCache; - protected internal AssetsRequest(ICollection uuids, AssetCache assetCache, AssetsRequestCallback assetsRequestCallback) + protected internal AssetsRequest(ICollection uuids, AssetCache assetCache, AssetsRequestCallback assetsRequestCallback) { m_uuids = uuids; m_assetsRequestCallback = assetsRequestCallback; @@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver if (m_repliesRequired == 0) m_assetsRequestCallback(m_assets, m_notFoundAssetUuids); - foreach (LLUUID uuid in m_uuids) + foreach (UUID uuid in m_uuids) { m_assetCache.GetAsset(uuid, AssetRequestCallback, true); } @@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - public void AssetRequestCallback(LLUUID assetID, AssetBase asset) + public void AssetRequestCallback(UUID assetID, AssetBase asset) { if (asset != null) m_assets[assetID] = asset; -- cgit v1.1