Make it possible for the "deregister region id" command to accept more than one id

varregion
Justin Clark-Casey (justincc) 2013-08-23 01:03:27 +01:00
parent 61c20bd06a
commit 2be786709b
1 changed files with 27 additions and 24 deletions

View File

@ -86,7 +86,7 @@ namespace OpenSim.Services.GridService
{ {
MainConsole.Instance.Commands.AddCommand("Regions", true, MainConsole.Instance.Commands.AddCommand("Regions", true,
"deregister region id", "deregister region id",
"deregister region id <Region UUID>", "deregister region id <region-id>+",
"Deregister a region manually.", "Deregister a region manually.",
String.Empty, String.Empty,
HandleDeregisterRegion); HandleDeregisterRegion);
@ -526,13 +526,15 @@ namespace OpenSim.Services.GridService
private void HandleDeregisterRegion(string module, string[] cmd) private void HandleDeregisterRegion(string module, string[] cmd)
{ {
if (cmd.Length != 4) if (cmd.Length < 4)
{ {
MainConsole.Instance.Output("Syntax: degregister region id <Region UUID>"); MainConsole.Instance.Output("Usage: degregister region id <region-id>+");
return; return;
} }
string rawRegionUuid = cmd[3]; for (int i = 3; i < cmd.Length; i++)
{
string rawRegionUuid = cmd[i];
UUID regionUuid; UUID regionUuid;
if (!UUID.TryParse(rawRegionUuid, out regionUuid)) if (!UUID.TryParse(rawRegionUuid, out regionUuid))
@ -558,6 +560,7 @@ namespace OpenSim.Services.GridService
// I don't think this can ever occur if we know that the region exists. // 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.OutputFormat("Error deregistering {0} {1}", region.RegionName, regionUuid);
} }
}
return; return;
} }