diff options
author | Melanie | 2013-08-11 17:31:25 +0100 |
---|---|---|
committer | Melanie | 2013-08-11 17:31:25 +0100 |
commit | ad1b2902f247a998f23e0d677ee50b10ab306396 (patch) | |
tree | 34dadb17811f2fba2f41595ce040e8a9352acc18 /OpenSim/Region/ClientStack/Linden/UDP | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Stats treaking. Update ToOSDMap for Stat and PercentageStat to return (diff) | |
download | opensim-SC-ad1b2902f247a998f23e0d677ee50b10ab306396.zip opensim-SC-ad1b2902f247a998f23e0d677ee50b10ab306396.tar.gz opensim-SC-ad1b2902f247a998f23e0d677ee50b10ab306396.tar.bz2 opensim-SC-ad1b2902f247a998f23e0d677ee50b10ab306396.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Application/OpenSimBase.cs
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
OpenSim/Region/Framework/Scenes/Scene.cs
OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
3 files changed, 40 insertions, 6 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; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 71b464b..0431b53 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -1871,9 +1871,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1871 | 1871 | ||
1872 | if (!client.SceneAgent.IsChildAgent) | 1872 | if (!client.SceneAgent.IsChildAgent) |
1873 | client.Kick("Simulator logged you out due to connection timeout."); | 1873 | client.Kick("Simulator logged you out due to connection timeout."); |
1874 | |||
1875 | client.CloseWithoutChecks(true); | ||
1876 | } | 1874 | } |
1875 | |||
1876 | m_scene.IncomingCloseAgent(client.AgentId, true); | ||
1877 | } | 1877 | } |
1878 | 1878 | ||
1879 | private void IncomingPacketHandler() | 1879 | private void IncomingPacketHandler() |
@@ -2216,7 +2216,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2216 | if (!client.IsLoggingOut) | 2216 | if (!client.IsLoggingOut) |
2217 | { | 2217 | { |
2218 | client.IsLoggingOut = true; | 2218 | client.IsLoggingOut = true; |
2219 | client.Close(false, false); | 2219 | m_scene.IncomingCloseAgent(client.AgentId, false); |
2220 | } | 2220 | } |
2221 | } | 2221 | } |
2222 | } | 2222 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs index b47ff54..9700224 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs | |||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
200 | public void TestLogoutClientDueToAck() | 200 | public void TestLogoutClientDueToAck() |
201 | { | 201 | { |
202 | TestHelpers.InMethod(); | 202 | TestHelpers.InMethod(); |
203 | // TestHelpers.EnableLogging(); | 203 | TestHelpers.EnableLogging(); |
204 | 204 | ||
205 | IniConfigSource ics = new IniConfigSource(); | 205 | IniConfigSource ics = new IniConfigSource(); |
206 | IConfig config = ics.AddConfig("ClientStack.LindenUDP"); | 206 | IConfig config = ics.AddConfig("ClientStack.LindenUDP"); |