diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | 32 |
1 files changed, 16 insertions, 16 deletions
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>(); |