* Removed the unused m_agentUpdates collection and some extra work that was being done for AgentUpdate packets
* Start LLUDPClients unpaused (this variable is not being used yet)prioritization
parent
d38f33736c
commit
1833c69568
|
@ -98,7 +98,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// <summary>True when this connection is alive, otherwise false</summary>
|
/// <summary>True when this connection is alive, otherwise false</summary>
|
||||||
public bool IsConnected = true;
|
public bool IsConnected = true;
|
||||||
/// <summary>True when this connection is paused, otherwise false</summary>
|
/// <summary>True when this connection is paused, otherwise false</summary>
|
||||||
public bool IsPaused = true;
|
public bool IsPaused;
|
||||||
/// <summary>Environment.TickCount when the last packet was received for this client</summary>
|
/// <summary>Environment.TickCount when the last packet was received for this client</summary>
|
||||||
public int TickLastPacketReceived;
|
public int TickLastPacketReceived;
|
||||||
/// <summary>Environment.TickCount of the last time the outgoing packet handler executed for this client</summary>
|
/// <summary>Environment.TickCount of the last time the outgoing packet handler executed for this client</summary>
|
||||||
|
|
|
@ -128,8 +128,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private bool m_setAlwaysRun;
|
private bool m_setAlwaysRun;
|
||||||
|
|
||||||
private bool m_updatesAllowed = true;
|
|
||||||
private List<AgentUpdateArgs> m_agentUpdates = new List<AgentUpdateArgs>();
|
|
||||||
private string m_movementAnimation = "DEFAULT";
|
private string m_movementAnimation = "DEFAULT";
|
||||||
private long m_animPersistUntil = 0;
|
private long m_animPersistUntil = 0;
|
||||||
private bool m_allowFalling = false;
|
private bool m_allowFalling = false;
|
||||||
|
@ -1090,34 +1088,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// These methods allow to queue up agent updates (like key presses)
|
|
||||||
// until all attachment scripts are running and the animations from
|
|
||||||
// AgentDataUpdate have been started. It is essential for combat
|
|
||||||
// devices, weapons and AOs that keypresses are not processed
|
|
||||||
// until scripts that are potentially interested in them are
|
|
||||||
// up and running and that animations a script knows to be running
|
|
||||||
// from before a crossing are running again
|
|
||||||
//
|
|
||||||
public void LockAgentUpdates()
|
|
||||||
{
|
|
||||||
m_updatesAllowed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UnlockAgentUpdates()
|
|
||||||
{
|
|
||||||
lock (m_agentUpdates)
|
|
||||||
{
|
|
||||||
if (m_updatesAllowed == false)
|
|
||||||
{
|
|
||||||
foreach (AgentUpdateArgs a in m_agentUpdates)
|
|
||||||
RealHandleAgentUpdate(ControllingClient, a);
|
|
||||||
m_agentUpdates.Clear();
|
|
||||||
m_updatesAllowed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Callback for the Camera view block check. Gets called with the results of the camera view block test
|
/// Callback for the Camera view block check. Gets called with the results of the camera view block test
|
||||||
/// hitYN is true when there's something in the way.
|
/// hitYN is true when there's something in the way.
|
||||||
|
@ -1155,30 +1125,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Array m_dirControlFlags = Enum.GetValues(typeof(Dir_ControlFlags));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is the event handler for client movement. If a client is moving, this event is triggering.
|
/// This is the event handler for client movement. If a client is moving, this event is triggering.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
||||||
{
|
|
||||||
const int AGENT_UPDATE_TIMEOUT_MS = 1000 * 3;
|
|
||||||
|
|
||||||
if (System.Threading.Monitor.TryEnter(m_agentUpdates, AGENT_UPDATE_TIMEOUT_MS))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (m_updatesAllowed)
|
|
||||||
{
|
|
||||||
RealHandleAgentUpdate(remoteClient, agentData);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_agentUpdates.Add(agentData);
|
|
||||||
}
|
|
||||||
finally { System.Threading.Monitor.Exit(m_agentUpdates); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RealHandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
|
||||||
{
|
{
|
||||||
//if (m_isChildAgent)
|
//if (m_isChildAgent)
|
||||||
//{
|
//{
|
||||||
|
@ -1186,18 +1138,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// return;
|
// return;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
m_perfMonMS = Environment.TickCount;
|
||||||
|
|
||||||
m_movementUpdateCount++;
|
++m_movementUpdateCount;
|
||||||
if (m_movementUpdateCount >= int.MaxValue)
|
if (m_movementUpdateCount < 1)
|
||||||
m_movementUpdateCount = 1;
|
m_movementUpdateCount = 1;
|
||||||
|
|
||||||
|
|
||||||
// Must check for standing up even when PhysicsActor is null,
|
// Must check for standing up even when PhysicsActor is null,
|
||||||
// since sitting currently removes avatar from physical scene
|
// since sitting currently removes avatar from physical scene
|
||||||
//m_log.Debug("agentPos:" + AbsolutePosition.ToString());
|
//m_log.Debug("agentPos:" + AbsolutePosition.ToString());
|
||||||
|
|
||||||
// This is irritating. Really.
|
// This is irritating. Really.
|
||||||
|
|
||||||
if (!AbsolutePosition.IsFinite())
|
if (!AbsolutePosition.IsFinite())
|
||||||
{
|
{
|
||||||
RemoveFromPhysicalScene();
|
RemoveFromPhysicalScene();
|
||||||
|
@ -1218,8 +1169,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_LastFinitePos = m_pos;
|
m_LastFinitePos = m_pos;
|
||||||
}
|
}
|
||||||
//m_physicsActor.AddForce(new PhysicsVector(999999999, 99999999, 999999999999999), true);
|
|
||||||
|
|
||||||
|
//m_physicsActor.AddForce(new PhysicsVector(999999999, 99999999, 999999999999999), true);
|
||||||
|
|
||||||
//ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
//ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
||||||
//if (land != null)
|
//if (land != null)
|
||||||
|
@ -1230,8 +1181,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//}
|
//}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
m_perfMonMS = Environment.TickCount;
|
|
||||||
|
|
||||||
uint flags = agentData.ControlFlags;
|
uint flags = agentData.ControlFlags;
|
||||||
Quaternion bodyRotation = agentData.BodyRotation;
|
Quaternion bodyRotation = agentData.BodyRotation;
|
||||||
|
|
||||||
|
@ -1268,7 +1217,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Raycast from the avatar's head to the camera to see if there's anything blocking the view
|
// Raycast from the avatar's head to the camera to see if there's anything blocking the view
|
||||||
if ((m_movementUpdateCount % NumMovementsBetweenRayCast) == 0 && m_scene.PhysicsScene.SupportsRayCast())
|
if ((m_movementUpdateCount % NumMovementsBetweenRayCast) == 0 && m_scene.PhysicsScene.SupportsRayCast())
|
||||||
{
|
{
|
||||||
|
|
||||||
if (m_followCamAuto)
|
if (m_followCamAuto)
|
||||||
{
|
{
|
||||||
Vector3 headadjustment = new Vector3(0, 0, 0.3f);
|
Vector3 headadjustment = new Vector3(0, 0, 0.3f);
|
||||||
|
@ -1277,20 +1225,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mouseLook = (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
|
m_mouseLook = (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_leftButtonDown = (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0;
|
m_leftButtonDown = (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lock (scriptedcontrols)
|
lock (scriptedcontrols)
|
||||||
{
|
{
|
||||||
if (scriptedcontrols.Count > 0)
|
if (scriptedcontrols.Count > 0)
|
||||||
{
|
{
|
||||||
SendControlToScripts(flags);
|
SendControlToScripts(flags);
|
||||||
flags = RemoveIgnoredControls(flags, IgnoredControls);
|
flags = RemoveIgnoredControls(flags, IgnoredControls);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1363,7 +1305,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
dirVectors = Dir_Vectors;
|
dirVectors = Dir_Vectors;
|
||||||
|
|
||||||
|
|
||||||
foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags)))
|
foreach (Dir_ControlFlags DCF in m_dirControlFlags)
|
||||||
{
|
{
|
||||||
if ((flags & (uint)DCF) != 0)
|
if ((flags & (uint)DCF) != 0)
|
||||||
{
|
{
|
||||||
|
@ -1479,10 +1421,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
||||||
//Avoid system crash, can be slower but...
|
//Avoid system crash, can be slower but...
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue