minor: dont let rcvd agentupdates time jump back

melanie
UbitUmarov 2016-11-16 22:34:56 +00:00
parent 05ba77fd3b
commit e77f913116
3 changed files with 34 additions and 12 deletions

View File

@ -82,6 +82,7 @@ namespace OpenSim.Framework
public Vector3 ClientAgentPosition; public Vector3 ClientAgentPosition;
public bool UseClientAgentPosition; public bool UseClientAgentPosition;
public bool NeedsCameraCollision; public bool NeedsCameraCollision;
public uint lastpacketSequence;
public AgentUpdateArgs() public AgentUpdateArgs()
{ {

View File

@ -6251,9 +6251,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return false; return false;
} }
uint seq = packet.Header.Sequence;
TotalAgentUpdates++; TotalAgentUpdates++;
// dont let ignored updates pollute this throttles // dont let ignored updates pollute this throttles
if(SceneAgent == null || SceneAgent.IsChildAgent || SceneAgent.IsInTransit) if(SceneAgent == null || SceneAgent.IsChildAgent ||
SceneAgent.IsInTransit || seq <= m_thisAgentUpdateArgs.lastpacketSequence )
{ {
// throttle reset is done at MoveAgentIntoRegion() // throttle reset is done at MoveAgentIntoRegion()
// called by scenepresence on completemovement // called by scenepresence on completemovement
@ -6261,6 +6264,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true; return true;
} }
m_thisAgentUpdateArgs.lastpacketSequence = seq;
bool movement = CheckAgentMovementUpdateSignificance(x); bool movement = CheckAgentMovementUpdateSignificance(x);
bool camera = CheckAgentCameraUpdateSignificance(x); bool camera = CheckAgentCameraUpdateSignificance(x);

View File

@ -2318,7 +2318,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 tocam = CameraPosition - posAdjusted; Vector3 tocam = CameraPosition - posAdjusted;
float distTocamlen = tocam.LengthSquared(); float distTocamlen = tocam.LengthSquared();
if (distTocamlen > 0.08f && distTocamlen < 400) if (distTocamlen > 0.01f && distTocamlen < 400)
{ {
distTocamlen = (float)Math.Sqrt(distTocamlen); distTocamlen = (float)Math.Sqrt(distTocamlen);
tocam *= (1.0f / distTocamlen); tocam *= (1.0f / distTocamlen);
@ -4378,16 +4378,12 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat( m_log.DebugFormat(
"[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}", "[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}",
knownRegions.Count, Scene.RegionInfo.RegionName); knownRegions.Count, Scene.RegionInfo.RegionName);
//DumpKnownRegions();
Util.RegionHandleToRegionLoc(newRegionHandle, out newRegionX, out newRegionY); Util.RegionHandleToRegionLoc(newRegionHandle, out newRegionX, out newRegionY);
uint x, y; uint x, y;
spRegionSizeInfo regInfo; spRegionSizeInfo regInfo;
// this should not be here
IEventQueue eventQueue = Scene.RequestModuleInterface<IEventQueue>();
foreach (ulong handle in knownRegions) foreach (ulong handle in knownRegions)
{ {
// Don't close the agent on this region yet // Don't close the agent on this region yet
@ -4400,16 +4396,10 @@ namespace OpenSim.Region.Framework.Scenes
Util.RegionHandleToRegionLoc(handle, out x, out y); Util.RegionHandleToRegionLoc(handle, out x, out y);
if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo)) if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo))
{ {
// m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX)));
// m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY)));
if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY)) regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY))
{ {
byebyeRegions.Add(handle); byebyeRegions.Add(handle);
// this should not be here
// if(eventQueue != null)
/// eventQueue.DisableSimulator(handle,UUID);
} }
} }
else else
@ -4445,6 +4435,32 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void closeAllChildAgents()
{
List<ulong> byebyeRegions = new List<ulong>();
List<ulong> knownRegions = KnownRegionHandles;
foreach (ulong handle in knownRegions)
{
if (handle != Scene.RegionInfo.RegionHandle)
{
byebyeRegions.Add(handle);
RemoveNeighbourRegion(handle);
Scene.CapsModule.DropChildSeed(UUID, handle);
}
}
if (byebyeRegions.Count > 0)
{
m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(UUID);
string auth = string.Empty;
if (acd != null)
auth = acd.SessionID.ToString();
m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, auth, byebyeRegions);
}
}
#endregion #endregion
/// <summary> /// <summary>