aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/GridService.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-23 01:03:27 +0100
committerJustin Clark-Casey (justincc)2013-08-23 01:03:27 +0100
commit2be786709badc9913f348932e75d3481d445caf8 (patch)
treef7aea9c1b619508ce2af361c734e2a2f43f808c8 /OpenSim/Services/GridService/GridService.cs
parentRemove old and unused ScenePresence.RestoreInCurrentScene() (diff)
downloadopensim-SC_OLD-2be786709badc9913f348932e75d3481d445caf8.zip
opensim-SC_OLD-2be786709badc9913f348932e75d3481d445caf8.tar.gz
opensim-SC_OLD-2be786709badc9913f348932e75d3481d445caf8.tar.bz2
opensim-SC_OLD-2be786709badc9913f348932e75d3481d445caf8.tar.xz
Make it possible for the "deregister region id" command to accept more than one id
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r--OpenSim/Services/GridService/GridService.cs51
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;