aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs99
1 files changed, 43 insertions, 56 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e39323f..f98e741 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 }
@@ -1020,6 +1020,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1020 public virtual void SendLayerData(float[] map) 1020 public virtual void SendLayerData(float[] map)
1021 { 1021 {
1022 Util.FireAndForget(DoSendLayerData, map); 1022 Util.FireAndForget(DoSendLayerData, map);
1023
1024 // Send it sync, and async. It's not that much data
1025 // and it improves user experience just so much!
1026 DoSendLayerData(map);
1023 } 1027 }
1024 1028
1025 /// <summary> 1029 /// <summary>
@@ -1032,16 +1036,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1032 1036
1033 try 1037 try
1034 { 1038 {
1035 //for (int y = 0; y < 16; y++) 1039 for (int y = 0; y < 16; y++)
1036 //{ 1040 {
1037 // for (int x = 0; x < 16; x++) 1041 for (int x = 0; x < 16; x+=4)
1038 // { 1042 {
1039 // SendLayerData(x, y, map); 1043 SendLayerPacket(x, y, map);
1040 // } 1044 }
1041 //} 1045 }
1042
1043 // Send LayerData in a spiral pattern. Fun!
1044 SendLayerTopRight(map, 0, 0, 15, 15);
1045 } 1046 }
1046 catch (Exception e) 1047 catch (Exception e)
1047 { 1048 {
@@ -1049,51 +1050,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1049 } 1050 }
1050 } 1051 }
1051 1052
1052 private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
1053 {
1054 // Row
1055 for (int i = x1; i <= x2; i++)
1056 SendLayerData(i, y1, map);
1057
1058 // Column
1059 for (int j = y1 + 1; j <= y2; j++)
1060 SendLayerData(x2, j, map);
1061
1062 if (x2 - x1 > 0)
1063 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1064 }
1065
1066 void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
1067 {
1068 // Row in reverse
1069 for (int i = x2; i >= x1; i--)
1070 SendLayerData(i, y2, map);
1071
1072 // Column in reverse
1073 for (int j = y2 - 1; j >= y1; j--)
1074 SendLayerData(x1, j, map);
1075
1076 if (x2 - x1 > 0)
1077 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1078 }
1079
1080 /// <summary> 1053 /// <summary>
1081 /// Sends a set of four patches (x, x+1, ..., x+3) to the client 1054 /// Sends a set of four patches (x, x+1, ..., x+3) to the client
1082 /// </summary> 1055 /// </summary>
1083 /// <param name="map">heightmap</param> 1056 /// <param name="map">heightmap</param>
1084 /// <param name="px">X coordinate for patches 0..12</param> 1057 /// <param name="px">X coordinate for patches 0..12</param>
1085 /// <param name="py">Y coordinate for patches 0..15</param> 1058 /// <param name="py">Y coordinate for patches 0..15</param>
1086 // private void SendLayerPacket(float[] map, int y, int x) 1059 private void SendLayerPacket(int x, int y, float[] map)
1087 // { 1060 {
1088 // int[] patches = new int[4]; 1061 int[] patches = new int[4];
1089 // patches[0] = x + 0 + y * 16; 1062 patches[0] = x + 0 + y * 16;
1090 // patches[1] = x + 1 + y * 16; 1063 patches[1] = x + 1 + y * 16;
1091 // patches[2] = x + 2 + y * 16; 1064 patches[2] = x + 2 + y * 16;
1092 // patches[3] = x + 3 + y * 16; 1065 patches[3] = x + 3 + y * 16;
1093 1066
1094 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); 1067 float[] heightmap = (map.Length == 65536) ?
1095 // OutPacket(layerpack, ThrottleOutPacketType.Land); 1068 map :
1096 // } 1069 LLHeightFieldMoronize(map);
1070
1071 try
1072 {
1073 Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1074 OutPacket(layerpack, ThrottleOutPacketType.Land);
1075 }
1076 catch
1077 {
1078 for (int px = x ; px < x + 4 ; px++)
1079 SendLayerData(px, y, map);
1080 }
1081 }
1097 1082
1098 /// <summary> 1083 /// <summary>
1099 /// Sends a specified patch to a client 1084 /// Sends a specified patch to a client
@@ -1113,7 +1098,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1113 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); 1098 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1114 layerpack.Header.Reliable = true; 1099 layerpack.Header.Reliable = true;
1115 1100
1116 OutPacket(layerpack, ThrottleOutPacketType.Land); 1101 OutPacket(layerpack, ThrottleOutPacketType.Task);
1117 } 1102 }
1118 catch (Exception e) 1103 catch (Exception e)
1119 { 1104 {
@@ -3373,7 +3358,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3373 3358
3374 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 3359 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
3375 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); 3360 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
3376
3377 OutPacket(objupdate, ThrottleOutPacketType.Task); 3361 OutPacket(objupdate, ThrottleOutPacketType.Task);
3378 } 3362 }
3379 3363
@@ -3424,8 +3408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3424 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); 3408 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue();
3425 } 3409 }
3426 3410
3427 // HACK: Using the task category until the tiered reprioritization code is in 3411 OutPacket(terse, ThrottleOutPacketType.State);
3428 OutPacket(terse, ThrottleOutPacketType.Task);
3429 } 3412 }
3430 3413
3431 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) 3414 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
@@ -3902,6 +3885,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3902 { 3885 {
3903 m_propertiesPacketTimer.Stop(); 3886 m_propertiesPacketTimer.Stop();
3904 3887
3888 if (m_propertiesBlocks.Count == 0)
3889 return;
3890
3905 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; 3891 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
3906 3892
3907 int index = 0; 3893 int index = 0;
@@ -4842,6 +4828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4842 (x.CameraLeftAxis != lastarg.CameraLeftAxis) || 4828 (x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
4843 (x.CameraUpAxis != lastarg.CameraUpAxis) || 4829 (x.CameraUpAxis != lastarg.CameraUpAxis) ||
4844 (x.ControlFlags != lastarg.ControlFlags) || 4830 (x.ControlFlags != lastarg.ControlFlags) ||
4831 (x.ControlFlags != 0) ||
4845 (x.Far != lastarg.Far) || 4832 (x.Far != lastarg.Far) ||
4846 (x.Flags != lastarg.Flags) || 4833 (x.Flags != lastarg.Flags) ||
4847 (x.State != lastarg.State) || 4834 (x.State != lastarg.State) ||