Small refactoring on Terrain Update sending, so that other code can force terrain updates to be sent to clients.

ThreadPoolClientBranch
MW 2008-02-05 15:03:08 +00:00
parent 33c4631c6d
commit 542cd417c8
1 changed files with 20 additions and 15 deletions

View File

@ -718,27 +718,32 @@ namespace OpenSim.Region.Environment.Scenes
m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
float[] terData = Terrain.GetHeights1D();
Broadcast(delegate(IClientAPI client)
{
for (int x = 0; x < 16; x++)
{
for (int y = 0; y < 16; y++)
{
if (Terrain.IsTainted(x*16, y*16))
{
client.SendLayerData(x, y, terData);
}
}
}
});
SendTerrainUpdate(true);
Terrain.ResetTaint();
}
}
}
public void SendTerrainUpdate(bool checkForTainted)
{
float[] terData = Terrain.GetHeights1D();
Broadcast(delegate(IClientAPI client)
{
for (int x = 0; x < 16; x++)
{
for (int y = 0; y < 16; y++)
{
if ((!checkForTainted) || (Terrain.IsTainted(x * 16, y * 16)))
{
client.SendLayerData(x, y, terData);
}
}
}
});
}
private void UpdateStorageBackup()
{
Backup();