diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 867f16f9c4..07ab34d67f 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -205,24 +205,7 @@ namespace OpenSim //Run Startup Commands if (m_startupCommandsFile != "") { - MainLog.Instance.Verbose("Running startup command script (" + m_startupCommandsFile + ")"); - if (File.Exists(m_startupCommandsFile)) - { - StreamReader readFile = File.OpenText(m_startupCommandsFile); - string currentCommand = ""; - while ((currentCommand = readFile.ReadLine()) != null) - { - if (currentCommand != "") - { - MainLog.Instance.Verbose("Running '" + currentCommand + "'"); - MainLog.Instance.MainLogRunCommand(currentCommand); - } - } - } - else - { - MainLog.Instance.Error("Startup command script missing. Will not run startup commands"); - } + RunCommandScript(m_startupCommandsFile); } else { @@ -230,6 +213,28 @@ namespace OpenSim } } + private void RunCommandScript(string fileName) + { + MainLog.Instance.Verbose("Running command script (" + fileName + ")"); + if (File.Exists(fileName)) + { + StreamReader readFile = File.OpenText(fileName); + string currentCommand = ""; + while ((currentCommand = readFile.ReadLine()) != null) + { + if (currentCommand != "") + { + MainLog.Instance.Verbose("Running '" + currentCommand + "'"); + MainLog.Instance.MainLogRunCommand(currentCommand); + } + } + } + else + { + MainLog.Instance.Error("Command script missing. Can not run commands"); + } + } + private static void CreateDefaultRegionInfoXml(string fileName) { new RegionInfo("DEFAULT REGION CONFIG", fileName); @@ -403,6 +408,13 @@ namespace OpenSim } break; + case "command-script": + if (cmdparams.Length > 0) + { + RunCommandScript(cmdparams[0]); + } + break; + case "permissions": // Treats each user as a super-admin when disabled foreach (Scene scene in m_localScenes) diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index 2f345f4b68..1ed0642329 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs @@ -207,8 +207,7 @@ namespace OpenSim.Region.Environment.LandManagement if (x > 63 || y > 63 || x < 0 || y < 0) { - return null; - //throw new Exception("Error: Parcel not found at point " + x + ", " + y); + throw new Exception("Error: Parcel not found at point " + x + ", " + y); } else { @@ -221,8 +220,7 @@ namespace OpenSim.Region.Environment.LandManagement { if (x > 256 || y > 256 || x < 0 || y < 0) { - return null; - //throw new Exception("Error: Parcel not found at point " + x + ", " + y); + throw new Exception("Error: Parcel not found at point " + x + ", " + y); } else {