take agentUpdate checks out of llUDPserver (disabling useless debug) and

do it only where its supposed to be done..
avinationmerge
UbitUmarov 2014-08-12 23:57:41 +01:00
parent f811efde85
commit 20b3cab5d1
2 changed files with 35 additions and 43 deletions

View File

@ -5819,7 +5819,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return cameraSignificant;
}
private bool HandleAgentUpdate(IClientAPI sener, Packet packet)
private bool HandleAgentUpdate(IClientAPI sender, Packet packet)
{
// We got here, which means that something in agent update was significant
@ -5827,19 +5827,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData;
if (x.AgentID != AgentId || x.SessionID != SessionId)
{
PacketPool.Instance.ReturnPacket(packet);
return false;
}
TotalAgentUpdates++;
// Before we update the current m_thisAgentUpdateArgs, let's check this again
// to see what exactly changed
bool movement = CheckAgentMovementUpdateSignificance(x);
bool camera = CheckAgentCameraUpdateSignificance(x);
m_thisAgentUpdateArgs.AgentID = x.AgentID;
// Was there a significant movement/state change?
if (movement)
{
m_thisAgentUpdateArgs.BodyRotation = x.BodyRotation;
m_thisAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis;
m_thisAgentUpdateArgs.CameraCenter = x.CameraCenter;
m_thisAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis;
m_thisAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis;
m_thisAgentUpdateArgs.ControlFlags = x.ControlFlags;
m_thisAgentUpdateArgs.Far = x.Far;
m_thisAgentUpdateArgs.Flags = x.Flags;
@ -5849,25 +5850,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UpdateAgent handlerAgentUpdate = OnAgentUpdate;
UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
UpdateAgent handlerAgentCameraUpdate = OnAgentCameraUpdate;
// Was there a significant movement/state change?
if (movement)
{
if (handlerPreAgentUpdate != null)
OnPreAgentUpdate(this, m_thisAgentUpdateArgs);
if (handlerAgentUpdate != null)
OnAgentUpdate(this, m_thisAgentUpdateArgs);
}
// Was there a significant camera(s) change?
if (camera)
if (handlerAgentCameraUpdate != null)
handlerAgentCameraUpdate(this, m_thisAgentUpdateArgs);
handlerAgentUpdate = null;
handlerPreAgentUpdate = null;
}
// Was there a significant camera(s) change?
if (camera)
{
m_thisAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis;
m_thisAgentUpdateArgs.CameraCenter = x.CameraCenter;
m_thisAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis;
m_thisAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis;
UpdateAgent handlerAgentCameraUpdate = OnAgentCameraUpdate;
if (handlerAgentCameraUpdate != null)
handlerAgentCameraUpdate(this, m_thisAgentUpdateArgs);
handlerAgentCameraUpdate = null;
}
PacketPool.Instance.ReturnPacket(packet);

View File

@ -731,7 +731,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"debug lludp status",
"Return status of LLUDP packet processing.",
HandleStatusCommand);
/* disabled
MainConsole.Instance.Commands.AddCommand(
"Debug",
false,
@ -739,6 +739,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"debug lludp toggle agentupdate",
"Toggle whether agentupdate packets are processed or simply discarded.",
HandleAgentUpdateCommand);
*/
}
private void HandlePacketCommand(string module, string[] args)
@ -1553,24 +1554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length);
#endregion BinaryStats
if (packet.Type == PacketType.AgentUpdate)
{
if (m_discardAgentUpdates)
return;
((LLClientView)client).TotalAgentUpdates++;
AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet;
LLClientView llClient = client as LLClientView;
if (agentUpdate.AgentData.SessionID != client.SessionId
|| agentUpdate.AgentData.AgentID != client.AgentId
|| !(llClient == null || llClient.CheckAgentUpdateSignificance(agentUpdate.AgentData)) )
{
PacketPool.Instance.ReturnPacket(packet);
return;
}
}
// AgentUpdate mess removed from here
#region Ping Check Handling