diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 84 |
1 files changed, 26 insertions, 58 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 8ba26e8..6cdf6f6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -606,21 +606,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
606 | //m_scene.CloseAllAgents(CircuitCode); | 606 | //m_scene.CloseAllAgents(CircuitCode); |
607 | 607 | ||
608 | // Disable UDP handling for this client | 608 | // Disable UDP handling for this client |
609 | m_udpClient.Shutdown(); | ||
610 | |||
611 | m_udpClient.OnQueueEmpty -= HandleQueueEmpty; | 609 | m_udpClient.OnQueueEmpty -= HandleQueueEmpty; |
612 | m_udpClient.HasUpdates -= HandleHasUpdates; | 610 | m_udpClient.HasUpdates -= HandleHasUpdates; |
613 | m_udpClient.OnPacketStats -= PopulateStats; | 611 | m_udpClient.OnPacketStats -= PopulateStats; |
612 | m_udpClient.Shutdown(); | ||
614 | 613 | ||
615 | // Shutdown the image manager | 614 | // Shutdown the image manager |
616 | ImageManager.Close(); | 615 | ImageManager.Close(); |
617 | ImageManager = null; | 616 | ImageManager = null; |
618 | 617 | ||
619 | m_entityUpdates = null; | 618 | m_entityUpdates = new PriorityQueue(1); |
620 | m_entityProps = null; | 619 | m_entityProps = new PriorityQueue(1); |
621 | m_killRecord.Clear(); | 620 | m_killRecord.Clear(); |
622 | GroupsInView.Clear(); | 621 | GroupsInView.Clear(); |
623 | m_scene = null; | 622 | // m_scene = null; can't do this unless checks are added everywhere due to workitems already in pools |
623 | |||
624 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 624 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
625 | //GC.Collect(); | 625 | //GC.Collect(); |
626 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 626 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
@@ -3126,10 +3126,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3126 | reply.Data.ActualArea = land.Area; | 3126 | reply.Data.ActualArea = land.Area; |
3127 | reply.Data.BillableArea = land.Area; // TODO: what is this? | 3127 | reply.Data.BillableArea = land.Area; // TODO: what is this? |
3128 | 3128 | ||
3129 | // Bit 0: Mature, bit 7: on sale, other bits: no idea | 3129 | reply.Data.Flags = (byte)Util.ConvertAccessLevelToMaturity((byte)info.AccessLevel); |
3130 | reply.Data.Flags = (byte)( | 3130 | if((land.Flags & (uint)ParcelFlags.ForSale) != 0) |
3131 | (info.AccessLevel > 13 ? (1 << 0) : 0) + | 3131 | reply.Data.Flags |= (byte)((1 << 7)); |
3132 | ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); | ||
3133 | 3132 | ||
3134 | Vector3 pos = land.UserLocation; | 3133 | Vector3 pos = land.UserLocation; |
3135 | if (pos.Equals(Vector3.Zero)) | 3134 | if (pos.Equals(Vector3.Zero)) |
@@ -4371,7 +4370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4371 | 4370 | ||
4372 | ushort timeDilation; | 4371 | ushort timeDilation; |
4373 | 4372 | ||
4374 | if(m_scene == null) | 4373 | if(!IsActive) |
4375 | return; | 4374 | return; |
4376 | 4375 | ||
4377 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); | 4376 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); |
@@ -9614,61 +9613,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9614 | 9613 | ||
9615 | #region Parcel related packets | 9614 | #region Parcel related packets |
9616 | 9615 | ||
9617 | // acumulate several HandleRegionHandleRequest consecutive overlaping requests | ||
9618 | // to be done with minimal resources as possible | ||
9619 | // variables temporary here while in test | ||
9620 | |||
9621 | Queue<UUID> RegionHandleRequests = new Queue<UUID>(); | ||
9622 | bool RegionHandleRequestsInService = false; | ||
9623 | |||
9624 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) | 9616 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) |
9625 | { | 9617 | { |
9626 | UUID currentUUID; | ||
9627 | |||
9628 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; | 9618 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; |
9629 | 9619 | ||
9630 | if (handlerRegionHandleRequest == null) | 9620 | if (handlerRegionHandleRequest != null) |
9631 | return true; | ||
9632 | |||
9633 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | ||
9634 | |||
9635 | lock (RegionHandleRequests) | ||
9636 | { | ||
9637 | if (RegionHandleRequestsInService) | ||
9638 | { | ||
9639 | // we are already busy doing a previus request | ||
9640 | // so enqueue it | ||
9641 | RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID); | ||
9642 | return true; | ||
9643 | } | ||
9644 | |||
9645 | // else do it | ||
9646 | currentUUID = rhrPack.RequestBlock.RegionID; | ||
9647 | RegionHandleRequestsInService = true; | ||
9648 | } | ||
9649 | |||
9650 | while (true) | ||
9651 | { | 9621 | { |
9652 | handlerRegionHandleRequest(this, currentUUID); | 9622 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; |
9653 | 9623 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | |
9654 | lock (RegionHandleRequests) | ||
9655 | { | ||
9656 | // exit condition, nothing to do or closed | ||
9657 | // current code seems to assume we may loose the handler at anytime, | ||
9658 | // so keep checking it | ||
9659 | handlerRegionHandleRequest = OnRegionHandleRequest; | ||
9660 | |||
9661 | if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null) | ||
9662 | { | ||
9663 | RegionHandleRequests.Clear(); | ||
9664 | RegionHandleRequestsInService = false; | ||
9665 | return true; | ||
9666 | } | ||
9667 | currentUUID = RegionHandleRequests.Dequeue(); | ||
9668 | } | ||
9669 | } | 9624 | } |
9670 | 9625 | ||
9671 | return true; // actually unreached | 9626 | return true; |
9672 | } | 9627 | } |
9673 | 9628 | ||
9674 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) | 9629 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) |
@@ -12945,9 +12900,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12945 | /// provide your own method.</param> | 12900 | /// provide your own method.</param> |
12946 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method) | 12901 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method) |
12947 | { | 12902 | { |
12903 | |||
12904 | /* this is causing packet loss for some reason | ||
12905 | if(!m_udpClient.IsConnected) | ||
12906 | { | ||
12907 | PacketPool.Instance.ReturnPacket(packet); | ||
12908 | return; | ||
12909 | } | ||
12910 | */ | ||
12948 | if (m_outPacketsToDrop != null) | 12911 | if (m_outPacketsToDrop != null) |
12912 | { | ||
12949 | if (m_outPacketsToDrop.Contains(packet.Type.ToString())) | 12913 | if (m_outPacketsToDrop.Contains(packet.Type.ToString())) |
12914 | { | ||
12915 | PacketPool.Instance.ReturnPacket(packet); | ||
12950 | return; | 12916 | return; |
12917 | } | ||
12918 | } | ||
12951 | 12919 | ||
12952 | if (DebugPacketLevel > 0) | 12920 | if (DebugPacketLevel > 0) |
12953 | { | 12921 | { |