diff options
author | UbitUmarov | 2019-03-30 12:07:49 +0000 |
---|---|---|
committer | UbitUmarov | 2019-03-30 12:07:49 +0000 |
commit | 6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14 (patch) | |
tree | 553b71ac6bc6bd451a8e733a3612f18f9f936d7e /OpenSim/Region/ClientStack/Linden/UDP | |
parent | Yengine: fix scripts resume on attachments drop (diff) | |
download | opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.zip opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.tar.gz opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.tar.bz2 opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.tar.xz |
a few more changes on initial objects send
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 27 | ||||
-rwxr-xr-x | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 124 |
2 files changed, 29 insertions, 122 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d21452f..6859b83 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
80 | public event DeRezObject OnDeRezObject; | 80 | public event DeRezObject OnDeRezObject; |
81 | public event RezRestoreToWorld OnRezRestoreToWorld; | 81 | public event RezRestoreToWorld OnRezRestoreToWorld; |
82 | public event ModifyTerrain OnModifyTerrain; | 82 | public event ModifyTerrain OnModifyTerrain; |
83 | public event Action<IClientAPI, uint> OnRegionHandShakeReply; | 83 | public event Action<IClientAPI> OnRegionHandShakeReply; |
84 | public event GenericCall1 OnRequestWearables; | 84 | public event GenericCall1 OnRequestWearables; |
85 | public event SetAppearance OnSetAppearance; | 85 | public event SetAppearance OnSetAppearance; |
86 | public event AvatarNowWearing OnAvatarNowWearing; | 86 | public event AvatarNowWearing OnAvatarNowWearing; |
@@ -8923,7 +8923,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8923 | 8923 | ||
8924 | private bool HandlerRegionHandshakeReply(IClientAPI sender, Packet Pack) | 8924 | private bool HandlerRegionHandshakeReply(IClientAPI sender, Packet Pack) |
8925 | { | 8925 | { |
8926 | Action<IClientAPI, uint> handlerRegionHandShakeReply = OnRegionHandShakeReply; | 8926 | Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; |
8927 | if (handlerRegionHandShakeReply == null) | 8927 | if (handlerRegionHandShakeReply == null) |
8928 | return true; // silence the warning | 8928 | return true; // silence the warning |
8929 | 8929 | ||
@@ -8936,7 +8936,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8936 | else | 8936 | else |
8937 | m_viewerHandShakeFlags = 0; | 8937 | m_viewerHandShakeFlags = 0; |
8938 | 8938 | ||
8939 | handlerRegionHandShakeReply(this, m_viewerHandShakeFlags); | 8939 | handlerRegionHandShakeReply(this); |
8940 | 8940 | ||
8941 | return true; | 8941 | return true; |
8942 | } | 8942 | } |
@@ -15364,15 +15364,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
15364 | return new HashSet<string>(m_inPacketsToDrop); | 15364 | return new HashSet<string>(m_inPacketsToDrop); |
15365 | } | 15365 | } |
15366 | 15366 | ||
15367 | public void CheckViewerCaps() | 15367 | public uint GetViewerCaps() |
15368 | { | 15368 | { |
15369 | m_SupportObjectAnimations = false; | 15369 | m_SupportObjectAnimations = false; |
15370 | uint ret; | ||
15371 | if(m_supportViewerCache) | ||
15372 | ret = m_viewerHandShakeFlags; | ||
15373 | else | ||
15374 | ret = m_viewerHandShakeFlags & 4; | ||
15375 | |||
15370 | if (m_scene.CapsModule != null) | 15376 | if (m_scene.CapsModule != null) |
15371 | { | 15377 | { |
15372 | Caps cap = m_scene.CapsModule.GetCapsForUser(CircuitCode); | 15378 | Caps cap = m_scene.CapsModule.GetCapsForUser(CircuitCode); |
15373 | if (cap != null && (cap.Flags & Caps.CapsFlags.ObjectAnim) != 0) | 15379 | if(cap != null) |
15374 | m_SupportObjectAnimations = true; | 15380 | { |
15381 | if((cap.Flags & Caps.CapsFlags.SentSeeds) != 0) | ||
15382 | ret |= 0x1000; | ||
15383 | if ((cap.Flags & Caps.CapsFlags.ObjectAnim) != 0) | ||
15384 | { | ||
15385 | m_SupportObjectAnimations = true; | ||
15386 | ret |= 0x2000; | ||
15387 | } | ||
15388 | } | ||
15375 | } | 15389 | } |
15390 | return ret; // ??? | ||
15376 | } | 15391 | } |
15377 | } | 15392 | } |
15378 | } | 15393 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index b105d52..6746573 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -1698,7 +1698,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1698 | } | 1698 | } |
1699 | 1699 | ||
1700 | // Now we know we can handle more data | 1700 | // Now we know we can handle more data |
1701 | Thread.Sleep(200); | 1701 | //Thread.Sleep(200); |
1702 | 1702 | ||
1703 | // Obtain the pending queue and remove it from the cache | 1703 | // Obtain the pending queue and remove it from the cache |
1704 | Queue<UDPPacketBuffer> queue = null; | 1704 | Queue<UDPPacketBuffer> queue = null; |
@@ -1727,7 +1727,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1727 | { | 1727 | { |
1728 | if(aCircuit.teleportFlags <= 0) | 1728 | if(aCircuit.teleportFlags <= 0) |
1729 | client.SendRegionHandshake(); | 1729 | client.SendRegionHandshake(); |
1730 | client.CheckViewerCaps(); | ||
1731 | } | 1730 | } |
1732 | } | 1731 | } |
1733 | else | 1732 | else |
@@ -1743,8 +1742,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1743 | } | 1742 | } |
1744 | 1743 | ||
1745 | // m_log.DebugFormat( | 1744 | // m_log.DebugFormat( |
1746 | // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", | 1745 | // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", |
1747 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); | 1746 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); |
1748 | 1747 | ||
1749 | } | 1748 | } |
1750 | catch (Exception e) | 1749 | catch (Exception e) |
@@ -1758,117 +1757,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1758 | e.StackTrace); | 1757 | e.StackTrace); |
1759 | } | 1758 | } |
1760 | } | 1759 | } |
1761 | /* | ||
1762 | protected void HandleCompleteMovementIntoRegion(object o) | ||
1763 | { | ||
1764 | IPEndPoint endPoint = null; | ||
1765 | IClientAPI client = null; | ||
1766 | |||
1767 | try | ||
1768 | { | ||
1769 | object[] array = (object[])o; | ||
1770 | endPoint = (IPEndPoint)array[0]; | ||
1771 | CompleteAgentMovementPacket packet = (CompleteAgentMovementPacket)array[1]; | ||
1772 | |||
1773 | m_log.DebugFormat( | ||
1774 | "[LLUDPSERVER]: Handling CompleteAgentMovement request from {0} in {1}", endPoint, Scene.Name); | ||
1775 | |||
1776 | // Determine which agent this packet came from | ||
1777 | // We need to wait here because in when using the OpenSimulator V2 teleport protocol to travel to a destination | ||
1778 | // simulator with no existing child presence, the viewer (at least LL 3.3.4) will send UseCircuitCode | ||
1779 | // and then CompleteAgentMovement immediately without waiting for an ack. As we are now handling these | ||
1780 | // packets asynchronously, we need to account for this thread proceeding more quickly than the | ||
1781 | // UseCircuitCode thread. | ||
1782 | int count = 40; | ||
1783 | while (count-- > 0) | ||
1784 | { | ||
1785 | if (Scene.TryGetClient(endPoint, out client)) | ||
1786 | { | ||
1787 | if (!client.IsActive) | ||
1788 | { | ||
1789 | // This check exists to catch a condition where the client has been closed by another thread | ||
1790 | // but has not yet been removed from the client manager (and possibly a new connection has | ||
1791 | // not yet been established). | ||
1792 | m_log.DebugFormat( | ||
1793 | "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client is not active yet. Waiting.", | ||
1794 | endPoint, client.Name, Scene.Name); | ||
1795 | } | ||
1796 | else if (client.SceneAgent == null) | ||
1797 | { | ||
1798 | // This check exists to catch a condition where the new client has been added to the client | ||
1799 | // manager but the SceneAgent has not yet been set in Scene.AddNewAgent(). If we are too | ||
1800 | // eager, then the new ScenePresence may not have registered a listener for this messsage | ||
1801 | // before we try to process it. | ||
1802 | // XXX: A better long term fix may be to add the SceneAgent before the client is added to | ||
1803 | // the client manager | ||
1804 | m_log.DebugFormat( | ||
1805 | "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client SceneAgent not set yet. Waiting.", | ||
1806 | endPoint, client.Name, Scene.Name); | ||
1807 | } | ||
1808 | else | ||
1809 | { | ||
1810 | break; | ||
1811 | } | ||
1812 | } | ||
1813 | else | ||
1814 | { | ||
1815 | m_log.DebugFormat( | ||
1816 | "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} in {1} but no client exists yet. Waiting.", | ||
1817 | endPoint, Scene.Name); | ||
1818 | } | ||
1819 | |||
1820 | Thread.Sleep(200); | ||
1821 | } | ||
1822 | |||
1823 | if (client == null) | ||
1824 | { | ||
1825 | m_log.DebugFormat( | ||
1826 | "[LLUDPSERVER]: No client found for CompleteAgentMovement from {0} in {1} after wait. Dropping.", | ||
1827 | endPoint, Scene.Name); | ||
1828 | |||
1829 | return; | ||
1830 | } | ||
1831 | else if (!client.IsActive || client.SceneAgent == null) | ||
1832 | { | ||
1833 | // This check exists to catch a condition where the client has been closed by another thread | ||
1834 | // but has not yet been removed from the client manager. | ||
1835 | // The packet could be simply ignored but it is useful to know if this condition occurred for other debugging | ||
1836 | // purposes. | ||
1837 | m_log.DebugFormat( | ||
1838 | "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client is not active after wait. Dropping.", | ||
1839 | endPoint, client.Name, Scene.Name); | ||
1840 | |||
1841 | return; | ||
1842 | } | ||
1843 | |||
1844 | IncomingPacket incomingPacket1; | ||
1845 | |||
1846 | // Inbox insertion | ||
1847 | if (UsePools) | ||
1848 | { | ||
1849 | incomingPacket1 = m_incomingPacketPool.GetObject(); | ||
1850 | incomingPacket1.Client = (LLClientView)client; | ||
1851 | incomingPacket1.Packet = packet; | ||
1852 | } | ||
1853 | else | ||
1854 | { | ||
1855 | incomingPacket1 = new IncomingPacket((LLClientView)client, packet); | ||
1856 | } | ||
1857 | |||
1858 | packetInbox.Enqueue(incomingPacket1); | ||
1859 | } | ||
1860 | catch (Exception e) | ||
1861 | { | ||
1862 | m_log.ErrorFormat( | ||
1863 | "[LLUDPSERVER]: CompleteAgentMovement handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}", | ||
1864 | endPoint != null ? endPoint.ToString() : "n/a", | ||
1865 | client != null ? client.Name : "unknown", | ||
1866 | client != null ? client.AgentId.ToString() : "unknown", | ||
1867 | e.Message, | ||
1868 | e.StackTrace); | ||
1869 | } | ||
1870 | } | ||
1871 | */ | ||
1872 | 1760 | ||
1873 | /// <summary> | 1761 | /// <summary> |
1874 | /// Send an ack immediately to the given endpoint. | 1762 | /// Send an ack immediately to the given endpoint. |
@@ -1936,7 +1824,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1936 | { | 1824 | { |
1937 | if (Scene.TryGetClient(agentID, out client)) | 1825 | if (Scene.TryGetClient(agentID, out client)) |
1938 | { | 1826 | { |
1939 | if (client.SceneAgent != null) | 1827 | if (client.SceneAgent != null && |
1828 | client.CircuitCode == circuitCode && | ||
1829 | client.SessionId == sessionID && | ||
1830 | client.RemoteEndPoint == remoteEndPoint && | ||
1831 | client.SceneAgent.ControllingClient.SecureSessionId == sessionInfo.LoginInfo.SecureSession) | ||
1940 | return client; | 1832 | return client; |
1941 | Scene.CloseAgent(agentID, true); | 1833 | Scene.CloseAgent(agentID, true); |
1942 | } | 1834 | } |