From 03d76e94034bbaa82d1872284d1fadbaa263411d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 17 Aug 2012 13:30:46 -0700 Subject: BulletSim: restore most of the Detail logging statements. Will have no effect on non-logging running. Capture region name that is passed to the physics engine and use it for detail logging file name prefix. Fix problem with avatars dropping when flying across region boundries. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index d901ff0..56924aa 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -73,6 +73,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly string LogHeader = "[BULLETS SCENE]"; + // The name of the region we're working for. + public string RegionName { get; private set; } + public string BulletSimVersion = "?"; private Dictionary m_avatars = new Dictionary(); @@ -196,6 +199,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters public BSScene(string identifier) { m_initialized = false; + // we are passed the name of the region we're working for. + RegionName = identifier; } public override void Initialise(IMesher meshmerizer, IConfigSource config) @@ -281,10 +286,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters // Very detailed logging for physics debugging m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); - m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-"); + m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); // Very detailed logging for vehicle debugging m_vehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); + + // Do any replacements in the parameters + m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); } } } @@ -362,7 +370,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters BSPrim bsprim = prim as BSPrim; if (bsprim != null) { - // DetailLog("{0},RemovePrim,call", bsprim.LocalID); + DetailLog("{0},RemovePrim,call", bsprim.LocalID); // m_log.DebugFormat("{0}: RemovePrim. id={1}/{2}", LogHeader, bsprim.Name, bsprim.LocalID); try { @@ -388,7 +396,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters if (!m_initialized) return null; - // DetailLog("{0},AddPrimShape,call", localID); + DetailLog("{0},AddPrimShape,call", localID); BSPrim prim = new BSPrim(localID, primName, this, position, size, rotation, pbs, isPhysical); lock (m_prims) m_prims.Add(localID, prim); @@ -534,7 +542,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters else if (m_avatars.ContainsKey(collidingWith)) type = ActorTypes.Agent; - DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); + // DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); BSPrim prim; if (m_prims.TryGetValue(localID, out prim)) { -- cgit v1.1