diff options
author | Melanie Thielker | 2014-08-13 03:05:54 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-08-13 03:05:54 +0200 |
commit | b96f951a6af00819badc4ff539e11a0e78c7f3cb (patch) | |
tree | e26f04f67811c708730dc858a68eced2efc11753 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |
parent | Revert "make HandlerRegionHandshakeReply processing async and delay it a bit.... (diff) | |
parent | remove HandleCompleteMovementIntoRegion delay hack from llUDPserver. If we (diff) | |
download | opensim-SC-b96f951a6af00819badc4ff539e11a0e78c7f3cb.zip opensim-SC-b96f951a6af00819badc4ff539e11a0e78c7f3cb.tar.gz opensim-SC-b96f951a6af00819badc4ff539e11a0e78c7f3cb.tar.bz2 opensim-SC-b96f951a6af00819badc4ff539e11a0e78c7f3cb.tar.xz |
Merge branch 'ubitworkmaster'
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 0bb53c4..fe79f87 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -731,7 +731,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
731 | "debug lludp status", | 731 | "debug lludp status", |
732 | "Return status of LLUDP packet processing.", | 732 | "Return status of LLUDP packet processing.", |
733 | HandleStatusCommand); | 733 | HandleStatusCommand); |
734 | 734 | /* disabled | |
735 | MainConsole.Instance.Commands.AddCommand( | 735 | MainConsole.Instance.Commands.AddCommand( |
736 | "Debug", | 736 | "Debug", |
737 | false, | 737 | false, |
@@ -739,6 +739,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
739 | "debug lludp toggle agentupdate", | 739 | "debug lludp toggle agentupdate", |
740 | "Toggle whether agentupdate packets are processed or simply discarded.", | 740 | "Toggle whether agentupdate packets are processed or simply discarded.", |
741 | HandleAgentUpdateCommand); | 741 | HandleAgentUpdateCommand); |
742 | */ | ||
742 | } | 743 | } |
743 | 744 | ||
744 | private void HandlePacketCommand(string module, string[] args) | 745 | private void HandlePacketCommand(string module, string[] args) |
@@ -1421,6 +1422,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1421 | return; | 1422 | return; |
1422 | } | 1423 | } |
1423 | 1424 | ||
1425 | /* | ||
1424 | else if (packet.Type == PacketType.CompleteAgentMovement) | 1426 | else if (packet.Type == PacketType.CompleteAgentMovement) |
1425 | { | 1427 | { |
1426 | // Send ack straight away to let the viewer know that we got it. | 1428 | // Send ack straight away to let the viewer know that we got it. |
@@ -1434,6 +1436,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1434 | 1436 | ||
1435 | return; | 1437 | return; |
1436 | } | 1438 | } |
1439 | */ | ||
1437 | } | 1440 | } |
1438 | 1441 | ||
1439 | // Determine which agent this packet came from | 1442 | // Determine which agent this packet came from |
@@ -1553,24 +1556,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1553 | LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length); | 1556 | LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length); |
1554 | #endregion BinaryStats | 1557 | #endregion BinaryStats |
1555 | 1558 | ||
1556 | if (packet.Type == PacketType.AgentUpdate) | 1559 | // AgentUpdate mess removed from here |
1557 | { | ||
1558 | if (m_discardAgentUpdates) | ||
1559 | return; | ||
1560 | |||
1561 | ((LLClientView)client).TotalAgentUpdates++; | ||
1562 | |||
1563 | AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet; | ||
1564 | |||
1565 | LLClientView llClient = client as LLClientView; | ||
1566 | if (agentUpdate.AgentData.SessionID != client.SessionId | ||
1567 | || agentUpdate.AgentData.AgentID != client.AgentId | ||
1568 | || !(llClient == null || llClient.CheckAgentUpdateSignificance(agentUpdate.AgentData)) ) | ||
1569 | { | ||
1570 | PacketPool.Instance.ReturnPacket(packet); | ||
1571 | return; | ||
1572 | } | ||
1573 | } | ||
1574 | 1560 | ||
1575 | #region Ping Check Handling | 1561 | #region Ping Check Handling |
1576 | 1562 | ||
@@ -1611,11 +1597,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1611 | incomingPacket = new IncomingPacket((LLClientView)client, packet); | 1597 | incomingPacket = new IncomingPacket((LLClientView)client, packet); |
1612 | } | 1598 | } |
1613 | 1599 | ||
1614 | if (incomingPacket.Packet.Type == PacketType.AgentUpdate || | 1600 | // if (incomingPacket.Packet.Type == PacketType.AgentUpdate || |
1615 | incomingPacket.Packet.Type == PacketType.ChatFromViewer) | 1601 | // incomingPacket.Packet.Type == PacketType.ChatFromViewer) |
1602 | if (incomingPacket.Packet.Type == PacketType.ChatFromViewer) | ||
1616 | packetInbox.EnqueueHigh(incomingPacket); | 1603 | packetInbox.EnqueueHigh(incomingPacket); |
1617 | else | 1604 | else |
1618 | packetInbox.EnqueueLow(incomingPacket); | 1605 | packetInbox.EnqueueLow(incomingPacket); |
1606 | |||
1619 | } | 1607 | } |
1620 | 1608 | ||
1621 | #region BinaryStats | 1609 | #region BinaryStats |
@@ -1732,7 +1720,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1732 | 1720 | ||
1733 | try | 1721 | try |
1734 | { | 1722 | { |
1735 | // DateTime startTime = DateTime.Now; | 1723 | // DateTime startTime = DateTime.Now; |
1736 | object[] array = (object[])o; | 1724 | object[] array = (object[])o; |
1737 | endPoint = (IPEndPoint)array[0]; | 1725 | endPoint = (IPEndPoint)array[0]; |
1738 | UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1]; | 1726 | UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1]; |
@@ -1752,9 +1740,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1752 | uccp.CircuitCode.SessionID, | 1740 | uccp.CircuitCode.SessionID, |
1753 | endPoint, | 1741 | endPoint, |
1754 | sessionInfo); | 1742 | sessionInfo); |
1755 | 1743 | ||
1756 | // Now we know we can handle more data | 1744 | // Now we know we can handle more data |
1757 | // Thread.Sleep(200); | 1745 | Thread.Sleep(200); |
1758 | 1746 | ||
1759 | // Obtain the pending queue and remove it from the cache | 1747 | // Obtain the pending queue and remove it from the cache |
1760 | Queue<UDPPacketBuffer> queue = null; | 1748 | Queue<UDPPacketBuffer> queue = null; |
@@ -1765,6 +1753,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1765 | { | 1753 | { |
1766 | m_log.DebugFormat("[LLUDPSERVER]: Client created but no pending queue present"); | 1754 | m_log.DebugFormat("[LLUDPSERVER]: Client created but no pending queue present"); |
1767 | return; | 1755 | return; |
1756 | |||
1768 | } | 1757 | } |
1769 | m_pendingCache.Remove(endPoint); | 1758 | m_pendingCache.Remove(endPoint); |
1770 | } | 1759 | } |
@@ -1772,11 +1761,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1772 | m_log.DebugFormat("[LLUDPSERVER]: Client created, processing pending queue, {0} entries", queue.Count); | 1761 | m_log.DebugFormat("[LLUDPSERVER]: Client created, processing pending queue, {0} entries", queue.Count); |
1773 | 1762 | ||
1774 | // Reinject queued packets | 1763 | // Reinject queued packets |
1775 | while(queue.Count > 0) | 1764 | while (queue.Count > 0) |
1776 | { | 1765 | { |
1777 | UDPPacketBuffer buf = queue.Dequeue(); | 1766 | UDPPacketBuffer buf = queue.Dequeue(); |
1778 | PacketReceived(buf); | 1767 | PacketReceived(buf); |
1779 | } | 1768 | } |
1769 | |||
1780 | queue = null; | 1770 | queue = null; |
1781 | 1771 | ||
1782 | // Send ack straight away to let the viewer know that the connection is active. | 1772 | // Send ack straight away to let the viewer know that the connection is active. |
@@ -1802,8 +1792,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1802 | uccp.CircuitCode.ID, m_scene.RegionInfo.RegionName, uccp.CircuitCode.Code, endPoint); | 1792 | uccp.CircuitCode.ID, m_scene.RegionInfo.RegionName, uccp.CircuitCode.Code, endPoint); |
1803 | lock (m_pendingCache) | 1793 | lock (m_pendingCache) |
1804 | m_pendingCache.Remove(endPoint); | 1794 | m_pendingCache.Remove(endPoint); |
1805 | } | 1795 | } |
1806 | |||
1807 | // m_log.DebugFormat( | 1796 | // m_log.DebugFormat( |
1808 | // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", | 1797 | // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", |
1809 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); | 1798 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); |
@@ -1820,8 +1809,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1820 | e.StackTrace); | 1809 | e.StackTrace); |
1821 | } | 1810 | } |
1822 | } | 1811 | } |
1823 | 1812 | /* | |
1824 | private void HandleCompleteMovementIntoRegion(object o) | 1813 | private void HandleCompleteMovementIntoRegion(object o) |
1825 | { | 1814 | { |
1826 | IPEndPoint endPoint = null; | 1815 | IPEndPoint endPoint = null; |
1827 | IClientAPI client = null; | 1816 | IClientAPI client = null; |
@@ -1930,6 +1919,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1930 | e.StackTrace); | 1919 | e.StackTrace); |
1931 | } | 1920 | } |
1932 | } | 1921 | } |
1922 | */ | ||
1933 | 1923 | ||
1934 | /// <summary> | 1924 | /// <summary> |
1935 | /// Send an ack immediately to the given endpoint. | 1925 | /// Send an ack immediately to the given endpoint. |
@@ -2067,7 +2057,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2067 | m_incomingPacketPool.ReturnObject(incomingPacket); | 2057 | m_incomingPacketPool.ReturnObject(incomingPacket); |
2068 | } | 2058 | } |
2069 | } | 2059 | } |
2070 | catch (Exception ex) | 2060 | catch(Exception ex) |
2071 | { | 2061 | { |
2072 | m_log.Error("[LLUDPSERVER]: Error in the incoming packet handler loop: " + ex.Message, ex); | 2062 | m_log.Error("[LLUDPSERVER]: Error in the incoming packet handler loop: " + ex.Message, ex); |
2073 | } | 2063 | } |