mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
* Users doing terraforming should see updates instantly now.
* Other viewers in the sim will see updates no more than once every 5 seconds.
This commit is contained in:
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
/// <param name="action">The action to be performed</param>
|
||||
/// <param name="north">Distance from the north border where the cursor is located</param>
|
||||
/// <param name="west">Distance from the west border where the cursor is located</param>
|
||||
public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west)
|
||||
public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser)
|
||||
{
|
||||
// Shiny.
|
||||
double size = (double)(1 << brushsize);
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
break;
|
||||
}
|
||||
|
||||
RegenerateTerrain(true, (int)(north / 16.0f), (int)(west / 16.0f));
|
||||
remoteUser.SendLayerData((int)(west / 16), (int)(north / 16), Terrain.GetHeights1D());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
|
||||
terrainCheckCount++;
|
||||
if (terrainCheckCount >= 5)
|
||||
if (terrainCheckCount >= 50)
|
||||
{
|
||||
terrainCheckCount = 0;
|
||||
|
||||
@@ -373,34 +373,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rebuilds the terrain assuming changes occured at a specified point[?]
|
||||
/// </summary>
|
||||
/// <param name="changes">???</param>
|
||||
/// <param name="pointx">???</param>
|
||||
/// <param name="pointy">???</param>
|
||||
public void RegenerateTerrain(bool changes, int pointx, int pointy)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (changes)
|
||||
{
|
||||
/* Dont save here, rely on tainting system instead */
|
||||
|
||||
float[] terrain = Terrain.GetHeights1D();
|
||||
|
||||
ForEachScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
SendLayerData(pointx, pointy, presence.ControllingClient, terrain);
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MainLog.Instance.Warn("terrain", "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Load Terrain
|
||||
|
||||
Reference in New Issue
Block a user