diff options
author | Justin Clark-Casey (justincc) | 2013-08-23 01:03:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-09-04 00:43:48 +0100 |
commit | b21f261008e677c294c6d6f44e784c330c360d74 (patch) | |
tree | 140f330d487c1b47da1968178898d233547882cf /OpenSim/Services/GridService/GridService.cs | |
parent | Remove old and unused ScenePresence.RestoreInCurrentScene() (diff) | |
download | opensim-SC_OLD-b21f261008e677c294c6d6f44e784c330c360d74.zip opensim-SC_OLD-b21f261008e677c294c6d6f44e784c330c360d74.tar.gz opensim-SC_OLD-b21f261008e677c294c6d6f44e784c330c360d74.tar.bz2 opensim-SC_OLD-b21f261008e677c294c6d6f44e784c330c360d74.tar.xz |
Make it possible for the "deregister region id" command to accept more than one id
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index daebf8b..59b150b 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -86,7 +86,7 @@ namespace OpenSim.Services.GridService | |||
86 | { | 86 | { |
87 | MainConsole.Instance.Commands.AddCommand("Regions", true, | 87 | MainConsole.Instance.Commands.AddCommand("Regions", true, |
88 | "deregister region id", | 88 | "deregister region id", |
89 | "deregister region id <Region UUID>", | 89 | "deregister region id <region-id>+", |
90 | "Deregister a region manually.", | 90 | "Deregister a region manually.", |
91 | String.Empty, | 91 | String.Empty, |
92 | HandleDeregisterRegion); | 92 | HandleDeregisterRegion); |
@@ -526,37 +526,40 @@ namespace OpenSim.Services.GridService | |||
526 | 526 | ||
527 | private void HandleDeregisterRegion(string module, string[] cmd) | 527 | private void HandleDeregisterRegion(string module, string[] cmd) |
528 | { | 528 | { |
529 | if (cmd.Length != 4) | 529 | if (cmd.Length < 4) |
530 | { | 530 | { |
531 | MainConsole.Instance.Output("Syntax: degregister region id <Region UUID>"); | 531 | MainConsole.Instance.Output("Usage: degregister region id <region-id>+"); |
532 | return; | 532 | return; |
533 | } | 533 | } |
534 | 534 | ||
535 | string rawRegionUuid = cmd[3]; | 535 | for (int i = 3; i < cmd.Length; i++) |
536 | UUID regionUuid; | ||
537 | |||
538 | if (!UUID.TryParse(rawRegionUuid, out regionUuid)) | ||
539 | { | 536 | { |
540 | MainConsole.Instance.OutputFormat("{0} is not a valid region uuid", rawRegionUuid); | 537 | string rawRegionUuid = cmd[i]; |
541 | return; | 538 | UUID regionUuid; |
542 | } | ||
543 | 539 | ||
544 | GridRegion region = GetRegionByUUID(UUID.Zero, regionUuid); | 540 | if (!UUID.TryParse(rawRegionUuid, out regionUuid)) |
541 | { | ||
542 | MainConsole.Instance.OutputFormat("{0} is not a valid region uuid", rawRegionUuid); | ||
543 | return; | ||
544 | } | ||
545 | 545 | ||
546 | if (region == null) | 546 | GridRegion region = GetRegionByUUID(UUID.Zero, regionUuid); |
547 | { | ||
548 | MainConsole.Instance.OutputFormat("No region with UUID {0}", regionUuid); | ||
549 | return; | ||
550 | } | ||
551 | 547 | ||
552 | if (DeregisterRegion(regionUuid)) | 548 | if (region == null) |
553 | { | 549 | { |
554 | MainConsole.Instance.OutputFormat("Deregistered {0} {1}", region.RegionName, regionUuid); | 550 | MainConsole.Instance.OutputFormat("No region with UUID {0}", regionUuid); |
555 | } | 551 | return; |
556 | else | 552 | } |
557 | { | 553 | |
558 | // I don't think this can ever occur if we know that the region exists. | 554 | if (DeregisterRegion(regionUuid)) |
559 | MainConsole.Instance.OutputFormat("Error deregistering {0} {1}", region.RegionName, regionUuid); | 555 | { |
556 | MainConsole.Instance.OutputFormat("Deregistered {0} {1}", region.RegionName, regionUuid); | ||
557 | } | ||
558 | else | ||
559 | { | ||
560 | // I don't think this can ever occur if we know that the region exists. | ||
561 | MainConsole.Instance.OutputFormat("Error deregistering {0} {1}", region.RegionName, regionUuid); | ||
562 | } | ||
560 | } | 563 | } |
561 | 564 | ||
562 | return; | 565 | return; |