private void UnregisterRegionCmd(List <string> args, TTY io, UUID limitedToScene) { if (limitedToScene != UUID.Zero) { io.Write("Command not allowed on limited console"); } else if (args[0] == "help" || args.Count != 4) { io.Write("unregister region id <regionid>\nunregister region name <name>"); } else { UUID id; RegionInfo ri; switch (args[2]) { case "id": if (!UUID.TryParse(args[3], out id)) { io.Write("regionid is not valid"); return; } break; case "name": if (!m_GridService.TryGetValue(args[3], out ri)) { io.WriteFormatted("region \"{0}\" is not known", args[3]); return; } id = ri.ID; break; default: io.WriteFormatted("Unknown region identifier type {0}", args[2]); return; } try { m_GridService.UnregisterRegion(id); } catch { io.Write("Failed to remove region"); } } }
private void HandleMapServerUnregisterRegion(HttpRequest req, Map jsondata) { UUID regionId; if (!jsondata.TryGetValue("id", out regionId)) { m_WebIF.ErrorResponse(req, AdminWebIfErrorResult.InvalidRequest); } else if (!m_GridService.ContainsKey(regionId)) { m_WebIF.ErrorResponse(req, AdminWebIfErrorResult.NotFound); } else { m_GridService.UnregisterRegion(regionId); m_WebIF.SuccessResponse(req, new Map()); } }