minor: Make wind console commands print out to console rather than log
parent
0875050161
commit
5ddd818238
|
@ -216,13 +216,13 @@ namespace OpenSim.Region.CoreModules
|
||||||
// FIXME: If console region is root then this will be printed by every module. Currently, there is no
|
// FIXME: If console region is root then this will be printed by every module. Currently, there is no
|
||||||
// way to prevent this, short of making the entire module shared (which is complete overkill).
|
// way to prevent this, short of making the entire module shared (which is complete overkill).
|
||||||
// One possibility is to return a bool to signal whether the module has completely handled the command
|
// One possibility is to return a bool to signal whether the module has completely handled the command
|
||||||
m_log.InfoFormat("[WIND]: Please change to a specific region in order to set Sun parameters.");
|
MainConsole.Instance.Output("Please change to a specific region in order to set Sun parameters.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_scene.ConsoleScene() != m_scene)
|
if (m_scene.ConsoleScene() != m_scene)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND]: Console Scene is not my scene.");
|
MainConsole.Instance.Output("Console Scene is not my scene.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,9 @@ namespace OpenSim.Region.CoreModules
|
||||||
private void HandleConsoleCommand(string module, string[] cmdparams)
|
private void HandleConsoleCommand(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
ValidateConsole();
|
ValidateConsole();
|
||||||
m_log.Info("[WIND] The wind command can be used to change the currently active wind model plugin and update the parameters for wind plugins.");
|
|
||||||
|
MainConsole.Instance.Output(
|
||||||
|
"The wind command can be used to change the currently active wind model plugin and update the parameters for wind plugins.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -246,7 +248,9 @@ namespace OpenSim.Region.CoreModules
|
||||||
if ((cmdparams.Length != 4)
|
if ((cmdparams.Length != 4)
|
||||||
|| !cmdparams[1].Equals("base"))
|
|| !cmdparams[1].Equals("base"))
|
||||||
{
|
{
|
||||||
m_log.Info("[WIND] Invalid parameters to change parameters for Wind module base, usage: wind base <parameter> <value>");
|
MainConsole.Instance.Output(
|
||||||
|
"Invalid parameters to change parameters for Wind module base, usage: wind base <parameter> <value>");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,7 +265,9 @@ namespace OpenSim.Region.CoreModules
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND] Invalid value {0} specified for {1}", cmdparams[3], cmdparams[2]);
|
MainConsole.Instance.OutputFormat(
|
||||||
|
"Invalid value {0} specified for {1}", cmdparams[3], cmdparams[2]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,22 +277,23 @@ namespace OpenSim.Region.CoreModules
|
||||||
|
|
||||||
if (desiredPlugin.Equals(m_activeWindPlugin.Name))
|
if (desiredPlugin.Equals(m_activeWindPlugin.Name))
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND] Wind model plugin {0} is already active", cmdparams[3]);
|
MainConsole.Instance.OutputFormat("Wind model plugin {0} is already active", cmdparams[3]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_availableWindPlugins.ContainsKey(desiredPlugin))
|
if (m_availableWindPlugins.ContainsKey(desiredPlugin))
|
||||||
{
|
{
|
||||||
m_activeWindPlugin = m_availableWindPlugins[cmdparams[3]];
|
m_activeWindPlugin = m_availableWindPlugins[cmdparams[3]];
|
||||||
m_log.InfoFormat("[WIND] {0} wind model plugin now active", m_activeWindPlugin.Name);
|
|
||||||
|
MainConsole.Instance.OutputFormat("{0} wind model plugin now active", m_activeWindPlugin.Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND] Could not find wind model plugin {0}", desiredPlugin);
|
MainConsole.Instance.OutputFormat("Could not find wind model plugin {0}", desiredPlugin);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -300,7 +307,7 @@ namespace OpenSim.Region.CoreModules
|
||||||
if ((cmdparams.Length != 4)
|
if ((cmdparams.Length != 4)
|
||||||
&& (cmdparams.Length != 3))
|
&& (cmdparams.Length != 3))
|
||||||
{
|
{
|
||||||
m_log.Info("[WIND] Usage: wind <plugin> <param> [value]");
|
MainConsole.Instance.Output("Usage: wind <plugin> <param> [value]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +318,7 @@ namespace OpenSim.Region.CoreModules
|
||||||
{
|
{
|
||||||
if (!float.TryParse(cmdparams[3], out value))
|
if (!float.TryParse(cmdparams[3], out value))
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND] Invalid value {0}", cmdparams[3]);
|
MainConsole.Instance.OutputFormat("Invalid value {0}", cmdparams[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -320,7 +327,7 @@ namespace OpenSim.Region.CoreModules
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND] {0}", e.Message);
|
MainConsole.Instance.OutputFormat("{0}", e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -328,11 +335,11 @@ namespace OpenSim.Region.CoreModules
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
value = WindParamGet(plugin, param);
|
value = WindParamGet(plugin, param);
|
||||||
m_log.InfoFormat("[WIND] {0} : {1}", param, value);
|
MainConsole.Instance.OutputFormat("{0} : {1}", param, value);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[WIND] {0}", e.Message);
|
MainConsole.Instance.OutputFormat("{0}", e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue