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