*Fixed bug that caused failure when System.Console.Readline returns null (no stdin)

*Fixed bug that would crash the simulator if there were two physics/meshing engines loaded with the same name.
0.6.0-stable
mingchen 2008-06-09 15:20:08 +00:00
parent c3292a9afa
commit db151bcec7
2 changed files with 20 additions and 6 deletions

View File

@ -230,7 +230,14 @@ namespace OpenSim.Framework.Console
{
try
{
return System.Console.ReadLine();
string line = System.Console.ReadLine();
while(line == null)
{
line = System.Console.ReadLine();
}
return line;
}
catch (Exception e)
{
@ -358,6 +365,7 @@ namespace OpenSim.Framework.Console
{
string tempstr = CmdPrompt(m_componentName + "# ");
RunCommand(tempstr);
}
public void RunCommand(string cmdline)

View File

@ -130,9 +130,12 @@ namespace OpenSim.Region.Physics.Manager
IPhysicsPlugin plug =
(IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Init();
if(!_PhysPlugins.ContainsKey(plug.GetName()))
{
_PhysPlugins.Add(plug.GetName(), plug);
m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName());
}
}
Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true);
@ -140,9 +143,12 @@ namespace OpenSim.Region.Physics.Manager
{
IMeshingPlugin plug =
(IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
if(!_MeshPlugins.ContainsKey(plug.GetName()))
{
_MeshPlugins.Add(plug.GetName(), plug);
m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName());
}
}
physTypeInterface = null;
meshTypeInterface = null;