diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 93 |
1 files changed, 38 insertions, 55 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f6c505a..3ac4e5e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -792,16 +792,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
792 | } | 792 | } |
793 | } | 793 | } |
794 | 794 | ||
795 | public void SendGenericMessage(string method, List<string> message) | 795 | public void SendGenericMessage(string method, List<byte[]> message) |
796 | { | 796 | { |
797 | GenericMessagePacket gmp = new GenericMessagePacket(); | 797 | GenericMessagePacket gmp = new GenericMessagePacket(); |
798 | gmp.MethodData.Method = Util.StringToBytes256(method); | 798 | gmp.MethodData.Method = Util.StringToBytes256(method); |
799 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; | 799 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; |
800 | int i = 0; | 800 | int i = 0; |
801 | foreach (string val in message) | 801 | foreach (byte[] val in message) |
802 | { | 802 | { |
803 | gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); | 803 | gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); |
804 | gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); | 804 | gmp.ParamList[i++].Parameter = val; |
805 | } | 805 | } |
806 | OutPacket(gmp, ThrottleOutPacketType.Task); | 806 | OutPacket(gmp, ThrottleOutPacketType.Task); |
807 | } | 807 | } |
@@ -813,6 +813,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
813 | public virtual void SendLayerData(float[] map) | 813 | public virtual void SendLayerData(float[] map) |
814 | { | 814 | { |
815 | Util.FireAndForget(DoSendLayerData, map); | 815 | Util.FireAndForget(DoSendLayerData, map); |
816 | |||
817 | // Send it sync, and async. It's not that much data | ||
818 | // and it improves user experience just so much! | ||
819 | DoSendLayerData(map); | ||
816 | } | 820 | } |
817 | 821 | ||
818 | /// <summary> | 822 | /// <summary> |
@@ -825,16 +829,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
825 | 829 | ||
826 | try | 830 | try |
827 | { | 831 | { |
828 | //for (int y = 0; y < 16; y++) | 832 | for (int y = 0; y < 16; y++) |
829 | //{ | 833 | { |
830 | // for (int x = 0; x < 16; x++) | 834 | for (int x = 0; x < 16; x+=4) |
831 | // { | 835 | { |
832 | // SendLayerData(x, y, map); | 836 | SendLayerPacket(x, y, map); |
833 | // } | 837 | } |
834 | //} | 838 | } |
835 | |||
836 | // Send LayerData in a spiral pattern. Fun! | ||
837 | SendLayerTopRight(map, 0, 0, 15, 15); | ||
838 | } | 839 | } |
839 | catch (Exception e) | 840 | catch (Exception e) |
840 | { | 841 | { |
@@ -842,51 +843,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
842 | } | 843 | } |
843 | } | 844 | } |
844 | 845 | ||
845 | private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2) | ||
846 | { | ||
847 | // Row | ||
848 | for (int i = x1; i <= x2; i++) | ||
849 | SendLayerData(i, y1, map); | ||
850 | |||
851 | // Column | ||
852 | for (int j = y1 + 1; j <= y2; j++) | ||
853 | SendLayerData(x2, j, map); | ||
854 | |||
855 | if (x2 - x1 > 0) | ||
856 | SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2); | ||
857 | } | ||
858 | |||
859 | void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2) | ||
860 | { | ||
861 | // Row in reverse | ||
862 | for (int i = x2; i >= x1; i--) | ||
863 | SendLayerData(i, y2, map); | ||
864 | |||
865 | // Column in reverse | ||
866 | for (int j = y2 - 1; j >= y1; j--) | ||
867 | SendLayerData(x1, j, map); | ||
868 | |||
869 | if (x2 - x1 > 0) | ||
870 | SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1); | ||
871 | } | ||
872 | |||
873 | /// <summary> | 846 | /// <summary> |
874 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 847 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
875 | /// </summary> | 848 | /// </summary> |
876 | /// <param name="map">heightmap</param> | 849 | /// <param name="map">heightmap</param> |
877 | /// <param name="px">X coordinate for patches 0..12</param> | 850 | /// <param name="px">X coordinate for patches 0..12</param> |
878 | /// <param name="py">Y coordinate for patches 0..15</param> | 851 | /// <param name="py">Y coordinate for patches 0..15</param> |
879 | // private void SendLayerPacket(float[] map, int y, int x) | 852 | private void SendLayerPacket(int x, int y, float[] map) |
880 | // { | 853 | { |
881 | // int[] patches = new int[4]; | 854 | int[] patches = new int[4]; |
882 | // patches[0] = x + 0 + y * 16; | 855 | patches[0] = x + 0 + y * 16; |
883 | // patches[1] = x + 1 + y * 16; | 856 | patches[1] = x + 1 + y * 16; |
884 | // patches[2] = x + 2 + y * 16; | 857 | patches[2] = x + 2 + y * 16; |
885 | // patches[3] = x + 3 + y * 16; | 858 | patches[3] = x + 3 + y * 16; |
886 | 859 | ||
887 | // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 860 | float[] heightmap = (map.Length == 65536) ? |
888 | // OutPacket(layerpack, ThrottleOutPacketType.Land); | 861 | map : |
889 | // } | 862 | LLHeightFieldMoronize(map); |
863 | |||
864 | try | ||
865 | { | ||
866 | Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | ||
867 | OutPacket(layerpack, ThrottleOutPacketType.Land); | ||
868 | } | ||
869 | catch | ||
870 | { | ||
871 | for (int px = x ; px < x + 4 ; px++) | ||
872 | SendLayerData(px, y, map); | ||
873 | } | ||
874 | } | ||
890 | 875 | ||
891 | /// <summary> | 876 | /// <summary> |
892 | /// Sends a specified patch to a client | 877 | /// Sends a specified patch to a client |
@@ -3164,7 +3149,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3164 | 3149 | ||
3165 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | 3150 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; |
3166 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); | 3151 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); |
3167 | |||
3168 | OutPacket(objupdate, ThrottleOutPacketType.Task); | 3152 | OutPacket(objupdate, ThrottleOutPacketType.Task); |
3169 | } | 3153 | } |
3170 | 3154 | ||
@@ -3215,8 +3199,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3215 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); | 3199 | terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); |
3216 | } | 3200 | } |
3217 | 3201 | ||
3218 | // HACK: Using the task category until the tiered reprioritization code is in | 3202 | OutPacket(terse, ThrottleOutPacketType.State); |
3219 | OutPacket(terse, ThrottleOutPacketType.Task); | ||
3220 | } | 3203 | } |
3221 | 3204 | ||
3222 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) | 3205 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |