diff options
author | Jeff Ames | 2008-02-05 19:44:27 +0000 |
---|---|---|
committer | Jeff Ames | 2008-02-05 19:44:27 +0000 |
commit | 6ed5283bc06a62f38eb517e67b975832b603bf61 (patch) | |
tree | e5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/Physics/Manager | |
parent | Cut down on the number of packets sent during terraforming. Terraforming shou... (diff) | |
download | opensim-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')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 16 |
2 files changed, 21 insertions, 17 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 | } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 37481f1..bd2ad99 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | ||
28 | using Axiom.Math; | 29 | using Axiom.Math; |
29 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
30 | using OpenSim.Framework.Console; | 31 | using OpenSim.Framework.Console; |
@@ -35,6 +36,8 @@ namespace OpenSim.Region.Physics.Manager | |||
35 | 36 | ||
36 | public abstract class PhysicsScene | 37 | public abstract class PhysicsScene |
37 | { | 38 | { |
39 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
40 | |||
38 | // The only thing that should register for this event is the InnerScene | 41 | // The only thing that should register for this event is the InnerScene |
39 | // Anything else could cause problems. | 42 | // Anything else could cause problems. |
40 | 43 | ||
@@ -92,7 +95,7 @@ namespace OpenSim.Region.Physics.Manager | |||
92 | 95 | ||
93 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) | 96 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) |
94 | { | 97 | { |
95 | MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : AddAvatar({0})", position); | 98 | m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : AddAvatar({0})", position)); |
96 | return PhysicsActor.Null; | 99 | return PhysicsActor.Null; |
97 | } | 100 | } |
98 | 101 | ||
@@ -107,7 +110,7 @@ namespace OpenSim.Region.Physics.Manager | |||
107 | /* | 110 | /* |
108 | public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation) | 111 | public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation) |
109 | { | 112 | { |
110 | MainLog.Instance.Verbose("NullPhysicsScene : AddPrim({0},{1})", position, size); | 113 | m_log.Info(String.Format("NullPhysicsScene : AddPrim({0},{1})", position, size)); |
111 | return PhysicsActor.Null; | 114 | return PhysicsActor.Null; |
112 | } | 115 | } |
113 | */ | 116 | */ |
@@ -121,7 +124,7 @@ namespace OpenSim.Region.Physics.Manager | |||
121 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, | 124 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, |
122 | PhysicsVector size, Quaternion rotation, bool isPhysical) | 125 | PhysicsVector size, Quaternion rotation, bool isPhysical) |
123 | { | 126 | { |
124 | MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : AddPrim({0},{1})", position, size); | 127 | m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size)); |
125 | return PhysicsActor.Null; | 128 | return PhysicsActor.Null; |
126 | } | 129 | } |
127 | 130 | ||
@@ -131,20 +134,19 @@ namespace OpenSim.Region.Physics.Manager | |||
131 | 134 | ||
132 | public override float Simulate(float timeStep) | 135 | public override float Simulate(float timeStep) |
133 | { | 136 | { |
134 | m_workIndicator = (m_workIndicator + 1)%10; | 137 | m_workIndicator = (m_workIndicator + 1) % 10; |
135 | 138 | ||
136 | //MainLog.Instance.SetStatus(m_workIndicator.ToString()); | ||
137 | return 0f; | 139 | return 0f; |
138 | } | 140 | } |
139 | 141 | ||
140 | public override void GetResults() | 142 | public override void GetResults() |
141 | { | 143 | { |
142 | MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : GetResults()"); | 144 | m_log.Info("[PHYSICS]: NullPhysicsScene : GetResults()"); |
143 | } | 145 | } |
144 | 146 | ||
145 | public override void SetTerrain(float[] heightMap) | 147 | public override void SetTerrain(float[] heightMap) |
146 | { | 148 | { |
147 | MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length); | 149 | m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : SetTerrain({0} items)", heightMap.Length)); |
148 | } | 150 | } |
149 | 151 | ||
150 | public override void DeleteTerrain() | 152 | public override void DeleteTerrain() |