waste another thread job on another thing that should be part of a more
unified service, and also not hidding on a so called event"LSLKeyTest
parent
d6e16c5130
commit
f4fa891928
|
@ -2080,66 +2080,63 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
sp.KnownRegions = seeds;
|
sp.KnownRegions = seeds;
|
||||||
sp.SetNeighbourRegionSizeInfo(neighbours);
|
sp.SetNeighbourRegionSizeInfo(neighbours);
|
||||||
|
|
||||||
AgentPosition agentpos = new AgentPosition();
|
if(newneighbours.Count > 0 || previousRegionNeighbourHandles.Count > 0)
|
||||||
agentpos.AgentID = new UUID(sp.UUID.Guid);
|
|
||||||
agentpos.SessionID = spClient.SessionId;
|
|
||||||
agentpos.Size = sp.Appearance.AvatarSize;
|
|
||||||
agentpos.Center = sp.CameraPosition;
|
|
||||||
agentpos.Far = sp.DrawDistance;
|
|
||||||
agentpos.Position = sp.AbsolutePosition;
|
|
||||||
agentpos.Velocity = sp.Velocity;
|
|
||||||
agentpos.RegionHandle = currentRegionHandler;
|
|
||||||
agentpos.Throttles = spClient.GetThrottlesPacked(1);
|
|
||||||
// agentpos.ChildrenCapSeeds = seeds;
|
|
||||||
|
|
||||||
Util.FireAndForget(delegate
|
|
||||||
{
|
{
|
||||||
Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start
|
AgentPosition agentpos = new AgentPosition();
|
||||||
int count = 0;
|
agentpos.AgentID = new UUID(sp.UUID.Guid);
|
||||||
|
agentpos.SessionID = spClient.SessionId;
|
||||||
|
agentpos.Size = sp.Appearance.AvatarSize;
|
||||||
|
agentpos.Center = sp.CameraPosition;
|
||||||
|
agentpos.Far = sp.DrawDistance;
|
||||||
|
agentpos.Position = sp.AbsolutePosition;
|
||||||
|
agentpos.Velocity = sp.Velocity;
|
||||||
|
agentpos.RegionHandle = currentRegionHandler;
|
||||||
|
agentpos.Throttles = spClient.GetThrottlesPacked(1);
|
||||||
|
// agentpos.ChildrenCapSeeds = seeds;
|
||||||
|
|
||||||
foreach (GridRegion neighbour in neighbours)
|
Util.FireAndForget(delegate
|
||||||
{
|
{
|
||||||
ulong handler = neighbour.RegionHandle;
|
Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start
|
||||||
try
|
int count = 0;
|
||||||
|
|
||||||
|
foreach (GridRegion neighbour in neighbours)
|
||||||
{
|
{
|
||||||
if (newneighbours.Contains(handler))
|
ulong handler = neighbour.RegionHandle;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
InformClientOfNeighbourAsync(sp, cagents[count], neighbour,
|
if (newneighbours.Contains(handler))
|
||||||
neighbour.ExternalEndPoint, true);
|
{
|
||||||
count++;
|
InformClientOfNeighbourAsync(sp, cagents[count], neighbour,
|
||||||
|
neighbour.ExternalEndPoint, true);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
else if (!previousRegionNeighbourHandles.Contains(handler))
|
||||||
|
{
|
||||||
|
spScene.SimulationService.UpdateAgent(neighbour, agentpos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!previousRegionNeighbourHandles.Contains(handler))
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
spScene.SimulationService.UpdateAgent(neighbour, agentpos);
|
m_log.ErrorFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
|
||||||
|
neighbour.ExternalHostName,
|
||||||
|
neighbour.RegionHandle,
|
||||||
|
neighbour.RegionLocX,
|
||||||
|
neighbour.RegionLocY);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}",
|
||||||
|
neighbour.ExternalHostName,
|
||||||
|
neighbour.RegionHandle,
|
||||||
|
neighbour.RegionLocX,
|
||||||
|
neighbour.RegionLocY,
|
||||||
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
});
|
||||||
{
|
}
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
|
|
||||||
neighbour.ExternalHostName,
|
|
||||||
neighbour.RegionHandle,
|
|
||||||
neighbour.RegionLocX,
|
|
||||||
neighbour.RegionLocY);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}",
|
|
||||||
neighbour.ExternalHostName,
|
|
||||||
neighbour.RegionHandle,
|
|
||||||
neighbour.RegionLocX,
|
|
||||||
neighbour.RegionLocY,
|
|
||||||
e);
|
|
||||||
|
|
||||||
// FIXME: Okay, even though we've failed, we're still going to throw the exception on,
|
|
||||||
// since I don't know what will happen if we just let the client continue
|
|
||||||
|
|
||||||
// XXX: Well, decided to swallow the exception instead for now. Let us see how that goes.
|
|
||||||
// throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Computes the difference between two region bases.
|
// Computes the difference between two region bases.
|
||||||
|
|
|
@ -68,6 +68,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
||||||
|
|
||||||
public void OnMakeRootAgent(ScenePresence sp)
|
public void OnMakeRootAgent(ScenePresence sp)
|
||||||
{
|
{
|
||||||
|
if (sp.isNPC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(sp.gotCrossUpdate)
|
||||||
|
{
|
||||||
|
Util.FireAndForget(delegate
|
||||||
|
{
|
||||||
|
DoOnMakeRootAgent(sp);
|
||||||
|
}, null, "PresenceDetector_MakeRoot");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DoOnMakeRootAgent(sp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DoOnMakeRootAgent(ScenePresence sp)
|
||||||
|
{
|
||||||
// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
|
||||||
if (sp.PresenceType != PresenceType.Npc)
|
if (sp.PresenceType != PresenceType.Npc)
|
||||||
m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID);
|
m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID);
|
||||||
|
|
Loading…
Reference in New Issue