diff options
author | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
commit | 7d89e122930be39e84a6d174548fa2d12ac0484a (patch) | |
tree | e5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Region/Environment/Modules/World/Archiver | |
parent | * minor: speculatively try a change to bamboo.build to see if this generates ... (diff) | |
download | opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2 opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver')
8 files changed, 49 insertions, 60 deletions
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 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using libsecondlife; | 29 | using OpenMetaverse; |
30 | 30 | ||
31 | namespace OpenSim.Region.Environment.Modules.World.Archiver | 31 | namespace OpenSim.Region.Environment.Modules.World.Archiver |
32 | { | 32 | { |
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
38 | /// <summary> | 38 | /// <summary> |
39 | /// The location of the archive control file | 39 | /// The location of the archive control file |
40 | /// </summary> | 40 | /// </summary> |
41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; | 41 | public static readonly string CONTROL_FILE_PATH = "archive.Xml"; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Path for the assets held in an archive | 44 | /// Path for the assets held in an archive |
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Path for the assets metadata file | 49 | /// Path for the assets metadata file |
50 | /// </summary> | 50 | /// </summary> |
51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; | 51 | //public static readonly string ASSETS_METADATA_PATH = "assets.Xml"; |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Path for the prims file | 54 | /// Path for the prims file |
@@ -88,11 +88,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; | 88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; |
89 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; | 89 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; |
90 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this | 90 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this |
91 | // disable warning: we know Script is obsolete, but need to support it | ||
92 | // anyhow | ||
93 | #pragma warning disable 0612 | ||
94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = ASSET_EXTENSION_SEPARATOR + "script.txt"; // Not sure if we'll ever see this | ||
95 | #pragma warning restore 0612 | ||
96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this | 91 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this |
97 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"; // Not sure if we'll ever see this | 92 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"; // Not sure if we'll ever see this |
98 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; | 93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; |
@@ -116,11 +111,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
116 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; | 111 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; |
117 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; | 112 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; |
118 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder; | 113 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder; |
119 | // disable warning: we know Script is obsolete, but need to support it | ||
120 | // anyhow | ||
121 | #pragma warning disable 0612 | ||
122 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.txt"] = (sbyte)AssetType.Script; | ||
123 | #pragma warning restore 0612 | ||
124 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; | 114 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; |
125 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"] = (sbyte)AssetType.SnapshotFolder; | 115 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"] = (sbyte)AssetType.SnapshotFolder; |
126 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound; | 116 | 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; | |||
31 | using OpenSim.Region.Environment.Modules.World.Terrain; | 31 | using OpenSim.Region.Environment.Modules.World.Terrain; |
32 | using OpenSim.Framework.Communications.Cache; | 32 | using OpenSim.Framework.Communications.Cache; |
33 | using System; | 33 | using System; |
34 | using Axiom.Math; | ||
35 | using System.Collections.Generic; | 34 | using System.Collections.Generic; |
36 | using System.IO; | 35 | using System.IO; |
37 | using System.IO.Compression; | 36 | using System.IO.Compression; |
38 | using System.Reflection; | 37 | using System.Reflection; |
39 | using System.Xml; | 38 | using System.Xml; |
40 | using libsecondlife; | 39 | using OpenMetaverse; |
41 | using log4net; | 40 | using log4net; |
42 | 41 | ||
43 | namespace OpenSim.Region.Environment.Modules.World.Archiver | 42 | namespace OpenSim.Region.Environment.Modules.World.Archiver |
@@ -57,7 +56,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
57 | /// <summary> | 56 | /// <summary> |
58 | /// Used to cache lookups for valid uuids. | 57 | /// Used to cache lookups for valid uuids. |
59 | /// </summary> | 58 | /// </summary> |
60 | private IDictionary<LLUUID, bool> m_validUserUuids = new Dictionary<LLUUID, bool>(); | 59 | private IDictionary<UUID, bool> m_validUserUuids = new Dictionary<UUID, bool>(); |
61 | 60 | ||
62 | public ArchiveReadRequest(Scene scene, string loadPath) | 61 | public ArchiveReadRequest(Scene scene, string loadPath) |
63 | { | 62 | { |
@@ -137,8 +136,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
137 | 136 | ||
138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 137 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
139 | // otherwise, use the master avatar uuid instead | 138 | // otherwise, use the master avatar uuid instead |
140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 139 | UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
141 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) | 140 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) |
142 | masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; | 141 | masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; |
143 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 142 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
144 | { | 143 | { |
@@ -184,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
184 | /// </summary> | 183 | /// </summary> |
185 | /// <param name="uuid"></param> | 184 | /// <param name="uuid"></param> |
186 | /// <returns></returns> | 185 | /// <returns></returns> |
187 | private bool resolveUserUuid(LLUUID uuid) | 186 | private bool resolveUserUuid(UUID uuid) |
188 | { | 187 | { |
189 | if (!m_validUserUuids.ContainsKey(uuid)) | 188 | if (!m_validUserUuids.ContainsKey(uuid)) |
190 | { | 189 | { |
@@ -209,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
209 | /// <returns>true if asset was successfully loaded, false otherwise</returns> | 208 | /// <returns>true if asset was successfully loaded, false otherwise</returns> |
210 | private bool LoadAsset(string assetPath, byte[] data) | 209 | private bool LoadAsset(string assetPath, byte[] data) |
211 | { | 210 | { |
212 | // Right now we're nastily obtaining the lluuid from the filename | 211 | // Right now we're nastily obtaining the UUID from the filename |
213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 212 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
214 | int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); | 213 | int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); |
215 | 214 | ||
@@ -231,7 +230,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
231 | 230 | ||
232 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 231 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
233 | 232 | ||
234 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); | 233 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); |
235 | asset.Type = assetType; | 234 | asset.Type = assetType; |
236 | asset.Data = data; | 235 | asset.Data = data; |
237 | 236 | ||
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; | |||
31 | using System.IO.Compression; | 31 | using System.IO.Compression; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Xml; | 33 | using System.Xml; |
34 | using libsecondlife; | 34 | using OpenMetaverse; |
35 | using log4net; | 35 | using log4net; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Environment.Interfaces; | 37 | using OpenSim.Region.Environment.Interfaces; |
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Method called when all the necessary assets for an archive request have been received. | 45 | /// Method called when all the necessary assets for an archive request have been received. |
46 | /// </summary> | 46 | /// </summary> |
47 | public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assetsFound, ICollection<LLUUID> assetsNotFoundUuids); | 47 | public delegate void AssetsRequestCallback(IDictionary<UUID, AssetBase> assetsFound, ICollection<UUID> assetsNotFoundUuids); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Execute the write of an archive once we have received all the necessary data | 50 | /// 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 | |||
73 | m_savePath = savePath; | 73 | m_savePath = savePath; |
74 | } | 74 | } |
75 | 75 | ||
76 | protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assetsFound, ICollection<LLUUID> assetsNotFoundUuids) | 76 | protected internal void ReceivedAllAssets(IDictionary<UUID, AssetBase> assetsFound, ICollection<UUID> assetsNotFoundUuids) |
77 | { | 77 | { |
78 | foreach (LLUUID uuid in assetsNotFoundUuids) | 78 | foreach (UUID uuid in assetsNotFoundUuids) |
79 | { | 79 | { |
80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); |
81 | } | 81 | } |
@@ -100,12 +100,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
100 | { | 100 | { |
101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
102 | 102 | ||
103 | LLVector3 position = sceneObject.AbsolutePosition; | 103 | Vector3 position = sceneObject.AbsolutePosition; |
104 | 104 | ||
105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); | 105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); |
106 | string filename | 106 | string filename |
107 | = string.Format( | 107 | = string.Format( |
108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", | 108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.Xml", |
109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, | 109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, |
110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), | 110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), |
111 | sceneObject.UUID); | 111 | 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; | |||
37 | //using System.Text; | 37 | //using System.Text; |
38 | using System.Text.RegularExpressions; | 38 | using System.Text.RegularExpressions; |
39 | using System.Threading; | 39 | using System.Threading; |
40 | using libsecondlife; | 40 | using OpenMetaverse; |
41 | using log4net; | 41 | using log4net; |
42 | using Nini.Config; | 42 | using Nini.Config; |
43 | 43 | ||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
84 | /// <summary> | 84 | /// <summary> |
85 | /// The callback made when we request the asset for an object from the asset service. | 85 | /// The callback made when we request the asset for an object from the asset service. |
86 | /// </summary> | 86 | /// </summary> |
87 | public void AssetRequestCallback(LLUUID assetID, AssetBase asset) | 87 | public void AssetRequestCallback(UUID assetID, AssetBase asset) |
88 | { | 88 | { |
89 | lock (this) | 89 | lock (this) |
90 | { | 90 | { |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="uuid"></param> | 101 | /// <param name="uuid"></param> |
102 | /// <returns></returns> | 102 | /// <returns></returns> |
103 | protected AssetBase GetAsset(LLUUID uuid) | 103 | protected AssetBase GetAsset(UUID uuid) |
104 | { | 104 | { |
105 | m_waitingForObjectAsset = true; | 105 | m_waitingForObjectAsset = true; |
106 | m_scene.AssetCache.GetAsset(uuid, AssetRequestCallback, true); | 106 | m_scene.AssetCache.GetAsset(uuid, AssetRequestCallback, true); |
@@ -128,20 +128,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
128 | /// </summary> | 128 | /// </summary> |
129 | /// <param name="scriptUuid"></param> | 129 | /// <param name="scriptUuid"></param> |
130 | /// <param name="assetUuids">Dictionary in which to record the references</param> | 130 | /// <param name="assetUuids">Dictionary in which to record the references</param> |
131 | protected void GetScriptAssetUuids(LLUUID scriptUuid, IDictionary<LLUUID, int> assetUuids) | 131 | protected void GetScriptAssetUuids(UUID scriptUuid, IDictionary<UUID, int> assetUuids) |
132 | { | 132 | { |
133 | AssetBase scriptAsset = GetAsset(scriptUuid); | 133 | AssetBase scriptAsset = GetAsset(scriptUuid); |
134 | 134 | ||
135 | if (null != scriptAsset) | 135 | if (null != scriptAsset) |
136 | { | 136 | { |
137 | string script = Helpers.FieldToUTF8String(scriptAsset.Data); | 137 | string script = Utils.BytesToString(scriptAsset.Data); |
138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); | 138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); |
139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); | 139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); |
140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); | 140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); |
141 | 141 | ||
142 | foreach (Match uuidMatch in uuidMatches) | 142 | foreach (Match uuidMatch in uuidMatches) |
143 | { | 143 | { |
144 | LLUUID uuid = new LLUUID(uuidMatch.Value); | 144 | UUID uuid = new UUID(uuidMatch.Value); |
145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); | 145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); |
146 | assetUuids[uuid] = 1; | 146 | assetUuids[uuid] = 1; |
147 | } | 147 | } |
@@ -153,17 +153,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
153 | /// </summary> | 153 | /// </summary> |
154 | /// <param name="wearableAssetUuid"></param> | 154 | /// <param name="wearableAssetUuid"></param> |
155 | /// <param name="assetUuids">Dictionary in which to record the references</param> | 155 | /// <param name="assetUuids">Dictionary in which to record the references</param> |
156 | protected void GetWearableAssetUuids(LLUUID wearableAssetUuid, IDictionary<LLUUID, int> assetUuids) | 156 | protected void GetWearableAssetUuids(UUID wearableAssetUuid, IDictionary<UUID, int> assetUuids) |
157 | { | 157 | { |
158 | AssetBase assetBase = GetAsset(wearableAssetUuid); | 158 | AssetBase assetBase = GetAsset(wearableAssetUuid); |
159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); | 159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); |
160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); | 160 | AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data); |
161 | wearableAsset.Decode(); | 161 | wearableAsset.Decode(); |
162 | 162 | ||
163 | //m_log.DebugFormat( | 163 | //m_log.DebugFormat( |
164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); | 164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); |
165 | 165 | ||
166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) | 166 | foreach (UUID uuid in wearableAsset.Textures.Values) |
167 | { | 167 | { |
168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); | 168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); |
169 | assetUuids[uuid] = 1; | 169 | assetUuids[uuid] = 1; |
@@ -176,14 +176,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
176 | /// within this object). | 176 | /// within this object). |
177 | /// </summary> | 177 | /// </summary> |
178 | /// <param name="sceneObject"></param> | 178 | /// <param name="sceneObject"></param> |
179 | /// <param name="assetUuids"></param> | 179 | /// <param name="assetUuids"></param> |
180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) | 180 | protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary<UUID, int> assetUuids) |
181 | { | 181 | { |
182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); | 182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); |
183 | 183 | ||
184 | if (null != objectAsset) | 184 | if (null != objectAsset) |
185 | { | 185 | { |
186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); | 186 | string xml = Utils.BytesToString(objectAsset.Data); |
187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); | 187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); |
188 | GetSceneObjectAssetUuids(sog, assetUuids); | 188 | GetSceneObjectAssetUuids(sog, assetUuids); |
189 | } | 189 | } |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
196 | /// </summary> | 196 | /// </summary> |
197 | /// <param name="sceneObject"></param> | 197 | /// <param name="sceneObject"></param> |
198 | /// <param name="assetUuids"></param> | 198 | /// <param name="assetUuids"></param> |
199 | protected void GetSceneObjectAssetUuids(SceneObjectGroup sceneObject, IDictionary<LLUUID, int> assetUuids) | 199 | protected void GetSceneObjectAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, int> assetUuids) |
200 | { | 200 | { |
201 | m_log.DebugFormat( | 201 | m_log.DebugFormat( |
202 | "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.Name, sceneObject.UUID); | 202 | "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.Name, sceneObject.UUID); |
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
208 | 208 | ||
209 | try | 209 | try |
210 | { | 210 | { |
211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; | 211 | Primitive.TextureEntry textureEntry = part.Shape.Textures; |
212 | 212 | ||
213 | // Get the prim's default texture. This will be used for faces which don't have their own texture | 213 | // Get the prim's default texture. This will be used for faces which don't have their own texture |
214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; | 214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; |
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
216 | // XXX: Not a great way to iterate through face textures, but there's no | 216 | // XXX: Not a great way to iterate through face textures, but there's no |
217 | // other method available to tell how many faces there actually are | 217 | // other method available to tell how many faces there actually are |
218 | //int i = 0; | 218 | //int i = 0; |
219 | foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures) | 219 | foreach (Primitive.TextureEntryFace texture in textureEntry.FaceTextures) |
220 | { | 220 | { |
221 | if (texture != null) | 221 | if (texture != null) |
222 | { | 222 | { |
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
262 | 262 | ||
263 | public void ArchiveRegion() | 263 | public void ArchiveRegion() |
264 | { | 264 | { |
265 | Dictionary<LLUUID, int> assetUuids = new Dictionary<LLUUID, int>(); | 265 | Dictionary<UUID, int> assetUuids = new Dictionary<UUID, int>(); |
266 | 266 | ||
267 | List<EntityBase> entities = m_scene.GetEntities(); | 267 | List<EntityBase> entities = m_scene.GetEntities(); |
268 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 268 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
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; | |||
31 | using OpenSim.Region.Environment.Scenes; | 31 | using OpenSim.Region.Environment.Scenes; |
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using libsecondlife; | 34 | using OpenMetaverse; |
35 | using log4net; | 35 | using log4net; |
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | 37 | ||
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; | |||
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Xml; | 31 | using System.Xml; |
32 | using libsecondlife; | 32 | using OpenMetaverse; |
33 | using log4net; | 33 | using log4net; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | 35 | ||
@@ -45,9 +45,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Archive assets | 46 | /// Archive assets |
47 | /// </summary> | 47 | /// </summary> |
48 | protected IDictionary<LLUUID, AssetBase> m_assets; | 48 | protected IDictionary<UUID, AssetBase> m_assets; |
49 | 49 | ||
50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) | 50 | public AssetsArchiver(IDictionary<UUID, AssetBase> assets) |
51 | { | 51 | { |
52 | m_assets = assets; | 52 | m_assets = assets; |
53 | } | 53 | } |
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
76 | 76 | ||
77 | xtw.WriteStartElement("assets"); | 77 | xtw.WriteStartElement("assets"); |
78 | 78 | ||
79 | foreach (LLUUID uuid in m_assets.Keys) | 79 | foreach (UUID uuid in m_assets.Keys) |
80 | { | 80 | { |
81 | AssetBase asset = m_assets[uuid]; | 81 | AssetBase asset = m_assets[uuid]; |
82 | 82 | ||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
105 | 105 | ||
106 | xtw.WriteEndDocument(); | 106 | xtw.WriteEndDocument(); |
107 | 107 | ||
108 | archive.AddFile("assets.xml", sw.ToString()); | 108 | archive.AddFile("assets.Xml", sw.ToString()); |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar | 117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar |
118 | //archive.AddDir("assets"); | 118 | //archive.AddDir("assets"); |
119 | 119 | ||
120 | foreach (LLUUID uuid in m_assets.Keys) | 120 | foreach (UUID uuid in m_assets.Keys) |
121 | { | 121 | { |
122 | AssetBase asset = m_assets[uuid]; | 122 | AssetBase asset = m_assets[uuid]; |
123 | 123 | ||
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; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Xml; | 32 | using System.Xml; |
33 | using libsecondlife; | 33 | using OpenMetaverse; |
34 | using log4net; | 34 | using log4net; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications.Cache; | 36 | using OpenSim.Framework.Communications.Cache; |
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
141 | /// <param name="data"></param> | 141 | /// <param name="data"></param> |
142 | protected void ResolveAssetData(string assetPath, byte[] data) | 142 | protected void ResolveAssetData(string assetPath, byte[] data) |
143 | { | 143 | { |
144 | // Right now we're nastily obtaining the lluuid from the filename | 144 | // Right now we're nastily obtaining the UUID from the filename |
145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
146 | 146 | ||
147 | if (m_metadata.ContainsKey(filename)) | 147 | if (m_metadata.ContainsKey(filename)) |
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
156 | 156 | ||
157 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 157 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
158 | 158 | ||
159 | AssetBase asset = new AssetBase(new LLUUID(filename), metadata.Name); | 159 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); |
160 | asset.Description = metadata.Description; | 160 | asset.Description = metadata.Description; |
161 | asset.Type = metadata.AssetType; | 161 | asset.Type = metadata.AssetType; |
162 | asset.Data = data; | 162 | 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; | |||
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | //using System.Reflection; | 33 | //using System.Reflection; |
34 | using System.Threading; | 34 | using System.Threading; |
35 | using libsecondlife; | 35 | using OpenMetaverse; |
36 | //using log4net; | 36 | //using log4net; |
37 | 37 | ||
38 | namespace OpenSim.Region.Environment.Modules.World.Archiver | 38 | namespace OpenSim.Region.Environment.Modules.World.Archiver |
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
47 | /// <summary> | 47 | /// <summary> |
48 | /// uuids to request | 48 | /// uuids to request |
49 | /// </summary> | 49 | /// </summary> |
50 | protected ICollection<LLUUID> m_uuids; | 50 | protected ICollection<UUID> m_uuids; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Callback used when all the assets requested have been received. | 53 | /// Callback used when all the assets requested have been received. |
@@ -57,12 +57,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Assets retrieved in this request | 58 | /// Assets retrieved in this request |
59 | /// </summary> | 59 | /// </summary> |
60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); | 60 | protected Dictionary<UUID, AssetBase> m_assets = new Dictionary<UUID, AssetBase>(); |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | 63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. |
64 | /// </summary> | 64 | /// </summary> |
65 | protected List<LLUUID> m_notFoundAssetUuids = new List<LLUUID>(); | 65 | protected List<UUID> m_notFoundAssetUuids = new List<UUID>(); |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Record the number of asset replies required so we know when we've finished | 68 | /// 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 | |||
74 | /// </summary> | 74 | /// </summary> |
75 | protected AssetCache m_assetCache; | 75 | protected AssetCache m_assetCache; |
76 | 76 | ||
77 | protected internal AssetsRequest(ICollection<LLUUID> uuids, AssetCache assetCache, AssetsRequestCallback assetsRequestCallback) | 77 | protected internal AssetsRequest(ICollection<UUID> uuids, AssetCache assetCache, AssetsRequestCallback assetsRequestCallback) |
78 | { | 78 | { |
79 | m_uuids = uuids; | 79 | m_uuids = uuids; |
80 | m_assetsRequestCallback = assetsRequestCallback; | 80 | m_assetsRequestCallback = assetsRequestCallback; |
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
88 | if (m_repliesRequired == 0) | 88 | if (m_repliesRequired == 0) |
89 | m_assetsRequestCallback(m_assets, m_notFoundAssetUuids); | 89 | m_assetsRequestCallback(m_assets, m_notFoundAssetUuids); |
90 | 90 | ||
91 | foreach (LLUUID uuid in m_uuids) | 91 | foreach (UUID uuid in m_uuids) |
92 | { | 92 | { |
93 | m_assetCache.GetAsset(uuid, AssetRequestCallback, true); | 93 | m_assetCache.GetAsset(uuid, AssetRequestCallback, true); |
94 | } | 94 | } |
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
99 | /// </summary> | 99 | /// </summary> |
100 | /// <param name="assetID"></param> | 100 | /// <param name="assetID"></param> |
101 | /// <param name="asset"></param> | 101 | /// <param name="asset"></param> |
102 | public void AssetRequestCallback(LLUUID assetID, AssetBase asset) | 102 | public void AssetRequestCallback(UUID assetID, AssetBase asset) |
103 | { | 103 | { |
104 | if (asset != null) | 104 | if (asset != null) |
105 | m_assets[assetID] = asset; | 105 | m_assets[assetID] = asset; |