aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs93
1 files changed, 38 insertions, 55 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 9944852..afd5f86 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -812,16 +812,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
812 } 812 }
813 } 813 }
814 814
815 public void SendGenericMessage(string method, List<string> message) 815 public void SendGenericMessage(string method, List<byte[]> message)
816 { 816 {
817 GenericMessagePacket gmp = new GenericMessagePacket(); 817 GenericMessagePacket gmp = new GenericMessagePacket();
818 gmp.MethodData.Method = Util.StringToBytes256(method); 818 gmp.MethodData.Method = Util.StringToBytes256(method);
819 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 819 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
820 int i = 0; 820 int i = 0;
821 foreach (string val in message) 821 foreach (byte[] val in message)
822 { 822 {
823 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); 823 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock();
824 gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); 824 gmp.ParamList[i++].Parameter = val;
825 } 825 }
826 OutPacket(gmp, ThrottleOutPacketType.Task); 826 OutPacket(gmp, ThrottleOutPacketType.Task);
827 } 827 }
@@ -1016,6 +1016,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1016 public virtual void SendLayerData(float[] map) 1016 public virtual void SendLayerData(float[] map)
1017 { 1017 {
1018 Util.FireAndForget(DoSendLayerData, map); 1018 Util.FireAndForget(DoSendLayerData, map);
1019
1020 // Send it sync, and async. It's not that much data
1021 // and it improves user experience just so much!
1022 DoSendLayerData(map);
1019 } 1023 }
1020 1024
1021 /// <summary> 1025 /// <summary>
@@ -1028,16 +1032,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1028 1032
1029 try 1033 try
1030 { 1034 {
1031 //for (int y = 0; y < 16; y++) 1035 for (int y = 0; y < 16; y++)
1032 //{ 1036 {
1033 // for (int x = 0; x < 16; x++) 1037 for (int x = 0; x < 16; x+=4)
1034 // { 1038 {
1035 // SendLayerData(x, y, map); 1039 SendLayerPacket(x, y, map);
1036 // } 1040 }
1037 //} 1041 }
1038
1039 // Send LayerData in a spiral pattern. Fun!
1040 SendLayerTopRight(map, 0, 0, 15, 15);
1041 } 1042 }
1042 catch (Exception e) 1043 catch (Exception e)
1043 { 1044 {
@@ -1045,51 +1046,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1045 } 1046 }
1046 } 1047 }
1047 1048
1048 private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
1049 {
1050 // Row
1051 for (int i = x1; i <= x2; i++)
1052 SendLayerData(i, y1, map);
1053
1054 // Column
1055 for (int j = y1 + 1; j <= y2; j++)
1056 SendLayerData(x2, j, map);
1057
1058 if (x2 - x1 > 0)
1059 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1060 }
1061
1062 void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
1063 {
1064 // Row in reverse
1065 for (int i = x2; i >= x1; i--)
1066 SendLayerData(i, y2, map);
1067
1068 // Column in reverse
1069 for (int j = y2 - 1; j >= y1; j--)
1070 SendLayerData(x1, j, map);
1071
1072 if (x2 - x1 > 0)
1073 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1074 }
1075
1076 /// <summary> 1049 /// <summary>
1077 /// Sends a set of four patches (x, x+1, ..., x+3) to the client 1050 /// Sends a set of four patches (x, x+1, ..., x+3) to the client
1078 /// </summary> 1051 /// </summary>
1079 /// <param name="map">heightmap</param> 1052 /// <param name="map">heightmap</param>
1080 /// <param name="px">X coordinate for patches 0..12</param> 1053 /// <param name="px">X coordinate for patches 0..12</param>
1081 /// <param name="py">Y coordinate for patches 0..15</param> 1054 /// <param name="py">Y coordinate for patches 0..15</param>
1082 // private void SendLayerPacket(float[] map, int y, int x) 1055 private void SendLayerPacket(int x, int y, float[] map)
1083 // { 1056 {
1084 // int[] patches = new int[4]; 1057 int[] patches = new int[4];
1085 // patches[0] = x + 0 + y * 16; 1058 patches[0] = x + 0 + y * 16;
1086 // patches[1] = x + 1 + y * 16; 1059 patches[1] = x + 1 + y * 16;
1087 // patches[2] = x + 2 + y * 16; 1060 patches[2] = x + 2 + y * 16;
1088 // patches[3] = x + 3 + y * 16; 1061 patches[3] = x + 3 + y * 16;
1089 1062
1090 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); 1063 float[] heightmap = (map.Length == 65536) ?
1091 // OutPacket(layerpack, ThrottleOutPacketType.Land); 1064 map :
1092 // } 1065 LLHeightFieldMoronize(map);
1066
1067 try
1068 {
1069 Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1070 OutPacket(layerpack, ThrottleOutPacketType.Land);
1071 }
1072 catch
1073 {
1074 for (int px = x ; px < x + 4 ; px++)
1075 SendLayerData(px, y, map);
1076 }
1077 }
1093 1078
1094 /// <summary> 1079 /// <summary>
1095 /// Sends a specified patch to a client 1080 /// Sends a specified patch to a client
@@ -3367,7 +3352,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3367 3352
3368 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 3353 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
3369 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); 3354 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
3370
3371 OutPacket(objupdate, ThrottleOutPacketType.Task); 3355 OutPacket(objupdate, ThrottleOutPacketType.Task);
3372 } 3356 }
3373 3357
@@ -3418,8 +3402,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3418 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); 3402 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue();
3419 } 3403 }
3420 3404
3421 // HACK: Using the task category until the tiered reprioritization code is in 3405 OutPacket(terse, ThrottleOutPacketType.State);
3422 OutPacket(terse, ThrottleOutPacketType.Task);
3423 } 3406 }
3424 3407
3425 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) 3408 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)