From 19e4473a9732bfb1ebbace4bcbfbe15a0d833941 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 27 Jan 2011 20:57:59 +0000 Subject: [PATCH] Put confirmation on "land clear" command to avoid nasty accidents --- .../World/Land/LandManagementModule.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index a46be13557..5243be88bf 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1653,9 +1653,21 @@ namespace OpenSim.Region.CoreModules.World.Land protected void ClearCommand(Object[] args) { - Clear(true); + string response = MainConsole.Instance.CmdPrompt( + string.Format( + "Are you sure that you want to clear all land parcels from {0} (y or n)", + m_scene.RegionInfo.RegionName), + "n"); - MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); + if (response.ToLower() == "y") + { + Clear(true); + MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); + } + else + { + MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.RegionInfo.RegionName); + } } protected void ShowParcelsCommand(Object[] args)