aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs43
2 files changed, 66 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b0fb8b3..998d598 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -222,6 +222,30 @@ namespace OpenSim.Region.Framework.Scenes
222 protected internal bool AddRestoredSceneObject( 222 protected internal bool AddRestoredSceneObject(
223 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) 223 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
224 { 224 {
225 // KF: Check for out-of-region, move inside and make static.
226 Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
227 sceneObject.RootPart.GroupPosition.Y,
228 sceneObject.RootPart.GroupPosition.Z);
229 if (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
230 npos.X > Constants.RegionSize ||
231 npos.Y > Constants.RegionSize)
232 {
233 if (npos.X < 0.0) npos.X = 1.0f;
234 if (npos.Y < 0.0) npos.Y = 1.0f;
235 if (npos.Z < 0.0) npos.Z = 0.0f;
236 if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
237 if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
238
239 foreach (SceneObjectPart part in sceneObject.Children.Values)
240 {
241 part.GroupPosition = npos;
242 }
243 sceneObject.RootPart.Velocity = Vector3.Zero;
244 sceneObject.RootPart.AngularVelocity = Vector3.Zero;
245 sceneObject.RootPart.Acceleration = Vector3.Zero;
246 sceneObject.RootPart.Velocity = Vector3.Zero;
247 }
248
225 if (!alreadyPersisted) 249 if (!alreadyPersisted)
226 { 250 {
227 sceneObject.ForceInventoryPersistence(); 251 sceneObject.ForceInventoryPersistence();
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
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO;
30using System.Reflection; 31using System.Reflection;
31using System.Text.RegularExpressions; 32using System.Text.RegularExpressions;
32using System.Threading; 33using 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}