From f6f7585ec583788b11960cf5a1ac36409e6583aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 29 Jul 2014 00:13:29 +0100 Subject: Add a "debug scene set child-repri " command that allows child reprioritization distance to be changed on the fly. This governs when child agent position changes are sent to neighbouring regions. Corresponding config parameter is ChildReprioritizationDistance in [InterestManagement] in OpenSim.ini For test purposes. --- OpenSim/Framework/Console/ConsoleUtil.cs | 44 ++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs index 744f652..44f6dc1 100644 --- a/OpenSim/Framework/Console/ConsoleUtil.cs +++ b/OpenSim/Framework/Console/ConsoleUtil.cs @@ -156,7 +156,7 @@ namespace OpenSim.Framework.Console } /// - /// Convert a console integer to an int, automatically complaining if a console is given. + /// Convert a console input to a bool, automatically complaining if a console is given. /// /// Can be null if no console is available. /// /param> @@ -176,7 +176,7 @@ namespace OpenSim.Framework.Console } /// - /// Convert a console integer to an int, automatically complaining if a console is given. + /// Convert a console input to an int, automatically complaining if a console is given. /// /// Can be null if no console is available. /// /param> @@ -196,6 +196,46 @@ namespace OpenSim.Framework.Console } /// + /// Convert a console input to a float, automatically complaining if a console is given. + /// + /// Can be null if no console is available. + /// /param> + /// + /// + public static bool TryParseConsoleFloat(ICommandConsole console, string rawConsoleInput, out float i) + { + if (!float.TryParse(rawConsoleInput, out i)) + { + if (console != null) + console.OutputFormat("ERROR: {0} is not a valid float", rawConsoleInput); + + return false; + } + + return true; + } + + /// + /// Convert a console input to a double, automatically complaining if a console is given. + /// + /// Can be null if no console is available. + /// /param> + /// + /// + public static bool TryParseConsoleDouble(ICommandConsole console, string rawConsoleInput, out double i) + { + if (!double.TryParse(rawConsoleInput, out i)) + { + if (console != null) + console.OutputFormat("ERROR: {0} is not a valid double", rawConsoleInput); + + return false; + } + + return true; + } + + /// /// Convert a console integer to a natural int, automatically complaining if a console is given. /// /// Can be null if no console is available. -- cgit v1.1