aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs33
1 files changed, 30 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index e775a81..f0d8181 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
327 private PriorityQueue m_entityProps; 327 private PriorityQueue m_entityProps;
328 private Prioritizer m_prioritizer; 328 private Prioritizer m_prioritizer;
329 private bool m_disableFacelights = false; 329 private bool m_disableFacelights = false;
330 330 private volatile bool m_justEditedTerrain = false;
331 /// <value> 331 /// <value>
332 /// List used in construction of data blocks for an object update packet. This is to stop us having to 332 /// List used in construction of data blocks for an object update packet. This is to stop us having to
333 /// continually recreate it. 333 /// continually recreate it.
@@ -1245,9 +1245,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1245 LLHeightFieldMoronize(map); 1245 LLHeightFieldMoronize(map);
1246 1246
1247 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); 1247 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1248 layerpack.Header.Reliable = true; 1248
1249 // When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience.
1250 // To alleviate this issue, when the user edits the terrain, we start skipping the queues until they're done editing the terrain.
1251 // We also make them unreliable because it's extremely likely that multiple packets will be sent for a terrain patch area
1252 // invalidating previous packets for that area.
1249 1253
1250 OutPacket(layerpack, ThrottleOutPacketType.Land); 1254 // It's possible for an editing user to flood themselves with edited packets but the majority of use cases are such that only a
1255 // tiny percentage of users will be editing the terrain. Other, non-editing users will see the edits much slower.
1256
1257 // One last note on this topic, by the time users are going to be editing the terrain, it's extremely likely that the sim will
1258 // have rezzed already and therefore this is not likely going to cause any additional issues with lost packets, objects or terrain
1259 // patches.
1260
1261 // m_justEditedTerrain is volatile, so test once and duplicate two affected statements so we only have one cache miss.
1262 if (m_justEditedTerrain)
1263 {
1264 layerpack.Header.Reliable = false;
1265 OutPacket(layerpack,
1266 ThrottleOutPacketType.Unknown );
1267 }
1268 else
1269 {
1270 layerpack.Header.Reliable = true;
1271 OutPacket(layerpack,
1272 ThrottleOutPacketType.Land);
1273 }
1251 } 1274 }
1252 catch (Exception e) 1275 catch (Exception e)
1253 { 1276 {
@@ -6269,6 +6292,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6269 //m_log.Info("[LAND]: LAND:" + modify.ToString()); 6292 //m_log.Info("[LAND]: LAND:" + modify.ToString());
6270 if (modify.ParcelData.Length > 0) 6293 if (modify.ParcelData.Length > 0)
6271 { 6294 {
6295 // Note: the ModifyTerrain event handler sends out updated packets before the end of this event. Therefore,
6296 // a simple boolean value should work and perhaps queue up just a few terrain patch packets at the end of the edit.
6297 m_justEditedTerrain = true; // Prevent terrain packet (Land layer) from being queued, make it unreliable
6272 if (OnModifyTerrain != null) 6298 if (OnModifyTerrain != null)
6273 { 6299 {
6274 for (int i = 0; i < modify.ParcelData.Length; i++) 6300 for (int i = 0; i < modify.ParcelData.Length; i++)
@@ -6284,6 +6310,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6284 } 6310 }
6285 } 6311 }
6286 } 6312 }
6313 m_justEditedTerrain = false; // Queue terrain packet (Land layer) if necessary, make it reliable again
6287 } 6314 }
6288 6315
6289 return true; 6316 return true;