aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/GridService/GridService.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 8a60ca5..11897f8 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -85,6 +85,13 @@ namespace OpenSim.Services.GridService
85 if (MainConsole.Instance != null) 85 if (MainConsole.Instance != null)
86 { 86 {
87 MainConsole.Instance.Commands.AddCommand("Regions", true, 87 MainConsole.Instance.Commands.AddCommand("Regions", true,
88 "deregister region",
89 "deregister region <Region UUID>",
90 "Deregister a region manually.",
91 String.Empty,
92 HandleDeregisterRegion);
93
94 MainConsole.Instance.Commands.AddCommand("Regions", true,
88 "show region", 95 "show region",
89 "show region <Region name>", 96 "show region <Region name>",
90 "Show details on a region", 97 "Show details on a region",
@@ -495,6 +502,44 @@ namespace OpenSim.Services.GridService
495 return -1; 502 return -1;
496 } 503 }
497 504
505 private void HandleDeregisterRegion(string module, string[] cmd)
506 {
507 if (cmd.Length != 3)
508 {
509 MainConsole.Instance.Output("Syntax: degregister region <Region UUID>");
510 return;
511 }
512
513 string rawRegionUuid = cmd[2];
514 UUID regionUuid;
515
516 if (!UUID.TryParse(rawRegionUuid, out regionUuid))
517 {
518 MainConsole.Instance.OutputFormat("{0} is not a valid region uuid", rawRegionUuid);
519 return;
520 }
521
522 GridRegion region = GetRegionByUUID(UUID.Zero, regionUuid);
523
524 if (region == null)
525 {
526 MainConsole.Instance.OutputFormat("No region with UUID {0}", regionUuid);
527 return;
528 }
529
530 if (DeregisterRegion(regionUuid))
531 {
532 MainConsole.Instance.OutputFormat("Deregistered {0} {1}", region.RegionName, regionUuid);
533 }
534 else
535 {
536 // I don't think this can ever occur if we know that the region exists.
537 MainConsole.Instance.OutputFormat("Error deregistering {0} {1}", region.RegionName, regionUuid);
538 }
539
540 return;
541 }
542
498 private void HandleShowRegion(string module, string[] cmd) 543 private void HandleShowRegion(string module, string[] cmd)
499 { 544 {
500 if (cmd.Length != 3) 545 if (cmd.Length != 3)