From f20728fc86accb4df56024e587e8d5762a8dda34 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Sat, 9 May 2015 15:26:34 -0400 Subject: Constrain 'terrain modify' to selected Region Signed-off-by: Michael Cerquoni --- .../CoreModules/World/Terrain/TerrainModule.cs | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 05c5fca..cec17e2 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -551,11 +551,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain m_plugineffects = new Dictionary(); LoadPlugins(Assembly.GetCallingAssembly()); string plugineffectsPath = "Terrain"; - + // Load the files in the Terrain/ dir if (!Directory.Exists(plugineffectsPath)) return; - + string[] files = Directory.GetFiles(plugineffectsPath); foreach(string file in files) { @@ -768,7 +768,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain fileStartX, fileStartY, fileStartX + fileWidth - 1, fileStartY + fileHeight - 1, m_scene.RegionInfo.RegionName, filename); } - + return; } } @@ -865,7 +865,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain client.OnLandUndo += client_OnLandUndo; client.OnUnackedTerrain += client_OnUnackedTerrain; } - + /// /// Installs terrain brush hook to IClientAPI /// @@ -884,7 +884,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain lock(m_perClientPatchUpdates) m_perClientPatchUpdates.Remove(client); } - + /// /// Scan over changes in the terrain and limit height changes. This enforces the /// non-estate owner limits on rate of terrain editting. @@ -1225,7 +1225,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter } } - + protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY) { //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); @@ -1676,10 +1676,16 @@ namespace OpenSim.Region.CoreModules.World.Terrain public void ModifyCommand(string module, string[] cmd) { string result; - if (cmd.Length > 2) + Scene scene = SceneManager.Instance.CurrentScene; + if ((scene != null) && (scene != m_scene)) + { + result = String.Empty; + } + else if (cmd.Length > 2) { string operationType = cmd[2]; + ITerrainModifier operation; if (!m_modifyOperations.TryGetValue(operationType, out operation)) { @@ -1704,7 +1710,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain { result = "Usage: ..."; } - MainConsole.Instance.Output(result); + if (result != String.Empty) + { + MainConsole.Instance.Output(result); + } } #endregion -- cgit v1.1