diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 930af813c2..7e3c192e10 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -91,6 +91,10 @@ namespace OpenSim.Region.Framework.Scenes { GetWearableAssetUuids(assetUuid, assetUuids); } + else if (AssetType.Gesture == assetType) + { + GetGestureAssetUuids(assetUuid, assetUuids); + } else if (AssetType.LSLText == assetType) { GetScriptAssetUuids(assetUuid, assetUuids); @@ -278,5 +282,41 @@ namespace OpenSim.Region.Framework.Scenes GatherAssetUuids(sog, assetUuids); } } + + protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary assetUuids) + { + AssetBase assetBase = GetAsset(gestureUuid); + + MemoryStream ms = new MemoryStream(assetBase.Data); + StreamReader sr = new StreamReader(ms); + + sr.ReadLine(); // Unknown (Version?) + sr.ReadLine(); // Unknown + sr.ReadLine(); // Unknown + sr.ReadLine(); // Name + sr.ReadLine(); // Comment ? + int count = Convert.ToInt32(sr.ReadLine()); // Item count + + for (int i = 0 ; i < count ; i++) + { + string type = sr.ReadLine(); + if (type == null) + break; + string name = sr.ReadLine(); + if (name == null) + break; + string id = sr.ReadLine(); + if (id == null) + break; + string unknown = sr.ReadLine(); + if (unknown == null) + break; + + // If it can be parsed as a UUID, it is an asset ID + UUID uuid; + if (UUID.Parse(id, out uuid)) + assetUuids[uuid] = 1; + } + } } -} \ No newline at end of file +}