aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 ef49205..1696037 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -820,16 +820,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
820 } 820 }
821 } 821 }
822 822
823 public void SendGenericMessage(string method, List<string> message) 823 public void SendGenericMessage(string method, List<byte[]> message)
824 { 824 {
825 GenericMessagePacket gmp = new GenericMessagePacket(); 825 GenericMessagePacket gmp = new GenericMessagePacket();
826 gmp.MethodData.Method = Util.StringToBytes256(method); 826 gmp.MethodData.Method = Util.StringToBytes256(method);
827 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 827 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
828 int i = 0; 828 int i = 0;
829 foreach (string val in message) 829 foreach (byte[] val in message)
830 { 830 {
831 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); 831 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock();
832 gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); 832 gmp.ParamList[i++].Parameter = val;
833 } 833 }
834 OutPacket(gmp, ThrottleOutPacketType.Task); 834 OutPacket(gmp, ThrottleOutPacketType.Task);
835 } 835 }
@@ -1028,6 +1028,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1028 public virtual void SendLayerData(float[] map) 1028 public virtual void SendLayerData(float[] map)
1029 { 1029 {
1030 Util.FireAndForget(DoSendLayerData, map); 1030 Util.FireAndForget(DoSendLayerData, map);
1031
1032 // Send it sync, and async. It's not that much data
1033 // and it improves user experience just so much!
1034 DoSendLayerData(map);
1031 } 1035 }
1032 1036
1033 /// <summary> 1037 /// <summary>
@@ -1040,16 +1044,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1040 1044
1041 try 1045 try
1042 { 1046 {
1043 //for (int y = 0; y < 16; y++) 1047 for (int y = 0; y < 16; y++)
1044 //{ 1048 {
1045 // for (int x = 0; x < 16; x++) 1049 for (int x = 0; x < 16; x+=4)
1046 // { 1050 {
1047 // SendLayerData(x, y, map); 1051 SendLayerPacket(x, y, map);
1048 // } 1052 }
1049 //} 1053 }
1050
1051 // Send LayerData in a spiral pattern. Fun!
1052 SendLayerTopRight(map, 0, 0, 15, 15);
1053 } 1054 }
1054 catch (Exception e) 1055 catch (Exception e)
1055 { 1056 {
@@ -1057,51 +1058,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1057 } 1058 }
1058 } 1059 }
1059 1060
1060 private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
1061 {
1062 // Row
1063 for (int i = x1; i <= x2; i++)
1064 SendLayerData(i, y1, map);
1065
1066 // Column
1067 for (int j = y1 + 1; j <= y2; j++)
1068 SendLayerData(x2, j, map);
1069
1070 if (x2 - x1 > 0)
1071 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1072 }
1073
1074 void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
1075 {
1076 // Row in reverse
1077 for (int i = x2; i >= x1; i--)
1078 SendLayerData(i, y2, map);
1079
1080 // Column in reverse
1081 for (int j = y2 - 1; j >= y1; j--)
1082 SendLayerData(x1, j, map);
1083
1084 if (x2 - x1 > 0)
1085 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1086 }
1087
1088 /// <summary> 1061 /// <summary>
1089 /// Sends a set of four patches (x, x+1, ..., x+3) to the client 1062 /// Sends a set of four patches (x, x+1, ..., x+3) to the client
1090 /// </summary> 1063 /// </summary>
1091 /// <param name="map">heightmap</param> 1064 /// <param name="map">heightmap</param>
1092 /// <param name="px">X coordinate for patches 0..12</param> 1065 /// <param name="px">X coordinate for patches 0..12</param>
1093 /// <param name="py">Y coordinate for patches 0..15</param> 1066 /// <param name="py">Y coordinate for patches 0..15</param>
1094 // private void SendLayerPacket(float[] map, int y, int x) 1067 private void SendLayerPacket(int x, int y, float[] map)
1095 // { 1068 {
1096 // int[] patches = new int[4]; 1069 int[] patches = new int[4];
1097 // patches[0] = x + 0 + y * 16; 1070 patches[0] = x + 0 + y * 16;
1098 // patches[1] = x + 1 + y * 16; 1071 patches[1] = x + 1 + y * 16;
1099 // patches[2] = x + 2 + y * 16; 1072 patches[2] = x + 2 + y * 16;
1100 // patches[3] = x + 3 + y * 16; 1073 patches[3] = x + 3 + y * 16;
1101 1074
1102 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); 1075 float[] heightmap = (map.Length == 65536) ?
1103 // OutPacket(layerpack, ThrottleOutPacketType.Land); 1076 map :
1104 // } 1077 LLHeightFieldMoronize(map);
1078
1079 try
1080 {
1081 Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1082 OutPacket(layerpack, ThrottleOutPacketType.Land);
1083 }
1084 catch
1085 {
1086 for (int px = x ; px < x + 4 ; px++)
1087 SendLayerData(px, y, map);
1088 }
1089 }
1105 1090
1106 /// <summary> 1091 /// <summary>
1107 /// Sends a specified patch to a client 1092 /// Sends a specified patch to a client
@@ -1121,7 +1106,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1121 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); 1106 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1122 layerpack.Header.Reliable = true; 1107 layerpack.Header.Reliable = true;
1123 1108
1124 OutPacket(layerpack, ThrottleOutPacketType.Land); 1109 OutPacket(layerpack, ThrottleOutPacketType.Task);
1125 } 1110 }
1126 catch (Exception e) 1111 catch (Exception e)
1127 { 1112 {
@@ -3388,7 +3373,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3388 3373
3389 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 3374 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
3390 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); 3375 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
3391
3392 OutPacket(objupdate, ThrottleOutPacketType.Task); 3376 OutPacket(objupdate, ThrottleOutPacketType.Task);
3393 } 3377 }
3394 3378
@@ -3439,8 +3423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3439 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); 3423 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue();
3440 } 3424 }
3441 3425
3442 // HACK: Using the task category until the tiered reprioritization code is in 3426 OutPacket(terse, ThrottleOutPacketType.State);
3443 OutPacket(terse, ThrottleOutPacketType.Task);
3444 } 3427 }
3445 3428
3446 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) 3429 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
@@ -3917,6 +3900,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3917 { 3900 {
3918 m_propertiesPacketTimer.Stop(); 3901 m_propertiesPacketTimer.Stop();
3919 3902
3903 if (m_propertiesBlocks.Count == 0)
3904 return;
3905
3920 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; 3906 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
3921 3907
3922 int index = 0; 3908 int index = 0;
@@ -4854,6 +4840,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4854 (x.CameraLeftAxis != lastarg.CameraLeftAxis) || 4840 (x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
4855 (x.CameraUpAxis != lastarg.CameraUpAxis) || 4841 (x.CameraUpAxis != lastarg.CameraUpAxis) ||
4856 (x.ControlFlags != lastarg.ControlFlags) || 4842 (x.ControlFlags != lastarg.ControlFlags) ||
4843 (x.ControlFlags != 0) ||
4857 (x.Far != lastarg.Far) || 4844 (x.Far != lastarg.Far) ||
4858 (x.Flags != lastarg.Flags) || 4845 (x.Flags != lastarg.Flags) ||
4859 (x.State != lastarg.State) || 4846 (x.State != lastarg.State) ||