aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-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 9ba99d6..0762ed0 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -845,16 +845,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
845 } 845 }
846 } 846 }
847 847
848 public void SendGenericMessage(string method, List<string> message) 848 public void SendGenericMessage(string method, List<byte[]> message)
849 { 849 {
850 GenericMessagePacket gmp = new GenericMessagePacket(); 850 GenericMessagePacket gmp = new GenericMessagePacket();
851 gmp.MethodData.Method = Util.StringToBytes256(method); 851 gmp.MethodData.Method = Util.StringToBytes256(method);
852 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 852 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
853 int i = 0; 853 int i = 0;
854 foreach (string val in message) 854 foreach (byte[] val in message)
855 { 855 {
856 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); 856 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock();
857 gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); 857 gmp.ParamList[i++].Parameter = val;
858 } 858 }
859 OutPacket(gmp, ThrottleOutPacketType.Task); 859 OutPacket(gmp, ThrottleOutPacketType.Task);
860 } 860 }
@@ -1053,6 +1053,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1053 public virtual void SendLayerData(float[] map) 1053 public virtual void SendLayerData(float[] map)
1054 { 1054 {
1055 Util.FireAndForget(DoSendLayerData, map); 1055 Util.FireAndForget(DoSendLayerData, map);
1056
1057 // Send it sync, and async. It's not that much data
1058 // and it improves user experience just so much!
1059 DoSendLayerData(map);
1056 } 1060 }
1057 1061
1058 /// <summary> 1062 /// <summary>
@@ -1065,16 +1069,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1065 1069
1066 try 1070 try
1067 { 1071 {
1068 //for (int y = 0; y < 16; y++) 1072 for (int y = 0; y < 16; y++)
1069 //{ 1073 {
1070 // for (int x = 0; x < 16; x++) 1074 for (int x = 0; x < 16; x+=4)
1071 // { 1075 {
1072 // SendLayerData(x, y, map); 1076 SendLayerPacket(x, y, map);
1073 // } 1077 }
1074 //} 1078 }
1075
1076 // Send LayerData in a spiral pattern. Fun!
1077 SendLayerTopRight(map, 0, 0, 15, 15);
1078 } 1079 }
1079 catch (Exception e) 1080 catch (Exception e)
1080 { 1081 {
@@ -1082,51 +1083,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1082 } 1083 }
1083 } 1084 }
1084 1085
1085 private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
1086 {
1087 // Row
1088 for (int i = x1; i <= x2; i++)
1089 SendLayerData(i, y1, map);
1090
1091 // Column
1092 for (int j = y1 + 1; j <= y2; j++)
1093 SendLayerData(x2, j, map);
1094
1095 if (x2 - x1 > 0)
1096 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1097 }
1098
1099 void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
1100 {
1101 // Row in reverse
1102 for (int i = x2; i >= x1; i--)
1103 SendLayerData(i, y2, map);
1104
1105 // Column in reverse
1106 for (int j = y2 - 1; j >= y1; j--)
1107 SendLayerData(x1, j, map);
1108
1109 if (x2 - x1 > 0)
1110 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1111 }
1112
1113 /// <summary> 1086 /// <summary>
1114 /// Sends a set of four patches (x, x+1, ..., x+3) to the client 1087 /// Sends a set of four patches (x, x+1, ..., x+3) to the client
1115 /// </summary> 1088 /// </summary>
1116 /// <param name="map">heightmap</param> 1089 /// <param name="map">heightmap</param>
1117 /// <param name="px">X coordinate for patches 0..12</param> 1090 /// <param name="px">X coordinate for patches 0..12</param>
1118 /// <param name="py">Y coordinate for patches 0..15</param> 1091 /// <param name="py">Y coordinate for patches 0..15</param>
1119 // private void SendLayerPacket(float[] map, int y, int x) 1092 private void SendLayerPacket(int x, int y, float[] map)
1120 // { 1093 {
1121 // int[] patches = new int[4]; 1094 int[] patches = new int[4];
1122 // patches[0] = x + 0 + y * 16; 1095 patches[0] = x + 0 + y * 16;
1123 // patches[1] = x + 1 + y * 16; 1096 patches[1] = x + 1 + y * 16;
1124 // patches[2] = x + 2 + y * 16; 1097 patches[2] = x + 2 + y * 16;
1125 // patches[3] = x + 3 + y * 16; 1098 patches[3] = x + 3 + y * 16;
1126 1099
1127 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); 1100 float[] heightmap = (map.Length == 65536) ?
1128 // OutPacket(layerpack, ThrottleOutPacketType.Land); 1101 map :
1129 // } 1102 LLHeightFieldMoronize(map);
1103
1104 try
1105 {
1106 Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1107 OutPacket(layerpack, ThrottleOutPacketType.Land);
1108 }
1109 catch
1110 {
1111 for (int px = x ; px < x + 4 ; px++)
1112 SendLayerData(px, y, map);
1113 }
1114 }
1130 1115
1131 /// <summary> 1116 /// <summary>
1132 /// Sends a specified patch to a client 1117 /// Sends a specified patch to a client
@@ -1146,7 +1131,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1146 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); 1131 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1147 layerpack.Header.Reliable = true; 1132 layerpack.Header.Reliable = true;
1148 1133
1149 OutPacket(layerpack, ThrottleOutPacketType.Land); 1134 OutPacket(layerpack, ThrottleOutPacketType.Task);
1150 } 1135 }
1151 catch (Exception e) 1136 catch (Exception e)
1152 { 1137 {
@@ -3418,7 +3403,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3418 3403
3419 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 3404 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
3420 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); 3405 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
3421
3422 OutPacket(objupdate, ThrottleOutPacketType.Task); 3406 OutPacket(objupdate, ThrottleOutPacketType.Task);
3423 } 3407 }
3424 3408
@@ -3469,8 +3453,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3469 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); 3453 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue();
3470 } 3454 }
3471 3455
3472 // HACK: Using the task category until the tiered reprioritization code is in 3456 OutPacket(terse, ThrottleOutPacketType.State);
3473 OutPacket(terse, ThrottleOutPacketType.Task);
3474 } 3457 }
3475 3458
3476 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) 3459 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
@@ -3960,6 +3943,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3960 { 3943 {
3961 m_propertiesPacketTimer.Stop(); 3944 m_propertiesPacketTimer.Stop();
3962 3945
3946 if (m_propertiesBlocks.Count == 0)
3947 return;
3948
3963 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; 3949 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
3964 3950
3965 int index = 0; 3951 int index = 0;
@@ -4897,6 +4883,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4897 (x.CameraLeftAxis != lastarg.CameraLeftAxis) || 4883 (x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
4898 (x.CameraUpAxis != lastarg.CameraUpAxis) || 4884 (x.CameraUpAxis != lastarg.CameraUpAxis) ||
4899 (x.ControlFlags != lastarg.ControlFlags) || 4885 (x.ControlFlags != lastarg.ControlFlags) ||
4886 (x.ControlFlags != 0) ||
4900 (x.Far != lastarg.Far) || 4887 (x.Far != lastarg.Far) ||
4901 (x.Flags != lastarg.Flags) || 4888 (x.Flags != lastarg.Flags) ||
4902 (x.State != lastarg.State) || 4889 (x.State != lastarg.State) ||