From ef8f03b711e7d15443b9f0a597632e75e3d86ddc Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 13:57:45 +0100 Subject: [PATCH 1/2] Prevent avatar data from being sent during login when it's not valid and crashes login on some viewers. --- OpenSim/Region/Framework/Scenes/Scene.cs | 1 + OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c99e37e3c6..23006f2df6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2977,6 +2977,7 @@ namespace OpenSim.Region.Framework.Scenes // start the scripts again (since this is done in RezAttachments()). // XXX: This is convoluted. sp.IsChildAgent = false; + sp.IsLoggingIn = true; if (AttachmentsModule != null) Util.FireAndForget(delegate(object o) { AttachmentsModule.RezAttachments(sp); }); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cdba2824b4..48212d01c8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -607,6 +607,7 @@ namespace OpenSim.Region.Framework.Scenes } public bool IsChildAgent { get; set; } + public bool IsLoggingIn { get; set; } /// /// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero. @@ -743,6 +744,7 @@ namespace OpenSim.Region.Framework.Scenes AttachmentsSyncLock = new Object(); AllowMovement = true; IsChildAgent = true; + IsLoggingIn = false; m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; Animator = new ScenePresenceAnimator(this); PresenceType = type; @@ -915,6 +917,7 @@ namespace OpenSim.Region.Framework.Scenes else { IsChildAgent = false; + IsLoggingIn = false; } @@ -2541,13 +2544,13 @@ namespace OpenSim.Region.Framework.Scenes // NOTE: Velocity is not the same as m_velocity. Velocity will attempt to // grab the latest PhysicsActor velocity, whereas m_velocity is often // storing a requested force instead of an actual traveling velocity - if (Appearance.AvatarSize != m_lastSize) + if (Appearance.AvatarSize != m_lastSize && !IsLoggingIn) { m_lastSize = Appearance.AvatarSize; SendAvatarDataToAllAgents(); } - else if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || + if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) { From 0aabb93ef3aa6217cb5f3312f864e46465204d48 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 14:00:40 +0100 Subject: [PATCH 2/2] Remove now superfluous update of m_lastSize --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1c2720283d..a9195f72fe 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2545,10 +2545,7 @@ namespace OpenSim.Region.Framework.Scenes // grab the latest PhysicsActor velocity, whereas m_velocity is often // storing a requested force instead of an actual traveling velocity if (Appearance.AvatarSize != m_lastSize && !IsLoggingIn) - { - m_lastSize = Appearance.AvatarSize; SendAvatarDataToAllAgents(); - } if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||