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 a9b5c2b..8cd47fb 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -827,16 +827,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
827 } 827 }
828 } 828 }
829 829
830 public void SendGenericMessage(string method, List<string> message) 830 public void SendGenericMessage(string method, List<byte[]> message)
831 { 831 {
832 GenericMessagePacket gmp = new GenericMessagePacket(); 832 GenericMessagePacket gmp = new GenericMessagePacket();
833 gmp.MethodData.Method = Util.StringToBytes256(method); 833 gmp.MethodData.Method = Util.StringToBytes256(method);
834 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 834 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
835 int i = 0; 835 int i = 0;
836 foreach (string val in message) 836 foreach (byte[] val in message)
837 { 837 {
838 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); 838 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock();
839 gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); 839 gmp.ParamList[i++].Parameter = val;
840 } 840 }
841 OutPacket(gmp, ThrottleOutPacketType.Task); 841 OutPacket(gmp, ThrottleOutPacketType.Task);
842 } 842 }
@@ -1035,6 +1035,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1035 public virtual void SendLayerData(float[] map) 1035 public virtual void SendLayerData(float[] map)
1036 { 1036 {
1037 Util.FireAndForget(DoSendLayerData, map); 1037 Util.FireAndForget(DoSendLayerData, map);
1038
1039 // Send it sync, and async. It's not that much data
1040 // and it improves user experience just so much!
1041 DoSendLayerData(map);
1038 } 1042 }
1039 1043
1040 /// <summary> 1044 /// <summary>
@@ -1047,16 +1051,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1047 1051
1048 try 1052 try
1049 { 1053 {
1050 //for (int y = 0; y < 16; y++) 1054 for (int y = 0; y < 16; y++)
1051 //{ 1055 {
1052 // for (int x = 0; x < 16; x++) 1056 for (int x = 0; x < 16; x+=4)
1053 // { 1057 {
1054 // SendLayerData(x, y, map); 1058 SendLayerPacket(x, y, map);
1055 // } 1059 }
1056 //} 1060 }
1057
1058 // Send LayerData in a spiral pattern. Fun!
1059 SendLayerTopRight(map, 0, 0, 15, 15);
1060 } 1061 }
1061 catch (Exception e) 1062 catch (Exception e)
1062 { 1063 {
@@ -1064,51 +1065,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1064 } 1065 }
1065 } 1066 }
1066 1067
1067 private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
1068 {
1069 // Row
1070 for (int i = x1; i <= x2; i++)
1071 SendLayerData(i, y1, map);
1072
1073 // Column
1074 for (int j = y1 + 1; j <= y2; j++)
1075 SendLayerData(x2, j, map);
1076
1077 if (x2 - x1 > 0)
1078 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1079 }
1080
1081 void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
1082 {
1083 // Row in reverse
1084 for (int i = x2; i >= x1; i--)
1085 SendLayerData(i, y2, map);
1086
1087 // Column in reverse
1088 for (int j = y2 - 1; j >= y1; j--)
1089 SendLayerData(x1, j, map);
1090
1091 if (x2 - x1 > 0)
1092 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1093 }
1094
1095 /// <summary> 1068 /// <summary>
1096 /// Sends a set of four patches (x, x+1, ..., x+3) to the client 1069 /// Sends a set of four patches (x, x+1, ..., x+3) to the client
1097 /// </summary> 1070 /// </summary>
1098 /// <param name="map">heightmap</param> 1071 /// <param name="map">heightmap</param>
1099 /// <param name="px">X coordinate for patches 0..12</param> 1072 /// <param name="px">X coordinate for patches 0..12</param>
1100 /// <param name="py">Y coordinate for patches 0..15</param> 1073 /// <param name="py">Y coordinate for patches 0..15</param>
1101 // private void SendLayerPacket(float[] map, int y, int x) 1074 private void SendLayerPacket(int x, int y, float[] map)
1102 // { 1075 {
1103 // int[] patches = new int[4]; 1076 int[] patches = new int[4];
1104 // patches[0] = x + 0 + y * 16; 1077 patches[0] = x + 0 + y * 16;
1105 // patches[1] = x + 1 + y * 16; 1078 patches[1] = x + 1 + y * 16;
1106 // patches[2] = x + 2 + y * 16; 1079 patches[2] = x + 2 + y * 16;
1107 // patches[3] = x + 3 + y * 16; 1080 patches[3] = x + 3 + y * 16;
1108 1081
1109 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); 1082 float[] heightmap = (map.Length == 65536) ?
1110 // OutPacket(layerpack, ThrottleOutPacketType.Land); 1083 map :
1111 // } 1084 LLHeightFieldMoronize(map);
1085
1086 try
1087 {
1088 Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1089 OutPacket(layerpack, ThrottleOutPacketType.Land);
1090 }
1091 catch
1092 {
1093 for (int px = x ; px < x + 4 ; px++)
1094 SendLayerData(px, y, map);
1095 }
1096 }
1112 1097
1113 /// <summary> 1098 /// <summary>
1114 /// Sends a specified patch to a client 1099 /// Sends a specified patch to a client
@@ -1128,7 +1113,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1128 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); 1113 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1129 layerpack.Header.Reliable = true; 1114 layerpack.Header.Reliable = true;
1130 1115
1131 OutPacket(layerpack, ThrottleOutPacketType.Land); 1116 OutPacket(layerpack, ThrottleOutPacketType.Task);
1132 } 1117 }
1133 catch (Exception e) 1118 catch (Exception e)
1134 { 1119 {
@@ -3395,7 +3380,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3395 3380
3396 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 3381 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
3397 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); 3382 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
3398
3399 OutPacket(objupdate, ThrottleOutPacketType.Task); 3383 OutPacket(objupdate, ThrottleOutPacketType.Task);
3400 } 3384 }
3401 3385
@@ -3446,8 +3430,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3446 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); 3430 terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue();
3447 } 3431 }
3448 3432
3449 // HACK: Using the task category until the tiered reprioritization code is in 3433 OutPacket(terse, ThrottleOutPacketType.State);
3450 OutPacket(terse, ThrottleOutPacketType.Task);
3451 } 3434 }
3452 3435
3453 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) 3436 public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
@@ -3924,6 +3907,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3924 { 3907 {
3925 m_propertiesPacketTimer.Stop(); 3908 m_propertiesPacketTimer.Stop();
3926 3909
3910 if (m_propertiesBlocks.Count == 0)
3911 return;
3912
3927 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; 3913 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
3928 3914
3929 int index = 0; 3915 int index = 0;
@@ -4861,6 +4847,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4861 (x.CameraLeftAxis != lastarg.CameraLeftAxis) || 4847 (x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
4862 (x.CameraUpAxis != lastarg.CameraUpAxis) || 4848 (x.CameraUpAxis != lastarg.CameraUpAxis) ||
4863 (x.ControlFlags != lastarg.ControlFlags) || 4849 (x.ControlFlags != lastarg.ControlFlags) ||
4850 (x.ControlFlags != 0) ||
4864 (x.Far != lastarg.Far) || 4851 (x.Far != lastarg.Far) ||
4865 (x.Flags != lastarg.Flags) || 4852 (x.Flags != lastarg.Flags) ||
4866 (x.State != lastarg.State) || 4853 (x.State != lastarg.State) ||