Constrain 'terrain modify' to selected Region

Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
fsassets
Dev Random 2015-05-09 15:26:34 -04:00 committed by Michael Cerquoni
parent adf0f49a69
commit f20728fc86
1 changed files with 17 additions and 8 deletions

View File

@ -551,11 +551,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_plugineffects = new Dictionary<string, ITerrainEffect>(); m_plugineffects = new Dictionary<string, ITerrainEffect>();
LoadPlugins(Assembly.GetCallingAssembly()); LoadPlugins(Assembly.GetCallingAssembly());
string plugineffectsPath = "Terrain"; string plugineffectsPath = "Terrain";
// Load the files in the Terrain/ dir // Load the files in the Terrain/ dir
if (!Directory.Exists(plugineffectsPath)) if (!Directory.Exists(plugineffectsPath))
return; return;
string[] files = Directory.GetFiles(plugineffectsPath); string[] files = Directory.GetFiles(plugineffectsPath);
foreach(string file in files) foreach(string file in files)
{ {
@ -768,7 +768,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
fileStartX, fileStartY, fileStartX + fileWidth - 1, fileStartY + fileHeight - 1, fileStartX, fileStartY, fileStartX + fileWidth - 1, fileStartY + fileHeight - 1,
m_scene.RegionInfo.RegionName, filename); m_scene.RegionInfo.RegionName, filename);
} }
return; return;
} }
} }
@ -865,7 +865,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
client.OnLandUndo += client_OnLandUndo; client.OnLandUndo += client_OnLandUndo;
client.OnUnackedTerrain += client_OnUnackedTerrain; client.OnUnackedTerrain += client_OnUnackedTerrain;
} }
/// <summary> /// <summary>
/// Installs terrain brush hook to IClientAPI /// Installs terrain brush hook to IClientAPI
/// </summary> /// </summary>
@ -884,7 +884,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
lock(m_perClientPatchUpdates) lock(m_perClientPatchUpdates)
m_perClientPatchUpdates.Remove(client); m_perClientPatchUpdates.Remove(client);
} }
/// <summary> /// <summary>
/// Scan over changes in the terrain and limit height changes. This enforces the /// Scan over changes in the terrain and limit height changes. This enforces the
/// non-estate owner limits on rate of terrain editting. /// 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 InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter
} }
} }
protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY) protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY)
{ {
//m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + 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) public void ModifyCommand(string module, string[] cmd)
{ {
string result; 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]; string operationType = cmd[2];
ITerrainModifier operation; ITerrainModifier operation;
if (!m_modifyOperations.TryGetValue(operationType, out operation)) if (!m_modifyOperations.TryGetValue(operationType, out operation))
{ {
@ -1704,7 +1710,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
{ {
result = "Usage: <operation-name> <arg1> <arg2>..."; result = "Usage: <operation-name> <arg1> <arg2>...";
} }
MainConsole.Instance.Output(result); if (result != String.Empty)
{
MainConsole.Instance.Output(result);
}
} }
#endregion #endregion