aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs22
1 files changed, 12 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index a4ac54f..acaa389b 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Physics.Manager
38 /// </summary> 38 /// </summary>
39 public class PhysicsPluginManager 39 public class PhysicsPluginManager
40 { 40 {
41 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42
41 private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>(); 43 private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>();
42 private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>(); 44 private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>();
43 45
@@ -60,25 +62,25 @@ namespace OpenSim.Region.Physics.Manager
60 IMesher meshEngine = null; 62 IMesher meshEngine = null;
61 if (_MeshPlugins.ContainsKey(meshEngineName)) 63 if (_MeshPlugins.ContainsKey(meshEngineName))
62 { 64 {
63 MainLog.Instance.Verbose("PHYSICS", "creating meshing engine " + meshEngineName); 65 m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
64 meshEngine = _MeshPlugins[meshEngineName].GetMesher(); 66 meshEngine = _MeshPlugins[meshEngineName].GetMesher();
65 } 67 }
66 else 68 else
67 { 69 {
68 MainLog.Instance.Warn("PHYSICS", "couldn't find meshingEngine: {0}", meshEngineName); 70 m_log.Warn(String.Format("[PHYSICS]: couldn't find meshingEngine: {0}", meshEngineName));
69 throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName)); 71 throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName));
70 } 72 }
71 73
72 if (_PhysPlugins.ContainsKey(physEngineName)) 74 if (_PhysPlugins.ContainsKey(physEngineName))
73 { 75 {
74 MainLog.Instance.Verbose("PHYSICS", "creating " + physEngineName); 76 m_log.Info("[PHYSICS]: creating " + physEngineName);
75 PhysicsScene result = _PhysPlugins[physEngineName].GetScene(); 77 PhysicsScene result = _PhysPlugins[physEngineName].GetScene();
76 result.Initialise(meshEngine); 78 result.Initialise(meshEngine);
77 return result; 79 return result;
78 } 80 }
79 else 81 else
80 { 82 {
81 MainLog.Instance.Warn("PHYSICS", "couldn't find physicsEngine: {0}", physEngineName); 83 m_log.Warn(String.Format("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName));
82 throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName)); 84 throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName));
83 } 85 }
84 } 86 }
@@ -89,7 +91,7 @@ namespace OpenSim.Region.Physics.Manager
89 IMeshingPlugin plugHard; 91 IMeshingPlugin plugHard;
90 plugHard = new ZeroMesherPlugin(); 92 plugHard = new ZeroMesherPlugin();
91 _MeshPlugins.Add(plugHard.GetName(), plugHard); 93 _MeshPlugins.Add(plugHard.GetName(), plugHard);
92 MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plugHard.GetName()); 94 m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName());
93 95
94 // And now walk all assemblies (DLLs effectively) and see if they are home 96 // And now walk all assemblies (DLLs effectively) and see if they are home
95 // of a plugin that is of interest for us 97 // of a plugin that is of interest for us
@@ -120,7 +122,7 @@ namespace OpenSim.Region.Physics.Manager
120 (IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 122 (IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
121 plug.Init(); 123 plug.Init();
122 _PhysPlugins.Add(plug.GetName(), plug); 124 _PhysPlugins.Add(plug.GetName(), plug);
123 MainLog.Instance.Verbose("PHYSICS", "Added physics engine: " + plug.GetName()); 125 m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName());
124 } 126 }
125 127
126 Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); 128 Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true);
@@ -130,7 +132,7 @@ namespace OpenSim.Region.Physics.Manager
130 IMeshingPlugin plug = 132 IMeshingPlugin plug =
131 (IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 133 (IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
132 _MeshPlugins.Add(plug.GetName(), plug); 134 _MeshPlugins.Add(plug.GetName(), plug);
133 MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plug.GetName()); 135 m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName());
134 } 136 }
135 137
136 physTypeInterface = null; 138 physTypeInterface = null;
@@ -147,11 +149,11 @@ namespace OpenSim.Region.Physics.Manager
147 { 149 {
148 if (isWarning) 150 if (isWarning)
149 { 151 {
150 MainLog.Instance.Warn("PHYSICS", message); 152 m_log.Warn("[PHYSICS]: " + message);
151 } 153 }
152 else 154 else
153 { 155 {
154 MainLog.Instance.Verbose("PHYSICS", message); 156 m_log.Info("[PHYSICS]: " + message);
155 } 157 }
156 } 158 }
157 159
@@ -171,4 +173,4 @@ namespace OpenSim.Region.Physics.Manager
171 string GetName(); 173 string GetName();
172 IMesher GetMesher(); 174 IMesher GetMesher();
173 } 175 }
174} \ No newline at end of file 176}