diff options
author | CasperW | 2009-12-26 18:17:55 +0100 |
---|---|---|
committer | CasperW | 2009-12-26 18:17:55 +0100 |
commit | 1b8f91a0db3dd636a86fc20ff1f8496474899925 (patch) | |
tree | 48274af2007b977d9dca28c702644d60559b1f01 /OpenSim/Region/Framework/Scenes | |
parent | Fix for landing points. Only one scenario is not fully covered by this change... (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC-1b8f91a0db3dd636a86fc20ff1f8496474899925.zip opensim-SC-1b8f91a0db3dd636a86fc20ff1f8496474899925.tar.gz opensim-SC-1b8f91a0db3dd636a86fc20ff1f8496474899925.tar.bz2 opensim-SC-1b8f91a0db3dd636a86fc20ff1f8496474899925.tar.xz |
Merge branch 'master' into casper
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 43 |
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 | ||
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 | } |