diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 0e20e38..8cbbfd9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -337,6 +337,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
337 | private bool m_VelocityInterpolate = false; | 337 | private bool m_VelocityInterpolate = false; |
338 | private const uint MaxTransferBytesPerPacket = 600; | 338 | private const uint MaxTransferBytesPerPacket = 600; |
339 | 339 | ||
340 | private volatile bool m_justEditedTerrain = false; | ||
340 | 341 | ||
341 | /// <value> | 342 | /// <value> |
342 | /// List used in construction of data blocks for an object update packet. This is to stop us having to | 343 | /// List used in construction of data blocks for an object update packet. This is to stop us having to |
@@ -536,7 +537,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
536 | // We still perform a force close inside the sync lock since this is intended to attempt close where | 537 | // We still perform a force close inside the sync lock since this is intended to attempt close where |
537 | // there is some unidentified connection problem, not where we have issues due to deadlock | 538 | // there is some unidentified connection problem, not where we have issues due to deadlock |
538 | if (!IsActive && !force) | 539 | if (!IsActive && !force) |
540 | { | ||
541 | m_log.DebugFormat( | ||
542 | "[CLIENT]: Not attempting to close inactive client {0} in {1} since force flag is not set", | ||
543 | Name, m_scene.Name); | ||
544 | |||
539 | return; | 545 | return; |
546 | } | ||
540 | 547 | ||
541 | IsActive = false; | 548 | IsActive = false; |
542 | CloseWithoutChecks(sendStop); | 549 | CloseWithoutChecks(sendStop); |
@@ -1231,9 +1238,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1231 | LLHeightFieldMoronize(map); | 1238 | LLHeightFieldMoronize(map); |
1232 | 1239 | ||
1233 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | 1240 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); |
1234 | layerpack.Header.Reliable = true; | 1241 | |
1242 | // When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience. | ||
1243 | // To alleviate this issue, when the user edits the terrain, we start skipping the queues until they're done editing the terrain. | ||
1244 | // We also make them unreliable because it's extremely likely that multiple packets will be sent for a terrain patch area | ||
1245 | // invalidating previous packets for that area. | ||
1246 | |||
1247 | // It's possible for an editing user to flood themselves with edited packets but the majority of use cases are such that only a | ||
1248 | // tiny percentage of users will be editing the terrain. Other, non-editing users will see the edits much slower. | ||
1249 | |||
1250 | // 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 | ||
1251 | // have rezzed already and therefore this is not likely going to cause any additional issues with lost packets, objects or terrain | ||
1252 | // patches. | ||
1235 | 1253 | ||
1236 | OutPacket(layerpack, ThrottleOutPacketType.Task); | 1254 | // m_justEditedTerrain is volatile, so test once and duplicate two affected statements so we only have one cache miss. |
1255 | if (m_justEditedTerrain) | ||
1256 | { | ||
1257 | layerpack.Header.Reliable = false; | ||
1258 | OutPacket(layerpack, | ||
1259 | ThrottleOutPacketType.Unknown ); | ||
1260 | } | ||
1261 | else | ||
1262 | { | ||
1263 | layerpack.Header.Reliable = true; | ||
1264 | OutPacket(layerpack, | ||
1265 | ThrottleOutPacketType.Task); | ||
1266 | } | ||
1237 | } | 1267 | } |
1238 | catch (Exception e) | 1268 | catch (Exception e) |
1239 | { | 1269 | { |
@@ -6367,6 +6397,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6367 | //m_log.Info("[LAND]: LAND:" + modify.ToString()); | 6397 | //m_log.Info("[LAND]: LAND:" + modify.ToString()); |
6368 | if (modify.ParcelData.Length > 0) | 6398 | if (modify.ParcelData.Length > 0) |
6369 | { | 6399 | { |
6400 | // Note: the ModifyTerrain event handler sends out updated packets before the end of this event. Therefore, | ||
6401 | // a simple boolean value should work and perhaps queue up just a few terrain patch packets at the end of the edit. | ||
6402 | m_justEditedTerrain = true; // Prevent terrain packet (Land layer) from being queued, make it unreliable | ||
6370 | if (OnModifyTerrain != null) | 6403 | if (OnModifyTerrain != null) |
6371 | { | 6404 | { |
6372 | for (int i = 0; i < modify.ParcelData.Length; i++) | 6405 | for (int i = 0; i < modify.ParcelData.Length; i++) |
@@ -6382,6 +6415,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6382 | } | 6415 | } |
6383 | } | 6416 | } |
6384 | } | 6417 | } |
6418 | m_justEditedTerrain = false; // Queue terrain packet (Land layer) if necessary, make it reliable again | ||
6385 | } | 6419 | } |
6386 | 6420 | ||
6387 | return true; | 6421 | return true; |