diff options
author | Melanie | 2013-11-08 17:55:01 +0000 |
---|---|---|
committer | Melanie | 2013-11-08 17:55:01 +0000 |
commit | 91b70bf3fe382729a94d9a0855be8b07ef67c360 (patch) | |
tree | 3e42c4c536da6c7eaaf1a72ecdbd2a24de4d1658 /OpenSim/Region/ClientStack/Linden | |
parent | Merge branch 'master' into careminster (diff) | |
parent | If the LSL state_entry() event definition contains any parameters, then gener... (diff) | |
download | opensim-SC_OLD-91b70bf3fe382729a94d9a0855be8b07ef67c360.zip opensim-SC_OLD-91b70bf3fe382729a94d9a0855be8b07ef67c360.tar.gz opensim-SC_OLD-91b70bf3fe382729a94d9a0855be8b07ef67c360.tar.bz2 opensim-SC_OLD-91b70bf3fe382729a94d9a0855be8b07ef67c360.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
4 files changed, 123 insertions, 49 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs index 10a4753..bbadc55 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs | |||
@@ -49,12 +49,10 @@ using OpenSim.Capabilities.Handlers; | |||
49 | 49 | ||
50 | namespace OpenSim.Region.ClientStack.Linden | 50 | namespace OpenSim.Region.ClientStack.Linden |
51 | { | 51 | { |
52 | |||
53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AvatarPickerSearchModule")] | 52 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AvatarPickerSearchModule")] |
54 | public class AvatarPickerSearchModule : INonSharedRegionModule | 53 | public class AvatarPickerSearchModule : INonSharedRegionModule |
55 | { | 54 | { |
56 | private static readonly ILog m_log = | 55 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
57 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
58 | 56 | ||
59 | private Scene m_scene; | 57 | private Scene m_scene; |
60 | private IPeople m_People; | 58 | private IPeople m_People; |
@@ -134,6 +132,5 @@ namespace OpenSim.Region.ClientStack.Linden | |||
134 | caps.RegisterHandler("AvatarPickerSearch", m_URL); | 132 | caps.RegisterHandler("AvatarPickerSearch", m_URL); |
135 | } | 133 | } |
136 | } | 134 | } |
137 | |||
138 | } | 135 | } |
139 | } | 136 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs index cf95463..47988dd 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs | |||
@@ -287,7 +287,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
287 | 287 | ||
288 | public void RegisterCaps(UUID agentID, Caps caps) | 288 | public void RegisterCaps(UUID agentID, Caps caps) |
289 | { | 289 | { |
290 | UUID capID = UUID.Random(); | 290 | // UUID capID = UUID.Random(); |
291 | 291 | ||
292 | //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); | 292 | //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); |
293 | if (m_URL == "localhost") | 293 | if (m_URL == "localhost") |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 51cc2bf..d94da34 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -3842,7 +3842,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3842 | m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber); | 3842 | m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber); |
3843 | 3843 | ||
3844 | // Count this as a resent packet since we are going to requeue all of the updates contained in it | 3844 | // Count this as a resent packet since we are going to requeue all of the updates contained in it |
3845 | Interlocked.Increment(ref m_udpClient.PacketsResent); | 3845 | Interlocked.Increment(ref m_udpClient.PacketsResent); |
3846 | |||
3847 | // We're not going to worry about interlock yet since its not currently critical that this total count | ||
3848 | // is 100% correct | ||
3849 | m_udpServer.PacketsResentCount++; | ||
3846 | 3850 | ||
3847 | foreach (EntityUpdate update in updates) | 3851 | foreach (EntityUpdate update in updates) |
3848 | ResendPrimUpdate(update); | 3852 | ResendPrimUpdate(update); |
@@ -4407,6 +4411,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4407 | // Count this as a resent packet since we are going to requeue all of the updates contained in it | 4411 | // Count this as a resent packet since we are going to requeue all of the updates contained in it |
4408 | Interlocked.Increment(ref m_udpClient.PacketsResent); | 4412 | Interlocked.Increment(ref m_udpClient.PacketsResent); |
4409 | 4413 | ||
4414 | // We're not going to worry about interlock yet since its not currently critical that this total count | ||
4415 | // is 100% correct | ||
4416 | m_udpServer.PacketsResentCount++; | ||
4417 | |||
4410 | foreach (ObjectPropertyUpdate update in updates) | 4418 | foreach (ObjectPropertyUpdate update in updates) |
4411 | ResendPropertyUpdate(update); | 4419 | ResendPropertyUpdate(update); |
4412 | } | 4420 | } |
@@ -4594,6 +4602,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4594 | SceneObjectPart root = sop.ParentGroup.RootPart; | 4602 | SceneObjectPart root = sop.ParentGroup.RootPart; |
4595 | 4603 | ||
4596 | block.TouchName = Util.StringToBytes256(root.TouchName); | 4604 | block.TouchName = Util.StringToBytes256(root.TouchName); |
4605 | |||
4606 | // SL 3.3.4, at least, appears to read this information as a concatenated byte[] stream of UUIDs but | ||
4607 | // it's not yet clear whether this is actually used. If this is done in the future then a pre-cached | ||
4608 | // copy is really needed since it's less efficient to be constantly recreating this byte array. | ||
4609 | // using (MemoryStream memStream = new MemoryStream()) | ||
4610 | // { | ||
4611 | // using (BinaryWriter binWriter = new BinaryWriter(memStream)) | ||
4612 | // { | ||
4613 | // for (int i = 0; i < sop.GetNumberOfSides(); i++) | ||
4614 | // { | ||
4615 | // Primitive.TextureEntryFace teFace = sop.Shape.Textures.FaceTextures[i]; | ||
4616 | // | ||
4617 | // UUID textureID; | ||
4618 | // | ||
4619 | // if (teFace != null) | ||
4620 | // textureID = teFace.TextureID; | ||
4621 | // else | ||
4622 | // textureID = sop.Shape.Textures.DefaultTexture.TextureID; | ||
4623 | // | ||
4624 | // binWriter.Write(textureID.GetBytes()); | ||
4625 | // } | ||
4626 | // | ||
4627 | // block.TextureID = memStream.ToArray(); | ||
4628 | // } | ||
4629 | // } | ||
4630 | |||
4597 | block.TextureID = new byte[0]; // TextureID ??? | 4631 | block.TextureID = new byte[0]; // TextureID ??? |
4598 | block.SitName = Util.StringToBytes256(root.SitName); | 4632 | block.SitName = Util.StringToBytes256(root.SitName); |
4599 | block.OwnerMask = root.OwnerMask; | 4633 | block.OwnerMask = root.OwnerMask; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 01981dd..4854893 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -147,6 +147,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
147 | 147 | ||
148 | StatsManager.RegisterStat( | 148 | StatsManager.RegisterStat( |
149 | new Stat( | 149 | new Stat( |
150 | "OutgoingPacketsResentCount", | ||
151 | "Number of packets resent because a client did not acknowledge receipt", | ||
152 | "", | ||
153 | "", | ||
154 | "clientstack", | ||
155 | scene.Name, | ||
156 | StatType.Pull, | ||
157 | MeasuresOfInterest.AverageChangeOverTime, | ||
158 | stat => stat.Value = m_udpServer.PacketsResentCount, | ||
159 | StatVerbosity.Debug)); | ||
160 | |||
161 | StatsManager.RegisterStat( | ||
162 | new Stat( | ||
150 | "AverageUDPProcessTime", | 163 | "AverageUDPProcessTime", |
151 | "Average number of milliseconds taken to process each incoming UDP packet in a sample.", | 164 | "Average number of milliseconds taken to process each incoming UDP packet in a sample.", |
152 | "This is for initial receive processing which is separate from the later client LL packet processing stage.", | 165 | "This is for initial receive processing which is separate from the later client LL packet processing stage.", |
@@ -299,6 +312,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
299 | public Socket Server { get { return null; } } | 312 | public Socket Server { get { return null; } } |
300 | 313 | ||
301 | /// <summary> | 314 | /// <summary> |
315 | /// Record how many packets have been resent | ||
316 | /// </summary> | ||
317 | internal int PacketsResentCount { get; set; } | ||
318 | |||
319 | /// <summary> | ||
320 | /// Record how many packets have been sent | ||
321 | /// </summary> | ||
322 | internal int PacketsSentCount { get; set; } | ||
323 | |||
324 | /// <summary> | ||
302 | /// Record how many inbound packets could not be recognized as LLUDP packets. | 325 | /// Record how many inbound packets could not be recognized as LLUDP packets. |
303 | /// </summary> | 326 | /// </summary> |
304 | public int IncomingMalformedPacketCount { get; private set; } | 327 | public int IncomingMalformedPacketCount { get; private set; } |
@@ -866,44 +889,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
866 | return x == m_location; | 889 | return x == m_location; |
867 | } | 890 | } |
868 | 891 | ||
869 | public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) | 892 | // public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) |
870 | { | 893 | // { |
871 | // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way | 894 | // // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way |
872 | if ((packet.Type == PacketType.CoarseLocationUpdate || packet.Type == PacketType.AvatarGroupsReply) && allowSplitting) | 895 | // if ((packet.Type == PacketType.CoarseLocationUpdate || packet.Type == PacketType.AvatarGroupsReply) && allowSplitting) |
873 | allowSplitting = false; | 896 | // allowSplitting = false; |
874 | 897 | // | |
875 | if (allowSplitting && packet.HasVariableBlocks) | 898 | // if (allowSplitting && packet.HasVariableBlocks) |
876 | { | 899 | // { |
877 | byte[][] datas = packet.ToBytesMultiple(); | 900 | // byte[][] datas = packet.ToBytesMultiple(); |
878 | int packetCount = datas.Length; | 901 | // int packetCount = datas.Length; |
879 | 902 | // | |
880 | if (packetCount < 1) | 903 | // if (packetCount < 1) |
881 | m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length); | 904 | // m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length); |
882 | 905 | // | |
883 | for (int i = 0; i < packetCount; i++) | 906 | // for (int i = 0; i < packetCount; i++) |
884 | { | 907 | // { |
885 | byte[] data = datas[i]; | 908 | // byte[] data = datas[i]; |
886 | m_scene.ForEachClient( | 909 | // m_scene.ForEachClient( |
887 | delegate(IClientAPI client) | 910 | // delegate(IClientAPI client) |
888 | { | 911 | // { |
889 | if (client is LLClientView) | 912 | // if (client is LLClientView) |
890 | SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); | 913 | // SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); |
891 | } | 914 | // } |
892 | ); | 915 | // ); |
893 | } | 916 | // } |
894 | } | 917 | // } |
895 | else | 918 | // else |
896 | { | 919 | // { |
897 | byte[] data = packet.ToBytes(); | 920 | // byte[] data = packet.ToBytes(); |
898 | m_scene.ForEachClient( | 921 | // m_scene.ForEachClient( |
899 | delegate(IClientAPI client) | 922 | // delegate(IClientAPI client) |
900 | { | 923 | // { |
901 | if (client is LLClientView) | 924 | // if (client is LLClientView) |
902 | SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); | 925 | // SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); |
903 | } | 926 | // } |
904 | ); | 927 | // ); |
905 | } | 928 | // } |
906 | } | 929 | // } |
907 | 930 | ||
908 | /// <summary> | 931 | /// <summary> |
909 | /// Start the process of sending a packet to the client. | 932 | /// Start the process of sending a packet to the client. |
@@ -923,6 +946,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
923 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) | 946 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) |
924 | allowSplitting = false; | 947 | allowSplitting = false; |
925 | 948 | ||
949 | bool packetQueued = false; | ||
950 | |||
926 | if (allowSplitting && packet.HasVariableBlocks) | 951 | if (allowSplitting && packet.HasVariableBlocks) |
927 | { | 952 | { |
928 | byte[][] datas = packet.ToBytesMultiple(); | 953 | byte[][] datas = packet.ToBytesMultiple(); |
@@ -934,18 +959,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
934 | for (int i = 0; i < packetCount; i++) | 959 | for (int i = 0; i < packetCount; i++) |
935 | { | 960 | { |
936 | byte[] data = datas[i]; | 961 | byte[] data = datas[i]; |
937 | SendPacketData(udpClient, data, packet.Type, category, method); | 962 | |
963 | if (!SendPacketData(udpClient, data, packet.Type, category, method)) | ||
964 | packetQueued = true; | ||
938 | } | 965 | } |
939 | } | 966 | } |
940 | else | 967 | else |
941 | { | 968 | { |
942 | byte[] data = packet.ToBytes(); | 969 | byte[] data = packet.ToBytes(); |
943 | SendPacketData(udpClient, data, packet.Type, category, method); | 970 | packetQueued = SendPacketData(udpClient, data, packet.Type, category, method); |
944 | } | 971 | } |
945 | 972 | ||
946 | PacketPool.Instance.ReturnPacket(packet); | 973 | PacketPool.Instance.ReturnPacket(packet); |
947 | 974 | ||
948 | m_dataPresentEvent.Set(); | 975 | if (packetQueued) |
976 | m_dataPresentEvent.Set(); | ||
949 | } | 977 | } |
950 | 978 | ||
951 | /// <summary> | 979 | /// <summary> |
@@ -959,7 +987,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
959 | /// The method to call if the packet is not acked by the client. If null, then a standard | 987 | /// The method to call if the packet is not acked by the client. If null, then a standard |
960 | /// resend of the packet is done. | 988 | /// resend of the packet is done. |
961 | /// </param> | 989 | /// </param> |
962 | public void SendPacketData( | 990 | /// <returns>true if the data was sent immediately, false if it was queued for sending</returns> |
991 | public bool SendPacketData( | ||
963 | LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) | 992 | LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) |
964 | { | 993 | { |
965 | int dataLength = data.Length; | 994 | int dataLength = data.Length; |
@@ -1032,7 +1061,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1032 | // packet so that it isn't sent before a queued update packet. | 1061 | // packet so that it isn't sent before a queued update packet. |
1033 | bool requestQueue = type == PacketType.KillObject; | 1062 | bool requestQueue = type == PacketType.KillObject; |
1034 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue, highPriority)) | 1063 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue, highPriority)) |
1064 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) | ||
1065 | { | ||
1035 | SendPacketFinal(outgoingPacket); | 1066 | SendPacketFinal(outgoingPacket); |
1067 | return true; | ||
1068 | } | ||
1069 | |||
1070 | return false; | ||
1036 | 1071 | ||
1037 | #endregion Queue or Send | 1072 | #endregion Queue or Send |
1038 | } | 1073 | } |
@@ -1213,6 +1248,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1213 | else | 1248 | else |
1214 | { | 1249 | { |
1215 | Interlocked.Increment(ref udpClient.PacketsResent); | 1250 | Interlocked.Increment(ref udpClient.PacketsResent); |
1251 | |||
1252 | // We're not going to worry about interlock yet since its not currently critical that this total count | ||
1253 | // is 100% correct | ||
1254 | PacketsResentCount++; | ||
1216 | } | 1255 | } |
1217 | 1256 | ||
1218 | #endregion Sequence Number Assignment | 1257 | #endregion Sequence Number Assignment |
@@ -1220,6 +1259,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1220 | // Stats tracking | 1259 | // Stats tracking |
1221 | Interlocked.Increment(ref udpClient.PacketsSent); | 1260 | Interlocked.Increment(ref udpClient.PacketsSent); |
1222 | 1261 | ||
1262 | // We're not going to worry about interlock yet since its not currently critical that this total count | ||
1263 | // is 100% correct | ||
1264 | PacketsSentCount++; | ||
1265 | |||
1223 | // Put the UDP payload on the wire | 1266 | // Put the UDP payload on the wire |
1224 | AsyncBeginSend(buffer); | 1267 | AsyncBeginSend(buffer); |
1225 | 1268 | ||