aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMW2008-05-22 19:44:57 +0000
committerMW2008-05-22 19:44:57 +0000
commit811cd3e0bf1c9984e9c9710dc27a606a8a689091 (patch)
tree3e3d81cd43c83c0d5fcce2027869403022d10b1f /OpenSim/Region
parent* Limiting the Quaternion reset to x=y=z=w=0 (diff)
downloadopensim-SC-811cd3e0bf1c9984e9c9710dc27a606a8a689091.zip
opensim-SC-811cd3e0bf1c9984e9c9710dc27a606a8a689091.tar.gz
opensim-SC-811cd3e0bf1c9984e9c9710dc27a606a8a689091.tar.bz2
opensim-SC-811cd3e0bf1c9984e9c9710dc27a606a8a689091.tar.xz
change to how initial terrain data is sent. Instead of sending the 64 packets in rapid fire as quickly as possible. The terrain data sending is now done in a threadpool worker thread over ~10 seconds with a thread.sleep between each packet sending. this hasn't been tested thoroughly, so it might not actually help with the atom bomb terrain (missing patches) but its a simple thing to revert if it makes things worse for anyone.
10 seconds is roughly the time between the region handshake completing and you being in world where you can see your avatar. So normally the terrain still should have loaded by time you get in the region, although it is possible that sometimes you might see the very end of the terrain load just after you arrive.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs56
1 files changed, 46 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 809822d..c23369c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1002,31 +1002,67 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1002 /// <param name="map">heightmap</param> 1002 /// <param name="map">heightmap</param>
1003 public virtual void SendLayerData(float[] map) 1003 public virtual void SendLayerData(float[] map)
1004 { 1004 {
1005 ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendLayerData), (object)map);
1006 //try
1007 //{
1008 // int[] patches = new int[4];
1009
1010 // for (int y = 0; y < 16; y++)
1011 // {
1012 // for (int x = 0; x < 16; x += 4)
1013 // {
1014 // patches[0] = x + 0 + y * 16;
1015 // patches[1] = x + 1 + y * 16;
1016 // patches[2] = x + 2 + y * 16;
1017 // patches[3] = x + 3 + y * 16;
1018
1019 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
1020 // OutPacket(layerpack, ThrottleOutPacketType.Land);
1021 // }
1022 // }
1023 //}
1024 //catch (Exception e)
1025 //{
1026 // m_log.Warn("[client]: " +
1027 // "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
1028 //}
1029 }
1030
1031
1032 private void DoSendLayerData(object o)
1033 {
1034 float[] map = (float[])o;
1005 try 1035 try
1006 { 1036 {
1007 int[] patches = new int[4];
1008
1009 for (int y = 0; y < 16; y++) 1037 for (int y = 0; y < 16; y++)
1010 { 1038 {
1011 for (int x = 0; x < 16; x += 4) 1039 for (int x = 0; x < 16; x += 4)
1012 { 1040 {
1013 patches[0] = x + 0 + y * 16; 1041 SendLayerPacket(map, y, x);
1014 patches[1] = x + 1 + y * 16; 1042 Thread.Sleep(150);
1015 patches[2] = x + 2 + y * 16;
1016 patches[3] = x + 3 + y * 16;
1017
1018 Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
1019 OutPacket(layerpack, ThrottleOutPacketType.Land);
1020 } 1043 }
1021 } 1044 }
1022 } 1045 }
1023 catch (Exception e) 1046 catch (Exception e)
1024 { 1047 {
1025 m_log.Warn("[client]: " + 1048 m_log.Warn("[client]: " +
1026 "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); 1049 "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
1027 } 1050 }
1028 } 1051 }
1029 1052
1053 private void SendLayerPacket(float[] map, int y, int x)
1054 {
1055 int[] patches = new int[4];
1056 patches[0] = x + 0 + y * 16;
1057 patches[1] = x + 1 + y * 16;
1058 patches[2] = x + 2 + y * 16;
1059 patches[3] = x + 3 + y * 16;
1060
1061 Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
1062 OutPacket(layerpack, ThrottleOutPacketType.Land);
1063 }
1064
1065
1030 /// <summary> 1066 /// <summary>
1031 /// Sends a specified patch to a client 1067 /// Sends a specified patch to a client
1032 /// </summary> 1068 /// </summary>