* One more attempt at the NullRef In The OdePlugin. This might fix it, but it will definitely get us closer to the root cause.

prioritization
Teravus Ovares (Dan Olivares) 2009-10-16 14:30:55 -04:00
parent 5de657cf5d
commit 0079d0a7c4
2 changed files with 22 additions and 1 deletions

View File

@ -1109,10 +1109,10 @@ namespace OpenSim.Region.Physics.OdePlugin
try try
{ {
vec = d.BodyGetPosition(Body); vec = d.BodyGetPosition(Body);
} }
catch (NullReferenceException) catch (NullReferenceException)
{ {
_parent_scene.BadCharacter(this);
vec = new d.Vector3(_position.X, _position.Y, _position.Z); vec = new d.Vector3(_position.X, _position.Y, _position.Z);
base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem!
m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name);

View File

@ -242,6 +242,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private readonly HashSet<OdeCharacter> _taintedActors = new HashSet<OdeCharacter>(); private readonly HashSet<OdeCharacter> _taintedActors = new HashSet<OdeCharacter>();
private readonly List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>(); private readonly List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>();
private readonly List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>(); private readonly List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>();
private readonly HashSet<OdeCharacter> _badCharacter = new HashSet<OdeCharacter>();
public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>(); public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>();
public Dictionary<IntPtr, PhysicsActor> actor_name_map = new Dictionary<IntPtr, PhysicsActor>(); public Dictionary<IntPtr, PhysicsActor> actor_name_map = new Dictionary<IntPtr, PhysicsActor>();
private bool m_NINJA_physics_joints_enabled = false; 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) 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) lock (_activeprims)
{ {
//if (timeStep < 0.2f) //if (timeStep < 0.2f)