aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs40
1 files changed, 39 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 11d0c65..04f64c3 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -34,6 +34,7 @@ using OpenSim.Region.Environment.Scenes;
34using System.Collections.Generic; 34using System.Collections.Generic;
35using System.Reflection; 35using System.Reflection;
36//using System.Text; 36//using System.Text;
37using System.Text.RegularExpressions;
37using System.Threading; 38using System.Threading;
38using libsecondlife; 39using libsecondlife;
39using log4net; 40using log4net;
@@ -50,6 +51,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
50 51
51 protected Scene m_scene; 52 protected Scene m_scene;
52 protected string m_savePath; 53 protected string m_savePath;
54
55 /// <summary>
56 /// Used for identifying uuids embedded in scripts
57 /// </summary>
58 protected static readonly Regex m_uuidRegex
59 = new Regex(
60 "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}",
61 RegexOptions.Compiled);
53 62
54 /// <summary> 63 /// <summary>
55 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate 64 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
@@ -114,6 +123,31 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
114 } 123 }
115 124
116 /// <summary> 125 /// <summary>
126 /// Record the asset uuids embedded within the given script.
127 /// </summary>
128 /// <param name="scriptUuid"></param>
129 /// <param name="assetUuids">Dictionary in which to record the references</param>
130 protected void GetScriptAssetUuids(LLUUID scriptUuid, IDictionary<LLUUID, int> assetUuids)
131 {
132 AssetBase scriptAsset = GetAsset(scriptUuid);
133
134 if (null != scriptAsset)
135 {
136 string script = Helpers.FieldToUTF8String(scriptAsset.Data);
137 m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
138 MatchCollection uuidMatches = m_uuidRegex.Matches(script);
139 m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);
140
141 foreach (Match uuidMatch in uuidMatches)
142 {
143 LLUUID uuid = new LLUUID(uuidMatch.Value);
144 m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);
145 assetUuids[uuid] = 1;
146 }
147 }
148 }
149
150 /// <summary>
117 /// Record the uuids referenced by the given wearable asset 151 /// Record the uuids referenced by the given wearable asset
118 /// </summary> 152 /// </summary>
119 /// <param name="wearableAssetUuid"></param> 153 /// <param name="wearableAssetUuid"></param>
@@ -200,7 +234,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
200 { 234 {
201 GetWearableAssetUuids(tii.AssetID, assetUuids); 235 GetWearableAssetUuids(tii.AssetID, assetUuids);
202 } 236 }
203 if ((int)AssetType.Object == tii.Type) 237 else if ((int)AssetType.LSLText == tii.Type)
238 {
239 GetScriptAssetUuids(tii.AssetID, assetUuids);
240 }
241 else if ((int)AssetType.Object == tii.Type)
204 { 242 {
205 GetSceneObjectAssetUuids(tii.AssetID, assetUuids); 243 GetSceneObjectAssetUuids(tii.AssetID, assetUuids);
206 } 244 }