aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorRobert Adams2014-03-11 07:12:47 -0700
committerRobert Adams2014-03-11 07:12:47 -0700
commit8edf4225f32ab5fe1e9a1796e1c51b99c391de69 (patch)
treefb58c09ed223685c3fc879227028002cc12c87fa /OpenSim/Region
parentAdd Lani Global to CONTRIBUTORS.txt (diff)
downloadopensim-SC_OLD-8edf4225f32ab5fe1e9a1796e1c51b99c391de69.zip
opensim-SC_OLD-8edf4225f32ab5fe1e9a1796e1c51b99c391de69.tar.gz
opensim-SC_OLD-8edf4225f32ab5fe1e9a1796e1c51b99c391de69.tar.bz2
opensim-SC_OLD-8edf4225f32ab5fe1e9a1796e1c51b99c391de69.tar.xz
varregion: remove serialization of region terrain to floats when sending patches.
This should eliminate much memory thrashing and CPU usage while sending initial terrain. The old way of passing terrain was to convert it to an array of floats. This is really bad for large terrain (think 4096x4096 floats). This change passes a dummy float array since the real region info is used anyway and the floats are ignored. (The ignoring the terrain floats is a kludge so as to not change IClientAPI.)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index daf9901..3fda67f 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -853,7 +853,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
853 /// <param name="y">The patch corner to send</param> 853 /// <param name="y">The patch corner to send</param>
854 private void SendToClients(TerrainData terrData, int x, int y) 854 private void SendToClients(TerrainData terrData, int x, int y)
855 { 855 {
856 float[] heightMap = terrData.GetFloatsSerialized(); 856 // We know the actual terrain data passed is ignored. This kludge saves changing IClientAPI.
857 //float[] heightMap = terrData.GetFloatsSerialized();
858 float[] heightMap = new float[10];
857 m_scene.ForEachClient( 859 m_scene.ForEachClient(
858 delegate(IClientAPI controller) 860 delegate(IClientAPI controller)
859 { 861 {
@@ -975,7 +977,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
975 protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY) 977 protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY)
976 { 978 {
977 //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); 979 //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
978 client.SendLayerData(patchX, patchY, m_scene.Heightmap.GetFloatsSerialised()); 980 // SendLayerData does not use the heightmap parameter. This kludge is so as to not change IClientAPI.
981 float[] heightMap = new float[10];
982 client.SendLayerData(patchX, patchY, heightMap);
979 } 983 }
980 984
981 private void StoreUndoState() 985 private void StoreUndoState()