Massive console refactor. Greatly simplify interface.

0.9.1.0-post-fixes
Melanie 2019-08-20 23:28:59 +01:00
parent f7a496136d
commit 0fd17c08ae
56 changed files with 430 additions and 453 deletions

2
OpenSim/Addons/Groups/GroupsMessagingModule.cs Normal file → Executable file
View File

@ -252,7 +252,7 @@ namespace OpenSim.Groups
m_debugEnabled = verbose;
MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
MainConsole.Instance.Output("{0} verbose logging set to {1}", null, Name, m_debugEnabled);
}
/// <summary>

2
OpenSim/Addons/Groups/GroupsModule.cs Normal file → Executable file
View File

@ -127,7 +127,7 @@ namespace OpenSim.Groups
m_debugEnabled = verbose;
MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
MainConsole.Instance.Output("{0} verbose logging set to {1}", null, Name, m_debugEnabled);
}
public void RegionLoaded(Scene scene)

4
OpenSim/Framework/ConfigurationMember.cs Normal file → Executable file
View File

@ -262,14 +262,14 @@ namespace OpenSim.Framework
if (configurationDescription.Trim() != String.Empty)
{
console_result =
MainConsole.Instance.CmdPrompt(
MainConsole.Instance.Prompt(
configurationDescription + ": " + configOption.configurationQuestion,
configOption.configurationDefault);
}
else
{
console_result =
MainConsole.Instance.CmdPrompt(configOption.configurationQuestion,
MainConsole.Instance.Prompt(configOption.configurationQuestion,
configOption.configurationDefault);
}
}

View File

@ -35,13 +35,13 @@ using log4net;
namespace OpenSim.Framework.Console
{
public class ConsoleBase
public class ConsoleBase : IConsole
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected string prompt = "# ";
public object ConsoleScene { get; set; }
public IScene ConsoleScene { get; set; }
public string DefaultPrompt { get; set; }
@ -58,78 +58,39 @@ namespace OpenSim.Framework.Console
{
}
public virtual void Output(string text, string level)
public virtual void Output(string format, string level = null, params object[] components)
{
Output(text);
System.Console.WriteLine(format, components);
}
public virtual void Output(string text)
{
System.Console.WriteLine(text);
}
public virtual void OutputFormat(string format, params object[] components)
{
Output(string.Format(format, components));
}
public string CmdPrompt(string p)
{
return ReadLine(String.Format("{0}: ", p), false, true);
}
public string CmdPrompt(string p, string def)
{
string ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, true);
if (ret == String.Empty)
ret = def;
return ret;
}
public string CmdPrompt(string p, List<char> excludedCharacters)
public virtual string Prompt(string p, string def = null, List<char> excludedCharacters = null, bool echo = true)
{
bool itisdone = false;
string ret = String.Empty;
while (!itisdone)
{
itisdone = true;
ret = CmdPrompt(p);
foreach (char c in excludedCharacters)
{
if (ret.Contains(c.ToString()))
{
System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted.");
itisdone = false;
}
}
}
if (def != null)
ret = ReadLine(String.Format("{0}: ", p), false, echo);
else
ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, echo);
return ret;
}
public string CmdPrompt(string p, string def, List<char> excludedCharacters)
{
bool itisdone = false;
string ret = String.Empty;
while (!itisdone)
{
itisdone = true;
ret = CmdPrompt(p, def);
if (ret == String.Empty)
if (ret == String.Empty && def != null)
{
ret = def;
}
else
{
foreach (char c in excludedCharacters)
if (excludedCharacters != null)
{
if (ret.Contains(c.ToString()))
foreach (char c in excludedCharacters)
{
System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted.");
itisdone = false;
if (ret.Contains(c.ToString()))
{
System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted.");
itisdone = false;
}
}
}
}
@ -139,14 +100,14 @@ namespace OpenSim.Framework.Console
}
// Displays a command prompt and returns a default value, user may only enter 1 of 2 options
public string CmdPrompt(string prompt, string defaultresponse, List<string> options)
public virtual string Prompt(string prompt, string defaultresponse, List<string> options)
{
bool itisdone = false;
string optstr = String.Empty;
foreach (string s in options)
optstr += " " + s;
string temp = CmdPrompt(prompt, defaultresponse);
string temp = Prompt(prompt, defaultresponse);
while (itisdone == false)
{
if (options.Contains(temp))
@ -156,19 +117,12 @@ namespace OpenSim.Framework.Console
else
{
System.Console.WriteLine("Valid options are" + optstr);
temp = CmdPrompt(prompt, defaultresponse);
temp = Prompt(prompt, defaultresponse);
}
}
return temp;
}
// Displays a prompt and waits for the user to enter a string, then returns that string
// (Done with no echo and suitable for passwords)
public string PasswdPrompt(string p)
{
return ReadLine(String.Format("{0}: ", p), false, false);
}
public virtual string ReadLine(string p, bool isCommand, bool e)
{
System.Console.Write("{0}", p);

20
OpenSim/Framework/Console/ConsoleUtil.cs Normal file → Executable file
View File

@ -75,7 +75,7 @@ namespace OpenSim.Framework.Console
{
if (File.Exists(path))
{
console.OutputFormat("File {0} already exists. Please move or remove it.", path);
console.Output("File {0} already exists. Please move or remove it.", null, path);
return false;
}
@ -97,7 +97,7 @@ namespace OpenSim.Framework.Console
if (!UUID.TryParse(rawUuid, out uuid))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid uuid", rawUuid);
console.Output("ERROR: {0} is not a valid uuid", null, rawUuid);
return false;
}
@ -110,7 +110,7 @@ namespace OpenSim.Framework.Console
if (!uint.TryParse(rawLocalId, out localId))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid local id", localId);
console.Output("ERROR: {0} is not a valid local id", null, localId);
return false;
}
@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console
if (localId == 0)
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid local id - it must be greater than 0", localId);
console.Output("ERROR: {0} is not a valid local id - it must be greater than 0", null, localId);
return false;
}
@ -150,7 +150,7 @@ namespace OpenSim.Framework.Console
}
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid UUID or local id", rawId);
console.Output("ERROR: {0} is not a valid UUID or local id", null, rawId);
return false;
}
@ -167,7 +167,7 @@ namespace OpenSim.Framework.Console
if (!bool.TryParse(rawConsoleString, out b))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a true or false value", rawConsoleString);
console.Output("ERROR: {0} is not a true or false value", null, rawConsoleString);
return false;
}
@ -187,7 +187,7 @@ namespace OpenSim.Framework.Console
if (!int.TryParse(rawConsoleInt, out i))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid integer", rawConsoleInt);
console.Output("ERROR: {0} is not a valid integer", null, rawConsoleInt);
return false;
}
@ -207,7 +207,7 @@ namespace OpenSim.Framework.Console
if (!float.TryParse(rawConsoleInput, out i))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid float", rawConsoleInput);
console.Output("ERROR: {0} is not a valid float", null, rawConsoleInput);
return false;
}
@ -227,7 +227,7 @@ namespace OpenSim.Framework.Console
if (!double.TryParse(rawConsoleInput, out i))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a valid double", rawConsoleInput);
console.Output("ERROR: {0} is not a valid double", null, rawConsoleInput);
return false;
}
@ -249,7 +249,7 @@ namespace OpenSim.Framework.Console
if (i < 0)
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a positive integer", rawConsoleInt);
console.Output("ERROR: {0} is not a positive integer", null, rawConsoleInt);
return false;
}

15
OpenSim/Framework/Console/LocalConsole.cs Normal file → Executable file
View File

@ -359,7 +359,7 @@ namespace OpenSim.Framework.Console
{
string outText = text;
if (level != LOGLEVEL_NONE)
if (level != null)
{
MatchCollection matches = m_categoryRegex.Matches(text);
@ -389,20 +389,15 @@ namespace OpenSim.Framework.Console
System.Console.WriteLine();
}
public override void Output(string text)
public override void Output(string format, string level = null, params object[] components)
{
Output(text, LOGLEVEL_NONE);
}
public override void Output(string text, string level)
{
FireOnOutput(text);
FireOnOutput(format);
lock (m_commandLine)
{
if (m_cursorYPosition == -1)
{
WriteLocalText(text, level);
WriteLocalText(format, level);
return;
}
@ -418,7 +413,7 @@ namespace OpenSim.Framework.Console
m_cursorYPosition = SetCursorTop(m_cursorYPosition);
SetCursorLeft(0);
WriteLocalText(text, level);
WriteLocalText(format, level);
m_cursorYPosition = System.Console.CursorTop;

14
OpenSim/Framework/Console/MockConsole.cs Normal file → Executable file
View File

@ -56,21 +56,17 @@ namespace OpenSim.Framework.Console
public string ReadLine(string p, bool isCommand, bool e) { return ""; }
public object ConsoleScene {
public IScene ConsoleScene {
get { return null; }
set {}
}
public void Output(string text, string level) {}
public void Output(string text) {}
public void OutputFormat(string format, params object[] components) {}
public void Output(string format, string level, params object[] components) {}
public string CmdPrompt(string p) { return ""; }
public string CmdPrompt(string p, string def) { return ""; }
public string CmdPrompt(string p, List<char> excludedCharacters) { return ""; }
public string CmdPrompt(string p, string def, List<char> excludedCharacters) { return ""; }
public string Prompt(string p) { return ""; }
public string Prompt(string p, string def, List<char> excludedCharacters, bool echo) { return ""; }
public string CmdPrompt(string prompt, string defaultresponse, List<string> options) { return ""; }
public string Prompt(string prompt, string defaultresponse, List<string> options) { return ""; }
public string PasswdPrompt(string p) { return ""; }
}

16
OpenSim/Framework/Console/RemoteConsole.cs Normal file → Executable file
View File

@ -188,13 +188,19 @@ namespace OpenSim.Framework.Console
m_Server.AddHTTPHandler("/SessionCommand/", HandleHttpSessionCommand);
}
public override void Output(string text, string level)
public override void Output(string format, string level = null, params object[] components)
{
Output(text, level, false, false, false);
if (components.Length == 0)
Output(format, level, false, false, false);
else
Output(String.Format(format, components), level, false, false, false);
}
protected void Output(string text, string level, bool isPrompt, bool isCommand, bool isInput)
{
if (level == null)
level = String.Empty;
// Increment the line number. It was 0 and they start at 1
// so we need to pre-increment.
m_lineNumber++;
@ -228,12 +234,6 @@ namespace OpenSim.Framework.Console
System.Console.WriteLine(text.Trim());
}
public override void Output(string text)
{
// Output plain (non-logging style) text.
Output(text, String.Empty, false, false, false);
}
public override string ReadLine(string p, bool isCommand, bool e)
{
// Output the prompt an prepare to wait. This

17
OpenSim/Framework/IConsole.cs Normal file → Executable file
View File

@ -32,22 +32,13 @@ namespace OpenSim.Framework
{
public interface IConsole
{
object ConsoleScene { get; set; }
IScene ConsoleScene { get; set; }
void Output(string text, string level);
void Output(string text);
void OutputFormat(string format, params object[] components);
void Output(string format, string level = null, params object[] components);
string CmdPrompt(string p);
string CmdPrompt(string p, string def);
string CmdPrompt(string p, List<char> excludedCharacters);
string CmdPrompt(string p, string def, List<char> excludedCharacters);
string Prompt(string p, string def = null, List<char> excludedCharacters = null, bool echo = true);
// Displays a command prompt and returns a default value, user may only enter 1 of 2 options
string CmdPrompt(string prompt, string defaultresponse, List<string> options);
// Displays a prompt and waits for the user to enter a string, then returns that string
// (Done with no echo and suitable for passwords)
string PasswdPrompt(string p);
string Prompt(string prompt, string defaultresponse, List<string> options);
}
}

2
OpenSim/Framework/Monitoring/ChecksManager.cs Normal file → Executable file
View File

@ -88,7 +88,7 @@ namespace OpenSim.Framework.Monitoring
con.Output("check categories available are:");
foreach (string category in RegisteredChecks.Keys)
con.OutputFormat(" {0}", category);
con.Output(" {0}", null, category);
}
// else
// {

4
OpenSim/Framework/Monitoring/StatsLogger.cs Normal file → Executable file
View File

@ -79,7 +79,7 @@ namespace OpenSim.Framework.Monitoring
if (cmd[2] == "start")
{
Start();
con.OutputFormat("Now recording all stats to file every {0}ms", m_statsLogIntervalMs);
con.Output("Now recording all stats to file every {0}ms", null, m_statsLogIntervalMs);
}
else if (cmd[2] == "stop")
{
@ -106,7 +106,7 @@ namespace OpenSim.Framework.Monitoring
sw.WriteLine(line);
}
MainConsole.Instance.OutputFormat("Stats saved to file {0}", path);
MainConsole.Instance.Output("Stats saved to file {0}", null, path);
}
public static void Start()

10
OpenSim/Framework/Monitoring/StatsManager.cs Normal file → Executable file
View File

@ -117,14 +117,14 @@ namespace OpenSim.Framework.Monitoring
{
con.Output("Statistic categories available are:");
foreach (string category in RegisteredStats.Keys)
con.OutputFormat(" {0}", category);
con.Output(" {0}", null, category);
}
else
{
SortedDictionary<string, SortedDictionary<string, Stat>> category;
if (!RegisteredStats.TryGetValue(categoryName, out category))
{
con.OutputFormat("No such category as {0}", categoryName);
con.Output("No such category as {0}", null, categoryName);
}
else
{
@ -150,14 +150,14 @@ namespace OpenSim.Framework.Monitoring
}
else
{
con.OutputFormat(
"No such stat {0} in {1}.{2}", statName, categoryName, containerName);
con.Output(
"No such stat {0} in {1}.{2}", null, statName, categoryName, containerName);
}
}
}
else
{
con.OutputFormat("No such container {0} in category {1}", containerName, categoryName);
con.Output("No such container {0} in category {1}", null, containerName, categoryName);
}
}
}

18
OpenSim/Framework/Monitoring/WorkManager.cs Normal file → Executable file
View File

@ -215,23 +215,23 @@ namespace OpenSim.Framework.Monitoring
if (subCommand == "stop")
{
JobEngine.Stop();
MainConsole.Instance.OutputFormat("Stopped job engine.");
MainConsole.Instance.Output("Stopped job engine.");
}
else if (subCommand == "start")
{
JobEngine.Start();
MainConsole.Instance.OutputFormat("Started job engine.");
MainConsole.Instance.Output("Started job engine.");
}
else if (subCommand == "status")
{
MainConsole.Instance.OutputFormat("Job engine running: {0}", JobEngine.IsRunning);
MainConsole.Instance.Output("Job engine running: {0}", null, JobEngine.IsRunning);
JobEngine.Job job = JobEngine.CurrentJob;
MainConsole.Instance.OutputFormat("Current job {0}", job != null ? job.Name : "none");
MainConsole.Instance.Output("Current job {0}", null, job != null ? job.Name : "none");
MainConsole.Instance.OutputFormat(
"Jobs waiting: {0}", JobEngine.IsRunning ? JobEngine.JobsWaiting.ToString() : "n/a");
MainConsole.Instance.OutputFormat("Log Level: {0}", JobEngine.LogLevel);
MainConsole.Instance.Output(
"Jobs waiting: {0}", null, JobEngine.IsRunning ? JobEngine.JobsWaiting.ToString() : "n/a");
MainConsole.Instance.Output("Log Level: {0}", null, JobEngine.LogLevel);
}
else if (subCommand == "log")
{
@ -246,12 +246,12 @@ namespace OpenSim.Framework.Monitoring
// if (ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out logLevel))
// {
JobEngine.LogLevel = logLevel;
MainConsole.Instance.OutputFormat("Set debug log level to {0}", JobEngine.LogLevel);
MainConsole.Instance.Output("Set debug log level to {0}", null, JobEngine.LogLevel);
// }
}
else
{
MainConsole.Instance.OutputFormat("Unrecognized job engine subcommand {0}", subCommand);
MainConsole.Instance.Output("Unrecognized job engine subcommand {0}", null, subCommand);
}
}
}

6
OpenSim/Framework/PluginManager.cs Normal file → Executable file
View File

@ -129,7 +129,7 @@ namespace OpenSim.Framework
}
Addin addin = addins[ndx];
MainConsole.Instance.OutputFormat("Uninstalling plugin {0}", addin.Id);
MainConsole.Instance.Output("Uninstalling plugin {0}", null, addin.Id);
AddinManager.Registry.DisableAddin(addin.Id);
addin.Enabled = false;
IProgressStatus ps = new ConsoleProgressStatus(false);
@ -487,7 +487,7 @@ namespace OpenSim.Framework
}
else
{
MainConsole.Instance.OutputFormat("Not Enabled in this domain {0}", addin.Name);
MainConsole.Instance.Output("Not Enabled in this domain {0}", null, addin.Name);
}
return;
}
@ -503,7 +503,7 @@ namespace OpenSim.Framework
foreach (Addin addin in addins)
{
MainConsole.Instance.OutputFormat("Addin {0}", addin.Name);
MainConsole.Instance.Output("Addin {0}", null, addin.Name);
}
}

14
OpenSim/Framework/RegionInfo.cs Normal file → Executable file
View File

@ -528,7 +528,7 @@ namespace OpenSim.Framework
{
while (name.Trim() == string.Empty)
{
name = MainConsole.Instance.CmdPrompt("New region name", name);
name = MainConsole.Instance.Prompt("New region name", name);
if (name.Trim() == string.Empty)
{
MainConsole.Instance.Output("Cannot interactively create region with no name");
@ -570,7 +570,7 @@ namespace OpenSim.Framework
UUID newID = UUID.Random();
while (RegionID == UUID.Zero)
{
regionUUID = MainConsole.Instance.CmdPrompt("RegionUUID", newID.ToString());
regionUUID = MainConsole.Instance.Prompt("RegionUUID", newID.ToString());
if (!UUID.TryParse(regionUUID.Trim(), out RegionID))
{
MainConsole.Instance.Output("RegionUUID must be a valid UUID");
@ -587,7 +587,7 @@ namespace OpenSim.Framework
string location = config.GetString("Location", String.Empty);
if (location == String.Empty)
{
location = MainConsole.Instance.CmdPrompt("Region Location", "1000,1000");
location = MainConsole.Instance.Prompt("Region Location", "1000,1000");
config.Set("Location", location);
}
@ -623,7 +623,7 @@ namespace OpenSim.Framework
}
else
{
address = IPAddress.Parse(MainConsole.Instance.CmdPrompt("Internal IP address", "0.0.0.0"));
address = IPAddress.Parse(MainConsole.Instance.Prompt("Internal IP address", "0.0.0.0"));
config.Set("InternalAddress", address.ToString());
}
@ -637,7 +637,7 @@ namespace OpenSim.Framework
}
else
{
port = Convert.ToInt32(MainConsole.Instance.CmdPrompt("Internal port", "9000"));
port = Convert.ToInt32(MainConsole.Instance.Prompt("Internal port", "9000"));
config.Set("InternalPort", port);
}
m_internalEndPoint = new IPEndPoint(address, port);
@ -652,7 +652,7 @@ namespace OpenSim.Framework
else
{
if (creatingNew)
m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False"));
m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.Prompt("Resolve hostname to IP on start (for running inside Docker)", "False"));
config.Set("ResolveAddress", m_resolveAddress.ToString());
}
@ -667,7 +667,7 @@ namespace OpenSim.Framework
}
else
{
externalName = MainConsole.Instance.CmdPrompt("External host name", "SYSTEMIP");
externalName = MainConsole.Instance.Prompt("External host name", "SYSTEMIP");
config.Set("ExternalHostName", externalName);
}
if (externalName == "SYSTEMIP")

12
OpenSim/Framework/Servers/MainServer.cs Normal file → Executable file
View File

@ -192,35 +192,35 @@ namespace OpenSim.Framework.Servers
if (!int.TryParse(rawNewDebug, out newDebug))
{
MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawNewDebug);
MainConsole.Instance.Output("{0} is not a valid debug level", null, rawNewDebug);
return;
}
if (newDebug < 0 || newDebug > 6)
{
MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0..6", newDebug);
MainConsole.Instance.Output("{0} is outside the valid debug level range of 0..6", null, newDebug);
return;
}
if (allReqs || inReqs)
{
MainServer.DebugLevel = newDebug;
MainConsole.Instance.OutputFormat("IN debug level set to {0}", newDebug);
MainConsole.Instance.Output("IN debug level set to {0}", null, newDebug);
}
if (allReqs || outReqs)
{
WebUtil.DebugLevel = newDebug;
MainConsole.Instance.OutputFormat("OUT debug level set to {0}", newDebug);
MainConsole.Instance.Output("OUT debug level set to {0}", null, newDebug);
}
}
else
{
if (allReqs || inReqs)
MainConsole.Instance.OutputFormat("Current IN debug level is {0}", MainServer.DebugLevel);
MainConsole.Instance.Output("Current IN debug level is {0}", null, DebugLevel);
if (allReqs || outReqs)
MainConsole.Instance.OutputFormat("Current OUT debug level is {0}", WebUtil.DebugLevel);
MainConsole.Instance.Output("Current OUT debug level is {0}", null, WebUtil.DebugLevel);
}
}

12
OpenSim/Framework/Servers/ServerBase.cs Normal file → Executable file
View File

@ -492,18 +492,18 @@ namespace OpenSim.Framework.Servers
if (!int.TryParse(rawLevel, out newLevel))
{
MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawLevel);
MainConsole.Instance.Output("{0} is not a valid debug level", null, rawLevel);
return;
}
if (newLevel < 0 || newLevel > Util.MAX_THREADPOOL_LEVEL)
{
MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0.." + Util.MAX_THREADPOOL_LEVEL, newLevel);
MainConsole.Instance.Output("{0} is outside the valid debug level range of 0.." + Util.MAX_THREADPOOL_LEVEL, null, newLevel);
return;
}
Util.LogThreadPool = newLevel;
MainConsole.Instance.OutputFormat("LogThreadPool set to {0}", newLevel);
MainConsole.Instance.Output("LogThreadPool set to {0}", null, newLevel);
}
private void HandleForceGc(string module, string[] args)
@ -991,9 +991,9 @@ namespace OpenSim.Framework.Servers
}
if (Watchdog.AbortThread(threadId))
MainConsole.Instance.OutputFormat("Aborted thread with id {0}", threadId);
MainConsole.Instance.Output("Aborted thread with id {0}", null, threadId);
else
MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId);
MainConsole.Instance.Output("ERROR - Thread with id {0} not found in managed threads", null, threadId);
}
/// <summary>
@ -1020,7 +1020,7 @@ namespace OpenSim.Framework.Servers
protected void Notice(string format, params object[] components)
{
if (m_console != null)
m_console.OutputFormat(format, components);
m_console.Output(format, null, components);
}
public virtual void Shutdown()

10
OpenSim/Region/Application/OpenSim.cs Normal file → Executable file
View File

@ -782,8 +782,8 @@ namespace OpenSim
Scene existingScene;
if (SceneManager.TryGetScene(regInfo.RegionID, out existingScene))
{
MainConsole.Instance.OutputFormat(
"ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}",
MainConsole.Instance.Output(
"ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}", null,
regInfo.RegionName, regInfo.RegionID, existingScene.RegionInfo.RegionName);
return;
@ -980,7 +980,7 @@ namespace OpenSim
SceneManager.ForEachSelectedScene(
scene =>
{
MainConsole.Instance.OutputFormat("Loaded region modules in {0} are:", scene.Name);
MainConsole.Instance.Output("Loaded region modules in {0} are:", null, scene.Name);
List<IRegionModuleBase> sharedModules = new List<IRegionModuleBase>();
List<IRegionModuleBase> nonSharedModules = new List<IRegionModuleBase>();
@ -994,10 +994,10 @@ namespace OpenSim
}
foreach (IRegionModuleBase module in sharedModules.OrderBy(m => m.Name))
MainConsole.Instance.OutputFormat("New Region Module (Shared): {0}", module.Name);
MainConsole.Instance.Output("New Region Module (Shared): {0}", null, module.Name);
foreach (IRegionModuleBase module in nonSharedModules.OrderBy(m => m.Name))
MainConsole.Instance.OutputFormat("New Region Module (Non-Shared): {0}", module.Name);
MainConsole.Instance.Output("New Region Module (Non-Shared): {0}", null, module.Name);
}
);

20
OpenSim/Region/Application/OpenSimBase.cs Normal file → Executable file
View File

@ -593,14 +593,14 @@ namespace OpenSim
estateOwnerPassword = Config.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null);
}
MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
MainConsole.Instance.Output("Estate {0} has no owner set.", null, regionInfo.EstateSettings.EstateName);
List<char> excluded = new List<char>(new char[1]{' '});
if (estateOwnerFirstName == null || estateOwnerLastName == null)
{
estateOwnerFirstName = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
estateOwnerLastName = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
estateOwnerFirstName = MainConsole.Instance.Prompt("Estate owner first name", "Test", excluded);
estateOwnerLastName = MainConsole.Instance.Prompt("Estate owner last name", "User", excluded);
}
UserAccount account
@ -624,13 +624,13 @@ namespace OpenSim
if (scene.UserAccountService is UserAccountService)
{
if (estateOwnerPassword == null)
estateOwnerPassword = MainConsole.Instance.PasswdPrompt("Password");
estateOwnerPassword = MainConsole.Instance.Prompt("Password", null, null, false);
if (estateOwnerEMail == null)
estateOwnerEMail = MainConsole.Instance.CmdPrompt("Email");
estateOwnerEMail = MainConsole.Instance.Prompt("Email");
if (rawEstateOwnerUuid == null)
rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
rawEstateOwnerUuid = MainConsole.Instance.Prompt("User ID", UUID.Random().ToString());
UUID estateOwnerUuid = UUID.Zero;
if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid))
@ -999,11 +999,11 @@ namespace OpenSim
if (!string.IsNullOrEmpty(estateName))
newName = estateName;
else
newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
newName = MainConsole.Instance.Prompt("New estate name", regInfo.EstateSettings.EstateName);
if (estatesByName.ContainsKey(newName))
{
MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
MainConsole.Instance.Output("An estate named {0} already exists. Please try again.", null, newName);
return false;
}
@ -1086,7 +1086,7 @@ namespace OpenSim
else
{
string response
= MainConsole.Instance.CmdPrompt(
= MainConsole.Instance.Prompt(
string.Format(
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
"yes",
@ -1103,7 +1103,7 @@ namespace OpenSim
{
string[] estateNames = estatesByName.Keys.ToArray();
response
= MainConsole.Instance.CmdPrompt(
= MainConsole.Instance.Prompt(
string.Format(
"Name of estate to join. Existing estate names are ({0})",
string.Join(", ", estateNames)),

View File

@ -150,26 +150,27 @@ namespace OpenSim.Region.ClientStack.Linden
if (!(args.Length == 3 && int.TryParse(args[2], out debugLevel)))
{
MainConsole.Instance.OutputFormat("Usage: debug eq [0|1|2]");
MainConsole.Instance.Output("Usage: debug eq [0|1|2]");
}
else
{
DebugLevel = debugLevel;
MainConsole.Instance.OutputFormat(
"Set event queue debug level to {0} in {1}", DebugLevel, m_scene.RegionInfo.RegionName);
MainConsole.Instance.Output(
"Set event queue debug level to {0} in {1}", null, DebugLevel, m_scene.RegionInfo.RegionName);
}
}
protected void HandleShowEq(string module, string[] args)
{
MainConsole.Instance.OutputFormat("For scene {0}", m_scene.Name);
MainConsole.Instance.Output("For scene {0}", null, m_scene.Name);
lock (queues)
{
foreach (KeyValuePair<UUID, Queue<OSD>> kvp in queues)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"For agent {0} there are {1} messages queued for send.",
null,
kvp.Key, kvp.Value.Count);
}
}

View File

@ -222,7 +222,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
return;
m_console.OutputFormat("Throttles for {0}", m_udpServer.Scene.Name);
m_console.Output("Throttles for {0}", null, m_udpServer.Scene.Name);
ConsoleDisplayList cdl = new ConsoleDisplayList();
cdl.AddRow("Adaptive throttles", m_udpServer.ThrottleRates.AdaptiveThrottlesEnabled);
@ -238,7 +238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_console.Output(cdl.ToString());
m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer));
m_console.Output("{0}\n", null, GetServerThrottlesReport(m_udpServer));
}
private string GetServerThrottlesReport(LLUDPServer udpServer)
@ -297,7 +297,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (args.Length != 7)
{
MainConsole.Instance.OutputFormat("Usage: debug lludp data out <true|false> <avatar-first-name> <avatar-last-name>");
MainConsole.Instance.Output("Usage: debug lludp data out <true|false> <avatar-first-name> <avatar-last-name>");
return;
}
@ -312,8 +312,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (sp.Firstname == firstName && sp.Lastname == lastName)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Data debug for {0} ({1}) set to {2} in {3}",
null,
sp.Name, sp.IsChildAgent ? "child" : "root", level, m_udpServer.Scene.Name);
((LLClientView)sp.ControllingClient).UDPClient.DebugDataOutLevel = level;
@ -331,7 +332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (!all && !one)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Usage: debug lludp throttles log <level> [<avatar-first-name> <avatar-last-name>]");
return;
}
@ -353,8 +354,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Throttle log level for {0} ({1}) set to {2} in {3}",
null,
sp.Name, sp.IsChildAgent ? "child" : "root", level, m_udpServer.Scene.Name);
((LLClientView)sp.ControllingClient).UDPClient.ThrottleDebugLevel = level;
@ -372,7 +374,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (!all && !one)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Usage: debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]");
return;
}
@ -399,8 +401,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Setting param {0} to {1} for {2} ({3}) in {4}",
null,
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
@ -422,8 +425,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Setting param {0} to {1} for {2} ({3}) in {4}",
null,
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
@ -443,8 +447,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Setting param {0} to {1} for {2} ({3}) in {4}",
null,
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
@ -464,7 +469,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (!all && !one)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Usage: debug lludp throttles get [<avatar-first-name> <avatar-last-name>]");
return;
}
@ -482,8 +487,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
{
m_console.OutputFormat(
m_console.Output(
"Status for {0} ({1}) in {2}",
null,
sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
@ -504,7 +510,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
return;
m_console.OutputFormat("Debug settings for {0}", m_udpServer.Scene.Name);
m_console.Output("Debug settings for {0}", null, m_udpServer.Scene.Name);
ConsoleDisplayList cdl = new ConsoleDisplayList();
long maxSceneDripRate = (long)m_udpServer.Throttle.MaxDripRate;
@ -527,7 +533,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (args.Length != 5)
{
MainConsole.Instance.OutputFormat("Usage: debug lludp set <param> <value>");
MainConsole.Instance.Output("Usage: debug lludp set <param> <value>");
return;
}
@ -555,7 +561,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
}
m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
m_console.Output("{0} set to {1} in {2}", null, param, rawValue, m_udpServer.Scene.Name);
}
/* not in use, nothing to set/get from lludp
@ -632,7 +638,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
MainConsole.Instance.OutputFormat("ERROR: Cannot specify a user name when setting default/all logging level");
MainConsole.Instance.Output("ERROR: Cannot specify a user name when setting default/all logging level");
return;
}
}
@ -646,16 +652,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_udpServer.DefaultClientPacketDebugLevel = newDebug;
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Packet debug for {0} clients set to {1} in {2}",
null,
(setAll ? "all" : "future"), m_udpServer.DefaultClientPacketDebugLevel, m_udpServer.Scene.Name);
if (setAll)
{
m_udpServer.Scene.ForEachScenePresence(sp =>
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Packet debug for {0} ({1}) set to {2} in {3}",
null,
sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_udpServer.Scene.Name);
sp.ControllingClient.DebugPacketLevel = newDebug;
@ -668,8 +676,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (name == null || sp.Name == name)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Packet debug for {0} ({1}) set to {2} in {3}",
null,
sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_udpServer.Scene.Name);
sp.ControllingClient.DebugPacketLevel = newDebug;
@ -701,8 +710,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (subCommand == "add")
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Adding packet {0} to {1} drop list for all connections in {2}",
null,
direction, packetName, m_udpServer.Scene.Name);
m_udpServer.Scene.ForEachScenePresence(
@ -719,8 +729,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else if (subCommand == "remove")
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Removing packet {0} from {1} drop list for all connections in {2}",
null,
direction, packetName, m_udpServer.Scene.Name);
m_udpServer.Scene.ForEachScenePresence(
@ -784,8 +795,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_udpServer.DiscardInboundAgentUpdates = !m_udpServer.DiscardInboundAgentUpdates;
MainConsole.Instance.OutputFormat(
"Discard AgentUpdates now {0} for {1}", m_udpServer.DiscardInboundAgentUpdates, m_udpServer.Scene.Name);
MainConsole.Instance.Output(
"Discard AgentUpdates now {0} for {1}", null, m_udpServer.DiscardInboundAgentUpdates, m_udpServer.Scene.Name);
}
private void HandleStatusCommand(string module, string[] args)
@ -793,14 +804,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
return;
MainConsole.Instance.OutputFormat(
"IN LLUDP packet processing for {0} is {1}", m_udpServer.Scene.Name, m_udpServer.IsRunningInbound ? "enabled" : "disabled");
MainConsole.Instance.Output(
"IN LLUDP packet processing for {0} is {1}", null, m_udpServer.Scene.Name, m_udpServer.IsRunningInbound ? "enabled" : "disabled");
MainConsole.Instance.OutputFormat(
"OUT LLUDP packet processing for {0} is {1}", m_udpServer.Scene.Name, m_udpServer.IsRunningOutbound ? "enabled" : "disabled");
MainConsole.Instance.Output(
"OUT LLUDP packet processing for {0} is {1}", null, m_udpServer.Scene.Name, m_udpServer.IsRunningOutbound ? "enabled" : "disabled");
MainConsole.Instance.OutputFormat(
"Packet debug level for new clients is {0}", m_udpServer.DefaultClientPacketDebugLevel);
MainConsole.Instance.Output(
"Packet debug level for new clients is {0}", null, m_udpServer.DefaultClientPacketDebugLevel);
}
private void HandleOqreCommand(string module, string[] args)
@ -819,24 +830,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (subCommand == "stop")
{
m_udpServer.OqrEngine.Stop();
MainConsole.Instance.OutputFormat("Stopped OQRE for {0}", m_udpServer.Scene.Name);
MainConsole.Instance.Output("Stopped OQRE for {0}", null, m_udpServer.Scene.Name);
}
else if (subCommand == "start")
{
m_udpServer.OqrEngine.Start();
MainConsole.Instance.OutputFormat("Started OQRE for {0}", m_udpServer.Scene.Name);
MainConsole.Instance.Output("Started OQRE for {0}", null, m_udpServer.Scene.Name);
}
else if (subCommand == "status")
{
MainConsole.Instance.OutputFormat("OQRE in {0}", m_udpServer.Scene.Name);
MainConsole.Instance.OutputFormat("Running: {0}", m_udpServer.OqrEngine.IsRunning);
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output("OQRE in {0}", null, m_udpServer.Scene.Name);
MainConsole.Instance.Output("Running: {0}", null, m_udpServer.OqrEngine.IsRunning);
MainConsole.Instance.Output(
"Requests waiting: {0}",
null,
m_udpServer.OqrEngine.IsRunning ? m_udpServer.OqrEngine.JobsWaiting.ToString() : "n/a");
}
else
{
MainConsole.Instance.OutputFormat("Unrecognized OQRE subcommand {0}", subCommand);
MainConsole.Instance.Output("Unrecognized OQRE subcommand {0}", null, subCommand);
}
}
}

20
OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs Normal file → Executable file
View File

@ -1075,14 +1075,14 @@ namespace OpenSim.Region.CoreModules.Asset
{
case "status":
if (m_MemoryCacheEnabled)
con.OutputFormat("Memory Cache: {0} assets", m_MemoryCache.Count);
con.Output("Memory Cache: {0} assets", null, m_MemoryCache.Count);
else
con.OutputFormat("Memory cache disabled");
con.Output("Memory cache disabled");
if (m_FileCacheEnabled)
{
int fileCount = GetFileCacheCount(m_CacheDirectory);
con.OutputFormat("File Cache: {0} assets", fileCount);
con.Output("File Cache: {0} assets", null, fileCount);
}
else
{
@ -1099,7 +1099,7 @@ namespace OpenSim.Region.CoreModules.Asset
{
string RegionID = s.Remove(0,s.IndexOf("_")).Replace(".fac","");
DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s);
con.OutputFormat("Region: {0}, {1}", RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss"));
con.Output("Region: {0}, {1}", null, RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss"));
}
}
@ -1160,7 +1160,7 @@ namespace OpenSim.Region.CoreModules.Asset
{
if(m_cleanupRunning)
{
con.OutputFormat("Flotsam assets check already running");
con.Output("Flotsam assets check already running");
return;
}
m_cleanupRunning = true;
@ -1192,7 +1192,7 @@ namespace OpenSim.Region.CoreModules.Asset
}
m_cleanupRunning = false;
}
con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal);
con.Output("Completed check with {0} assets.", null, assetReferenceTotal);
}, null, "TouchAllSceneAssets", false);
break;
@ -1200,7 +1200,7 @@ namespace OpenSim.Region.CoreModules.Asset
case "expire":
if (cmdparams.Length < 3)
{
con.OutputFormat("Invalid parameters for Expire, please specify a valid date & time", cmd);
con.Output("Invalid parameters for Expire, please specify a valid date & time");
break;
}
@ -1218,18 +1218,18 @@ namespace OpenSim.Region.CoreModules.Asset
if (!DateTime.TryParse(s_expirationDate, out expirationDate))
{
con.OutputFormat("{0} is not a valid date & time", cmd);
con.Output("{0} is not a valid date & time", null, cmd);
break;
}
if (m_FileCacheEnabled)
CleanExpiredFiles(m_CacheDirectory, expirationDate);
else
con.OutputFormat("File cache not active, not clearing.");
con.Output("File cache not active, not clearing.");
break;
default:
con.OutputFormat("Unknown command {0}", cmd);
con.Output("Unknown command {0}", null, cmd);
break;
}
}

View File

@ -159,27 +159,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (!(args.Length == 4 && int.TryParse(args[3], out debugLevel)))
{
MainConsole.Instance.OutputFormat("Usage: debug attachments log [0|1]");
MainConsole.Instance.Output("Usage: debug attachments log [0|1]");
}
else
{
DebugLevel = debugLevel;
MainConsole.Instance.OutputFormat(
"Set attachments debug level to {0} in {1}", DebugLevel, m_scene.Name);
MainConsole.Instance.Output(
"Set attachments debug level to {0} in {1}", null, DebugLevel, m_scene.Name);
}
}
private void HandleDebugAttachmentsStatus(string module, string[] args)
{
MainConsole.Instance.OutputFormat("Settings for {0}", m_scene.Name);
MainConsole.Instance.OutputFormat("Debug logging level: {0}", DebugLevel);
MainConsole.Instance.Output("Settings for {0}", null, m_scene.Name);
MainConsole.Instance.Output("Debug logging level: {0}", null, DebugLevel);
}
protected void HandleShowAttachmentsCommand(string module, string[] cmd)
{
if (cmd.Length != 2 && cmd.Length < 4)
{
MainConsole.Instance.OutputFormat("Usage: attachments show [<first-name> <last-name>]");
MainConsole.Instance.Output("Usage: attachments show [<first-name> <last-name>]");
return;
}

View File

@ -1370,7 +1370,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
rawTextureID += " (uploaded)";
}
outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
outputAction(BAKED_TEXTURES_REPORT_FORMAT, null, bt, rawTextureID);
}
bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);

View File

@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands
{
if (cmd.Length < 5)
{
MainConsole.Instance.OutputFormat("Usage: " + TeleportUserCommandSyntax);
MainConsole.Instance.Output("Usage: " + TeleportUserCommandSyntax);
return;
}
@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands
if (user == null)
{
MainConsole.Instance.OutputFormat("No user found with name {0} {1}", firstName, lastName);
MainConsole.Instance.Output("No user found with name {0} {1}", null, firstName, lastName);
return;
}
@ -161,7 +161,7 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands
if (!m.Success)
{
MainConsole.Instance.OutputFormat("Invalid destination {0}", rawDestination);
MainConsole.Instance.Output("Invalid destination {0}", null, rawDestination);
return;
}
}
@ -169,8 +169,9 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands
string regionName
= m.Groups["regionName"].Success ? m.Groups["regionName"].Value : user.Scene.RegionInfo.RegionName;
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Teleporting {0} to {1},{2},{3} in {4}",
null,
user.Name,
m.Groups["x"], m.Groups["y"], m.Groups["z"],
regionName);

View File

@ -316,15 +316,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
{
foreach (IMonitor monitor in m_staticMonitors)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"[MONITOR MODULE]: {0} reports {1} = {2}",
null,
m_scene.RegionInfo.RegionName, monitor.GetFriendlyName(), monitor.GetFriendlyValue());
}
foreach (KeyValuePair<string, float> tuple in m_scene.StatsReporter.GetExtraSimStats())
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"[MONITOR MODULE]: {0} reports {1} = {2}",
null,
m_scene.RegionInfo.RegionName, tuple.Key, tuple.Value);
}
}

View File

@ -1028,7 +1028,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
if (cmd.Length < 3)
{
MainConsole.Instance.OutputFormat("Usage: show name <uuid>");
MainConsole.Instance.Output("Usage: show name <uuid>");
return;
}
@ -1040,7 +1040,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
if(!GetUser(userId, out ud))
{
MainConsole.Instance.OutputFormat("No name known for user with id {0}", userId);
MainConsole.Instance.Output("No name known for user with id {0}", null, userId);
return;
}

View File

@ -2528,7 +2528,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
return;
string response = MainConsole.Instance.CmdPrompt(
string response = MainConsole.Instance.Prompt(
string.Format(
"Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name),
"n");
@ -2536,11 +2536,11 @@ namespace OpenSim.Region.CoreModules.World.Land
if (response.ToLower() == "y")
{
Clear(true);
MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.Name);
MainConsole.Instance.Output("Cleared all parcels from {0}", null, m_scene.Name);
}
else
{
MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name);
MainConsole.Instance.Output("Aborting clear of all parcels from {0}", null, m_scene.Name);
}
}
@ -2568,7 +2568,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{
if (!m_landList.TryGetValue(landLocalId, out lo))
{
MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId);
MainConsole.Instance.Output("No parcel found with local ID {0}", null, landLocalId);
return;
}
}

View File

@ -235,7 +235,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
sb.AppendFormat("{0} object(s) found in {1}\n", sceneObjects.Count, m_scene.Name);
m_console.OutputFormat(sb.ToString());
m_console.Output(sb.ToString());
}
private void OutputSopsToConsole(Predicate<SceneObjectPart> searchPredicate, bool showFull)
@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
sb.AppendFormat("{0} parts found in {1}\n", parts.Count, m_scene.Name);
m_console.OutputFormat(sb.ToString());
m_console.Output(sb.ToString());
}
private void HandleShowObjectById(string module, string[] cmdparams)
@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 4)
{
m_console.OutputFormat("Usage: show object uuid <uuid>");
m_console.Output("Usage: show object uuid <uuid>");
return;
}
@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
StringBuilder sb = new StringBuilder();
AddSceneObjectReport(sb, so, showFull);
m_console.OutputFormat(sb.ToString());
m_console.Output(sb.ToString());
}
private void HandleShowObjectByName(string module, string[] cmdparams)
@ -313,7 +313,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 4)
{
m_console.OutputFormat("Usage: show object name [--full] [--regex] <name>");
m_console.Output("Usage: show object name [--full] [--regex] <name>");
return;
}
@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 4)
{
m_console.OutputFormat("Usage: show object owner <OwnerID>");
m_console.Output("Usage: show object owner <OwnerID>");
return;
}
@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 5)
{
m_console.OutputFormat("Usage: show object pos [--full] <start-coord> to <end-coord>");
m_console.Output("Usage: show object pos [--full] <start-coord> to <end-coord>");
return;
}
@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 4)
{
//m_console.OutputFormat("Usage: show part id [--full] <UUID-or-localID>");
m_console.OutputFormat("Usage: show part id <UUID-or-localID>");
m_console.Output("Usage: show part id <UUID-or-localID>");
return;
}
@ -425,7 +425,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
StringBuilder sb = new StringBuilder();
AddScenePartReport(sb, sop, true);
m_console.OutputFormat(sb.ToString());
m_console.Output(sb.ToString());
}
private void HandleShowPartByPos(string module, string[] cmdparams)
@ -442,7 +442,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 5)
{
//m_console.OutputFormat("Usage: show part pos <start-coord> to <end-coord>");
m_console.OutputFormat("Usage: show part pos [--full] <start-coord> to <end-coord>");
m_console.Output("Usage: show part pos [--full] <start-coord> to <end-coord>");
return;
}
@ -451,7 +451,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector))
{
m_console.OutputFormat("Error: Start vector '{0}' does not have a valid format", rawConsoleStartVector);
m_console.Output("Error: Start vector '{0}' does not have a valid format", null, rawConsoleStartVector);
return;
}
@ -460,7 +460,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector))
{
m_console.OutputFormat("Error: End vector '{0}' does not have a valid format", rawConsoleEndVector);
m_console.Output("Error: End vector '{0}' does not have a valid format", null, rawConsoleEndVector);
return;
}
@ -482,7 +482,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 4)
{
m_console.OutputFormat("Usage: show part name [--regex] <name>");
m_console.Output("Usage: show part name [--regex] <name>");
//m_console.OutputFormat("Usage: show part name [--full] [--regex] <name>");
return;
}
@ -511,7 +511,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (cmdparams.Length < 4)
{
m_console.OutputFormat("Usage: dump object id <UUID-or-localID>");
m_console.Output("Usage: dump object id <UUID-or-localID>");
return;
}
@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
SceneObjectSerializer.ToOriginalXmlFormat(so, xtw, true);
}
m_console.OutputFormat("Object dumped to file {0}", fileName);
m_console.Output("Object dumped to file {0}", fileName);
}
/// <summary>
@ -809,7 +809,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if(so.IsAttachment)
{
requireConfirmation = true;
m_console.OutputFormat("Warning: object with uuid {0} is a attachment", uuid);
m_console.Output("Warning: object with uuid {0} is a attachment", null, uuid);
}
}
break;
@ -844,7 +844,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
});
if (deletes.Count == 0)
m_console.OutputFormat("No objects were found outside region bounds");
m_console.Output("No objects were found outside region bounds");
break;
@ -853,7 +853,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
break;
default:
m_console.OutputFormat("Unrecognized mode {0}", mode);
m_console.Output("Unrecognized mode {0}", null, mode);
return;
}
@ -862,7 +862,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (requireConfirmation)
{
string response = MainConsole.Instance.CmdPrompt(
string response = MainConsole.Instance.Prompt(
string.Format(
"Are you sure that you want to delete {0} objects from {1}",
deletes.Count, m_scene.RegionInfo.RegionName),
@ -870,18 +870,18 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (response.ToLower() != "y")
{
MainConsole.Instance.OutputFormat(
"Aborting delete of {0} objects from {1}", deletes.Count, m_scene.RegionInfo.RegionName);
MainConsole.Instance.Output(
"Aborting delete of {0} objects from {1}", null, deletes.Count, m_scene.RegionInfo.RegionName);
return;
}
}
m_console.OutputFormat("Deleting {0} objects in {1}", deletes.Count, m_scene.RegionInfo.RegionName);
m_console.Output("Deleting {0} objects in {1}", null, deletes.Count, m_scene.RegionInfo.RegionName);
foreach (SceneObjectGroup g in deletes)
{
m_console.OutputFormat("Deleting object {0} {1}", g.UUID, g.Name);
m_console.Output("Deleting object {0} {1}", null, g.UUID, g.Name);
m_scene.DeleteSceneObject(g, false);
}
}
@ -895,7 +895,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (mainParams.Count < 4)
{
m_console.OutputFormat("Usage: delete object name [--regex] <name>");
m_console.Output("Usage: delete object name [--regex] <name>");
return null;
}
@ -917,7 +917,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
m_scene.ForEachSOG(searchAction);
if (sceneObjects.Count == 0)
m_console.OutputFormat("No objects with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
m_console.Output("No objects with name {0} found in {1}", null, name, m_scene.RegionInfo.RegionName);
return sceneObjects;
}
@ -933,7 +933,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
{
if (cmdparams.Length < 5)
{
m_console.OutputFormat("Usage: delete object pos <start-coord> to <end-coord>");
m_console.Output("Usage: delete object pos <start-coord> to <end-coord>");
return null;
}
@ -952,7 +952,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector))
{
m_console.OutputFormat("Error: Start vector '{0}' does not have a valid format", rawConsoleStartVector);
m_console.Output("Error: Start vector '{0}' does not have a valid format", null, rawConsoleStartVector);
endVector = Vector3.Zero;
return false;
@ -962,7 +962,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector))
{
m_console.OutputFormat("Error: End vector '{0}' does not have a valid format", rawConsoleEndVector);
m_console.Output("Error: End vector '{0}' does not have a valid format", null, rawConsoleEndVector);
return false;
}

View File

@ -202,7 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (args.Length != 4)
{
MainConsole.Instance.OutputFormat("Usage: region set <param> <value>");
MainConsole.Instance.Output("Usage: region set <param> <value>");
return;
}
@ -224,16 +224,17 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (newValue > ri.AgentCapacity)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit",
null,
newValue, m_scene.Name, ri.AgentCapacity);
}
else
{
rs.AgentLimit = newValue;
MainConsole.Instance.OutputFormat(
"{0} set to {1} in {2}", "agent-limit", newValue, m_scene.Name);
MainConsole.Instance.Output(
"{0} set to {1} in {2}", "agent-limit", null, newValue, m_scene.Name);
}
rs.Save();
@ -247,15 +248,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
ri.AgentCapacity = newValue;
MainConsole.Instance.OutputFormat(
"{0} set to {1} in {2}", "max-agent-limit", newValue, m_scene.Name);
MainConsole.Instance.Output(
"{0} set to {1} in {2}", "max-agent-limit", null, newValue, m_scene.Name);
if (ri.AgentCapacity < rs.AgentLimit)
{
rs.AgentLimit = ri.AgentCapacity;
MainConsole.Instance.OutputFormat(
"Reducing {0} to {1} in {2}", "agent-limit", rs.AgentLimit, m_scene.Name);
MainConsole.Instance.Output(
"Reducing {0} to {1} in {2}", null, "agent-limit", rs.AgentLimit, m_scene.Name);
}
rs.Save();

View File

@ -337,8 +337,8 @@ namespace OpenSim.Region.CoreModules.World.Region
for (int i = 4 ; i < args.Length ; i++)
times.Add(Convert.ToInt32(args[i]));
MainConsole.Instance.OutputFormat(
"Region {0} scheduled for restart in {1} seconds", m_Scene.Name, times.Sum());
MainConsole.Instance.Output(
"Region {0} scheduled for restart in {1} seconds", null, m_Scene.Name, times.Sum());
ScheduleRestart(UUID.Zero, args[3], times.ToArray(), notice);
}

View File

@ -791,8 +791,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
if (offsetX < 0 || offsetX >= fileWidth || offsetY < 0 || offsetY >= fileHeight)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"ERROR: file width + minimum X tile and file height + minimum Y tile must incorporate the current region at ({0},{1}). File width {2} from {3} and file height {4} from {5} does not.",
null,
m_scene.RegionInfo.RegionLocX, m_scene.RegionInfo.RegionLocY, fileWidth, fileStartX, fileHeight, fileStartY);
return;
@ -810,8 +811,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
(int)m_scene.RegionInfo.RegionSizeX,
(int)m_scene.RegionInfo.RegionSizeY);
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Saved terrain from ({0},{1}) to ({2},{3}) from {4} to {5}",
null,
fileStartX, fileStartY, fileStartX + fileWidth - 1, fileStartY + fileHeight - 1,
m_scene.RegionInfo.RegionName, filename);
}
@ -820,8 +822,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
}
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"ERROR: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
null,
m_scene.RegionInfo.RegionName, filename, m_supportFileExtensionsForTileSave);
}
@ -1538,7 +1541,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
else
{
MainConsole.Instance.OutputFormat("ERROR: Unrecognised direction {0} - need x or y", direction);
MainConsole.Instance.Output("ERROR: Unrecognised direction {0} - need x or y", null, direction);
}
}
@ -1703,8 +1706,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
double avg = sum / (m_channel.Height * m_channel.Width);
MainConsole.Instance.OutputFormat("Channel {0}x{1}", m_channel.Width, m_channel.Height);
MainConsole.Instance.OutputFormat("max/min/avg/sum: {0}/{1}/{2}/{3}", max, min, avg, sum);
MainConsole.Instance.Output("Channel {0}x{1}", null, m_channel.Width, m_channel.Height);
MainConsole.Instance.Output("max/min/avg/sum: {0}/{1}/{2}/{3}", null, max, min, avg, sum);
}
private void InterfaceEnableExperimentalBrushes(Object[] args)

20
OpenSim/Region/CoreModules/World/Wind/WindModule.cs Normal file → Executable file
View File

@ -264,8 +264,8 @@ namespace OpenSim.Region.CoreModules
}
else
{
MainConsole.Instance.OutputFormat(
"Invalid value {0} specified for {1}", cmdparams[3], cmdparams[2]);
MainConsole.Instance.Output(
"Invalid value {0} specified for {1}", null, cmdparams[3], cmdparams[2]);
return;
}
@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules
if (desiredPlugin.Equals(m_activeWindPlugin.Name))
{
MainConsole.Instance.OutputFormat("Wind model plugin {0} is already active", cmdparams[3]);
MainConsole.Instance.Output("Wind model plugin {0} is already active", null, cmdparams[3]);
return;
}
@ -285,11 +285,11 @@ namespace OpenSim.Region.CoreModules
{
m_activeWindPlugin = m_availableWindPlugins[cmdparams[3]];
MainConsole.Instance.OutputFormat("{0} wind model plugin now active", m_activeWindPlugin.Name);
MainConsole.Instance.Output("{0} wind model plugin now active", null, m_activeWindPlugin.Name);
}
else
{
MainConsole.Instance.OutputFormat("Could not find wind model plugin {0}", desiredPlugin);
MainConsole.Instance.Output("Could not find wind model plugin {0}", null, desiredPlugin);
}
break;
}
@ -317,17 +317,17 @@ namespace OpenSim.Region.CoreModules
{
if (!float.TryParse(cmdparams[3], out value))
{
MainConsole.Instance.OutputFormat("Invalid value {0}", cmdparams[3]);
MainConsole.Instance.Output("Invalid value {0}", null, cmdparams[3]);
}
try
{
WindParamSet(plugin, param, value);
MainConsole.Instance.OutputFormat("{0} set to {1}", param, value);
MainConsole.Instance.Output("{0} set to {1}", null, param, value);
}
catch (Exception e)
{
MainConsole.Instance.OutputFormat("{0}", e.Message);
MainConsole.Instance.Output("{0}", null, e.Message);
}
}
else
@ -335,11 +335,11 @@ namespace OpenSim.Region.CoreModules
try
{
value = WindParamGet(plugin, param);
MainConsole.Instance.OutputFormat("{0} : {1}", param, value);
MainConsole.Instance.Output("{0} : {1}", null, param, value);
}
catch (Exception e)
{
MainConsole.Instance.OutputFormat("{0}", e.Message);
MainConsole.Instance.Output("{0}", null, e.Message);
}
}

View File

@ -31,7 +31,7 @@ using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces
{
public delegate void ReportOutputAction(string format, params object[] args);
public delegate void ReportOutputAction(string format, string level, params object[] args);
public interface IAvatarFactoryModule
{

View File

@ -114,27 +114,27 @@ namespace OpenSim.Region.OptionalModules.Agent.TextureSender
if (!UUID.TryParse(rawAssetId, out assetId))
{
MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid ID format", rawAssetId);
MainConsole.Instance.Output("ERROR: {0} is not a valid ID format", null, rawAssetId);
return;
}
AssetBase asset = m_scene.AssetService.Get(assetId.ToString());
if (asset == null)
{
MainConsole.Instance.OutputFormat("ERROR: No asset found with ID {0}", assetId);
MainConsole.Instance.Output("ERROR: No asset found with ID {0}", null, assetId);
return;
}
if (asset.Type != (sbyte)AssetType.Texture)
{
MainConsole.Instance.OutputFormat("ERROR: Asset {0} is not a texture type", assetId);
MainConsole.Instance.Output("ERROR: Asset {0} is not a texture type", null, assetId);
return;
}
IJ2KDecoder decoder = m_scene.RequestModuleInterface<IJ2KDecoder>();
if (decoder == null)
{
MainConsole.Instance.OutputFormat("ERROR: No IJ2KDecoder module available");
MainConsole.Instance.Output("ERROR: No IJ2KDecoder module available");
return;
}
@ -142,13 +142,14 @@ namespace OpenSim.Region.OptionalModules.Agent.TextureSender
int components;
if (decoder.Decode(assetId, asset.Data, out layers, out components))
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Successfully decoded asset {0} with {1} layers and {2} components",
null,
assetId, layers.Length, components);
}
else
{
MainConsole.Instance.OutputFormat("Decode of asset {0} failed", assetId);
MainConsole.Instance.Output("Decode of asset {0} failed", null, assetId);
}
}
}

20
OpenSim/Region/OptionalModules/Asset/AssetInfoModule.cs Normal file → Executable file
View File

@ -115,14 +115,14 @@ namespace OpenSim.Region.OptionalModules.Asset
if (!UUID.TryParse(rawAssetId, out assetId))
{
MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid ID format", rawAssetId);
MainConsole.Instance.Output("ERROR: {0} is not a valid ID format", null, rawAssetId);
return;
}
AssetBase asset = m_scene.AssetService.Get(assetId.ToString());
if (asset == null)
{
MainConsole.Instance.OutputFormat("ERROR: No asset found with ID {0}", assetId);
MainConsole.Instance.Output("ERROR: No asset found with ID {0}", null, assetId);
return;
}
@ -139,7 +139,7 @@ namespace OpenSim.Region.OptionalModules.Asset
}
}
MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
MainConsole.Instance.Output("Asset dumped to file {0}", null, fileName);
}
void HandleShowAsset(string module, string[] args)
@ -160,13 +160,13 @@ namespace OpenSim.Region.OptionalModules.Asset
int i;
MainConsole.Instance.OutputFormat("Name: {0}", asset.Name);
MainConsole.Instance.OutputFormat("Description: {0}", asset.Description);
MainConsole.Instance.OutputFormat("Type: {0} (type number = {1})", (AssetType)asset.Type, asset.Type);
MainConsole.Instance.OutputFormat("Content-type: {0}", asset.Metadata.ContentType);
MainConsole.Instance.OutputFormat("Size: {0} bytes", asset.Data.Length);
MainConsole.Instance.OutputFormat("Temporary: {0}", asset.Temporary ? "yes" : "no");
MainConsole.Instance.OutputFormat("Flags: {0}", asset.Metadata.Flags);
MainConsole.Instance.Output("Name: {0}", null, asset.Name);
MainConsole.Instance.Output("Description: {0}", null, asset.Description);
MainConsole.Instance.Output("Type: {0} (type number = {1})", null, (AssetType)asset.Type, asset.Type);
MainConsole.Instance.Output("Content-type: {0}", null, asset.Metadata.ContentType);
MainConsole.Instance.Output("Size: {0} bytes", null, asset.Data.Length);
MainConsole.Instance.Output("Temporary: {0}", null, asset.Temporary ? "yes" : "no");
MainConsole.Instance.Output("Flags: {0}", null, asset.Metadata.Flags);
for (i = 0 ; i < 5 ; i++)
{

View File

@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
{
if (cmd.Length != 2 && cmd.Length < 4)
{
MainConsole.Instance.OutputFormat("Usage: show animations [<first-name> <last-name>]");
MainConsole.Instance.Output("Usage: show animations [<first-name> <last-name>]");
return;
}

View File

@ -154,7 +154,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
if (cmd.Length != 2 && cmd.Length < 4)
{
MainConsole.Instance.OutputFormat("Usage: appearance send [<first-name> <last-name>]");
MainConsole.Instance.Output("Usage: appearance send [<first-name> <last-name>]");
return;
}
@ -178,8 +178,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Sending appearance information for {0} to all other avatars in {1}",
null,
sp.Name, scene.RegionInfo.RegionName);
scene.AvatarFactory.SendAppearance(sp.UUID);
@ -190,8 +191,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
scene.ForEachRootScenePresence(
sp =>
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Sending appearance information for {0} to all other avatars in {1}",
null,
sp.Name, scene.RegionInfo.RegionName);
scene.AvatarFactory.SendAppearance(sp.UUID);
@ -206,7 +208,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
if (cmd.Length != 2 && cmd.Length < 4)
{
MainConsole.Instance.OutputFormat("Usage: appearance show [<first-name> <last-name>]");
MainConsole.Instance.Output("Usage: appearance show [<first-name> <last-name>]");
return;
}
@ -229,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent)
scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.OutputFormat);
scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.Output);
}
else
{
@ -237,8 +239,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
sp =>
{
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
MainConsole.Instance.OutputFormat(
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "incomplete");
MainConsole.Instance.Output(
"{0} baked appearance texture is {1}", null, sp.Name, bakedTextureValid ? "OK" : "incomplete");
}
);
}
@ -250,7 +252,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
if (cmd.Length != 4)
{
MainConsole.Instance.OutputFormat("Usage: appearance rebake <first-name> <last-name>");
MainConsole.Instance.Output("Usage: appearance rebake <first-name> <last-name>");
return;
}
@ -267,12 +269,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
int rebakesRequested = scene.AvatarFactory.RequestRebake(sp, false);
if (rebakesRequested > 0)
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Requesting rebake of {0} uploaded textures for {1} in {2}",
null,
rebakesRequested, sp.Name, scene.RegionInfo.RegionName);
else
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"No texture IDs available for rebake request for {0} in {1}",
null,
sp.Name, scene.RegionInfo.RegionName);
}
}
@ -283,7 +287,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
if (cmd.Length != 3)
{
MainConsole.Instance.OutputFormat("Usage: appearance find <uuid-or-start-of-uuid>");
MainConsole.Instance.Output("Usage: appearance find <uuid-or-start-of-uuid>");
return;
}
@ -310,12 +314,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
if (matchedAvatars.Count == 0)
{
MainConsole.Instance.OutputFormat("{0} did not match any baked avatar textures in use", rawUuid);
MainConsole.Instance.Output("{0} did not match any baked avatar textures in use", null, rawUuid);
}
else
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"{0} matched {1}",
null,
rawUuid,
string.Join(", ", matchedAvatars.ToList().ConvertAll<string>(sp => sp.Name).ToArray()));
}
@ -325,7 +330,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
if (cmd.Length != 2 && cmd.Length < 4)
{
MainConsole.Instance.OutputFormat("Usage: wearables show [<first-name> <last-name>]");
MainConsole.Instance.Output("Usage: wearables show [<first-name> <last-name>]");
return;
}
@ -388,7 +393,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
if (cmd.Length != 4)
{
MainConsole.Instance.OutputFormat("Usage: wearables check <first-name> <last-name>");
MainConsole.Instance.Output("Usage: wearables check <first-name> <last-name>");
return;
}
@ -410,7 +415,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
AvatarWearable[] wearables = sp.Appearance.Wearables;
if(wearables.Count() == 0)
{
MainConsole.Instance.OutputFormat("avatar has no wearables");
MainConsole.Instance.Output("avatar has no wearables");
return;
}

View File

@ -122,7 +122,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
if (mainParams.Count != 4)
{
MainConsole.Instance.OutputFormat("Usage: friends show [--cache] <first-name> <last-name>");
MainConsole.Instance.Output("Usage: friends show [--cache] <first-name> <last-name>");
return;
}
@ -136,7 +136,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
if (userId == UUID.Zero)
{
MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName);
MainConsole.Instance.Output("No such user as {0} {1}", null, firstName, lastName);
return;
}
@ -146,7 +146,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
{
if (!m_friendsModule.AreFriendsCached(userId))
{
MainConsole.Instance.OutputFormat("No friends cached on this simulator for {0} {1}", firstName, lastName);
MainConsole.Instance.Output("No friends cached on this simulator for {0} {1}", null, firstName, lastName);
return;
}
else
@ -162,10 +162,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
friends = ((FriendsModule)m_friendsModule).FriendsService.GetFriends(userId);
}
MainConsole.Instance.OutputFormat("Friends for {0} {1} {2}:", firstName, lastName, userId);
MainConsole.Instance.Output("Friends for {0} {1} {2}:", null, firstName, lastName, userId);
MainConsole.Instance.OutputFormat(
"{0,-36} {1,-36} {2,-7} {3,7} {4,10}", "UUID", "Name", "Status", "MyFlags", "TheirFlags");
MainConsole.Instance.Output(
"{0,-36} {1,-36} {2,-7} {3,7} {4,10}", null, "UUID", "Name", "Status", "MyFlags", "TheirFlags");
foreach (FriendInfo friend in friends)
{
@ -191,8 +191,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
else
onlineText = "offline";
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"{0,-36} {1,-36} {2,-7} {3,-7} {4,-10}",
null,
friend.Friend, friendName, onlineText, friend.MyFlags, friend.TheirFlags);
}
}

View File

@ -142,8 +142,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.SitStand
if (sitPart != null)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Sitting {0} on {1} {2} in {3}",
null,
sp.Name, sitPart.ParentGroup.Name, sitPart.ParentGroup.UUID, m_scene.Name);
sp.HandleAgentRequestSit(sp.ControllingClient, sp.UUID, sitPart.UUID, Vector3.Zero);
@ -151,8 +152,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.SitStand
}
else
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Could not find any unoccupied set seat on which to sit {0} in {1}. Aborting",
null,
sp.Name, m_scene.Name);
break;
@ -177,7 +179,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.SitStand
{
if (sp.SitGround || sp.IsSatOnObject)
{
MainConsole.Instance.OutputFormat("Standing {0} in {1}", sp.Name, m_scene.Name);
MainConsole.Instance.Output("Standing {0} in {1}", null, sp.Name, m_scene.Name);
sp.StandUp();
}
}

View File

@ -243,7 +243,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_debugEnabled = verbose;
MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
MainConsole.Instance.Output("{0} verbose logging set to {1}", null, Name, m_debugEnabled);
}
/// <summary>

View File

@ -154,7 +154,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_debugEnabled = verbose;
MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
MainConsole.Instance.Output("{0} verbose logging set to {1}", null, Name, m_debugEnabled);
}
public void RegionLoaded(Scene scene)

View File

@ -256,13 +256,13 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
private void WriteOut(string msg, params object[] args)
{
// m_log.InfoFormat(msg, args);
MainConsole.Instance.OutputFormat(msg, args);
MainConsole.Instance.Output(msg, null, args);
}
private void WriteError(string msg, params object[] args)
{
// m_log.ErrorFormat(msg, args);
MainConsole.Instance.OutputFormat(msg, args);
MainConsole.Instance.Output(msg, null, args);
}
}
}

View File

@ -186,7 +186,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return;
JsonStoreStats stats = m_store.GetStoreStats();
MainConsole.Instance.OutputFormat("{0}\t{1}",m_scene.RegionInfo.RegionName,stats.StoreCount);
MainConsole.Instance.Output("{0}\t{1}", null, m_scene.RegionInfo.RegionName, stats.StoreCount);
}
#endregion

View File

@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
// This should always show up to the user but should not trigger warn/errors as these messages are
// expected and are not simulator problems. Ideally, there would be a status level in log4net but
// failing that, we will print out to console instead.
MainConsole.Instance.OutputFormat("Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
MainConsole.Instance.Output("Region {0} - LOGINS DISABLED DURING INITIALIZATION.", null, m_scene.Name);
if (m_uri != string.Empty)
{
@ -232,7 +232,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
// without info log messages enabled. Making this a warning is arguably misleading since it isn't a
// warning, and monitor scripts looking for warn/error/fatal messages will received false positives.
// Arguably, log4net needs a status log level (like Apache).
MainConsole.Instance.OutputFormat("INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
MainConsole.Instance.Output("INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", null, m_scene.Name);
}
m_scene.SceneGridService.InformNeighborsThatRegionisUp(

View File

@ -271,13 +271,13 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
if (args.Length != 2)
{
MainConsole.Instance.OutputFormat ("Usage: dooarbackup <regionname>");
MainConsole.Instance.Output("Usage: dooarbackup <regionname>");
return;
}
if(m_busy)
{
MainConsole.Instance.OutputFormat ("Already doing a backup, please try later");
MainConsole.Instance.Output("Already doing a backup, please try later");
return;
}
@ -327,7 +327,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
m_busy = false;
}
if (!found)
MainConsole.Instance.OutputFormat ("No such region {0}. Nothing to backup", name);
MainConsole.Instance.Output("No such region {0}. Nothing to backup", null, name);
}
private void ParseDefaultConfig(IConfig config)

View File

@ -145,7 +145,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
cdl.AddRow("teleport", m_scene.DebugTeleporting);
cdl.AddRow("updates", m_scene.DebugUpdates);
MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name);
MainConsole.Instance.Output("Scene {0} options:", null, m_scene.Name);
MainConsole.Instance.Output(cdl.ToString());
}
@ -160,7 +160,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
string value = args[4];
SetSceneDebugOptions(new Dictionary<string, string>() { { key, value } });
MainConsole.Instance.OutputFormat("Set {0} debug scene {1} = {2}", m_scene.Name, key, value);
MainConsole.Instance.Output("Set {0} debug scene {1} = {2}", null, m_scene.Name, key, value);
}
else
{

View File

@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
MainConsole.Instance.Output(cdt.ToString());
MainConsole.Instance.OutputFormat("Total: {0}", sensorInfo.Count);
MainConsole.Instance.Output("Total: {0}", null, sensorInfo.Count);
}
private void HandleShowTimers(string module, string[] cmdparams)
@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
MainConsole.Instance.Output(cdt.ToString());
MainConsole.Instance.OutputFormat("Total: {0}", timersInfo.Count);
MainConsole.Instance.Output("Total: {0}", null, timersInfo.Count);
}
}
}

View File

@ -456,7 +456,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
si.DebugLevel = newLevel;
MainConsole.Instance.OutputFormat("Set debug level of {0} {1} to {2}", si.ScriptName, si.ItemID, newLevel);
MainConsole.Instance.Output("Set debug level of {0} {1} to {2}", null, si.ScriptName, si.ItemID, newLevel);
}
/// <summary>
@ -472,12 +472,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, args[3], out newDebug))
{
DebugLevel = newDebug;
MainConsole.Instance.OutputFormat("Debug level set to {0} in XEngine for region {1}", newDebug, m_Scene.Name);
MainConsole.Instance.Output("Debug level set to {0} in XEngine for region {1}", null, newDebug, m_Scene.Name);
}
}
else if (args.Length == 3)
{
MainConsole.Instance.OutputFormat("Current debug level is {0}", DebugLevel);
MainConsole.Instance.Output("Current debug level is {0}", null, DebugLevel);
}
else
{
@ -532,7 +532,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (!UUID.TryParse(rawItemId, out itemId))
{
MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId);
MainConsole.Instance.Output("ERROR: {0} is not a valid UUID", null, rawItemId);
continue;
}
@ -617,8 +617,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
lock (m_Scripts)
{
MainConsole.Instance.OutputFormat(
"Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName);
MainConsole.Instance.Output(
"Showing {0} scripts in {1}", null, m_Scripts.Count, m_Scene.RegionInfo.RegionName);
}
}
@ -669,8 +669,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instance.Suspend();
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Suspended {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
null,
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
}
}
@ -682,8 +683,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instance.Resume();
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Resumed {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
null,
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
}
}
@ -695,8 +697,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instance.Start();
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Started {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
null,
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
}
}
@ -710,8 +713,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instance.Stop(0);
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Stopped {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
null,
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
}
}

15
OpenSim/Server/Base/CommandManager.cs Normal file → Executable file
View File

@ -178,7 +178,8 @@ namespace OpenSim.Server.Base
{
Dictionary<string, object> plugin = (Dictionary<string, object>)result[k];
bool enabled = (bool)plugin["enabled"];
MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}",
MainConsole.Instance.Output("{0}) {1} {2} rev. {3}",
null,
k,
enabled == true ? "[ ]" : "[X]",
plugin["name"], plugin["version"]);
@ -215,7 +216,8 @@ namespace OpenSim.Server.Base
{
Dictionary<string, object> plugin = (Dictionary<string, object>)result[k];
bool enabled = (bool)plugin["enabled"];
MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}",
MainConsole.Instance.Output("{0}) {1} {2} rev. {3}",
null,
k,
enabled == true ? "[ ]" : "[X]",
plugin["name"], plugin["version"]);
@ -235,7 +237,8 @@ namespace OpenSim.Server.Base
{
// name, version, repository
Dictionary<string, object> plugin = (Dictionary<string, object>)result[k];
MainConsole.Instance.OutputFormat("{0}) {1} rev. {2} {3}",
MainConsole.Instance.Output("{0}) {1} rev. {2} {3}",
null,
k,
plugin["name"],
plugin["version"],
@ -309,7 +312,8 @@ namespace OpenSim.Server.Base
{
Dictionary<string, object> repo = (Dictionary<string, object>)result[k];
bool enabled = (bool)repo["enabled"];
MainConsole.Instance.OutputFormat("{0}) {1} {2}",
MainConsole.Instance.Output("{0}) {1} {2}",
null,
k,
enabled == true ? "[ ]" : "[X]",
repo["name"], repo["url"]);
@ -329,7 +333,8 @@ namespace OpenSim.Server.Base
int ndx = Convert.ToInt16(cmd[2]);
PluginManager.AddinInfo(ndx, out result);
MainConsole.Instance.OutputFormat("Name: {0}\nURL: {1}\nFile: {2}\nAuthor: {3}\nCategory: {4}\nDesc: {5}",
MainConsole.Instance.Output("Name: {0}\nURL: {1}\nFile: {2}\nAuthor: {3}\nCategory: {4}\nDesc: {5}",
null,
result["name"],
result["url"],
result["file_name"],

26
OpenSim/Server/Handlers/Asset/AssetServerConnector.cs Normal file → Executable file
View File

@ -125,14 +125,14 @@ namespace OpenSim.Server.Handlers.Asset
if (asset == null || asset.Data.Length == 0)
{
MainConsole.Instance.OutputFormat("Could not find asset with ID {0}", args[2]);
MainConsole.Instance.Output("Could not find asset with ID {0}", null, args[2]);
return;
}
if (!m_AssetService.Delete(asset.ID))
MainConsole.Instance.OutputFormat("ERROR: Could not delete asset {0} {1}", asset.ID, asset.Name);
MainConsole.Instance.Output("ERROR: Could not delete asset {0} {1}", null, asset.ID, asset.Name);
else
MainConsole.Instance.OutputFormat("Deleted asset {0} {1}", asset.ID, asset.Name);
MainConsole.Instance.Output("Deleted asset {0} {1}", null, asset.ID, asset.Name);
}
void HandleDumpAsset(string module, string[] args)
@ -148,14 +148,14 @@ namespace OpenSim.Server.Handlers.Asset
if (!UUID.TryParse(rawAssetId, out assetId))
{
MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid ID format", rawAssetId);
MainConsole.Instance.Output("ERROR: {0} is not a valid ID format", null, rawAssetId);
return;
}
AssetBase asset = m_AssetService.Get(assetId.ToString());
if (asset == null)
{
MainConsole.Instance.OutputFormat("ERROR: No asset found with ID {0}", assetId);
MainConsole.Instance.Output("ERROR: No asset found with ID {0}", null, assetId);
return;
}
@ -172,7 +172,7 @@ namespace OpenSim.Server.Handlers.Asset
}
}
MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
MainConsole.Instance.Output("Asset dumped to file {0}", null, fileName);
}
void HandleShowAsset(string module, string[] args)
@ -193,13 +193,13 @@ namespace OpenSim.Server.Handlers.Asset
int i;
MainConsole.Instance.OutputFormat("Name: {0}", asset.Name);
MainConsole.Instance.OutputFormat("Description: {0}", asset.Description);
MainConsole.Instance.OutputFormat("Type: {0} (type number = {1})", (AssetType)asset.Type, asset.Type);
MainConsole.Instance.OutputFormat("Content-type: {0}", asset.Metadata.ContentType);
MainConsole.Instance.OutputFormat("Size: {0} bytes", asset.Data.Length);
MainConsole.Instance.OutputFormat("Temporary: {0}", asset.Temporary ? "yes" : "no");
MainConsole.Instance.OutputFormat("Flags: {0}", asset.Metadata.Flags);
MainConsole.Instance.Output("Name: {0}", null, asset.Name);
MainConsole.Instance.Output("Description: {0}", null, asset.Description);
MainConsole.Instance.Output("Type: {0} (type number = {1})", null, (AssetType)asset.Type, asset.Type);
MainConsole.Instance.Output("Content-type: {0}", null, asset.Metadata.ContentType);
MainConsole.Instance.Output("Size: {0} bytes", null, asset.Data.Length);
MainConsole.Instance.Output("Temporary: {0}", null, asset.Temporary ? "yes" : "no");
MainConsole.Instance.Output("Flags: {0}", null, asset.Metadata.Flags);
for (i = 0 ; i < 5 ; i++)
{

12
OpenSim/Services/GridService/GridService.cs Normal file → Executable file
View File

@ -772,7 +772,7 @@ namespace OpenSim.Services.GridService
if (!UUID.TryParse(rawRegionUuid, out regionUuid))
{
MainConsole.Instance.OutputFormat("{0} is not a valid region uuid", rawRegionUuid);
MainConsole.Instance.Output("{0} is not a valid region uuid", null, rawRegionUuid);
return;
}
@ -780,18 +780,18 @@ namespace OpenSim.Services.GridService
if (region == null)
{
MainConsole.Instance.OutputFormat("No region with UUID {0}", regionUuid);
MainConsole.Instance.Output("No region with UUID {0}", null, regionUuid);
return;
}
if (DeregisterRegion(regionUuid))
{
MainConsole.Instance.OutputFormat("Deregistered {0} {1}", region.RegionName, regionUuid);
MainConsole.Instance.Output("Deregistered {0} {1}", null, region.RegionName, regionUuid);
}
else
{
// I don't think this can ever occur if we know that the region exists.
MainConsole.Instance.OutputFormat("Error deregistering {0} {1}", region.RegionName, regionUuid);
MainConsole.Instance.Output("Error deregistering {0} {1}", null, region.RegionName, regionUuid);
}
}
}
@ -828,7 +828,7 @@ namespace OpenSim.Services.GridService
MainConsole.Instance.Output("it will count regions that are inactive but were not deregistered from the grid service");
MainConsole.Instance.Output("(e.g. simulator crashed rather than shutting down cleanly).\n");
MainConsole.Instance.OutputFormat("Grid size: {0} km squared.", size / 1000000);
MainConsole.Instance.Output("Grid size: {0} km squared.", null, size / 1000000);
}
private void HandleShowRegion(string module, string[] cmd)
@ -877,7 +877,7 @@ namespace OpenSim.Services.GridService
if (region == null)
{
MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);
MainConsole.Instance.Output("No region found at {0},{1}", null, x, y);
return;
}

8
OpenSim/Services/LLLoginService/LLLoginService.cs Normal file → Executable file
View File

@ -1122,22 +1122,22 @@ namespace OpenSim.Services.LLLoginService
if (cmd.Length > 2)
{
if (Int32.TryParse(cmd[2], out m_MinLoginLevel))
MainConsole.Instance.OutputFormat("Set minimum login level to {0}", m_MinLoginLevel);
MainConsole.Instance.Output("Set minimum login level to {0}", null, m_MinLoginLevel);
else
MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid login level", cmd[2]);
MainConsole.Instance.Output("ERROR: {0} is not a valid login level", null, cmd[2]);
}
break;
case "reset":
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
MainConsole.Instance.OutputFormat("Reset min login level to {0}", m_MinLoginLevel);
MainConsole.Instance.Output("Reset min login level to {0}", null, m_MinLoginLevel);
break;
case "text":
if (cmd.Length > 2)
{
m_WelcomeMessage = cmd[2];
MainConsole.Instance.OutputFormat("Login welcome message set to '{0}'", m_WelcomeMessage);
MainConsole.Instance.Output("Login welcome message set to '{0}'", null, m_WelcomeMessage);
}
break;
}

4
OpenSim/Services/UserAccountService/GridUserService.cs Normal file → Executable file
View File

@ -94,7 +94,7 @@ namespace OpenSim.Services.UserAccountService
MainConsole.Instance.Output(cdl.ToString());
}
MainConsole.Instance.OutputFormat("Entries: {0}", data.Length);
MainConsole.Instance.Output("Entries: {0}", null, data.Length);
}
protected void HandleShowGridUsersOnline(string module, string[] cmdparams)
@ -123,7 +123,7 @@ namespace OpenSim.Services.UserAccountService
}
}
MainConsole.Instance.OutputFormat("Users online: {0}", onlineRecentlyCount);
MainConsole.Instance.Output("Users online: {0}", null, onlineRecentlyCount);
}
private GridUserData GetGridUserData(string userID)

View File

@ -385,28 +385,28 @@ namespace OpenSim.Services.UserAccountService
// List<char> excluded = new List<char>(new char[]{' '});
List<char> excluded = new List<char>(new char[]{' ', '@', '.', ':' }); //Protect user names from using valid HG identifiers.
if (cmdparams.Length < 3)
firstName = MainConsole.Instance.CmdPrompt("First name", "Default", excluded);
firstName = MainConsole.Instance.Prompt("First name", "Default", excluded);
else firstName = cmdparams[2];
if (cmdparams.Length < 4)
lastName = MainConsole.Instance.CmdPrompt("Last name", "User", excluded);
lastName = MainConsole.Instance.Prompt("Last name", "User", excluded);
else lastName = cmdparams[3];
if (cmdparams.Length < 5)
password = MainConsole.Instance.PasswdPrompt("Password");
password = MainConsole.Instance.Prompt("Password", null, null, false);
else password = cmdparams[4];
if (cmdparams.Length < 6)
email = MainConsole.Instance.CmdPrompt("Email", "");
email = MainConsole.Instance.Prompt("Email", "");
else email = cmdparams[5];
if (cmdparams.Length < 7)
rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID (enter for random)", "");
rawPrincipalId = MainConsole.Instance.Prompt("User ID (enter for random)", "");
else
rawPrincipalId = cmdparams[6];
if (cmdparams.Length < 8)
model = MainConsole.Instance.CmdPrompt("Model name","");
model = MainConsole.Instance.Prompt("Model name","");
else
model = cmdparams[7];
@ -434,19 +434,19 @@ namespace OpenSim.Services.UserAccountService
if (ua == null)
{
MainConsole.Instance.OutputFormat("No user named {0} {1}", firstName, lastName);
MainConsole.Instance.Output("No user named {0} {1}", null, firstName, lastName);
return;
}
MainConsole.Instance.OutputFormat("Name: {0}", ua.Name);
MainConsole.Instance.OutputFormat("ID: {0}", ua.PrincipalID);
MainConsole.Instance.OutputFormat("Title: {0}", ua.UserTitle);
MainConsole.Instance.OutputFormat("E-mail: {0}", ua.Email);
MainConsole.Instance.OutputFormat("Created: {0}", Utils.UnixTimeToDateTime(ua.Created));
MainConsole.Instance.OutputFormat("Level: {0}", ua.UserLevel);
MainConsole.Instance.OutputFormat("Flags: {0}", ua.UserFlags);
MainConsole.Instance.Output("Name: {0}", null, ua.Name);
MainConsole.Instance.Output("ID: {0}", null, ua.PrincipalID);
MainConsole.Instance.Output("Title: {0}", null, ua.UserTitle);
MainConsole.Instance.Output("E-mail: {0}", null, ua.Email);
MainConsole.Instance.Output("Created: {0}", null, Utils.UnixTimeToDateTime(ua.Created));
MainConsole.Instance.Output("Level: {0}", null, ua.UserLevel);
MainConsole.Instance.Output("Flags: {0}", null, ua.UserFlags);
foreach (KeyValuePair<string, Object> kvp in ua.ServiceURLs)
MainConsole.Instance.OutputFormat("{0}: {1}", kvp.Key, kvp.Value);
MainConsole.Instance.Output("{0}: {1}", null, kvp.Key, kvp.Value);
}
protected void HandleResetUserPassword(string module, string[] cmdparams)
@ -456,21 +456,21 @@ namespace OpenSim.Services.UserAccountService
string newPassword;
if (cmdparams.Length < 4)
firstName = MainConsole.Instance.CmdPrompt("First name");
firstName = MainConsole.Instance.Prompt("First name");
else firstName = cmdparams[3];
if (cmdparams.Length < 5)
lastName = MainConsole.Instance.CmdPrompt("Last name");
lastName = MainConsole.Instance.Prompt("Last name");
else lastName = cmdparams[4];
if (cmdparams.Length < 6)
newPassword = MainConsole.Instance.PasswdPrompt("New password");
newPassword = MainConsole.Instance.Prompt("New password", null, null, false);
else newPassword = cmdparams[5];
UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
if (account == null)
{
MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName);
MainConsole.Instance.Output("No such user as {0} {1}", null, firstName, lastName);
return;
}
@ -479,9 +479,9 @@ namespace OpenSim.Services.UserAccountService
success = m_AuthenticationService.SetPassword(account.PrincipalID, newPassword);
if (!success)
MainConsole.Instance.OutputFormat("Unable to reset password for account {0} {1}.", firstName, lastName);
MainConsole.Instance.Output("Unable to reset password for account {0} {1}.", null, firstName, lastName);
else
MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName);
MainConsole.Instance.Output("Password reset for user {0} {1}", null, firstName, lastName);
}
protected void HandleResetUserEmail(string module, string[] cmdparams)
@ -491,21 +491,21 @@ namespace OpenSim.Services.UserAccountService
string newEmail;
if (cmdparams.Length < 4)
firstName = MainConsole.Instance.CmdPrompt("First name");
firstName = MainConsole.Instance.Prompt("First name");
else firstName = cmdparams[3];
if (cmdparams.Length < 5)
lastName = MainConsole.Instance.CmdPrompt("Last name");
lastName = MainConsole.Instance.Prompt("Last name");
else lastName = cmdparams[4];
if (cmdparams.Length < 6)
newEmail = MainConsole.Instance.PasswdPrompt("New Email");
newEmail = MainConsole.Instance.Prompt("New Email");
else newEmail = cmdparams[5];
UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
if (account == null)
{
MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName);
MainConsole.Instance.Output("No such user as {0} {1}", null, firstName, lastName);
return;
}
@ -515,9 +515,9 @@ namespace OpenSim.Services.UserAccountService
success = StoreUserAccount(account);
if (!success)
MainConsole.Instance.OutputFormat("Unable to set Email for account {0} {1}.", firstName, lastName);
MainConsole.Instance.Output("Unable to set Email for account {0} {1}.", null, firstName, lastName);
else
MainConsole.Instance.OutputFormat("User Email set for user {0} {1} to {2}", firstName, lastName, account.Email);
MainConsole.Instance.Output("User Email set for user {0} {1} to {2}", null, firstName, lastName, account.Email);
}
@ -529,25 +529,25 @@ namespace OpenSim.Services.UserAccountService
int level;
if (cmdparams.Length < 4)
firstName = MainConsole.Instance.CmdPrompt("First name");
firstName = MainConsole.Instance.Prompt("First name");
else firstName = cmdparams[3];
if (cmdparams.Length < 5)
lastName = MainConsole.Instance.CmdPrompt("Last name");
lastName = MainConsole.Instance.Prompt("Last name");
else lastName = cmdparams[4];
UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
if (account == null) {
MainConsole.Instance.OutputFormat("No such user");
MainConsole.Instance.Output("No such user");
return;
}
if (cmdparams.Length < 6)
rawLevel = MainConsole.Instance.CmdPrompt("User level");
rawLevel = MainConsole.Instance.Prompt("User level");
else rawLevel = cmdparams[5];
if(int.TryParse(rawLevel, out level) == false) {
MainConsole.Instance.OutputFormat("Invalid user level");
MainConsole.Instance.Output("Invalid user level");
return;
}
@ -555,9 +555,9 @@ namespace OpenSim.Services.UserAccountService
bool success = StoreUserAccount(account);
if (!success)
MainConsole.Instance.OutputFormat("Unable to set user level for account {0} {1}.", firstName, lastName);
MainConsole.Instance.Output("Unable to set user level for account {0} {1}.", null, firstName, lastName);
else
MainConsole.Instance.OutputFormat("User level set for user {0} {1} to {2}", firstName, lastName, level);
MainConsole.Instance.Output("User level set for user {0} {1} to {2}", null, firstName, lastName, level);
}
#endregion

51
OpenSim/Tools/pCampBot/BotManager.cs Normal file → Executable file
View File

@ -352,7 +352,7 @@ namespace pCampBot
}
else
{
MainConsole.Instance.OutputFormat("No behaviour with abbreviated name {0} found", abName);
MainConsole.Instance.Output("No behaviour with abbreviated name {0} found", null, abName);
}
}
@ -365,8 +365,8 @@ namespace pCampBot
{
if (BotConnectingState != BotManagerBotConnectingState.Ready)
{
MainConsole.Instance.OutputFormat(
"Bot connecting status is {0}. Please wait for previous process to complete.", BotConnectingState);
MainConsole.Instance.Output(
"Bot connecting status is {0}. Please wait for previous process to complete.", null, BotConnectingState);
return;
}
@ -486,8 +486,9 @@ namespace pCampBot
BotManager bm, List<IBehaviour> behaviours,
string firstName, string lastName, string password, string loginUri, string startLocation, string wearSetting)
{
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"[BOT MANAGER]: Creating bot {0} {1}, behaviours are {2}",
null,
firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray()));
Bot pb = new Bot(bm, behaviours, firstName, lastName, password, startLocation, loginUri);
@ -552,7 +553,7 @@ namespace pCampBot
botsToConnect = Math.Min(botsToConnect, disconnectedBots);
}
MainConsole.Instance.OutputFormat("Connecting {0} bots", botsToConnect);
MainConsole.Instance.Output("Connecting {0} bots", null, botsToConnect);
ConnectBots(botsToConnect);
}
@ -562,7 +563,7 @@ namespace pCampBot
{
if (cmd.Length < 3 || cmd.Length > 4)
{
MainConsole.Instance.OutputFormat("Usage: add behaviour <abbreviated-behaviour> [<bot-number>]");
MainConsole.Instance.Output("Usage: add behaviour <abbreviated-behaviour> [<bot-number>]");
return;
}
@ -585,7 +586,7 @@ namespace pCampBot
if (bot == null)
{
MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber);
MainConsole.Instance.Output("Error: No bot found with number {0}", null, botNumber);
return;
}
@ -606,8 +607,9 @@ namespace pCampBot
behavioursAdded.Add(behaviour);
}
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Added behaviours {0} to bot {1}",
null,
string.Join(", ", behavioursAdded.ConvertAll<string>(b => b.Name).ToArray()), bot.Name);
}
}
@ -616,7 +618,7 @@ namespace pCampBot
{
if (cmd.Length < 3 || cmd.Length > 4)
{
MainConsole.Instance.OutputFormat("Usage: remove behaviour <abbreviated-behaviour> [<bot-number>]");
MainConsole.Instance.Output("Usage: remove behaviour <abbreviated-behaviour> [<bot-number>]");
return;
}
@ -639,7 +641,7 @@ namespace pCampBot
if (bot == null)
{
MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber);
MainConsole.Instance.Output("Error: No bot found with number {0}", null, botNumber);
return;
}
@ -664,8 +666,9 @@ namespace pCampBot
}
}
MainConsole.Instance.OutputFormat(
MainConsole.Instance.Output(
"Removed behaviours {0} from bot {1}",
null,
string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name);
}
}
@ -701,7 +704,7 @@ namespace pCampBot
private void DisconnectBotsInternal(List<Bot> connectedBots, int disconnectCount)
{
MainConsole.Instance.OutputFormat("Disconnecting {0} bots", disconnectCount);
MainConsole.Instance.Output("Disconnecting {0} bots", null, disconnectCount);
int disconnectedBots = 0;
@ -731,7 +734,7 @@ namespace pCampBot
{
if (bot.ConnectionState == ConnectionState.Connected)
{
MainConsole.Instance.OutputFormat("Sitting bot {0} on ground.", bot.Name);
MainConsole.Instance.Output("Sitting bot {0} on ground.", null, bot.Name);
bot.SitOnGround();
}
}
@ -746,7 +749,7 @@ namespace pCampBot
{
if (bot.ConnectionState == ConnectionState.Connected)
{
MainConsole.Instance.OutputFormat("Standing bot {0} from ground.", bot.Name);
MainConsole.Instance.Output("Standing bot {0} from ground.", null, bot.Name);
bot.Stand();
}
}
@ -761,7 +764,7 @@ namespace pCampBot
if (connectedBots > 0)
{
MainConsole.Instance.OutputFormat("Please disconnect {0} connected bots first", connectedBots);
MainConsole.Instance.Output("Please disconnect {0} connected bots first", null, connectedBots);
return;
}
}
@ -785,8 +788,8 @@ namespace pCampBot
if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newSendAgentUpdatesSetting))
return;
MainConsole.Instance.OutputFormat(
"Setting SEND_AGENT_UPDATES to {0} for all bots", newSendAgentUpdatesSetting);
MainConsole.Instance.Output("Setting SEND_AGENT_UPDATES to {0} for all bots",
null, newSendAgentUpdatesSetting);
lock (m_bots)
m_bots.ForEach(b => b.Client.Settings.SEND_AGENT_UPDATES = newSendAgentUpdatesSetting);
@ -801,7 +804,7 @@ namespace pCampBot
{
if (args.Length != 6)
{
MainConsole.Instance.OutputFormat("Usage: debug lludp packet <level> <bot-first-name> <bot-last-name>");
MainConsole.Instance.Output("Usage: debug lludp packet <level> <bot-first-name> <bot-last-name>");
return;
}
@ -820,26 +823,26 @@ namespace pCampBot
if (bot == null)
{
MainConsole.Instance.OutputFormat("No bot named {0} {1}", botFirstName, botLastName);
MainConsole.Instance.Output("No bot named {0} {1}", null, botFirstName, botLastName);
return;
}
bot.PacketDebugLevel = level;
MainConsole.Instance.OutputFormat("Set debug level of {0} to {1}", bot.Name, bot.PacketDebugLevel);
MainConsole.Instance.Output("Set debug level of {0} to {1}", null, bot.Name, bot.PacketDebugLevel);
}
private void HandleShowRegions(string module, string[] cmd)
{
string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}";
MainConsole.Instance.OutputFormat(outputFormat, "Name", "Handle", "X", "Y");
MainConsole.Instance.Output(outputFormat, null, "Name", "Handle", "X", "Y");
lock (RegionsKnown)
{
foreach (GridRegion region in RegionsKnown.Values)
{
MainConsole.Instance.OutputFormat(
outputFormat, region.Name, region.RegionHandle, region.X, region.Y);
MainConsole.Instance.Output(
outputFormat, null, region.Name, region.RegionHandle, region.X, region.Y);
}
}
}
@ -908,7 +911,7 @@ namespace pCampBot
if (bot == null)
{
MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber);
MainConsole.Instance.Output("Error: No bot found with number {0}", null, botNumber);
return;
}