diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/UuidGatherer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 930af81..3edb677 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using System.Text.RegularExpressions; | 32 | using System.Text.RegularExpressions; |
32 | using System.Threading; | 33 | using System.Threading; |
@@ -91,6 +92,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
91 | { | 92 | { |
92 | GetWearableAssetUuids(assetUuid, assetUuids); | 93 | GetWearableAssetUuids(assetUuid, assetUuids); |
93 | } | 94 | } |
95 | else if (AssetType.Gesture == assetType) | ||
96 | { | ||
97 | GetGestureAssetUuids(assetUuid, assetUuids); | ||
98 | } | ||
94 | else if (AssetType.LSLText == assetType) | 99 | else if (AssetType.LSLText == assetType) |
95 | { | 100 | { |
96 | GetScriptAssetUuids(assetUuid, assetUuids); | 101 | GetScriptAssetUuids(assetUuid, assetUuids); |
@@ -278,5 +283,41 @@ namespace OpenSim.Region.Framework.Scenes | |||
278 | GatherAssetUuids(sog, assetUuids); | 283 | GatherAssetUuids(sog, assetUuids); |
279 | } | 284 | } |
280 | } | 285 | } |
286 | |||
287 | protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary<UUID, int> assetUuids) | ||
288 | { | ||
289 | AssetBase assetBase = GetAsset(gestureUuid); | ||
290 | |||
291 | MemoryStream ms = new MemoryStream(assetBase.Data); | ||
292 | StreamReader sr = new StreamReader(ms); | ||
293 | |||
294 | sr.ReadLine(); // Unknown (Version?) | ||
295 | sr.ReadLine(); // Unknown | ||
296 | sr.ReadLine(); // Unknown | ||
297 | sr.ReadLine(); // Name | ||
298 | sr.ReadLine(); // Comment ? | ||
299 | int count = Convert.ToInt32(sr.ReadLine()); // Item count | ||
300 | |||
301 | for (int i = 0 ; i < count ; i++) | ||
302 | { | ||
303 | string type = sr.ReadLine(); | ||
304 | if (type == null) | ||
305 | break; | ||
306 | string name = sr.ReadLine(); | ||
307 | if (name == null) | ||
308 | break; | ||
309 | string id = sr.ReadLine(); | ||
310 | if (id == null) | ||
311 | break; | ||
312 | string unknown = sr.ReadLine(); | ||
313 | if (unknown == null) | ||
314 | break; | ||
315 | |||
316 | // If it can be parsed as a UUID, it is an asset ID | ||
317 | UUID uuid; | ||
318 | if (UUID.TryParse(id, out uuid)) | ||
319 | assetUuids[uuid] = 1; | ||
320 | } | ||
321 | } | ||
281 | } | 322 | } |
282 | } \ No newline at end of file | 323 | } |