diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 95 |
1 files changed, 41 insertions, 54 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d7120a5..3262419 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1064,6 +1064,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1064 | public virtual void SendLayerData(float[] map) | 1064 | public virtual void SendLayerData(float[] map) |
1065 | { | 1065 | { |
1066 | Util.FireAndForget(DoSendLayerData, map); | 1066 | Util.FireAndForget(DoSendLayerData, map); |
1067 | |||
1068 | // Send it sync, and async. It's not that much data | ||
1069 | // and it improves user experience just so much! | ||
1070 | DoSendLayerData(map); | ||
1067 | } | 1071 | } |
1068 | 1072 | ||
1069 | /// <summary> | 1073 | /// <summary> |
@@ -1076,16 +1080,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1076 | 1080 | ||
1077 | try | 1081 | try |
1078 | { | 1082 | { |
1079 | //for (int y = 0; y < 16; y++) | 1083 | for (int y = 0; y < 16; y++) |
1080 | //{ | 1084 | { |
1081 | // for (int x = 0; x < 16; x++) | 1085 | for (int x = 0; x < 16; x+=4) |
1082 | // { | 1086 | { |
1083 | // SendLayerData(x, y, map); | 1087 | SendLayerPacket(x, y, map); |
1084 | // } | 1088 | } |
1085 | //} | 1089 | } |
1086 | |||
1087 | // Send LayerData in a spiral pattern. Fun! | ||
1088 | SendLayerTopRight(map, 0, 0, 15, 15); | ||
1089 | } | 1090 | } |
1090 | catch (Exception e) | 1091 | catch (Exception e) |
1091 | { | 1092 | { |
@@ -1093,51 +1094,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1093 | } | 1094 | } |
1094 | } | 1095 | } |
1095 | 1096 | ||
1096 | private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2) | ||
1097 | { | ||
1098 | // Row | ||
1099 | for (int i = x1; i <= x2; i++) | ||
1100 | SendLayerData(i, y1, map); | ||
1101 | |||
1102 | // Column | ||
1103 | for (int j = y1 + 1; j <= y2; j++) | ||
1104 | SendLayerData(x2, j, map); | ||
1105 | |||
1106 | if (x2 - x1 > 0) | ||
1107 | SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2); | ||
1108 | } | ||
1109 | |||
1110 | void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2) | ||
1111 | { | ||
1112 | // Row in reverse | ||
1113 | for (int i = x2; i >= x1; i--) | ||
1114 | SendLayerData(i, y2, map); | ||
1115 | |||
1116 | // Column in reverse | ||
1117 | for (int j = y2 - 1; j >= y1; j--) | ||
1118 | SendLayerData(x1, j, map); | ||
1119 | |||
1120 | if (x2 - x1 > 0) | ||
1121 | SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1); | ||
1122 | } | ||
1123 | |||
1124 | /// <summary> | 1097 | /// <summary> |
1125 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 1098 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
1126 | /// </summary> | 1099 | /// </summary> |
1127 | /// <param name="map">heightmap</param> | 1100 | /// <param name="map">heightmap</param> |
1128 | /// <param name="px">X coordinate for patches 0..12</param> | 1101 | /// <param name="px">X coordinate for patches 0..12</param> |
1129 | /// <param name="py">Y coordinate for patches 0..15</param> | 1102 | /// <param name="py">Y coordinate for patches 0..15</param> |
1130 | // private void SendLayerPacket(float[] map, int y, int x) | 1103 | private void SendLayerPacket(int x, int y, float[] map) |
1131 | // { | 1104 | { |
1132 | // int[] patches = new int[4]; | 1105 | int[] patches = new int[4]; |
1133 | // patches[0] = x + 0 + y * 16; | 1106 | patches[0] = x + 0 + y * 16; |
1134 | // patches[1] = x + 1 + y * 16; | 1107 | patches[1] = x + 1 + y * 16; |
1135 | // patches[2] = x + 2 + y * 16; | 1108 | patches[2] = x + 2 + y * 16; |
1136 | // patches[3] = x + 3 + y * 16; | 1109 | patches[3] = x + 3 + y * 16; |
1137 | 1110 | ||
1138 | // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1111 | float[] heightmap = (map.Length == 65536) ? |
1139 | // OutPacket(layerpack, ThrottleOutPacketType.Land); | 1112 | map : |
1140 | // } | 1113 | LLHeightFieldMoronize(map); |
1114 | |||
1115 | try | ||
1116 | { | ||
1117 | Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | ||
1118 | OutPacket(layerpack, ThrottleOutPacketType.Land); | ||
1119 | } | ||
1120 | catch | ||
1121 | { | ||
1122 | for (int px = x ; px < x + 4 ; px++) | ||
1123 | SendLayerData(px, y, map); | ||
1124 | } | ||
1125 | } | ||
1141 | 1126 | ||
1142 | /// <summary> | 1127 | /// <summary> |
1143 | /// Sends a specified patch to a client | 1128 | /// Sends a specified patch to a client |
@@ -1157,7 +1142,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1157 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | 1142 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); |
1158 | layerpack.Header.Reliable = true; | 1143 | layerpack.Header.Reliable = true; |
1159 | 1144 | ||
1160 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1145 | OutPacket(layerpack, ThrottleOutPacketType.Task); |
1161 | } | 1146 | } |
1162 | catch (Exception e) | 1147 | catch (Exception e) |
1163 | { | 1148 | { |
@@ -3429,7 +3414,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3429 | 3414 | ||
3430 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | 3415 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; |
3431 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); | 3416 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); |
3432 | |||
3433 | OutPacket(objupdate, ThrottleOutPacketType.Task); | 3417 | OutPacket(objupdate, ThrottleOutPacketType.Task); |
3434 | } | 3418 | } |
3435 | 3419 | ||
@@ -3480,8 +3464,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3480 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); | 3464 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); |
3481 | } | 3465 | } |
3482 | 3466 | ||
3483 | // HACK: Using the task category until the tiered reprioritization code is in | 3467 | OutPacket(terse, ThrottleOutPacketType.State); |
3484 | OutPacket(terse, ThrottleOutPacketType.Task); | ||
3485 | } | 3468 | } |
3486 | 3469 | ||
3487 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) | 3470 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |
@@ -3971,6 +3954,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3971 | { | 3954 | { |
3972 | m_propertiesPacketTimer.Stop(); | 3955 | m_propertiesPacketTimer.Stop(); |
3973 | 3956 | ||
3957 | if (m_propertiesBlocks.Count == 0) | ||
3958 | return; | ||
3959 | |||
3974 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; | 3960 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; |
3975 | 3961 | ||
3976 | int index = 0; | 3962 | int index = 0; |
@@ -4909,6 +4895,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4909 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || | 4895 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || |
4910 | (x.CameraUpAxis != lastarg.CameraUpAxis) || | 4896 | (x.CameraUpAxis != lastarg.CameraUpAxis) || |
4911 | (x.ControlFlags != lastarg.ControlFlags) || | 4897 | (x.ControlFlags != lastarg.ControlFlags) || |
4898 | (x.ControlFlags != 0) || | ||
4912 | (x.Far != lastarg.Far) || | 4899 | (x.Far != lastarg.Far) || |
4913 | (x.Flags != lastarg.Flags) || | 4900 | (x.Flags != lastarg.Flags) || |
4914 | (x.State != lastarg.State) || | 4901 | (x.State != lastarg.State) || |
@@ -5279,7 +5266,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5279 | args.Channel = ch; | 5266 | args.Channel = ch; |
5280 | args.From = String.Empty; | 5267 | args.From = String.Empty; |
5281 | args.Message = Utils.BytesToString(msg); | 5268 | args.Message = Utils.BytesToString(msg); |
5282 | args.Type = ChatTypeEnum.Shout; | 5269 | args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance |
5283 | args.Position = new Vector3(); | 5270 | args.Position = new Vector3(); |
5284 | args.Scene = Scene; | 5271 | args.Scene = Scene; |
5285 | args.Sender = this; | 5272 | args.Sender = this; |