diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 56 |
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> |