diff options
author | Justin Clark-Casey (justincc) | 2012-06-13 03:49:22 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-13 03:49:22 +0100 |
commit | 5145356467244d6a4d66cd36eef22a23d6fc73a1 (patch) | |
tree | d45ea4e917d929608f3c28dc5c6b1360e4a88924 /OpenSim/Services/GridService | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-5145356467244d6a4d66cd36eef22a23d6fc73a1.zip opensim-SC-5145356467244d6a4d66cd36eef22a23d6fc73a1.tar.gz opensim-SC-5145356467244d6a4d66cd36eef22a23d6fc73a1.tar.bz2 opensim-SC-5145356467244d6a4d66cd36eef22a23d6fc73a1.tar.xz |
Add "deregister region" by uuid command to grid service to allow manual deregistration of simulators.
Useful if a simulator has crashed without removing its regions and those regions have been reconfigured differently
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 45 |
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) |