diff options
author | teravus | 2012-11-15 10:05:16 -0500 |
---|---|---|
committer | teravus | 2012-11-15 10:05:16 -0500 |
commit | e9153e1d1aae50024d8cd05fe14a9bce34343a0e (patch) | |
tree | bc111d34f95a26b99c7e34d9e495dc14d1802cc3 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Merge master into teravuswork (diff) | |
download | opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.zip opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.gz opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.bz2 opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.xz |
Revert "Merge master into teravuswork", it should have been avination, not master.
This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing
changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 25a53b4..2b9665c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -69,15 +69,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
69 | public ScriptControlled eventControls; | 69 | public ScriptControlled eventControls; |
70 | } | 70 | } |
71 | 71 | ||
72 | public delegate void SendCoarseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); | 72 | public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); |
73 | 73 | ||
74 | public class ScenePresence : EntityBase, IScenePresence | 74 | public class ScenePresence : EntityBase, IScenePresence |
75 | { | 75 | { |
76 | // ~ScenePresence() | 76 | // ~ScenePresence() |
77 | // { | 77 | // { |
78 | // m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name); | 78 | // m_log.Debug("[SCENE PRESENCE] Destructor called"); |
79 | // } | 79 | // } |
80 | |||
81 | private void TriggerScenePresenceUpdated() | 80 | private void TriggerScenePresenceUpdated() |
82 | { | 81 | { |
83 | if (m_scene != null) | 82 | if (m_scene != null) |
@@ -189,7 +188,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
189 | /// </summary> | 188 | /// </summary> |
190 | public bool SitGround { get; private set; } | 189 | public bool SitGround { get; private set; } |
191 | 190 | ||
192 | private SendCoarseLocationsMethod m_sendCoarseLocationsMethod; | 191 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; |
193 | 192 | ||
194 | //private Vector3 m_requestedSitOffset = new Vector3(); | 193 | //private Vector3 m_requestedSitOffset = new Vector3(); |
195 | 194 | ||
@@ -547,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
547 | { | 546 | { |
548 | try | 547 | try |
549 | { | 548 | { |
550 | PhysicsActor.TargetVelocity = value; | 549 | PhysicsActor.Velocity = value; |
551 | } | 550 | } |
552 | catch (Exception e) | 551 | catch (Exception e) |
553 | { | 552 | { |
@@ -712,7 +711,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
712 | AttachmentsSyncLock = new Object(); | 711 | AttachmentsSyncLock = new Object(); |
713 | AllowMovement = true; | 712 | AllowMovement = true; |
714 | IsChildAgent = true; | 713 | IsChildAgent = true; |
715 | m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; | 714 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; |
716 | Animator = new ScenePresenceAnimator(this); | 715 | Animator = new ScenePresenceAnimator(this); |
717 | PresenceType = type; | 716 | PresenceType = type; |
718 | DrawDistance = world.DefaultDrawDistance; | 717 | DrawDistance = world.DefaultDrawDistance; |
@@ -976,9 +975,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
976 | { | 975 | { |
977 | if (wasChild && HasAttachments()) | 976 | if (wasChild && HasAttachments()) |
978 | { | 977 | { |
979 | m_log.DebugFormat( | 978 | m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments..."); |
980 | "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); | ||
981 | |||
982 | // Resume scripts | 979 | // Resume scripts |
983 | Util.FireAndForget(delegate(object x) { | 980 | Util.FireAndForget(delegate(object x) { |
984 | foreach (SceneObjectGroup sog in m_attachments) | 981 | foreach (SceneObjectGroup sog in m_attachments) |
@@ -1534,22 +1531,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1534 | bool DCFlagKeyPressed = false; | 1531 | bool DCFlagKeyPressed = false; |
1535 | Vector3 agent_control_v3 = Vector3.Zero; | 1532 | Vector3 agent_control_v3 = Vector3.Zero; |
1536 | 1533 | ||
1537 | bool newFlying = actor.Flying; | 1534 | bool oldflying = Flying; |
1538 | 1535 | ||
1539 | if (ForceFly) | 1536 | if (ForceFly) |
1540 | newFlying = true; | 1537 | actor.Flying = true; |
1541 | else if (FlyDisabled) | 1538 | else if (FlyDisabled) |
1542 | newFlying = false; | 1539 | actor.Flying = false; |
1543 | else | 1540 | else |
1544 | newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1541 | actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1545 | 1542 | ||
1546 | if (actor.Flying != newFlying) | 1543 | if (actor.Flying != oldflying) |
1547 | { | ||
1548 | // Note: ScenePresence.Flying is actually fetched from the physical actor | ||
1549 | // so setting PhysActor.Flying here also sets the ScenePresence's value. | ||
1550 | actor.Flying = newFlying; | ||
1551 | update_movementflag = true; | 1544 | update_movementflag = true; |
1552 | } | ||
1553 | 1545 | ||
1554 | if (ParentID == 0) | 1546 | if (ParentID == 0) |
1555 | { | 1547 | { |
@@ -2631,17 +2623,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2631 | 2623 | ||
2632 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | 2624 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
2633 | { | 2625 | { |
2634 | SendCoarseLocationsMethod d = m_sendCoarseLocationsMethod; | 2626 | SendCourseLocationsMethod d = m_sendCourseLocationsMethod; |
2635 | if (d != null) | 2627 | if (d != null) |
2636 | { | 2628 | { |
2637 | d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); | 2629 | d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); |
2638 | } | 2630 | } |
2639 | } | 2631 | } |
2640 | 2632 | ||
2641 | public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d) | 2633 | public void SetSendCourseLocationMethod(SendCourseLocationsMethod d) |
2642 | { | 2634 | { |
2643 | if (d != null) | 2635 | if (d != null) |
2644 | m_sendCoarseLocationsMethod = d; | 2636 | m_sendCourseLocationsMethod = d; |
2645 | } | 2637 | } |
2646 | 2638 | ||
2647 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | 2639 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
@@ -2845,7 +2837,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2845 | #region Significant Movement Method | 2837 | #region Significant Movement Method |
2846 | 2838 | ||
2847 | /// <summary> | 2839 | /// <summary> |
2848 | /// This checks for a significant movement and sends a coarselocationchange update | 2840 | /// This checks for a significant movement and sends a courselocationchange update |
2849 | /// </summary> | 2841 | /// </summary> |
2850 | protected void CheckForSignificantMovement() | 2842 | protected void CheckForSignificantMovement() |
2851 | { | 2843 | { |
@@ -3282,7 +3274,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3282 | } | 3274 | } |
3283 | catch { } | 3275 | catch { } |
3284 | cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; | 3276 | cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; |
3285 | cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation; | ||
3286 | 3277 | ||
3287 | if (Scene.AttachmentsModule != null) | 3278 | if (Scene.AttachmentsModule != null) |
3288 | Scene.AttachmentsModule.CopyAttachments(this, cAgent); | 3279 | Scene.AttachmentsModule.CopyAttachments(this, cAgent); |
@@ -3359,8 +3350,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3359 | Animator.Animations.FromArray(cAgent.Anims); | 3350 | Animator.Animations.FromArray(cAgent.Anims); |
3360 | if (cAgent.DefaultAnim != null) | 3351 | if (cAgent.DefaultAnim != null) |
3361 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); | 3352 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); |
3362 | if (cAgent.AnimState != null) | ||
3363 | Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); | ||
3364 | 3353 | ||
3365 | if (Scene.AttachmentsModule != null) | 3354 | if (Scene.AttachmentsModule != null) |
3366 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); | 3355 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); |
@@ -3643,16 +3632,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3643 | public List<SceneObjectGroup> GetAttachments(uint attachmentPoint) | 3632 | public List<SceneObjectGroup> GetAttachments(uint attachmentPoint) |
3644 | { | 3633 | { |
3645 | List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); | 3634 | List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); |
3646 | 3635 | ||
3647 | if (attachmentPoint >= 0) | 3636 | lock (m_attachments) |
3648 | { | 3637 | { |
3649 | lock (m_attachments) | 3638 | foreach (SceneObjectGroup so in m_attachments) |
3650 | { | 3639 | { |
3651 | foreach (SceneObjectGroup so in m_attachments) | 3640 | if (attachmentPoint == so.AttachmentPoint) |
3652 | { | 3641 | attachments.Add(so); |
3653 | if (attachmentPoint == so.AttachmentPoint) | ||
3654 | attachments.Add(so); | ||
3655 | } | ||
3656 | } | 3642 | } |
3657 | } | 3643 | } |
3658 | 3644 | ||