From ac2f98b846eba85ab3d9acb5bd0f355a404de86c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:32:30 -0400 Subject: * A hacky attempt at resolving mantis #4260. I think ODE was unable to allocate memory, and therefore the unmanaged wrapper call fails or worse.. there's some unmanaged resource accounting in the ODEPlugin for ODECharacter that isn't being done properly now. * The broken avatar may not be able to move, but it won't stop simulate from pressing on now. And, the simulator will try to destroy the avatar's physics proxy and recreate it again... but if this is what I think it is, it may not help. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 646a483..96fa467 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3410,11 +3410,20 @@ namespace OpenSim.Region.Framework.Scenes scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; + m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); m_physicsActor.LocalID = LocalId; } + private void OutOfBoundsCall(PhysicsVector pos) + { + bool flying = m_physicsActor.Flying; + RemoveFromPhysicalScene(); + + AddToPhysicalScene(flying); + } + // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { -- cgit v1.1 From 67afa9e633b6b5c9c8be8f50eeecc5177c05119b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:52:57 -0400 Subject: * Make sure to unregister the OutOfBounds Physics event in RemoveFromPhysicalScene or we'll be leaking --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 96fa467..b468dde 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -908,6 +908,7 @@ namespace OpenSim.Region.Framework.Scenes if (PhysicsActor != null) { m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; + m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_physicsActor.UnSubscribeEvents(); m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; -- cgit v1.1 From ac31cb89d59b1d9be84df94ef3f26cad8624c452 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 16:22:10 -0400 Subject: * Ensure that at least 20 frames run before letting avatar in. --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d3d397d..c4622cd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -128,6 +128,7 @@ namespace OpenSim.Region.Framework.Scenes public CommunicationsManager CommsManager; protected SceneCommunicationService m_sceneGridService; + public bool loginsdisabled = true; public SceneCommunicationService SceneGridService { @@ -1062,6 +1063,11 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); } + if (loginsdisabled && ((m_frame % 20) == 0)) + { + m_log.Debug("[REGION]: Enabling Logins"); + loginsdisabled = false; + } } catch (NotImplementedException) { @@ -3227,6 +3233,11 @@ namespace OpenSim.Region.Framework.Scenes /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, out string reason) { + if (loginsdisabled) + { + reason = "Logins Disabled"; + return false; + } // Don't disable this log message - it's too helpful m_log.InfoFormat( "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5})", -- cgit v1.1 From f5964347bdb7df75ec41dcdfc7e9f648caa18ee2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 16:25:48 -0400 Subject: * fix previous commit --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c4622cd..29d2a84 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1063,7 +1063,7 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); } - if (loginsdisabled && ((m_frame % 20) == 0)) + if (loginsdisabled && (m_frame > 20)) { m_log.Debug("[REGION]: Enabling Logins"); loginsdisabled = false; -- cgit v1.1 From 01051daaab27cf4c4b5e3d5e8066caa61cf769a6 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 21:24:08 -0400 Subject: * One more tweak to inform the user that they may not be able to move until relogging. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b468dde..c25fa55 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3419,10 +3419,12 @@ namespace OpenSim.Region.Framework.Scenes private void OutOfBoundsCall(PhysicsVector pos) { - bool flying = m_physicsActor.Flying; - RemoveFromPhysicalScene(); + //bool flying = m_physicsActor.Flying; + //RemoveFromPhysicalScene(); - AddToPhysicalScene(flying); + //AddToPhysicalScene(flying); + if (ControllingClient != null) + ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.",true); } // Event called by the physics plugin to tell the avatar about a collision. -- cgit v1.1 From 0d29614ca129a044f6fad01f5600c52a922b702c Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 19 Oct 2009 08:58:03 +0900 Subject: Formatting cleanup. --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 29d2a84..151df27 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1116,13 +1116,13 @@ namespace OpenSim.Region.Framework.Scenes public void AddGroupTarget(SceneObjectGroup grp) { - lock(m_groupsWithTargets) + lock (m_groupsWithTargets) m_groupsWithTargets[grp.UUID] = grp; } public void RemoveGroupTarget(SceneObjectGroup grp) { - lock(m_groupsWithTargets) + lock (m_groupsWithTargets) m_groupsWithTargets.Remove(grp.UUID); } -- cgit v1.1