diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 101 |
1 files changed, 44 insertions, 57 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 8b81377..731dc8e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -814,16 +814,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
814 | } | 814 | } |
815 | } | 815 | } |
816 | 816 | ||
817 | public void SendGenericMessage(string method, List<string> message) | 817 | public void SendGenericMessage(string method, List<byte[]> message) |
818 | { | 818 | { |
819 | GenericMessagePacket gmp = new GenericMessagePacket(); | 819 | GenericMessagePacket gmp = new GenericMessagePacket(); |
820 | gmp.MethodData.Method = Util.StringToBytes256(method); | 820 | gmp.MethodData.Method = Util.StringToBytes256(method); |
821 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; | 821 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; |
822 | int i = 0; | 822 | int i = 0; |
823 | foreach (string val in message) | 823 | foreach (byte[] val in message) |
824 | { | 824 | { |
825 | gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); | 825 | gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); |
826 | gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); | 826 | gmp.ParamList[i++].Parameter = val; |
827 | } | 827 | } |
828 | OutPacket(gmp, ThrottleOutPacketType.Task); | 828 | OutPacket(gmp, ThrottleOutPacketType.Task); |
829 | } | 829 | } |
@@ -1022,6 +1022,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1022 | public virtual void SendLayerData(float[] map) | 1022 | public virtual void SendLayerData(float[] map) |
1023 | { | 1023 | { |
1024 | Util.FireAndForget(DoSendLayerData, map); | 1024 | Util.FireAndForget(DoSendLayerData, map); |
1025 | |||
1026 | // Send it sync, and async. It's not that much data | ||
1027 | // and it improves user experience just so much! | ||
1028 | DoSendLayerData(map); | ||
1025 | } | 1029 | } |
1026 | 1030 | ||
1027 | /// <summary> | 1031 | /// <summary> |
@@ -1034,16 +1038,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1034 | 1038 | ||
1035 | try | 1039 | try |
1036 | { | 1040 | { |
1037 | //for (int y = 0; y < 16; y++) | 1041 | for (int y = 0; y < 16; y++) |
1038 | //{ | 1042 | { |
1039 | // for (int x = 0; x < 16; x++) | 1043 | for (int x = 0; x < 16; x+=4) |
1040 | // { | 1044 | { |
1041 | // SendLayerData(x, y, map); | 1045 | SendLayerPacket(x, y, map); |
1042 | // } | 1046 | } |
1043 | //} | 1047 | } |
1044 | |||
1045 | // Send LayerData in a spiral pattern. Fun! | ||
1046 | SendLayerTopRight(map, 0, 0, 15, 15); | ||
1047 | } | 1048 | } |
1048 | catch (Exception e) | 1049 | catch (Exception e) |
1049 | { | 1050 | { |
@@ -1051,51 +1052,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1051 | } | 1052 | } |
1052 | } | 1053 | } |
1053 | 1054 | ||
1054 | private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2) | ||
1055 | { | ||
1056 | // Row | ||
1057 | for (int i = x1; i <= x2; i++) | ||
1058 | SendLayerData(i, y1, map); | ||
1059 | |||
1060 | // Column | ||
1061 | for (int j = y1 + 1; j <= y2; j++) | ||
1062 | SendLayerData(x2, j, map); | ||
1063 | |||
1064 | if (x2 - x1 > 0) | ||
1065 | SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2); | ||
1066 | } | ||
1067 | |||
1068 | void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2) | ||
1069 | { | ||
1070 | // Row in reverse | ||
1071 | for (int i = x2; i >= x1; i--) | ||
1072 | SendLayerData(i, y2, map); | ||
1073 | |||
1074 | // Column in reverse | ||
1075 | for (int j = y2 - 1; j >= y1; j--) | ||
1076 | SendLayerData(x1, j, map); | ||
1077 | |||
1078 | if (x2 - x1 > 0) | ||
1079 | SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1); | ||
1080 | } | ||
1081 | |||
1082 | /// <summary> | 1055 | /// <summary> |
1083 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 1056 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
1084 | /// </summary> | 1057 | /// </summary> |
1085 | /// <param name="map">heightmap</param> | 1058 | /// <param name="map">heightmap</param> |
1086 | /// <param name="px">X coordinate for patches 0..12</param> | 1059 | /// <param name="px">X coordinate for patches 0..12</param> |
1087 | /// <param name="py">Y coordinate for patches 0..15</param> | 1060 | /// <param name="py">Y coordinate for patches 0..15</param> |
1088 | // private void SendLayerPacket(float[] map, int y, int x) | 1061 | private void SendLayerPacket(int x, int y, float[] map) |
1089 | // { | 1062 | { |
1090 | // int[] patches = new int[4]; | 1063 | int[] patches = new int[4]; |
1091 | // patches[0] = x + 0 + y * 16; | 1064 | patches[0] = x + 0 + y * 16; |
1092 | // patches[1] = x + 1 + y * 16; | 1065 | patches[1] = x + 1 + y * 16; |
1093 | // patches[2] = x + 2 + y * 16; | 1066 | patches[2] = x + 2 + y * 16; |
1094 | // patches[3] = x + 3 + y * 16; | 1067 | patches[3] = x + 3 + y * 16; |
1095 | 1068 | ||
1096 | // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1069 | float[] heightmap = (map.Length == 65536) ? |
1097 | // OutPacket(layerpack, ThrottleOutPacketType.Land); | 1070 | map : |
1098 | // } | 1071 | LLHeightFieldMoronize(map); |
1072 | |||
1073 | try | ||
1074 | { | ||
1075 | Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | ||
1076 | OutPacket(layerpack, ThrottleOutPacketType.Land); | ||
1077 | } | ||
1078 | catch | ||
1079 | { | ||
1080 | for (int px = x ; px < x + 4 ; px++) | ||
1081 | SendLayerData(px, y, map); | ||
1082 | } | ||
1083 | } | ||
1099 | 1084 | ||
1100 | /// <summary> | 1085 | /// <summary> |
1101 | /// Sends a specified patch to a client | 1086 | /// Sends a specified patch to a client |
@@ -1115,7 +1100,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1115 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | 1100 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); |
1116 | layerpack.Header.Reliable = true; | 1101 | layerpack.Header.Reliable = true; |
1117 | 1102 | ||
1118 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1103 | OutPacket(layerpack, ThrottleOutPacketType.Task); |
1119 | } | 1104 | } |
1120 | catch (Exception e) | 1105 | catch (Exception e) |
1121 | { | 1106 | { |
@@ -3375,7 +3360,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3375 | 3360 | ||
3376 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | 3361 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; |
3377 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); | 3362 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); |
3378 | |||
3379 | OutPacket(objupdate, ThrottleOutPacketType.Task); | 3363 | OutPacket(objupdate, ThrottleOutPacketType.Task); |
3380 | } | 3364 | } |
3381 | 3365 | ||
@@ -3426,8 +3410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3426 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); | 3410 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); |
3427 | } | 3411 | } |
3428 | 3412 | ||
3429 | // HACK: Using the task category until the tiered reprioritization code is in | 3413 | OutPacket(terse, ThrottleOutPacketType.State); |
3430 | OutPacket(terse, ThrottleOutPacketType.Task); | ||
3431 | } | 3414 | } |
3432 | 3415 | ||
3433 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) | 3416 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |
@@ -3904,6 +3887,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3904 | { | 3887 | { |
3905 | m_propertiesPacketTimer.Stop(); | 3888 | m_propertiesPacketTimer.Stop(); |
3906 | 3889 | ||
3890 | if (m_propertiesBlocks.Count == 0) | ||
3891 | return; | ||
3892 | |||
3907 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; | 3893 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; |
3908 | 3894 | ||
3909 | int index = 0; | 3895 | int index = 0; |
@@ -4846,6 +4832,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4846 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || | 4832 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || |
4847 | (x.CameraUpAxis != lastarg.CameraUpAxis) || | 4833 | (x.CameraUpAxis != lastarg.CameraUpAxis) || |
4848 | (x.ControlFlags != lastarg.ControlFlags) || | 4834 | (x.ControlFlags != lastarg.ControlFlags) || |
4835 | (x.ControlFlags != 0) || | ||
4849 | (x.Far != lastarg.Far) || | 4836 | (x.Far != lastarg.Far) || |
4850 | (x.Flags != lastarg.Flags) || | 4837 | (x.Flags != lastarg.Flags) || |
4851 | (x.State != lastarg.State) || | 4838 | (x.State != lastarg.State) || |
@@ -5213,7 +5200,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5213 | args.Channel = ch; | 5200 | args.Channel = ch; |
5214 | args.From = String.Empty; | 5201 | args.From = String.Empty; |
5215 | args.Message = Utils.BytesToString(msg); | 5202 | args.Message = Utils.BytesToString(msg); |
5216 | args.Type = ChatTypeEnum.Shout; | 5203 | args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance |
5217 | args.Position = new Vector3(); | 5204 | args.Position = new Vector3(); |
5218 | args.Scene = Scene; | 5205 | args.Scene = Scene; |
5219 | args.Sender = this; | 5206 | args.Sender = this; |