From 0079d0a7c423db6e95c04b9055127b53ae6a3622 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 14:30:55 -0400 Subject: * One more attempt at the NullRef In The OdePlugin. This might fix it, but it will definitely get us closer to the root cause. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 083b7db..0e03e81 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -242,6 +242,7 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly HashSet _taintedActors = new HashSet(); private readonly List _perloopContact = new List(); private readonly List _collisionEventPrim = new List(); + private readonly HashSet _badCharacter = new HashSet(); public Dictionary geom_name_map = new Dictionary(); public Dictionary actor_name_map = new Dictionary(); private bool m_NINJA_physics_joints_enabled = false; @@ -1677,6 +1678,14 @@ namespace OpenSim.Region.Physics.OdePlugin } } } + public void BadCharacter(OdeCharacter chr) + { + lock (_badCharacter) + { + if (!_badCharacter.Contains(chr)) + _badCharacter.Add(chr); + } + } public override void RemoveAvatar(PhysicsActor actor) { @@ -2975,6 +2984,18 @@ namespace OpenSim.Region.Physics.OdePlugin } } + lock (_badCharacter) + { + if (_badCharacter.Count > 0) + { + foreach (OdeCharacter chr in _badCharacter) + { + RemoveCharacter(chr); + } + _badCharacter.Clear(); + } + } + lock (_activeprims) { //if (timeStep < 0.2f) -- cgit v1.1