diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 |
4 files changed, 56 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 2365cfe..e88a623 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -484,6 +484,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
484 | public delegate void SceneObjectPartUpdated(SceneObjectPart sop); | 484 | public delegate void SceneObjectPartUpdated(SceneObjectPart sop); |
485 | public event SceneObjectPartUpdated OnSceneObjectPartUpdated; | 485 | public event SceneObjectPartUpdated OnSceneObjectPartUpdated; |
486 | 486 | ||
487 | public delegate void ScenePresenceUpdated(ScenePresence sp); | ||
488 | public event ScenePresenceUpdated OnScenePresenceUpdated; | ||
489 | |||
487 | public delegate void RegionUp(GridRegion region); | 490 | public delegate void RegionUp(GridRegion region); |
488 | public event RegionUp OnRegionUp; | 491 | public event RegionUp OnRegionUp; |
489 | 492 | ||
@@ -2367,6 +2370,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2367 | } | 2370 | } |
2368 | } | 2371 | } |
2369 | 2372 | ||
2373 | public void TriggerScenePresenceUpdated(ScenePresence sp) | ||
2374 | { | ||
2375 | ScenePresenceUpdated handler = OnScenePresenceUpdated; | ||
2376 | if (handler != null) | ||
2377 | { | ||
2378 | foreach (ScenePresenceUpdated d in handler.GetInvocationList()) | ||
2379 | { | ||
2380 | try | ||
2381 | { | ||
2382 | d(sp); | ||
2383 | } | ||
2384 | catch (Exception e) | ||
2385 | { | ||
2386 | m_log.ErrorFormat( | ||
2387 | "[EVENT MANAGER]: Delegate for TriggerScenePresenceUpdated failed - continuing. {0} {1}", | ||
2388 | e.Message, e.StackTrace); | ||
2389 | } | ||
2390 | } | ||
2391 | } | ||
2392 | } | ||
2393 | |||
2370 | public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, | 2394 | public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, |
2371 | int local_id, IClientAPI remote_client) | 2395 | int local_id, IClientAPI remote_client) |
2372 | { | 2396 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index debb164..00f76e0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -102,8 +102,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
102 | protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>(); | 102 | protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>(); |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Lock to prevent object group update, linking and delinking operations from running concurrently. | 105 | /// Lock to prevent object group update, linking, delinking and duplication operations from running concurrently. |
106 | /// </summary> | 106 | /// </summary> |
107 | /// <remarks> | ||
108 | /// These operations rely on the parts composition of the object. If allowed to run concurrently then race | ||
109 | /// conditions can occur. | ||
110 | /// </remarks> | ||
107 | private Object m_updateLock = new Object(); | 111 | private Object m_updateLock = new Object(); |
108 | 112 | ||
109 | #endregion | 113 | #endregion |
@@ -2067,12 +2071,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2067 | /// <param name="AgentID"></param> | 2071 | /// <param name="AgentID"></param> |
2068 | /// <param name="GroupID"></param> | 2072 | /// <param name="GroupID"></param> |
2069 | /// <param name="rot"></param> | 2073 | /// <param name="rot"></param> |
2074 | /// <returns>null if duplication fails, otherwise the duplicated object</returns> | ||
2075 | /// <summary> | ||
2070 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) | 2076 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) |
2071 | { | 2077 | { |
2072 | // m_log.DebugFormat( | 2078 | // m_log.DebugFormat( |
2073 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", | 2079 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", |
2074 | // originalPrimID, offset, AgentID); | 2080 | // originalPrimID, offset, AgentID); |
2075 | 2081 | ||
2076 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); | 2082 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); |
2077 | if (original != null) | 2083 | if (original != null) |
2078 | { | 2084 | { |
@@ -2102,25 +2108,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2102 | 2108 | ||
2103 | // FIXME: This section needs to be refactored so that it just calls AddSceneObject() | 2109 | // FIXME: This section needs to be refactored so that it just calls AddSceneObject() |
2104 | Entities.Add(copy); | 2110 | Entities.Add(copy); |
2105 | 2111 | ||
2106 | lock (SceneObjectGroupsByFullID) | 2112 | lock (SceneObjectGroupsByFullID) |
2107 | SceneObjectGroupsByFullID[copy.UUID] = copy; | 2113 | SceneObjectGroupsByFullID[copy.UUID] = copy; |
2108 | 2114 | ||
2109 | SceneObjectPart[] children = copy.Parts; | 2115 | SceneObjectPart[] children = copy.Parts; |
2110 | 2116 | ||
2111 | lock (SceneObjectGroupsByFullPartID) | 2117 | lock (SceneObjectGroupsByFullPartID) |
2112 | { | 2118 | { |
2113 | SceneObjectGroupsByFullPartID[copy.UUID] = copy; | 2119 | SceneObjectGroupsByFullPartID[copy.UUID] = copy; |
2114 | foreach (SceneObjectPart part in children) | 2120 | foreach (SceneObjectPart part in children) |
2115 | SceneObjectGroupsByFullPartID[part.UUID] = copy; | 2121 | SceneObjectGroupsByFullPartID[part.UUID] = copy; |
2116 | } | 2122 | } |
2117 | 2123 | ||
2118 | lock (SceneObjectGroupsByLocalPartID) | 2124 | lock (SceneObjectGroupsByLocalPartID) |
2119 | { | 2125 | { |
2120 | SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; | 2126 | SceneObjectGroupsByLocalPartID[copy.LocalId] = copy; |
2121 | foreach (SceneObjectPart part in children) | 2127 | foreach (SceneObjectPart part in children) |
2122 | SceneObjectGroupsByLocalPartID[part.LocalId] = copy; | 2128 | SceneObjectGroupsByLocalPartID[part.LocalId] = copy; |
2123 | } | 2129 | } |
2124 | // PROBABLE END OF FIXME | 2130 | // PROBABLE END OF FIXME |
2125 | 2131 | ||
2126 | // Since we copy from a source group that is in selected | 2132 | // Since we copy from a source group that is in selected |
@@ -2152,11 +2158,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2152 | { | 2158 | { |
2153 | m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); | 2159 | m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); |
2154 | } | 2160 | } |
2155 | 2161 | ||
2156 | return null; | 2162 | return null; |
2157 | } | 2163 | } |
2158 | 2164 | ||
2159 | /// <summary> | ||
2160 | /// Calculates the distance between two Vector3s | 2165 | /// Calculates the distance between two Vector3s |
2161 | /// </summary> | 2166 | /// </summary> |
2162 | /// <param name="v1"></param> | 2167 | /// <param name="v1"></param> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 843c426..82bba35 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3835,7 +3835,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3835 | hasProfileCut = hasDimple; // is it the same thing? | 3835 | hasProfileCut = hasDimple; // is it the same thing? |
3836 | } | 3836 | } |
3837 | 3837 | ||
3838 | |||
3839 | public void SetGroup(UUID groupID, IClientAPI client) | 3838 | public void SetGroup(UUID groupID, IClientAPI client) |
3840 | { | 3839 | { |
3841 | // Scene.AddNewPrims() calls with client == null so can't use this. | 3840 | // Scene.AddNewPrims() calls with client == null so can't use this. |
@@ -3865,10 +3864,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3865 | 3864 | ||
3866 | public void SetPhysicsAxisRotation() | 3865 | public void SetPhysicsAxisRotation() |
3867 | { | 3866 | { |
3868 | if (PhysActor != null) | 3867 | PhysicsActor pa = PhysActor; |
3868 | |||
3869 | if (pa != null) | ||
3869 | { | 3870 | { |
3870 | PhysActor.LockAngularMotion(RotationAxis); | 3871 | pa.LockAngularMotion(RotationAxis); |
3871 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 3872 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); |
3872 | } | 3873 | } |
3873 | } | 3874 | } |
3874 | 3875 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5a6fb6c..99ad685 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -77,6 +77,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
77 | // { | 77 | // { |
78 | // m_log.Debug("[SCENE PRESENCE] Destructor called"); | 78 | // m_log.Debug("[SCENE PRESENCE] Destructor called"); |
79 | // } | 79 | // } |
80 | private void TriggerScenePresenceUpdated() | ||
81 | { | ||
82 | if (m_scene != null) | ||
83 | m_scene.EventManager.TriggerScenePresenceUpdated(this); | ||
84 | } | ||
80 | 85 | ||
81 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 86 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
82 | 87 | ||
@@ -498,6 +503,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
498 | //m_log.DebugFormat( | 503 | //m_log.DebugFormat( |
499 | // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", | 504 | // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", |
500 | // Scene.RegionInfo.RegionName, Name, m_pos); | 505 | // Scene.RegionInfo.RegionName, Name, m_pos); |
506 | TriggerScenePresenceUpdated(); | ||
501 | } | 507 | } |
502 | } | 508 | } |
503 | 509 | ||
@@ -517,6 +523,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
517 | return; | 523 | return; |
518 | 524 | ||
519 | m_pos = value; | 525 | m_pos = value; |
526 | TriggerScenePresenceUpdated(); | ||
520 | } | 527 | } |
521 | } | 528 | } |
522 | 529 | ||
@@ -1090,6 +1097,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1090 | 1097 | ||
1091 | public void TeleportWithMomentum(Vector3 pos, Vector3? v) | 1098 | public void TeleportWithMomentum(Vector3 pos, Vector3? v) |
1092 | { | 1099 | { |
1100 | if (ParentID != (uint)0) | ||
1101 | StandUp(); | ||
1093 | bool isFlying = Flying; | 1102 | bool isFlying = Flying; |
1094 | Vector3 vel = Velocity; | 1103 | Vector3 vel = Velocity; |
1095 | RemoveFromPhysicalScene(); | 1104 | RemoveFromPhysicalScene(); |
@@ -1662,6 +1671,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1662 | } | 1671 | } |
1663 | 1672 | ||
1664 | m_scene.EventManager.TriggerOnClientMovement(this); | 1673 | m_scene.EventManager.TriggerOnClientMovement(this); |
1674 | TriggerScenePresenceUpdated(); | ||
1665 | } | 1675 | } |
1666 | 1676 | ||
1667 | /// <summary> | 1677 | /// <summary> |
@@ -2594,6 +2604,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2594 | 2604 | ||
2595 | m_scene.ForEachClient(SendTerseUpdateToClient); | 2605 | m_scene.ForEachClient(SendTerseUpdateToClient); |
2596 | } | 2606 | } |
2607 | TriggerScenePresenceUpdated(); | ||
2597 | } | 2608 | } |
2598 | 2609 | ||
2599 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | 2610 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
@@ -3379,6 +3390,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3379 | Velocity = force; | 3390 | Velocity = force; |
3380 | 3391 | ||
3381 | m_forceToApply = null; | 3392 | m_forceToApply = null; |
3393 | TriggerScenePresenceUpdated(); | ||
3382 | } | 3394 | } |
3383 | } | 3395 | } |
3384 | 3396 | ||