aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP
diff options
context:
space:
mode:
authorUbitUmarov2014-08-04 19:57:47 +0100
committerUbitUmarov2014-08-04 19:57:47 +0100
commit05a2feba5d780c57c252891a20071800fd9f2e3e (patch)
tree690addc627a94a260536c4b8b270e60876634626 /OpenSim/Region/ClientStack/Linden/UDP
parentlocal chat gods bug fix (diff)
downloadopensim-SC_OLD-05a2feba5d780c57c252891a20071800fd9f2e3e.zip
opensim-SC_OLD-05a2feba5d780c57c252891a20071800fd9f2e3e.tar.gz
opensim-SC_OLD-05a2feba5d780c57c252891a20071800fd9f2e3e.tar.bz2
opensim-SC_OLD-05a2feba5d780c57c252891a20071800fd9f2e3e.tar.xz
start sending terrain in scenePresence after well defined avatar. Minor
change on significante AgentUpdate check.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs28
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs34
2 files changed, 37 insertions, 25 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 34a2797..7d61577 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -577,7 +577,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
577 577
578 // Fire the callback for this connection closing 578 // Fire the callback for this connection closing
579 if (OnConnectionClosed != null) 579 if (OnConnectionClosed != null)
580 {
580 OnConnectionClosed(this); 581 OnConnectionClosed(this);
582 }
583
581 584
582 // Flush all of the packets out of the UDP server for this client 585 // Flush all of the packets out of the UDP server for this client
583 if (m_udpServer != null) 586 if (m_udpServer != null)
@@ -5518,8 +5521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5518 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); 5521 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
5519 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); 5522 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
5520 5523
5521// AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false); 5524 AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false);
5522 AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, true);
5523 5525
5524 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); 5526 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
5525 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); 5527 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
@@ -5732,10 +5734,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5732 #region Scene/Avatar 5734 #region Scene/Avatar
5733 5735
5734 // Threshold for body rotation to be a significant agent update 5736 // Threshold for body rotation to be a significant agent update
5735 private const float QDELTA = 0.000001f; 5737 // private const float QDELTA = 0.000001f;
5738 // QDELTA is now relative to abs of cos of angle between orientations
5739
5740 private const float QDELTABODY = 1 - 0.0001f;
5741 private const float QDELTAHEAD = 1 - 0.0001f;
5742
5736 // Threshold for camera rotation to be a significant agent update 5743 // Threshold for camera rotation to be a significant agent update
5737 private const float VDELTA = 0.01f; 5744 private const float VDELTA = 0.01f;
5738 5745
5739 /// <summary> 5746 /// <summary>
5740 /// This checks the update significance against the last update made. 5747 /// This checks the update significance against the last update made.
5741 /// </summary> 5748 /// </summary>
@@ -5755,13 +5762,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5755 /// <param name='x'></param> 5762 /// <param name='x'></param>
5756 private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) 5763 private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
5757 { 5764 {
5758 float qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2); 5765 // float qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2);
5759 //qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2); 5766 //qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2);
5767 // now using abs of cos
5768 float qdelta1 = (float)Math.Abs(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation));
5769 float qdelta2 = (float)Math.Abs(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation));
5760 5770
5761 bool movementSignificant = 5771 bool movementSignificant =
5762 (qdelta1 > QDELTA) // significant if body rotation above threshold 5772// (qdelta1 > QDELTA) // significant if body rotation above threshold
5763 // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack 5773 (qdelta1 < QDELTABODY) // higher angle lower cos
5774// Ignoring head rotation altogether, because it's not being used for anything interesting up the stack
5764 // || (qdelta2 > QDELTA * 10) // significant if head rotation above threshold 5775 // || (qdelta2 > QDELTA * 10) // significant if head rotation above threshold
5776 || (qdelta2 < QDELTAHEAD) // using cos above
5765 || (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed 5777 || (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed
5766 || (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands 5778 || (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands
5767 || (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed 5779 || (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed
@@ -6476,7 +6488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6476 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; 6488 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
6477 if (handlerRegionHandShakeReply != null) 6489 if (handlerRegionHandShakeReply != null)
6478 { 6490 {
6479 Thread.Sleep(500); 6491// Thread.Sleep(500);
6480 handlerRegionHandShakeReply(this); 6492 handlerRegionHandShakeReply(this);
6481 } 6493 }
6482 6494
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index b7c8594..a3fdae1 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -1750,25 +1750,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1750 endPoint, 1750 endPoint,
1751 sessionInfo); 1751 sessionInfo);
1752 1752
1753 // Send ack straight away to let the viewer know that the connection is active.
1754 // The client will be null if it already exists (e.g. if on a region crossing the client sends a use
1755 // circuit code to the existing child agent. This is not particularly obvious.
1756 SendAckImmediate(endPoint, uccp.Header.Sequence);
1757
1758 // We only want to send initial data to new clients, not ones which are being converted from child to root.
1759 if (client != null)
1760 {
1761 AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(uccp.CircuitCode.Code);
1762 bool tp = (aCircuit.teleportFlags > 0);
1763 // Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from
1764 if (!tp)
1765 client.SceneAgent.SendInitialDataToMe();
1766 }
1767
1768 // Now we know we can handle more data 1753 // Now we know we can handle more data
1769 Thread.Sleep(200); 1754// Thread.Sleep(200);
1770 1755
1771 // Obtain the queue and remove it from the cache 1756 // Obtain the pending queue and remove it from the cache
1772 Queue<UDPPacketBuffer> queue = null; 1757 Queue<UDPPacketBuffer> queue = null;
1773 1758
1774 lock (m_pendingCache) 1759 lock (m_pendingCache)
@@ -1790,6 +1775,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1790 PacketReceived(buf); 1775 PacketReceived(buf);
1791 } 1776 }
1792 queue = null; 1777 queue = null;
1778
1779 // Send ack straight away to let the viewer know that the connection is active.
1780 // The client will be null if it already exists (e.g. if on a region crossing the client sends a use
1781 // circuit code to the existing child agent. This is not particularly obvious.
1782 SendAckImmediate(endPoint, uccp.Header.Sequence);
1783
1784 // We only want to send initial data to new clients, not ones which are being converted from child to root.
1785 if (client != null)
1786 {
1787 AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(uccp.CircuitCode.Code);
1788 bool tp = (aCircuit.teleportFlags > 0);
1789 // Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from
1790 if (!tp)
1791 client.SceneAgent.SendInitialDataToMe();
1792 }
1793 } 1793 }
1794 else 1794 else
1795 { 1795 {