diff options
author | Justin Clarke Casey | 2008-07-03 23:04:12 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-03 23:04:12 +0000 |
commit | 8251508412940b3f584f051a860a1bb4ddbfb62e (patch) | |
tree | 8a5e460836a8fe6c945e5a3ac4e54445a6d9cfe4 | |
parent | Mantis#1661. Thank you kindly, CMickeyb for a patch that: (diff) | |
download | opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.zip opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.tar.gz opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.tar.bz2 opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.tar.xz |
* On client login, send only one terrain patch at a time (with pauses) instead of 4 at a time
* Certain terrains which are fine went patches are sent singly cause a libsecondlife failure when patches are sent in batches
* See http://opensimulator.org/mantis/view.php?id=1662 for more details
4 files changed, 41 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index cd3efe3..949aa27 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1101,27 +1101,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1101 | //} | 1101 | //} |
1102 | } | 1102 | } |
1103 | 1103 | ||
1104 | /// <summary> | ||
1105 | /// Send terrain layer information to the client. | ||
1106 | /// </summary> | ||
1107 | /// <param name="o"></param> | ||
1104 | private void DoSendLayerData(object o) | 1108 | private void DoSendLayerData(object o) |
1105 | { | 1109 | { |
1106 | float[] map = (float[])o; | 1110 | float[] map = (float[])o; |
1111 | |||
1107 | try | 1112 | try |
1108 | { | 1113 | { |
1109 | for (int y = 0; y < 16; y++) | 1114 | for (int y = 0; y < 16; y++) |
1110 | { | 1115 | { |
1111 | for (int x = 0; x < 16; x += 4) | 1116 | // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception |
1117 | // see http://opensimulator.org/mantis/view.php?id=1662 | ||
1118 | //for (int x = 0; x < 16; x += 4) | ||
1119 | //{ | ||
1120 | // SendLayerPacket(map, y, x); | ||
1121 | // Thread.Sleep(150); | ||
1122 | //} | ||
1123 | for (int x= 0; x < 16; x++) | ||
1112 | { | 1124 | { |
1113 | SendLayerPacket(map, y, x); | 1125 | SendLayerData(x, y, map); |
1114 | Thread.Sleep(150); | 1126 | Thread.Sleep(35); |
1115 | } | 1127 | } |
1116 | } | 1128 | } |
1117 | } | 1129 | } |
1118 | catch (Exception e) | 1130 | catch (Exception e) |
1119 | { | 1131 | { |
1120 | m_log.Warn("[client]: " + | 1132 | m_log.Warn("[CLIENT]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); |
1121 | "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); | ||
1122 | } | 1133 | } |
1123 | } | 1134 | } |
1124 | 1135 | ||
1136 | /// <summary> | ||
1137 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | ||
1138 | /// </summary> | ||
1139 | /// <param name="map">heightmap</param> | ||
1140 | /// <param name="px">X coordinate for patches 0..12</param> | ||
1141 | /// <param name="py">Y coordinate for patches 0..15</param> | ||
1125 | private void SendLayerPacket(float[] map, int y, int x) | 1142 | private void SendLayerPacket(float[] map, int y, int x) |
1126 | { | 1143 | { |
1127 | int[] patches = new int[4]; | 1144 | int[] patches = new int[4]; |
@@ -1137,8 +1154,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1137 | /// <summary> | 1154 | /// <summary> |
1138 | /// Sends a specified patch to a client | 1155 | /// Sends a specified patch to a client |
1139 | /// </summary> | 1156 | /// </summary> |
1140 | /// <param name="px">Patch coordinate (x) 0..16</param> | 1157 | /// <param name="px">Patch coordinate (x) 0..15</param> |
1141 | /// <param name="py">Patch coordinate (y) 0..16</param> | 1158 | /// <param name="py">Patch coordinate (y) 0..15</param> |
1142 | /// <param name="map">heightmap</param> | 1159 | /// <param name="map">heightmap</param> |
1143 | public void SendLayerData(int px, int py, float[] map) | 1160 | public void SendLayerData(int px, int py, float[] map) |
1144 | { | 1161 | { |
@@ -1157,8 +1174,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1157 | } | 1174 | } |
1158 | catch (Exception e) | 1175 | catch (Exception e) |
1159 | { | 1176 | { |
1160 | m_log.Warn("[client]: " + | 1177 | m_log.Warn("[client]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); |
1161 | "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); | ||
1162 | } | 1178 | } |
1163 | } | 1179 | } |
1164 | 1180 | ||
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index 952ca0a..aa34c45 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs | |||
@@ -32,7 +32,13 @@ namespace OpenSim.Region.Environment.Interfaces | |||
32 | int Height { get; } | 32 | int Height { get; } |
33 | double this[int x, int y] { get; set; } | 33 | double this[int x, int y] { get; set; } |
34 | int Width { get; } | 34 | int Width { get; } |
35 | |||
36 | /// <summary> | ||
37 | /// Squash the entire heightmap into a single dimensioned array | ||
38 | /// </summary> | ||
39 | /// <returns></returns> | ||
35 | float[] GetFloatsSerialised(); | 40 | float[] GetFloatsSerialised(); |
41 | |||
36 | double[,] GetDoubles(); | 42 | double[,] GetDoubles(); |
37 | bool Tainted(int x, int y); | 43 | bool Tainted(int x, int y); |
38 | ITerrainChannel MakeCopy(); | 44 | ITerrainChannel MakeCopy(); |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs index 53d03fc..24a76f7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
45 | 45 | ||
46 | public TerrainChannel() | 46 | public TerrainChannel() |
47 | { | 47 | { |
48 | map = new double[Constants.RegionSize,Constants.RegionSize]; | 48 | map = new double[Constants.RegionSize, Constants.RegionSize]; |
49 | taint = new bool[Constants.RegionSize / 16,Constants.RegionSize / 16]; | 49 | taint = new bool[Constants.RegionSize / 16,Constants.RegionSize / 16]; |
50 | 50 | ||
51 | int x; | 51 | int x; |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index fb81abc..f47e6c0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -494,8 +494,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
494 | } | 494 | } |
495 | 495 | ||
496 | /// <summary> | 496 | /// <summary> |
497 | /// Checks to see if the terrain has been modified since last check | 497 | /// Checks to see if the terrain has been modified since last check. |
498 | /// if the call is asked to respect the estate settings for terrain_raise_limit and | 498 | /// If it has been modified, every all the terrain patches are sent to the client. |
499 | /// If the call is asked to respect the estate settings for terrain_raise_limit and | ||
499 | /// terrain_lower_limit, it will clamp terrain updates between these values | 500 | /// terrain_lower_limit, it will clamp terrain updates between these values |
500 | /// currently invoked by client_OnModifyTerrain only and not the Commander interfaces | 501 | /// currently invoked by client_OnModifyTerrain only and not the Commander interfaces |
501 | /// <param name="respectEstateSettings">should height map deltas be limited to the estate settings limits</param> | 502 | /// <param name="respectEstateSettings">should height map deltas be limited to the estate settings limits</param> |
@@ -520,6 +521,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
520 | // what we are going to send to the client | 521 | // what we are going to send to the client |
521 | serialised = m_channel.GetFloatsSerialised(); | 522 | serialised = m_channel.GetFloatsSerialised(); |
522 | } | 523 | } |
524 | |||
523 | SendToClients(serialised, x, y); | 525 | SendToClients(serialised, x, y); |
524 | shouldTaint = true; | 526 | shouldTaint = true; |
525 | } | 527 | } |
@@ -578,7 +580,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
578 | private void SendToClients(float[] serialised, int x, int y) | 580 | private void SendToClients(float[] serialised, int x, int y) |
579 | { | 581 | { |
580 | m_scene.ForEachClient( | 582 | m_scene.ForEachClient( |
581 | delegate(IClientAPI controller) { controller.SendLayerData(x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); }); | 583 | delegate(IClientAPI controller) |
584 | { controller.SendLayerData( | ||
585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); | ||
586 | } | ||
587 | ); | ||
582 | } | 588 | } |
583 | 589 | ||
584 | private void client_OnModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, | 590 | private void client_OnModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, |