aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2014-08-12 23:57:41 +0100
committerUbitUmarov2014-08-12 23:57:41 +0100
commit20b3cab5d1cb1bbbe951a90ae6de7ffb495e6375 (patch)
treef32e183217a74d24ed5816bf7d6b6c33a44bdf6c /OpenSim/Region
parentdo the significance test invalidation at MoveAgentToRegion (diff)
downloadopensim-SC_OLD-20b3cab5d1cb1bbbe951a90ae6de7ffb495e6375.zip
opensim-SC_OLD-20b3cab5d1cb1bbbe951a90ae6de7ffb495e6375.tar.gz
opensim-SC_OLD-20b3cab5d1cb1bbbe951a90ae6de7ffb495e6375.tar.bz2
opensim-SC_OLD-20b3cab5d1cb1bbbe951a90ae6de7ffb495e6375.tar.xz
take agentUpdate checks out of llUDPserver (disabling useless debug) and
do it only where its supposed to be done..
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs56
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs22
2 files changed, 35 insertions, 43 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index f5bb70b..9462bdc 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5819,55 +5819,63 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5819 return cameraSignificant; 5819 return cameraSignificant;
5820 } 5820 }
5821 5821
5822 private bool HandleAgentUpdate(IClientAPI sener, Packet packet) 5822 private bool HandleAgentUpdate(IClientAPI sender, Packet packet)
5823 { 5823 {
5824 // We got here, which means that something in agent update was significant 5824 // We got here, which means that something in agent update was significant
5825 5825
5826 AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet; 5826 AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet;
5827 AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData; 5827 AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData;
5828 5828
5829 if (x.AgentID != AgentId || x.SessionID != SessionId) 5829 if (x.AgentID != AgentId || x.SessionID != SessionId)
5830 {
5831 PacketPool.Instance.ReturnPacket(packet);
5830 return false; 5832 return false;
5833 }
5834
5835 TotalAgentUpdates++;
5831 5836
5832 // Before we update the current m_thisAgentUpdateArgs, let's check this again
5833 // to see what exactly changed
5834 bool movement = CheckAgentMovementUpdateSignificance(x); 5837 bool movement = CheckAgentMovementUpdateSignificance(x);
5835 bool camera = CheckAgentCameraUpdateSignificance(x); 5838 bool camera = CheckAgentCameraUpdateSignificance(x);
5836 5839
5837 m_thisAgentUpdateArgs.AgentID = x.AgentID;
5838 m_thisAgentUpdateArgs.BodyRotation = x.BodyRotation;
5839 m_thisAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis;
5840 m_thisAgentUpdateArgs.CameraCenter = x.CameraCenter;
5841 m_thisAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis;
5842 m_thisAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis;
5843 m_thisAgentUpdateArgs.ControlFlags = x.ControlFlags;
5844 m_thisAgentUpdateArgs.Far = x.Far;
5845 m_thisAgentUpdateArgs.Flags = x.Flags;
5846 m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation;
5847 m_thisAgentUpdateArgs.SessionID = x.SessionID;
5848 m_thisAgentUpdateArgs.State = x.State;
5849
5850 UpdateAgent handlerAgentUpdate = OnAgentUpdate;
5851 UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
5852 UpdateAgent handlerAgentCameraUpdate = OnAgentCameraUpdate;
5853
5854 // Was there a significant movement/state change? 5840 // Was there a significant movement/state change?
5855 if (movement) 5841 if (movement)
5856 { 5842 {
5843 m_thisAgentUpdateArgs.BodyRotation = x.BodyRotation;
5844 m_thisAgentUpdateArgs.ControlFlags = x.ControlFlags;
5845 m_thisAgentUpdateArgs.Far = x.Far;
5846 m_thisAgentUpdateArgs.Flags = x.Flags;
5847 m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation;
5848 m_thisAgentUpdateArgs.SessionID = x.SessionID;
5849 m_thisAgentUpdateArgs.State = x.State;
5850
5851 UpdateAgent handlerAgentUpdate = OnAgentUpdate;
5852 UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
5853
5857 if (handlerPreAgentUpdate != null) 5854 if (handlerPreAgentUpdate != null)
5858 OnPreAgentUpdate(this, m_thisAgentUpdateArgs); 5855 OnPreAgentUpdate(this, m_thisAgentUpdateArgs);
5859 5856
5860 if (handlerAgentUpdate != null) 5857 if (handlerAgentUpdate != null)
5861 OnAgentUpdate(this, m_thisAgentUpdateArgs); 5858 OnAgentUpdate(this, m_thisAgentUpdateArgs);
5859
5860 handlerAgentUpdate = null;
5861 handlerPreAgentUpdate = null;
5862 } 5862 }
5863
5863 // Was there a significant camera(s) change? 5864 // Was there a significant camera(s) change?
5864 if (camera) 5865 if (camera)
5866 {
5867 m_thisAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis;
5868 m_thisAgentUpdateArgs.CameraCenter = x.CameraCenter;
5869 m_thisAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis;
5870 m_thisAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis;
5871
5872 UpdateAgent handlerAgentCameraUpdate = OnAgentCameraUpdate;
5873
5865 if (handlerAgentCameraUpdate != null) 5874 if (handlerAgentCameraUpdate != null)
5866 handlerAgentCameraUpdate(this, m_thisAgentUpdateArgs); 5875 handlerAgentCameraUpdate(this, m_thisAgentUpdateArgs);
5867 5876
5868 handlerAgentUpdate = null; 5877 handlerAgentCameraUpdate = null;
5869 handlerPreAgentUpdate = null; 5878 }
5870 handlerAgentCameraUpdate = null;
5871 5879
5872 PacketPool.Instance.ReturnPacket(packet); 5880 PacketPool.Instance.ReturnPacket(packet);
5873 5881
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 0bb53c4..15d0316 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)
@@ -1553,24 +1554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1553 LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length); 1554 LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length);
1554 #endregion BinaryStats 1555 #endregion BinaryStats
1555 1556
1556 if (packet.Type == PacketType.AgentUpdate) 1557// 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 1558
1575 #region Ping Check Handling 1559 #region Ping Check Handling
1576 1560