diff options
Diffstat (limited to 'OpenSim/Framework/Console')
-rw-r--r-- | OpenSim/Framework/Console/ConsoleUtil.cs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs index c0ff454..794bfaf 100644 --- a/OpenSim/Framework/Console/ConsoleUtil.cs +++ b/OpenSim/Framework/Console/ConsoleUtil.cs | |||
@@ -179,8 +179,8 @@ namespace OpenSim.Framework.Console | |||
179 | /// Convert a console integer to an int, automatically complaining if a console is given. | 179 | /// Convert a console integer to an int, automatically complaining if a console is given. |
180 | /// </summary> | 180 | /// </summary> |
181 | /// <param name='console'>Can be null if no console is available.</param> | 181 | /// <param name='console'>Can be null if no console is available.</param> |
182 | /// <param name='rawConsoleVector'>/param> | 182 | /// <param name='rawConsoleInt'>/param> |
183 | /// <param name='vector'></param> | 183 | /// <param name='i'></param> |
184 | /// <returns></returns> | 184 | /// <returns></returns> |
185 | public static bool TryParseConsoleInt(ICommandConsole console, string rawConsoleInt, out int i) | 185 | public static bool TryParseConsoleInt(ICommandConsole console, string rawConsoleInt, out int i) |
186 | { | 186 | { |
@@ -194,6 +194,31 @@ namespace OpenSim.Framework.Console | |||
194 | 194 | ||
195 | return true; | 195 | return true; |
196 | } | 196 | } |
197 | |||
198 | /// <summary> | ||
199 | /// Convert a console integer to a natural int, automatically complaining if a console is given. | ||
200 | /// </summary> | ||
201 | /// <param name='console'>Can be null if no console is available.</param> | ||
202 | /// <param name='rawConsoleInt'>/param> | ||
203 | /// <param name='i'></param> | ||
204 | /// <returns></returns> | ||
205 | public static bool TryParseConsoleNaturalInt(ICommandConsole console, string rawConsoleInt, out int i) | ||
206 | { | ||
207 | if (TryParseConsoleInt(console, rawConsoleInt, out i)) | ||
208 | { | ||
209 | if (i < 0) | ||
210 | { | ||
211 | if (console != null) | ||
212 | console.OutputFormat("ERROR: {0} is not a positive integer", rawConsoleInt); | ||
213 | |||
214 | return false; | ||
215 | } | ||
216 | |||
217 | return true; | ||
218 | } | ||
219 | |||
220 | return false; | ||
221 | } | ||
197 | 222 | ||
198 | /// <summary> | 223 | /// <summary> |
199 | /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 | 224 | /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 |