Make it possible to disconnected a specified number of bots via the pCampbot console command "disconnect [<n>]"

Bots disconnected are ascending from last in numeric order.
Temporarily no way to reconnect bots.
This commit is contained in:
Justin Clark-Casey (justincc)
2013-08-19 21:00:31 +01:00
parent 49b7cbda72
commit 2fa42f24fd
2 changed files with 82 additions and 48 deletions

View File

@@ -179,8 +179,8 @@ namespace OpenSim.Framework.Console
/// Convert a console integer to an int, automatically complaining if a console is given.
/// </summary>
/// <param name='console'>Can be null if no console is available.</param>
/// <param name='rawConsoleVector'>/param>
/// <param name='vector'></param>
/// <param name='rawConsoleInt'>/param>
/// <param name='i'></param>
/// <returns></returns>
public static bool TryParseConsoleInt(ICommandConsole console, string rawConsoleInt, out int i)
{
@@ -194,6 +194,31 @@ namespace OpenSim.Framework.Console
return true;
}
/// <summary>
/// Convert a console integer to a natural int, automatically complaining if a console is given.
/// </summary>
/// <param name='console'>Can be null if no console is available.</param>
/// <param name='rawConsoleInt'>/param>
/// <param name='i'></param>
/// <returns></returns>
public static bool TryParseConsoleNaturalInt(ICommandConsole console, string rawConsoleInt, out int i)
{
if (TryParseConsoleInt(console, rawConsoleInt, out i))
{
if (i < 0)
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a positive integer", rawConsoleInt);
return false;
}
return true;
}
return false;
}
/// <summary>
/// Convert a minimum vector input from the console to an OpenMetaverse.Vector3