diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 40 |
3 files changed, 58 insertions, 31 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e479628..216eb51 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2384,16 +2384,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2384 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2384 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
2385 | return false; | 2385 | return false; |
2386 | } | 2386 | } |
2387 | 2387 | ||
2388 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2); | 2388 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); |
2389 | 2389 | ||
2390 | newObject.ResumeScripts(); | 2390 | newObject.ResumeScripts(); |
2391 | 2391 | ||
2392 | // Do this as late as possible so that listeners have full access to the incoming object | 2392 | // Do this as late as possible so that listeners have full access to the incoming object |
2393 | EventManager.TriggerOnIncomingSceneObject(newObject); | 2393 | EventManager.TriggerOnIncomingSceneObject(newObject); |
2394 | 2394 | ||
2395 | TriggerChangedTeleport(newObject); | ||
2396 | |||
2397 | return true; | 2395 | return true; |
2398 | } | 2396 | } |
2399 | 2397 | ||
@@ -2520,7 +2518,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2520 | return true; | 2518 | return true; |
2521 | } | 2519 | } |
2522 | 2520 | ||
2523 | private void TriggerChangedTeleport(SceneObjectGroup sog) | 2521 | private int GetStateSource(SceneObjectGroup sog) |
2524 | { | 2522 | { |
2525 | ScenePresence sp = GetScenePresence(sog.OwnerID); | 2523 | ScenePresence sp = GetScenePresence(sog.OwnerID); |
2526 | 2524 | ||
@@ -2531,13 +2529,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2531 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) | 2529 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) |
2532 | { | 2530 | { |
2533 | // This will get your attention | 2531 | // This will get your attention |
2534 | //m_log.Error("[XXX] Triggering "); | 2532 | //m_log.Error("[XXX] Triggering CHANGED_TELEPORT"); |
2535 | 2533 | ||
2536 | // Trigger CHANGED_TELEPORT | 2534 | return 5; // StateSource.Teleporting |
2537 | sp.Scene.EventManager.TriggerOnScriptChangedEvent(sog.LocalId, (uint)Changed.TELEPORT); | ||
2538 | } | 2535 | } |
2539 | |||
2540 | } | 2536 | } |
2537 | return 2; // StateSource.PrimCrossing | ||
2541 | } | 2538 | } |
2542 | 2539 | ||
2543 | #endregion | 2540 | #endregion |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 98a3b29..24c809b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -464,16 +464,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
464 | // if (actor != null) | 464 | // if (actor != null) |
465 | if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting! | 465 | if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting! |
466 | m_pos = actor.Position; | 466 | m_pos = actor.Position; |
467 | 467 | else | |
468 | // If we're sitting, we need to update our position | ||
469 | if (m_parentID != 0) | ||
470 | { | 468 | { |
471 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); | 469 | // Obtain the correct position of a seated avatar. |
472 | if (part != null) | 470 | // In addition to providing the correct position while |
473 | m_parentPosition = part.AbsolutePosition; | 471 | // the avatar is seated, this value will also |
472 | // be used as the location to unsit to. | ||
473 | // | ||
474 | // If m_parentID is not 0, assume we are a seated avatar | ||
475 | // and we should return the position based on the sittarget | ||
476 | // offset and rotation of the prim we are seated on. | ||
477 | // | ||
478 | // Generally, m_pos will contain the position of the avatar | ||
479 | // in the sim unless the avatar is on a sit target. While | ||
480 | // on a sit target, m_pos will contain the desired offset | ||
481 | // without the parent rotation applied. | ||
482 | if (m_parentID != 0) | ||
483 | { | ||
484 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); | ||
485 | if (part != null) | ||
486 | { | ||
487 | return m_parentPosition + (m_pos * part.GetWorldRotation()); | ||
488 | } | ||
489 | else | ||
490 | { | ||
491 | return m_parentPosition + m_pos; | ||
492 | } | ||
493 | } | ||
474 | } | 494 | } |
475 | 495 | ||
476 | return m_parentPosition + m_pos; | 496 | return m_pos; |
477 | } | 497 | } |
478 | set | 498 | set |
479 | { | 499 | { |
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index aee2d10..3978a7d 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -86,23 +86,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
86 | /// <param name="assetUuids">The assets gathered</param> | 86 | /// <param name="assetUuids">The assets gathered</param> |
87 | public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, AssetType> assetUuids) | 87 | public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, AssetType> assetUuids) |
88 | { | 88 | { |
89 | assetUuids[assetUuid] = assetType; | 89 | try |
90 | 90 | { | |
91 | if (AssetType.Bodypart == assetType || AssetType.Clothing == assetType) | 91 | assetUuids[assetUuid] = assetType; |
92 | { | 92 | |
93 | GetWearableAssetUuids(assetUuid, assetUuids); | 93 | if (AssetType.Bodypart == assetType || AssetType.Clothing == assetType) |
94 | } | 94 | { |
95 | else if (AssetType.Gesture == assetType) | 95 | GetWearableAssetUuids(assetUuid, assetUuids); |
96 | { | 96 | } |
97 | GetGestureAssetUuids(assetUuid, assetUuids); | 97 | else if (AssetType.Gesture == assetType) |
98 | } | 98 | { |
99 | else if (AssetType.LSLText == assetType) | 99 | GetGestureAssetUuids(assetUuid, assetUuids); |
100 | { | 100 | } |
101 | GetScriptAssetUuids(assetUuid, assetUuids); | 101 | else if (AssetType.LSLText == assetType) |
102 | { | ||
103 | GetScriptAssetUuids(assetUuid, assetUuids); | ||
104 | } | ||
105 | else if (AssetType.Object == assetType) | ||
106 | { | ||
107 | GetSceneObjectAssetUuids(assetUuid, assetUuids); | ||
108 | } | ||
102 | } | 109 | } |
103 | else if (AssetType.Object == assetType) | 110 | catch (Exception) |
104 | { | 111 | { |
105 | GetSceneObjectAssetUuids(assetUuid, assetUuids); | 112 | m_log.ErrorFormat( |
113 | "[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}", | ||
114 | assetUuid, assetType); | ||
115 | throw; | ||
106 | } | 116 | } |
107 | } | 117 | } |
108 | 118 | ||