Cut down on the number of packets sent during terraforming. Terraforming should be much more responsive.

ThreadPoolClientBranch
Brian McBee 2008-02-05 18:27:40 +00:00
parent 36f7a087e6
commit 7a61bcff86
1 changed files with 15 additions and 7 deletions

View File

@ -89,6 +89,8 @@ namespace OpenSim.Region.Terrain
public DateTime lastEdit = DateTime.Now; public DateTime lastEdit = DateTime.Now;
private int counter = 0;
/// <summary> /// <summary>
/// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine. /// 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) /// 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); FlattenTerrain(y, x, size, (double) seconds/5.0);
lastEdit = DateTime.Now; 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); RaiseTerrain(y, x, size, (double) seconds/5.0);
lastEdit = DateTime.Now; lastEdit = DateTime.Now;
remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D()); //remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
} }
} }
break; break;
@ -231,7 +233,7 @@ namespace OpenSim.Region.Terrain
{ {
LowerTerrain(y, x, size, (double) seconds/5.0); LowerTerrain(y, x, size, (double) seconds/5.0);
lastEdit = DateTime.Now; lastEdit = DateTime.Now;
remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D()); //remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
} }
} }
break; break;
@ -288,6 +290,10 @@ namespace OpenSim.Region.Terrain
break; break;
} }
counter++;
if(counter==3)
{
counter=0;
for (int x = 0; x < 16; x++) for (int x = 0; x < 16; x++)
{ {
for (int y = 0; y < 16; y++) for (int y = 0; y < 16; y++)
@ -298,6 +304,8 @@ namespace OpenSim.Region.Terrain
} }
} }
} }
}
lastEdit = DateTime.Now; lastEdit = DateTime.Now;