diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 41 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 34 |
2 files changed, 45 insertions, 30 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 2ff6ced..cd687aa 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -99,8 +99,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
99 | public event AgentRequestSit OnAgentRequestSit; | 99 | public event AgentRequestSit OnAgentRequestSit; |
100 | public event AgentSit OnAgentSit; | 100 | public event AgentSit OnAgentSit; |
101 | public event AvatarPickerRequest OnAvatarPickerRequest; | 101 | public event AvatarPickerRequest OnAvatarPickerRequest; |
102 | public event StartAnim OnStartAnim; | ||
103 | public event StopAnim OnStopAnim; | ||
104 | public event ChangeAnim OnChangeAnim; | 102 | public event ChangeAnim OnChangeAnim; |
105 | public event Action<IClientAPI> OnRequestAvatarsData; | 103 | public event Action<IClientAPI> OnRequestAvatarsData; |
106 | public event LinkObjects OnLinkObjects; | 104 | public event LinkObjects OnLinkObjects; |
@@ -131,12 +129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
131 | public event UpdatePrimTexture OnUpdatePrimTexture; | 129 | public event UpdatePrimTexture OnUpdatePrimTexture; |
132 | public event ClientChangeObject onClientChangeObject; | 130 | public event ClientChangeObject onClientChangeObject; |
133 | public event UpdateVector OnUpdatePrimGroupPosition; | 131 | public event UpdateVector OnUpdatePrimGroupPosition; |
134 | public event UpdateVector OnUpdatePrimSinglePosition; | ||
135 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 132 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
136 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | ||
137 | public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; | ||
138 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | ||
139 | public event UpdateVector OnUpdatePrimScale; | ||
140 | public event UpdateVector OnUpdatePrimGroupScale; | 133 | public event UpdateVector OnUpdatePrimGroupScale; |
141 | public event RequestMapBlocks OnRequestMapBlocks; | 134 | public event RequestMapBlocks OnRequestMapBlocks; |
142 | public event RequestMapName OnMapNameRequest; | 135 | public event RequestMapName OnMapNameRequest; |
@@ -292,7 +285,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
292 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; | 285 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
293 | public event GenericCall2 OnUpdateThrottles; | 286 | public event GenericCall2 OnUpdateThrottles; |
294 | 287 | ||
288 | |||
295 | #pragma warning disable 0067 | 289 | #pragma warning disable 0067 |
290 | // still unused | ||
296 | public event GenericMessage OnGenericMessage; | 291 | public event GenericMessage OnGenericMessage; |
297 | public event TextureRequest OnRequestTexture; | 292 | public event TextureRequest OnRequestTexture; |
298 | public event StatusChange OnChildAgentStatus; | 293 | public event StatusChange OnChildAgentStatus; |
@@ -304,6 +299,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
304 | public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; | 299 | public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; |
305 | public event TerrainUnacked OnUnackedTerrain; | 300 | public event TerrainUnacked OnUnackedTerrain; |
306 | public event CachedTextureRequest OnCachedTextureRequest; | 301 | public event CachedTextureRequest OnCachedTextureRequest; |
302 | |||
303 | public event UpdateVector OnUpdatePrimSinglePosition; | ||
304 | public event StartAnim OnStartAnim; | ||
305 | public event StopAnim OnStopAnim; | ||
306 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | ||
307 | public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; | ||
308 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | ||
309 | public event UpdateVector OnUpdatePrimScale; | ||
310 | |||
311 | |||
307 | #pragma warning restore 0067 | 312 | #pragma warning restore 0067 |
308 | 313 | ||
309 | #endregion Events | 314 | #endregion Events |
@@ -335,16 +340,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
335 | private readonly byte[] m_channelVersion = Utils.EmptyBytes; | 340 | private readonly byte[] m_channelVersion = Utils.EmptyBytes; |
336 | private readonly IGroupsModule m_GroupsModule; | 341 | private readonly IGroupsModule m_GroupsModule; |
337 | 342 | ||
338 | private int m_cachedTextureSerial; | 343 | // private int m_cachedTextureSerial; |
339 | private PriorityQueue m_entityUpdates; | 344 | private PriorityQueue m_entityUpdates; |
340 | private PriorityQueue m_entityProps; | 345 | private PriorityQueue m_entityProps; |
341 | private Prioritizer m_prioritizer; | 346 | private Prioritizer m_prioritizer; |
342 | private bool m_disableFacelights = false; | 347 | private bool m_disableFacelights; |
343 | 348 | ||
344 | // needs optimazation | 349 | // needs optimazation |
345 | private HashSet<SceneObjectGroup> GroupsInView = new HashSet<SceneObjectGroup>(); | 350 | private HashSet<SceneObjectGroup> GroupsInView = new HashSet<SceneObjectGroup>(); |
346 | 351 | #pragma warning disable 0414 | |
347 | private bool m_VelocityInterpolate = false; | 352 | private bool m_VelocityInterpolate; |
353 | #pragma warning restore 0414 | ||
348 | private const uint MaxTransferBytesPerPacket = 600; | 354 | private const uint MaxTransferBytesPerPacket = 600; |
349 | 355 | ||
350 | /// <value> | 356 | /// <value> |
@@ -503,8 +509,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
503 | RegisterInterface<IClientChat>(this); | 509 | RegisterInterface<IClientChat>(this); |
504 | 510 | ||
505 | m_scene = scene; | 511 | m_scene = scene; |
506 | m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); | 512 | int pcap = 512; |
507 | m_entityProps = new PriorityQueue(m_scene.Entities.Count); | 513 | if(pcap > m_scene.Entities.Count) |
514 | pcap = m_scene.Entities.Count; | ||
515 | m_entityUpdates = new PriorityQueue(pcap); | ||
516 | m_entityProps = new PriorityQueue(pcap); | ||
508 | m_killRecord = new List<uint>(); | 517 | m_killRecord = new List<uint>(); |
509 | // m_attachmentsSent = new HashSet<uint>(); | 518 | // m_attachmentsSent = new HashSet<uint>(); |
510 | 519 | ||
@@ -617,6 +626,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
617 | ImageManager.Close(); | 626 | ImageManager.Close(); |
618 | ImageManager = null; | 627 | ImageManager = null; |
619 | 628 | ||
629 | // m_entityUpdates.Close(); | ||
630 | // m_entityProps.Close(); | ||
620 | m_entityUpdates = new PriorityQueue(1); | 631 | m_entityUpdates = new PriorityQueue(1); |
621 | m_entityProps = new PriorityQueue(1); | 632 | m_entityProps = new PriorityQueue(1); |
622 | m_killRecord.Clear(); | 633 | m_killRecord.Clear(); |
@@ -11039,9 +11050,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11039 | if(muteListRequest.MuteData.MuteCRC == 0) | 11050 | if(muteListRequest.MuteData.MuteCRC == 0) |
11040 | SendEmpytMuteList(); | 11051 | SendEmpytMuteList(); |
11041 | else | 11052 | else |
11042 | SendUseCachedMuteList(); | 11053 | SendUseCachedMuteList(); |
11043 | } | 11054 | } |
11044 | return true; | 11055 | return true; |
11045 | } | 11056 | } |
11046 | 11057 | ||
11047 | private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet) | 11058 | private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet) |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index b575ed9..552c51e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Collections.Concurrent; | ||
30 | using System.Diagnostics; | 31 | using System.Diagnostics; |
31 | using System.IO; | 32 | using System.IO; |
32 | using System.Net; | 33 | using System.Net; |
@@ -285,7 +286,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
285 | /// <summary>Incoming packets that are awaiting handling</summary> | 286 | /// <summary>Incoming packets that are awaiting handling</summary> |
286 | //protected OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>(); | 287 | //protected OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>(); |
287 | 288 | ||
288 | protected OpenSim.Framework.BlockingQueue<IncomingPacket> packetInbox = new OpenSim.Framework.BlockingQueue<IncomingPacket>(); | 289 | protected BlockingCollection<IncomingPacket> packetInbox = new BlockingCollection<IncomingPacket>(); |
289 | 290 | ||
290 | /// <summary>Bandwidth throttle for this UDP server</summary> | 291 | /// <summary>Bandwidth throttle for this UDP server</summary> |
291 | public TokenBucket Throttle { get; protected set; } | 292 | public TokenBucket Throttle { get; protected set; } |
@@ -712,7 +713,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
712 | scene.Name, | 713 | scene.Name, |
713 | StatType.Pull, | 714 | StatType.Pull, |
714 | MeasuresOfInterest.AverageChangeOverTime, | 715 | MeasuresOfInterest.AverageChangeOverTime, |
715 | stat => stat.Value = packetInbox.Count(), | 716 | stat => {try{stat.Value = packetInbox.Count;}catch{}}, |
716 | StatVerbosity.Debug)); | 717 | StatVerbosity.Debug)); |
717 | 718 | ||
718 | // XXX: These stats are also pool stats but we register them separately since they are currently not | 719 | // XXX: These stats are also pool stats but we register them separately since they are currently not |
@@ -898,7 +899,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
898 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) | 899 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) |
899 | allowSplitting = false; | 900 | allowSplitting = false; |
900 | 901 | ||
901 | bool packetQueued = false; | 902 | // bool packetQueued = false; |
902 | 903 | ||
903 | if (allowSplitting && packet.HasVariableBlocks) | 904 | if (allowSplitting && packet.HasVariableBlocks) |
904 | { | 905 | { |
@@ -911,15 +912,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
911 | for (int i = 0; i < packetCount; i++) | 912 | for (int i = 0; i < packetCount; i++) |
912 | { | 913 | { |
913 | byte[] data = datas[i]; | 914 | byte[] data = datas[i]; |
914 | if (!SendPacketData(udpClient, data, packet.Type, category, method)) | 915 | // if (!SendPacketData(udpClient, data, packet.Type, category, method)) |
915 | packetQueued = true; | 916 | // packetQueued = true; |
917 | SendPacketData(udpClient, data, packet.Type, category, method); | ||
916 | } | 918 | } |
917 | } | 919 | } |
918 | else | 920 | else |
919 | { | 921 | { |
920 | byte[] data = packet.ToBytes(); | 922 | byte[] data = packet.ToBytes(); |
921 | if (!SendPacketData(udpClient, data, packet.Type, category, method)) | 923 | // if (!SendPacketData(udpClient, data, packet.Type, category, method)) |
922 | packetQueued = true; | 924 | // packetQueued = true; |
925 | SendPacketData(udpClient, data, packet.Type, category, method); | ||
923 | } | 926 | } |
924 | 927 | ||
925 | PacketPool.Instance.ReturnPacket(packet); | 928 | PacketPool.Instance.ReturnPacket(packet); |
@@ -1544,10 +1547,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1544 | 1547 | ||
1545 | // if (incomingPacket.Packet.Type == PacketType.AgentUpdate || | 1548 | // if (incomingPacket.Packet.Type == PacketType.AgentUpdate || |
1546 | // incomingPacket.Packet.Type == PacketType.ChatFromViewer) | 1549 | // incomingPacket.Packet.Type == PacketType.ChatFromViewer) |
1547 | if (incomingPacket.Packet.Type == PacketType.ChatFromViewer) | 1550 | // if (incomingPacket.Packet.Type == PacketType.ChatFromViewer) |
1548 | packetInbox.PriorityEnqueue(incomingPacket); | 1551 | // packetInbox.PriorityEnqueue(incomingPacket); |
1549 | else | 1552 | // else |
1550 | packetInbox.Enqueue(incomingPacket); | 1553 | // packetInbox.Enqueue(incomingPacket); |
1554 | packetInbox.Add(incomingPacket); | ||
1551 | 1555 | ||
1552 | } | 1556 | } |
1553 | 1557 | ||
@@ -2016,7 +2020,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2016 | Scene.ThreadAlive(1); | 2020 | Scene.ThreadAlive(1); |
2017 | try | 2021 | try |
2018 | { | 2022 | { |
2019 | incomingPacket = packetInbox.Dequeue(250); | 2023 | packetInbox.TryTake(out incomingPacket, 250); |
2020 | 2024 | ||
2021 | if (incomingPacket != null && IsRunningInbound) | 2025 | if (incomingPacket != null && IsRunningInbound) |
2022 | { | 2026 | { |
@@ -2038,9 +2042,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2038 | Watchdog.UpdateThread(); | 2042 | Watchdog.UpdateThread(); |
2039 | } | 2043 | } |
2040 | 2044 | ||
2041 | if (packetInbox.Count() > 0) | 2045 | if (packetInbox.Count > 0) |
2042 | m_log.Warn("[LLUDPSERVER]: IncomingPacketHandler is shutting down, dropping " + packetInbox.Count() + " packets"); | 2046 | m_log.Warn("[LLUDPSERVER]: IncomingPacketHandler is shutting down, dropping " + packetInbox.Count + " packets"); |
2043 | packetInbox.Clear(); | 2047 | packetInbox.Dispose(); |
2044 | 2048 | ||
2045 | Watchdog.RemoveThread(); | 2049 | Watchdog.RemoveThread(); |
2046 | } | 2050 | } |