From fe900b28c69ad0970c273ea25f4194c7f4456520 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 22 Jul 2014 15:56:20 +0100 Subject: CrossPrimGroupIntoNewRegion does keyframes and physics crossing fails, so revert previus change assuming it didnt. remove a no longer needed else {} --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 177 ++++++++++----------- 1 file changed, 86 insertions(+), 91 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index d4051c0..4ac6743 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -557,121 +557,116 @@ namespace OpenSim.Region.Framework.Scenes // actually assume this sog was removed from simulation return; } - else + + if (m_rootPart.KeyframeMotion != null) + m_rootPart.KeyframeMotion.StartCrossingCheck(); + + bool canCross = true; + + foreach (ScenePresence av in m_linkedAvatars) { - if (m_rootPart.KeyframeMotion != null) - m_rootPart.KeyframeMotion.StartCrossingCheck(); + // We need to cross these agents. First, let's find + // out if any of them can't cross for some reason. + // We have to deny the crossing entirely if any + // of them are banned. Alternatively, we could + // unsit banned agents.... - bool canCross = true; - foreach (ScenePresence av in m_linkedAvatars) + // We set the avatar position as being the object + // position to get the region to send to + if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null) { - // We need to cross these agents. First, let's find - // out if any of them can't cross for some reason. - // We have to deny the crossing entirely if any - // of them are banned. Alternatively, we could - // unsit banned agents.... + canCross = false; + break; + } + m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName); + } - // We set the avatar position as being the object - // position to get the region to send to - if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null) - { - canCross = false; - break; - } + if (canCross) + { + // We unparent the SP quietly so that it won't + // be made to stand up - m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName); - } + List avsToCross = new List(); - if (canCross) + foreach (ScenePresence av in m_linkedAvatars) { - // We unparent the SP quietly so that it won't - // be made to stand up + avtocrossInfo avinfo = new avtocrossInfo(); + SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID); + if (parentPart != null) + av.ParentUUID = parentPart.UUID; - List avsToCross = new List(); + avinfo.av = av; + avinfo.ParentID = av.ParentID; + avsToCross.Add(avinfo); - foreach (ScenePresence av in m_linkedAvatars) - { - avtocrossInfo avinfo = new avtocrossInfo(); - SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID); - if (parentPart != null) - av.ParentUUID = parentPart.UUID; - - avinfo.av = av; - avinfo.ParentID = av.ParentID; - avsToCross.Add(avinfo); + av.PrevSitOffset = av.OffsetPosition; + av.ParentID = 0; + } - av.PrevSitOffset = av.OffsetPosition; - av.ParentID = 0; - } + // m_linkedAvatars.Clear(); + m_scene.CrossPrimGroupIntoNewRegion(val, this, true); - // m_linkedAvatars.Clear(); - m_scene.CrossPrimGroupIntoNewRegion(val, this, true); - - // Normalize - if (val.X >= Constants.RegionSize) - val.X -= Constants.RegionSize; - if (val.Y >= Constants.RegionSize) - val.Y -= Constants.RegionSize; - if (val.X < 0) - val.X += Constants.RegionSize; - if (val.Y < 0) - val.Y += Constants.RegionSize; - - // If it's deleted, crossing was successful - if (IsDeleted) - { - // foreach (ScenePresence av in m_linkedAvatars) - foreach (avtocrossInfo avinfo in avsToCross) - { - ScenePresence av = avinfo.av; - if (!av.IsInTransit) // just in case... - { - m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); - - av.IsInTransit = true; - - CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; - d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); - } - else - m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val); - } - avsToCross.Clear(); - return; - } - else // cross failed, put avas back ?? + // Normalize + if (val.X >= Constants.RegionSize) + val.X -= Constants.RegionSize; + if (val.Y >= Constants.RegionSize) + val.Y -= Constants.RegionSize; + if (val.X < 0) + val.X += Constants.RegionSize; + if (val.Y < 0) + val.Y += Constants.RegionSize; + + // If it's deleted, crossing was successful + if (IsDeleted) + { + // foreach (ScenePresence av in m_linkedAvatars) + foreach (avtocrossInfo avinfo in avsToCross) { - foreach (avtocrossInfo avinfo in avsToCross) + ScenePresence av = avinfo.av; + if (!av.IsInTransit) // just in case... { - ScenePresence av = avinfo.av; - av.ParentUUID = UUID.Zero; - av.ParentID = avinfo.ParentID; - // m_linkedAvatars.Add(av); + m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); + + av.IsInTransit = true; + + CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; + d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); } + else + m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val); } avsToCross.Clear(); - + return; } - // else - // we need to do this on all fails - + else // cross failed, put avas back ?? { - if (m_rootPart.KeyframeMotion != null) - m_rootPart.KeyframeMotion.CrossingFailure(); - - if (RootPart.PhysActor != null) + foreach (avtocrossInfo avinfo in avsToCross) { - RootPart.PhysActor.CrossingFailure(); + ScenePresence av = avinfo.av; + av.ParentUUID = UUID.Zero; + av.ParentID = avinfo.ParentID; + // m_linkedAvatars.Add(av); } } - Vector3 oldp = AbsolutePosition; - val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f); - val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f); - // dont crash land StarShips - // val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f); + avsToCross.Clear(); + } + else + { + if (m_rootPart.KeyframeMotion != null) + m_rootPart.KeyframeMotion.CrossingFailure(); + + if (RootPart.PhysActor != null) + { + RootPart.PhysActor.CrossingFailure(); + } } + Vector3 oldp = AbsolutePosition; + val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f); + val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f); + // dont crash land StarShips + // val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f); } } -- cgit v1.1