diff options
author | Robert Adams | 2013-10-28 09:30:26 -0700 |
---|---|---|
committer | Robert Adams | 2013-10-28 09:30:26 -0700 |
commit | 2be0347f5044ec723748c53db9290f3cf8bc431a (patch) | |
tree | b52812ac7fcdcd8a7a985094e14ca3d461a39673 /OpenSim/Region/ClientStack | |
parent | varregion: update PGSQL driver for storing variable terrain size blobs. (diff) | |
parent | BulletSim: restore collision flags when clear collision cache. (diff) | |
download | opensim-SC_OLD-2be0347f5044ec723748c53db9290f3cf8bc431a.zip opensim-SC_OLD-2be0347f5044ec723748c53db9290f3cf8bc431a.tar.gz opensim-SC_OLD-2be0347f5044ec723748c53db9290f3cf8bc431a.tar.bz2 opensim-SC_OLD-2be0347f5044ec723748c53db9290f3cf8bc431a.tar.xz |
Merge branch 'master' into varregion
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 97 |
2 files changed, 81 insertions, 42 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7984acc..2b8a04f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4515,6 +4515,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4515 | SceneObjectPart root = sop.ParentGroup.RootPart; | 4515 | SceneObjectPart root = sop.ParentGroup.RootPart; |
4516 | 4516 | ||
4517 | block.TouchName = Util.StringToBytes256(root.TouchName); | 4517 | block.TouchName = Util.StringToBytes256(root.TouchName); |
4518 | |||
4519 | // SL 3.3.4, at least, appears to read this information as a concatenated byte[] stream of UUIDs but | ||
4520 | // it's not yet clear whether this is actually used. If this is done in the future then a pre-cached | ||
4521 | // copy is really needed since it's less efficient to be constantly recreating this byte array. | ||
4522 | // using (MemoryStream memStream = new MemoryStream()) | ||
4523 | // { | ||
4524 | // using (BinaryWriter binWriter = new BinaryWriter(memStream)) | ||
4525 | // { | ||
4526 | // for (int i = 0; i < sop.GetNumberOfSides(); i++) | ||
4527 | // { | ||
4528 | // Primitive.TextureEntryFace teFace = sop.Shape.Textures.FaceTextures[i]; | ||
4529 | // | ||
4530 | // UUID textureID; | ||
4531 | // | ||
4532 | // if (teFace != null) | ||
4533 | // textureID = teFace.TextureID; | ||
4534 | // else | ||
4535 | // textureID = sop.Shape.Textures.DefaultTexture.TextureID; | ||
4536 | // | ||
4537 | // binWriter.Write(textureID.GetBytes()); | ||
4538 | // } | ||
4539 | // | ||
4540 | // block.TextureID = memStream.ToArray(); | ||
4541 | // } | ||
4542 | // } | ||
4543 | |||
4518 | block.TextureID = new byte[0]; // TextureID ??? | 4544 | block.TextureID = new byte[0]; // TextureID ??? |
4519 | block.SitName = Util.StringToBytes256(root.SitName); | 4545 | block.SitName = Util.StringToBytes256(root.SitName); |
4520 | block.OwnerMask = root.OwnerMask; | 4546 | block.OwnerMask = root.OwnerMask; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 8d957dc..218c2b2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -862,44 +862,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
862 | return x == m_location; | 862 | return x == m_location; |
863 | } | 863 | } |
864 | 864 | ||
865 | public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) | 865 | // public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) |
866 | { | 866 | // { |
867 | // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way | 867 | // // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way |
868 | if ((packet.Type == PacketType.CoarseLocationUpdate || packet.Type == PacketType.AvatarGroupsReply) && allowSplitting) | 868 | // if ((packet.Type == PacketType.CoarseLocationUpdate || packet.Type == PacketType.AvatarGroupsReply) && allowSplitting) |
869 | allowSplitting = false; | 869 | // allowSplitting = false; |
870 | 870 | // | |
871 | if (allowSplitting && packet.HasVariableBlocks) | 871 | // if (allowSplitting && packet.HasVariableBlocks) |
872 | { | 872 | // { |
873 | byte[][] datas = packet.ToBytesMultiple(); | 873 | // byte[][] datas = packet.ToBytesMultiple(); |
874 | int packetCount = datas.Length; | 874 | // int packetCount = datas.Length; |
875 | 875 | // | |
876 | if (packetCount < 1) | 876 | // if (packetCount < 1) |
877 | m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length); | 877 | // m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length); |
878 | 878 | // | |
879 | for (int i = 0; i < packetCount; i++) | 879 | // for (int i = 0; i < packetCount; i++) |
880 | { | 880 | // { |
881 | byte[] data = datas[i]; | 881 | // byte[] data = datas[i]; |
882 | m_scene.ForEachClient( | 882 | // m_scene.ForEachClient( |
883 | delegate(IClientAPI client) | 883 | // delegate(IClientAPI client) |
884 | { | 884 | // { |
885 | if (client is LLClientView) | 885 | // if (client is LLClientView) |
886 | SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); | 886 | // SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); |
887 | } | 887 | // } |
888 | ); | 888 | // ); |
889 | } | 889 | // } |
890 | } | 890 | // } |
891 | else | 891 | // else |
892 | { | 892 | // { |
893 | byte[] data = packet.ToBytes(); | 893 | // byte[] data = packet.ToBytes(); |
894 | m_scene.ForEachClient( | 894 | // m_scene.ForEachClient( |
895 | delegate(IClientAPI client) | 895 | // delegate(IClientAPI client) |
896 | { | 896 | // { |
897 | if (client is LLClientView) | 897 | // if (client is LLClientView) |
898 | SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); | 898 | // SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); |
899 | } | 899 | // } |
900 | ); | 900 | // ); |
901 | } | 901 | // } |
902 | } | 902 | // } |
903 | 903 | ||
904 | /// <summary> | 904 | /// <summary> |
905 | /// Start the process of sending a packet to the client. | 905 | /// Start the process of sending a packet to the client. |
@@ -919,6 +919,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
919 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) | 919 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) |
920 | allowSplitting = false; | 920 | allowSplitting = false; |
921 | 921 | ||
922 | bool packetQueued = false; | ||
923 | |||
922 | if (allowSplitting && packet.HasVariableBlocks) | 924 | if (allowSplitting && packet.HasVariableBlocks) |
923 | { | 925 | { |
924 | byte[][] datas = packet.ToBytesMultiple(); | 926 | byte[][] datas = packet.ToBytesMultiple(); |
@@ -930,18 +932,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
930 | for (int i = 0; i < packetCount; i++) | 932 | for (int i = 0; i < packetCount; i++) |
931 | { | 933 | { |
932 | byte[] data = datas[i]; | 934 | byte[] data = datas[i]; |
933 | SendPacketData(udpClient, data, packet.Type, category, method); | 935 | |
936 | if (!SendPacketData(udpClient, data, packet.Type, category, method)) | ||
937 | packetQueued = true; | ||
934 | } | 938 | } |
935 | } | 939 | } |
936 | else | 940 | else |
937 | { | 941 | { |
938 | byte[] data = packet.ToBytes(); | 942 | byte[] data = packet.ToBytes(); |
939 | SendPacketData(udpClient, data, packet.Type, category, method); | 943 | packetQueued = SendPacketData(udpClient, data, packet.Type, category, method); |
940 | } | 944 | } |
941 | 945 | ||
942 | PacketPool.Instance.ReturnPacket(packet); | 946 | PacketPool.Instance.ReturnPacket(packet); |
943 | 947 | ||
944 | m_dataPresentEvent.Set(); | 948 | if (packetQueued) |
949 | m_dataPresentEvent.Set(); | ||
945 | } | 950 | } |
946 | 951 | ||
947 | /// <summary> | 952 | /// <summary> |
@@ -955,7 +960,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
955 | /// The method to call if the packet is not acked by the client. If null, then a standard | 960 | /// The method to call if the packet is not acked by the client. If null, then a standard |
956 | /// resend of the packet is done. | 961 | /// resend of the packet is done. |
957 | /// </param> | 962 | /// </param> |
958 | public void SendPacketData( | 963 | /// <returns>true if the data was sent immediately, false if it was queued for sending</returns> |
964 | public bool SendPacketData( | ||
959 | LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) | 965 | LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) |
960 | { | 966 | { |
961 | int dataLength = data.Length; | 967 | int dataLength = data.Length; |
@@ -1020,7 +1026,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1020 | // packet so that it isn't sent before a queued update packet. | 1026 | // packet so that it isn't sent before a queued update packet. |
1021 | bool requestQueue = type == PacketType.KillObject; | 1027 | bool requestQueue = type == PacketType.KillObject; |
1022 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) | 1028 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) |
1029 | { | ||
1023 | SendPacketFinal(outgoingPacket); | 1030 | SendPacketFinal(outgoingPacket); |
1031 | return true; | ||
1032 | } | ||
1033 | else | ||
1034 | { | ||
1035 | return false; | ||
1036 | } | ||
1024 | 1037 | ||
1025 | #endregion Queue or Send | 1038 | #endregion Queue or Send |
1026 | } | 1039 | } |