From 6f2d80cc930c83e81cc351f6e66a206141cf084a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 14 Dec 2011 21:27:47 +0000 Subject: minor: add some currently commented log lines for use in debugging --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index a6c2eca..da540fa 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1699,6 +1699,10 @@ namespace OpenSim.Region.Physics.OdePlugin public override void RemoveAvatar(PhysicsActor actor) { +// m_log.DebugFormat( +// "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}", +// actor.Name, actor.LocalID, Name); + //m_log.Debug("[PHYSICS]:ODELOCK"); ((OdeCharacter) actor).Destroy(); } @@ -1707,6 +1711,9 @@ namespace OpenSim.Region.Physics.OdePlugin { if (!_characters.Contains(chr)) { +// m_log.DebugFormat( +// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}", chr.Name, chr.LocalID, Name); + _characters.Add(chr); if (chr.bad) @@ -1765,7 +1772,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { -// m_log.DebugFormat("[ODE SCENE]: Adding physics actor to {0} {1}", primName, localid); +// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); } -- cgit v1.1 From 937c06db54f8152486d37a4ba604ffb3bcdccbb4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 15 Dec 2011 21:57:22 +0000 Subject: Code cleanup related to ScenePresence.PhysicsActor and OdeScene/OdeCharacter Stop hiding RemoveAvatar failure, add log messages when characters are removed through defects or re-added unexpectedly. Add commented out log lines for future use. Use automatic property for PhysicsActor for better code readability and simplicity --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index da540fa..afe646c 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1703,7 +1703,6 @@ namespace OpenSim.Region.Physics.OdePlugin // "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}", // actor.Name, actor.LocalID, Name); - //m_log.Debug("[PHYSICS]:ODELOCK"); ((OdeCharacter) actor).Destroy(); } @@ -1711,11 +1710,12 @@ namespace OpenSim.Region.Physics.OdePlugin { if (!_characters.Contains(chr)) { -// m_log.DebugFormat( -// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}", chr.Name, chr.LocalID, Name); - _characters.Add(chr); +// m_log.DebugFormat( +// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}. Count now {3}", +// chr.Name, chr.LocalID, Name, _characters.Count); + if (chr.bad) m_log.ErrorFormat("[ODE SCENE]: Added BAD actor {0} to characters list", chr.m_uuid); } @@ -1730,11 +1730,19 @@ namespace OpenSim.Region.Physics.OdePlugin internal void RemoveCharacter(OdeCharacter chr) { if (_characters.Contains(chr)) + { _characters.Remove(chr); + +// m_log.DebugFormat( +// "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}. Count now {3}", +// chr.Name, chr.LocalID, Name, _characters.Count); + } else + { m_log.ErrorFormat( "[ODE SCENE]: Tried to remove character {0} {1} but they are not in the list!", chr.Name, chr.LocalID); + } } private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, @@ -1772,7 +1780,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { -// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); + m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); } @@ -2762,6 +2770,10 @@ namespace OpenSim.Region.Physics.OdePlugin { foreach (OdeCharacter actor in defects) { + m_log.ErrorFormat( + "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when moving", + actor.Name, actor.LocalID, Name); + RemoveCharacter(actor); actor.DestroyOdeStructures(); } @@ -2832,6 +2844,10 @@ namespace OpenSim.Region.Physics.OdePlugin { foreach (OdeCharacter actor in defects) { + m_log.ErrorFormat( + "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when updating position and velocity", + actor.Name, actor.LocalID, Name); + RemoveCharacter(actor); actor.DestroyOdeStructures(); } -- cgit v1.1 From 5d79f857b0020715f4fed4fdd9d9b764c1864960 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Dec 2011 20:54:28 +0000 Subject: Comment out accidentally left in "Adding physics prim" log message --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index afe646c..f716687 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1780,7 +1780,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { - m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); +// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); } -- cgit v1.1