take agentUpdate checks out of llUDPserver (disabling useless debug) and
do it only where its supposed to be done..avinationmerge
parent
f811efde85
commit
20b3cab5d1
|
@ -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,47 +5827,55 @@ 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;
|
||||
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;
|
||||
m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation;
|
||||
m_thisAgentUpdateArgs.SessionID = x.SessionID;
|
||||
m_thisAgentUpdateArgs.State = x.State;
|
||||
|
||||
UpdateAgent handlerAgentUpdate = OnAgentUpdate;
|
||||
UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
|
||||
UpdateAgent handlerAgentCameraUpdate = OnAgentCameraUpdate;
|
||||
|
||||
// Was there a significant movement/state change?
|
||||
if (movement)
|
||||
{
|
||||
m_thisAgentUpdateArgs.BodyRotation = x.BodyRotation;
|
||||
m_thisAgentUpdateArgs.ControlFlags = x.ControlFlags;
|
||||
m_thisAgentUpdateArgs.Far = x.Far;
|
||||
m_thisAgentUpdateArgs.Flags = x.Flags;
|
||||
m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation;
|
||||
m_thisAgentUpdateArgs.SessionID = x.SessionID;
|
||||
m_thisAgentUpdateArgs.State = x.State;
|
||||
|
||||
UpdateAgent handlerAgentUpdate = OnAgentUpdate;
|
||||
UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
|
||||
|
||||
if (handlerPreAgentUpdate != null)
|
||||
OnPreAgentUpdate(this, m_thisAgentUpdateArgs);
|
||||
|
||||
if (handlerAgentUpdate != null)
|
||||
OnAgentUpdate(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);
|
||||
|
||||
handlerAgentUpdate = null;
|
||||
handlerPreAgentUpdate = null;
|
||||
handlerAgentCameraUpdate = null;
|
||||
handlerAgentCameraUpdate = null;
|
||||
}
|
||||
|
||||
PacketPool.Instance.ReturnPacket(packet);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue