aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2009-12-23 23:09:41 +0000
committerMelanie2009-12-23 23:09:41 +0000
commit53386b6f1f6fe02f3b6e544ce5d50bdf2cc6e7ec (patch)
treef028ed94375c9957c901a384c2db679c5d798495 /OpenSim/Region
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-53386b6f1f6fe02f3b6e544ce5d50bdf2cc6e7ec.zip
opensim-SC-53386b6f1f6fe02f3b6e544ce5d50bdf2cc6e7ec.tar.gz
opensim-SC-53386b6f1f6fe02f3b6e544ce5d50bdf2cc6e7ec.tar.bz2
opensim-SC-53386b6f1f6fe02f3b6e544ce5d50bdf2cc6e7ec.tar.xz
Add saving assets from gestures to IAR
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs42
1 files changed, 41 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index 930af81..7e3c192 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -91,6 +91,10 @@ namespace OpenSim.Region.Framework.Scenes
91 { 91 {
92 GetWearableAssetUuids(assetUuid, assetUuids); 92 GetWearableAssetUuids(assetUuid, assetUuids);
93 } 93 }
94 else if (AssetType.Gesture == assetType)
95 {
96 GetGestureAssetUuids(assetUuid, assetUuids);
97 }
94 else if (AssetType.LSLText == assetType) 98 else if (AssetType.LSLText == assetType)
95 { 99 {
96 GetScriptAssetUuids(assetUuid, assetUuids); 100 GetScriptAssetUuids(assetUuid, assetUuids);
@@ -278,5 +282,41 @@ namespace OpenSim.Region.Framework.Scenes
278 GatherAssetUuids(sog, assetUuids); 282 GatherAssetUuids(sog, assetUuids);
279 } 283 }
280 } 284 }
285
286 protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary<UUID, int> assetUuids)
287 {
288 AssetBase assetBase = GetAsset(gestureUuid);
289
290 MemoryStream ms = new MemoryStream(assetBase.Data);
291 StreamReader sr = new StreamReader(ms);
292
293 sr.ReadLine(); // Unknown (Version?)
294 sr.ReadLine(); // Unknown
295 sr.ReadLine(); // Unknown
296 sr.ReadLine(); // Name
297 sr.ReadLine(); // Comment ?
298 int count = Convert.ToInt32(sr.ReadLine()); // Item count
299
300 for (int i = 0 ; i < count ; i++)
301 {
302 string type = sr.ReadLine();
303 if (type == null)
304 break;
305 string name = sr.ReadLine();
306 if (name == null)
307 break;
308 string id = sr.ReadLine();
309 if (id == null)
310 break;
311 string unknown = sr.ReadLine();
312 if (unknown == null)
313 break;
314
315 // If it can be parsed as a UUID, it is an asset ID
316 UUID uuid;
317 if (UUID.Parse(id, out uuid))
318 assetUuids[uuid] = 1;
319 }
320 }
281 } 321 }
282} \ No newline at end of file 322}