diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 93 |
1 files changed, 40 insertions, 53 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 25f6ef0..773baf5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1054,6 +1054,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1054 | public virtual void SendLayerData(float[] map) | 1054 | public virtual void SendLayerData(float[] map) |
1055 | { | 1055 | { |
1056 | Util.FireAndForget(DoSendLayerData, map); | 1056 | Util.FireAndForget(DoSendLayerData, map); |
1057 | |||
1058 | // Send it sync, and async. It's not that much data | ||
1059 | // and it improves user experience just so much! | ||
1060 | DoSendLayerData(map); | ||
1057 | } | 1061 | } |
1058 | 1062 | ||
1059 | /// <summary> | 1063 | /// <summary> |
@@ -1066,16 +1070,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1066 | 1070 | ||
1067 | try | 1071 | try |
1068 | { | 1072 | { |
1069 | //for (int y = 0; y < 16; y++) | 1073 | for (int y = 0; y < 16; y++) |
1070 | //{ | 1074 | { |
1071 | // for (int x = 0; x < 16; x++) | 1075 | for (int x = 0; x < 16; x+=4) |
1072 | // { | 1076 | { |
1073 | // SendLayerData(x, y, map); | 1077 | SendLayerPacket(x, y, map); |
1074 | // } | 1078 | } |
1075 | //} | 1079 | } |
1076 | |||
1077 | // Send LayerData in a spiral pattern. Fun! | ||
1078 | SendLayerTopRight(map, 0, 0, 15, 15); | ||
1079 | } | 1080 | } |
1080 | catch (Exception e) | 1081 | catch (Exception e) |
1081 | { | 1082 | { |
@@ -1083,51 +1084,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1083 | } | 1084 | } |
1084 | } | 1085 | } |
1085 | 1086 | ||
1086 | private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2) | ||
1087 | { | ||
1088 | // Row | ||
1089 | for (int i = x1; i <= x2; i++) | ||
1090 | SendLayerData(i, y1, map); | ||
1091 | |||
1092 | // Column | ||
1093 | for (int j = y1 + 1; j <= y2; j++) | ||
1094 | SendLayerData(x2, j, map); | ||
1095 | |||
1096 | if (x2 - x1 > 0) | ||
1097 | SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2); | ||
1098 | } | ||
1099 | |||
1100 | void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2) | ||
1101 | { | ||
1102 | // Row in reverse | ||
1103 | for (int i = x2; i >= x1; i--) | ||
1104 | SendLayerData(i, y2, map); | ||
1105 | |||
1106 | // Column in reverse | ||
1107 | for (int j = y2 - 1; j >= y1; j--) | ||
1108 | SendLayerData(x1, j, map); | ||
1109 | |||
1110 | if (x2 - x1 > 0) | ||
1111 | SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1); | ||
1112 | } | ||
1113 | |||
1114 | /// <summary> | 1087 | /// <summary> |
1115 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 1088 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
1116 | /// </summary> | 1089 | /// </summary> |
1117 | /// <param name="map">heightmap</param> | 1090 | /// <param name="map">heightmap</param> |
1118 | /// <param name="px">X coordinate for patches 0..12</param> | 1091 | /// <param name="px">X coordinate for patches 0..12</param> |
1119 | /// <param name="py">Y coordinate for patches 0..15</param> | 1092 | /// <param name="py">Y coordinate for patches 0..15</param> |
1120 | // private void SendLayerPacket(float[] map, int y, int x) | 1093 | private void SendLayerPacket(int x, int y, float[] map) |
1121 | // { | 1094 | { |
1122 | // int[] patches = new int[4]; | 1095 | int[] patches = new int[4]; |
1123 | // patches[0] = x + 0 + y * 16; | 1096 | patches[0] = x + 0 + y * 16; |
1124 | // patches[1] = x + 1 + y * 16; | 1097 | patches[1] = x + 1 + y * 16; |
1125 | // patches[2] = x + 2 + y * 16; | 1098 | patches[2] = x + 2 + y * 16; |
1126 | // patches[3] = x + 3 + y * 16; | 1099 | patches[3] = x + 3 + y * 16; |
1127 | 1100 | ||
1128 | // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1101 | float[] heightmap = (map.Length == 65536) ? |
1129 | // OutPacket(layerpack, ThrottleOutPacketType.Land); | 1102 | map : |
1130 | // } | 1103 | LLHeightFieldMoronize(map); |
1104 | |||
1105 | try | ||
1106 | { | ||
1107 | Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | ||
1108 | OutPacket(layerpack, ThrottleOutPacketType.Land); | ||
1109 | } | ||
1110 | catch | ||
1111 | { | ||
1112 | for (int px = x ; px < x + 4 ; px++) | ||
1113 | SendLayerData(px, y, map); | ||
1114 | } | ||
1115 | } | ||
1131 | 1116 | ||
1132 | /// <summary> | 1117 | /// <summary> |
1133 | /// Sends a specified patch to a client | 1118 | /// Sends a specified patch to a client |
@@ -1147,7 +1132,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1147 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | 1132 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); |
1148 | layerpack.Header.Reliable = true; | 1133 | layerpack.Header.Reliable = true; |
1149 | 1134 | ||
1150 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1135 | OutPacket(layerpack, ThrottleOutPacketType.Task); |
1151 | } | 1136 | } |
1152 | catch (Exception e) | 1137 | catch (Exception e) |
1153 | { | 1138 | { |
@@ -3419,7 +3404,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3419 | 3404 | ||
3420 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | 3405 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; |
3421 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); | 3406 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); |
3422 | |||
3423 | OutPacket(objupdate, ThrottleOutPacketType.Task); | 3407 | OutPacket(objupdate, ThrottleOutPacketType.Task); |
3424 | } | 3408 | } |
3425 | 3409 | ||
@@ -3470,8 +3454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3470 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); | 3454 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); |
3471 | } | 3455 | } |
3472 | 3456 | ||
3473 | // HACK: Using the task category until the tiered reprioritization code is in | 3457 | OutPacket(terse, ThrottleOutPacketType.State); |
3474 | OutPacket(terse, ThrottleOutPacketType.Task); | ||
3475 | } | 3458 | } |
3476 | 3459 | ||
3477 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) | 3460 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |
@@ -3961,6 +3944,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3961 | { | 3944 | { |
3962 | m_propertiesPacketTimer.Stop(); | 3945 | m_propertiesPacketTimer.Stop(); |
3963 | 3946 | ||
3947 | if (m_propertiesBlocks.Count == 0) | ||
3948 | return; | ||
3949 | |||
3964 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; | 3950 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; |
3965 | 3951 | ||
3966 | int index = 0; | 3952 | int index = 0; |
@@ -4898,6 +4884,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4898 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || | 4884 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || |
4899 | (x.CameraUpAxis != lastarg.CameraUpAxis) || | 4885 | (x.CameraUpAxis != lastarg.CameraUpAxis) || |
4900 | (x.ControlFlags != lastarg.ControlFlags) || | 4886 | (x.ControlFlags != lastarg.ControlFlags) || |
4887 | (x.ControlFlags != 0) || | ||
4901 | (x.Far != lastarg.Far) || | 4888 | (x.Far != lastarg.Far) || |
4902 | (x.Flags != lastarg.Flags) || | 4889 | (x.Flags != lastarg.Flags) || |
4903 | (x.State != lastarg.State) || | 4890 | (x.State != lastarg.State) || |