Cut down on the number of packets sent during terraforming. Terraforming should be much more responsive.
parent
36f7a087e6
commit
7a61bcff86
|
@ -89,6 +89,8 @@ namespace OpenSim.Region.Terrain
|
|||
public DateTime lastEdit = DateTime.Now;
|
||||
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine.
|
||||
/// Counts the number of modifications since the last save. (0 = Untainted)
|
||||
|
@ -206,7 +208,7 @@ namespace OpenSim.Region.Terrain
|
|||
{
|
||||
FlattenTerrain(y, x, size, (double) seconds/5.0);
|
||||
lastEdit = DateTime.Now;
|
||||
remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
|
||||
//remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +221,7 @@ namespace OpenSim.Region.Terrain
|
|||
{
|
||||
RaiseTerrain(y, x, size, (double) seconds/5.0);
|
||||
lastEdit = DateTime.Now;
|
||||
remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
|
||||
//remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -231,7 +233,7 @@ namespace OpenSim.Region.Terrain
|
|||
{
|
||||
LowerTerrain(y, x, size, (double) seconds/5.0);
|
||||
lastEdit = DateTime.Now;
|
||||
remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
|
||||
//remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -288,6 +290,10 @@ namespace OpenSim.Region.Terrain
|
|||
break;
|
||||
}
|
||||
|
||||
counter++;
|
||||
if(counter==3)
|
||||
{
|
||||
counter=0;
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
for (int y = 0; y < 16; y++)
|
||||
|
@ -298,6 +304,8 @@ namespace OpenSim.Region.Terrain
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lastEdit = DateTime.Now;
|
||||
|
||||
|
|
Loading…
Reference in New Issue