Merge branch 'master' into httptests
commit
de153c2b62
|
@ -500,13 +500,13 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
responsedata["http_protocol_version"] = "HTTP/1.0";
|
responsedata["http_protocol_version"] = "HTTP/1.0";
|
||||||
return responsedata;
|
return responsedata;
|
||||||
}
|
}
|
||||||
|
/* this is not a event message
|
||||||
public void DisableSimulator(ulong handle, UUID avatarID)
|
public void DisableSimulator(ulong handle, UUID avatarID)
|
||||||
{
|
{
|
||||||
OSD item = EventQueueHelper.DisableSimulator(handle);
|
OSD item = EventQueueHelper.DisableSimulator(handle);
|
||||||
Enqueue(item, avatarID);
|
Enqueue(item, avatarID);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
|
public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
|
||||||
{
|
{
|
||||||
if (DebugLevel > 0)
|
if (DebugLevel > 0)
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
return BuildEvent("EnableSimulator", llsdBody);
|
return BuildEvent("EnableSimulator", llsdBody);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public static OSD DisableSimulator(ulong handle)
|
public static OSD DisableSimulator(ulong handle)
|
||||||
{
|
{
|
||||||
//OSDMap llsdSimInfo = new OSDMap(1);
|
//OSDMap llsdSimInfo = new OSDMap(1);
|
||||||
|
@ -105,7 +105,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
return BuildEvent("DisableSimulator", llsdBody);
|
return BuildEvent("DisableSimulator", llsdBody);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt,
|
public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt,
|
||||||
IPEndPoint newRegionExternalEndPoint,
|
IPEndPoint newRegionExternalEndPoint,
|
||||||
string capsURL, UUID agentID, UUID sessionID,
|
string capsURL, UUID agentID, UUID sessionID,
|
||||||
|
|
|
@ -843,6 +843,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
sp.Name, Scene.Name, finalDestination.RegionName);
|
sp.Name, Scene.Name, finalDestination.RegionName);
|
||||||
|
|
||||||
string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||||
|
List<ulong> childRegionsToClose = sp.GetChildAgentsToClose(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY);
|
||||||
|
if(agentCircuit.ChildrenCapSeeds != null)
|
||||||
|
{
|
||||||
|
foreach(ulong handler in childRegionsToClose)
|
||||||
|
{
|
||||||
|
agentCircuit.ChildrenCapSeeds.Remove(handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Let's create an agent there if one doesn't exist yet.
|
// Let's create an agent there if one doesn't exist yet.
|
||||||
// NOTE: logout will always be false for a non-HG teleport.
|
// NOTE: logout will always be false for a non-HG teleport.
|
||||||
|
@ -1026,7 +1034,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// TODO: This may be 0.6. Check if still needed
|
// TODO: This may be 0.6. Check if still needed
|
||||||
// For backwards compatibility
|
// For backwards compatibility
|
||||||
|
@ -1040,7 +1047,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
sp.CloseChildAgents(logout, destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY);
|
if(logout)
|
||||||
|
sp.closeAllChildAgents();
|
||||||
|
else
|
||||||
|
sp.CloseChildAgents(childRegionsToClose);
|
||||||
|
|
||||||
// call HG hook
|
// call HG hook
|
||||||
AgentHasMovedAway(sp, logout);
|
AgentHasMovedAway(sp, logout);
|
||||||
|
@ -1066,9 +1076,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// This sleep can be increased if necessary. However, whilst it's active,
|
// This sleep can be increased if necessary. However, whilst it's active,
|
||||||
// an agent cannot teleport back to this region if it has teleported away.
|
// an agent cannot teleport back to this region if it has teleported away.
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
// if (m_eqModule != null && !sp.DoNotCloseAfterTeleport)
|
|
||||||
// m_eqModule.DisableSimulator(sourceRegionHandle,sp.UUID);
|
|
||||||
Thread.Sleep(500);
|
|
||||||
sp.Scene.CloseAgent(sp.UUID, false);
|
sp.Scene.CloseAgent(sp.UUID, false);
|
||||||
}
|
}
|
||||||
sp.IsInTransit = false;
|
sp.IsInTransit = false;
|
||||||
|
@ -1078,7 +1085,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
IPEndPoint endPoint, uint teleportFlags, bool OutSideViewRange, EntityTransferContext ctx, out string reason)
|
IPEndPoint endPoint, uint teleportFlags, bool OutSideViewRange, EntityTransferContext ctx, out string reason)
|
||||||
{
|
{
|
||||||
ulong destinationHandle = finalDestination.RegionHandle;
|
ulong destinationHandle = finalDestination.RegionHandle;
|
||||||
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
|
||||||
|
List<ulong> childRegionsToClose = sp.GetChildAgentsToClose(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY);
|
||||||
|
|
||||||
|
if(agentCircuit.ChildrenCapSeeds != null)
|
||||||
|
{
|
||||||
|
foreach(ulong handler in childRegionsToClose)
|
||||||
|
{
|
||||||
|
agentCircuit.ChildrenCapSeeds.Remove(handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);;
|
string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);;
|
||||||
|
|
||||||
|
@ -1178,20 +1194,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Keeping avatar in {2}",
|
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Keeping avatar in {2}",
|
||||||
sp.Name, finalDestination.RegionName, sp.Scene.Name);
|
sp.Name, finalDestination.RegionName, sp.Scene.Name);
|
||||||
|
|
||||||
Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Connection between viewer and destination region could not be established.");
|
Fail(sp, finalDestination, logout, agentCircuit.SessionID.ToString(), "Connection between viewer and destination region could not be established.");
|
||||||
sp.IsInTransit = false;
|
sp.IsInTransit = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
// Need to signal neighbours whether child agents may need closing irrespective of whether this
|
if(logout)
|
||||||
// one needed closing. We also need to close child agents as quickly as possible to avoid complicated
|
sp.closeAllChildAgents();
|
||||||
// race conditions with rapid agent releporting (e.g. from A1 to a non-neighbour B, back
|
else
|
||||||
// to a neighbour A2 then off to a non-neighbour C). Closing child agents any later requires complex
|
sp.CloseChildAgents(childRegionsToClose);
|
||||||
// distributed checks to avoid problems in rapid reteleporting scenarios and where child agents are
|
|
||||||
// abandoned without proper close by viewer but then re-used by an incoming connection.
|
|
||||||
sp.CloseChildAgents(logout, destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY);
|
|
||||||
|
|
||||||
sp.HasMovedAway(!(OutSideViewRange || logout));
|
sp.HasMovedAway(!(OutSideViewRange || logout));
|
||||||
|
|
||||||
|
@ -1217,10 +1230,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR
|
// DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR
|
||||||
// IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS.
|
// IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS.
|
||||||
|
|
||||||
Thread.Sleep(25000);
|
Thread.Sleep(15000);
|
||||||
// if (m_eqModule != null && !sp.DoNotCloseAfterTeleport)
|
|
||||||
// m_eqModule.DisableSimulator(sourceRegionHandle,sp.UUID);
|
|
||||||
// Thread.Sleep(1000);
|
|
||||||
|
|
||||||
// OK, it got this agent. Let's close everything
|
// OK, it got this agent. Let's close everything
|
||||||
// If we shouldn't close the agent due to some other region renewing the connection
|
// If we shouldn't close the agent due to some other region renewing the connection
|
||||||
|
@ -1230,13 +1240,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
sp.Scene.CloseAgent(sp.UUID, false);
|
sp.Scene.CloseAgent(sp.UUID, false);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// now we have a child agent in this region.
|
|
||||||
sp.Reset();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
sp.IsInTransit = false;
|
sp.IsInTransit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1641,54 +1644,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
icon.EndInvoke(iar);
|
icon.EndInvoke(iar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This Closes child agents on neighbouring regions
|
|
||||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
|
||||||
/// </summary>
|
|
||||||
public ScenePresence CrossAgentToNewRegionAsync(
|
|
||||||
ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
|
|
||||||
bool isFlying, EntityTransferContext ctx)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: new region={1} at <{2},{3}>. newpos={4}",
|
|
||||||
LogHeader, neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, pos);
|
|
||||||
|
|
||||||
if (neighbourRegion == null)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: invalid destiny", LogHeader);
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
|
|
||||||
IPEndPoint endpoint = neighbourRegion.ExternalEndPoint;
|
|
||||||
if(endpoint == null)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: failed to resolve neighbour address {0} ",neighbourRegion.ExternalHostName);
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_entityTransferStateMachine.SetInTransit(agent.UUID);
|
|
||||||
agent.RemoveFromPhysicalScene();
|
|
||||||
|
|
||||||
if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying, ctx))
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader);
|
|
||||||
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
|
|
||||||
CrossAgentToNewRegionPost(agent, pos, neighbourRegion, endpoint, isFlying, ctx);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.Error(string.Format("{0}: CrossAgentToNewRegionAsync: failed with exception ", LogHeader), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CrossAgentCreateFarChild(ScenePresence agent, GridRegion neighbourRegion, Vector3 pos, EntityTransferContext ctx)
|
public bool CrossAgentCreateFarChild(ScenePresence agent, GridRegion neighbourRegion, Vector3 pos, EntityTransferContext ctx)
|
||||||
{
|
{
|
||||||
ulong regionhandler = neighbourRegion.RegionHandle;
|
ulong regionhandler = neighbourRegion.RegionHandle;
|
||||||
|
@ -1728,50 +1683,99 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.DebugFormat("CrossAgentCreateFarChild failed to resolve neighbour address {0}", neighbourRegion.ExternalHostName);
|
m_log.DebugFormat("CrossAgentCreateFarChild failed to resolve neighbour address {0}", neighbourRegion.ExternalHostName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason))
|
if (!Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason))
|
||||||
{
|
{
|
||||||
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
agent.RemoveNeighbourRegion(regionhandler);
|
||||||
int newSizeX = neighbourRegion.RegionSizeX;
|
return false;
|
||||||
int newSizeY = neighbourRegion.RegionSizeY;
|
|
||||||
|
|
||||||
if (m_eqModule != null)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " +
|
|
||||||
"and EstablishAgentCommunication with seed cap {8}", LogHeader,
|
|
||||||
source.RegionName, agent.Name,
|
|
||||||
neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, newSizeX, newSizeY , capsPath);
|
|
||||||
|
|
||||||
m_eqModule.EnableSimulator(regionhandler,
|
|
||||||
endPoint, agent.UUID, newSizeX, newSizeY);
|
|
||||||
m_eqModule.EstablishAgentCommunication(agent.UUID, endPoint, capsPath,
|
|
||||||
regionhandler, newSizeX, newSizeY);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
agent.ControllingClient.InformClientOfNeighbour(regionhandler, endPoint);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
agent.RemoveNeighbourRegion(regionhandler);
|
|
||||||
return false;
|
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||||
|
int newSizeX = neighbourRegion.RegionSizeX;
|
||||||
|
int newSizeY = neighbourRegion.RegionSizeY;
|
||||||
|
|
||||||
|
if (m_eqModule != null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " +
|
||||||
|
"and EstablishAgentCommunication with seed cap {8}", LogHeader,
|
||||||
|
source.RegionName, agent.Name,
|
||||||
|
neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, newSizeX, newSizeY , capsPath);
|
||||||
|
|
||||||
|
m_eqModule.EnableSimulator(regionhandler,
|
||||||
|
endPoint, agent.UUID, newSizeX, newSizeY);
|
||||||
|
m_eqModule.EstablishAgentCommunication(agent.UUID, endPoint, capsPath,
|
||||||
|
regionhandler, newSizeX, newSizeY);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
agent.ControllingClient.InformClientOfNeighbour(regionhandler, endPoint);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx)
|
/// <summary>
|
||||||
|
/// This Closes child agents on neighbouring regions
|
||||||
|
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||||
|
/// </summary>
|
||||||
|
public ScenePresence CrossAgentToNewRegionAsync(
|
||||||
|
ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
|
||||||
|
bool isFlying, EntityTransferContext ctx)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: new region={1} at <{2},{3}>. newpos={4}",
|
||||||
|
LogHeader, neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, pos);
|
||||||
|
|
||||||
|
if (neighbourRegion == null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: invalid destiny", LogHeader);
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
IPEndPoint endpoint = neighbourRegion.ExternalEndPoint;
|
||||||
|
if(endpoint == null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: failed to resolve neighbour address {0} ",neighbourRegion.ExternalHostName);
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_entityTransferStateMachine.SetInTransit(agent.UUID);
|
||||||
|
agent.RemoveFromPhysicalScene();
|
||||||
|
|
||||||
|
if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, endpoint, isFlying, ctx))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader);
|
||||||
|
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.Error(string.Format("{0}: CrossAgentToNewRegionAsync: failed with exception ", LogHeader), e);
|
||||||
|
}
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
|
||||||
|
IPEndPoint endpoint, bool isFlying, EntityTransferContext ctx)
|
||||||
{
|
{
|
||||||
int ts = Util.EnvironmentTickCount();
|
int ts = Util.EnvironmentTickCount();
|
||||||
bool sucess = true;
|
bool sucess = true;
|
||||||
string reason = String.Empty;
|
string reason = String.Empty;
|
||||||
|
List<ulong> childRegionsToClose = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
AgentData cAgent = new AgentData();
|
AgentData cAgent = new AgentData();
|
||||||
agent.CopyTo(cAgent,true);
|
agent.CopyTo(cAgent,true);
|
||||||
|
|
||||||
// agent.Appearance.WearableCacheItems = null;
|
|
||||||
|
|
||||||
cAgent.Position = pos;
|
cAgent.Position = pos;
|
||||||
cAgent.ChildrenCapSeeds = agent.KnownRegions;
|
cAgent.ChildrenCapSeeds = agent.KnownRegions;
|
||||||
|
|
||||||
|
childRegionsToClose = agent.GetChildAgentsToClose(neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
|
||||||
|
if(cAgent.ChildrenCapSeeds != null)
|
||||||
|
{
|
||||||
|
foreach(ulong regh in childRegionsToClose)
|
||||||
|
cAgent.ChildrenCapSeeds.Remove(regh);
|
||||||
|
}
|
||||||
|
|
||||||
if (isFlying)
|
if (isFlying)
|
||||||
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
||||||
|
|
||||||
|
@ -1806,7 +1810,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[CrossAgentIntoNewRegionMain] ok, time {0}ms",Util.EnvironmentTickCountSubtract(ts));
|
m_log.DebugFormat("[CrossAgentIntoNewRegionMain] ok, time {0}ms",Util.EnvironmentTickCountSubtract(ts));
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1818,19 +1821,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
|
|
||||||
IPEndPoint endpoint, bool isFlying, EntityTransferContext ctx)
|
|
||||||
{
|
|
||||||
|
|
||||||
string agentcaps;
|
string agentcaps;
|
||||||
if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
|
if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.",
|
m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.",
|
||||||
neighbourRegion.RegionHandle);
|
neighbourRegion.RegionHandle);
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No turning back
|
// No turning back
|
||||||
|
@ -1865,7 +1861,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// Unlike a teleport, here we do not wait for the destination region to confirm the receipt.
|
// Unlike a teleport, here we do not wait for the destination region to confirm the receipt.
|
||||||
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
|
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
agent.CloseChildAgents(false, neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
|
if(childRegionsToClose != null)
|
||||||
|
agent.CloseChildAgents(childRegionsToClose);
|
||||||
|
|
||||||
// this may need the attachments
|
// this may need the attachments
|
||||||
|
|
||||||
|
@ -1877,20 +1874,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// but not sure yet what the side effects would be.
|
// but not sure yet what the side effects would be.
|
||||||
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
||||||
|
|
||||||
// the user may change their profile information in other region,
|
return true;
|
||||||
// so the userinfo in UserProfileCache is not reliable any more, delete it
|
|
||||||
// REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
|
|
||||||
// if (agent.Scene.NeedSceneCacheClear(agent.UUID))
|
|
||||||
// {
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//m_log.Debug("AFTER CROSS");
|
|
||||||
//Scene.DumpChildrenSeeds(UUID);
|
|
||||||
//DumpKnownRegions();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CrossAgentToNewRegionCompleted(IAsyncResult iar)
|
private void CrossAgentToNewRegionCompleted(IAsyncResult iar)
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
bool Enqueue(OSD o, UUID avatarID);
|
bool Enqueue(OSD o, UUID avatarID);
|
||||||
|
|
||||||
// These are required to decouple Scenes from EventQueueHelper
|
// These are required to decouple Scenes from EventQueueHelper
|
||||||
void DisableSimulator(ulong handle, UUID avatarID);
|
// void DisableSimulator(ulong handle, UUID avatarID);
|
||||||
void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY);
|
void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY);
|
||||||
void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint,
|
void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint,
|
||||||
string capsPath, ulong regionHandle, int regionSizeX, int regionSizeY);
|
string capsPath, ulong regionHandle, int regionSizeX, int regionSizeY);
|
||||||
|
|
|
@ -618,13 +618,147 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
int rnditerations = 3;
|
int rnditerations = 3;
|
||||||
BinBVHAnimation anim = new BinBVHAnimation();
|
BinBVHAnimation anim = new BinBVHAnimation();
|
||||||
List<string> parts = new List<string>();
|
List<string> parts = new List<string>();
|
||||||
parts.Add("mPelvis"); parts.Add("mHead"); parts.Add("mTorso");
|
|
||||||
parts.Add("mHipLeft"); parts.Add("mHipRight"); parts.Add("mHipLeft"); parts.Add("mKneeLeft");
|
/// Torso and Head
|
||||||
parts.Add("mKneeRight"); parts.Add("mCollarLeft"); parts.Add("mCollarRight"); parts.Add("mNeck");
|
parts.Add("mPelvis");
|
||||||
parts.Add("mElbowLeft"); parts.Add("mElbowRight"); parts.Add("mWristLeft"); parts.Add("mWristRight");
|
parts.Add("mTorso");
|
||||||
parts.Add("mShoulderLeft"); parts.Add("mShoulderRight"); parts.Add("mAnkleLeft"); parts.Add("mAnkleRight");
|
parts.Add("mChest");
|
||||||
parts.Add("mEyeRight"); parts.Add("mChest"); parts.Add("mToeLeft"); parts.Add("mToeRight");
|
parts.Add("mNeck");
|
||||||
parts.Add("mFootLeft"); parts.Add("mFootRight"); parts.Add("mEyeLeft");
|
parts.Add("mHead");
|
||||||
|
parts.Add("mSkull");
|
||||||
|
parts.Add("mEyeRight");
|
||||||
|
parts.Add("mEyeLeft");
|
||||||
|
/// Arms
|
||||||
|
parts.Add("mCollarLeft");
|
||||||
|
parts.Add("mShoulderLeft");
|
||||||
|
parts.Add("mElbowLeft");
|
||||||
|
parts.Add("mWristLeft");
|
||||||
|
parts.Add("mCollarRight");
|
||||||
|
parts.Add("mShoulderRight");
|
||||||
|
parts.Add("mElbowRight");
|
||||||
|
parts.Add("mWristRight");
|
||||||
|
/// Legs
|
||||||
|
parts.Add("mHipLeft");
|
||||||
|
parts.Add("mKneeLeft");
|
||||||
|
parts.Add("mAnkleLeft");
|
||||||
|
parts.Add("mFootLeft");
|
||||||
|
parts.Add("mToeLeft");
|
||||||
|
parts.Add("mHipRight");
|
||||||
|
parts.Add("mKneeRight");
|
||||||
|
parts.Add("mAnkleRight");
|
||||||
|
parts.Add("mFootRight");
|
||||||
|
parts.Add("mToeRight");
|
||||||
|
///Hands
|
||||||
|
parts.Add("mHandThumb1Left");
|
||||||
|
parts.Add("mHandThumb1Right");
|
||||||
|
parts.Add("mHandThumb2Left");
|
||||||
|
parts.Add("mHandThumb2Right");
|
||||||
|
parts.Add("mHandThumb3Left");
|
||||||
|
parts.Add("mHandThumb3Right");
|
||||||
|
parts.Add("mHandIndex1Left");
|
||||||
|
parts.Add("mHandIndex1Right");
|
||||||
|
parts.Add("mHandIndex2Left");
|
||||||
|
parts.Add("mHandIndex2Right");
|
||||||
|
parts.Add("mHandIndex3Left");
|
||||||
|
parts.Add("mHandIndex3Right");
|
||||||
|
parts.Add("mHandMiddle1Left");
|
||||||
|
parts.Add("mHandMiddle1Right");
|
||||||
|
parts.Add("mHandMiddle2Left");
|
||||||
|
parts.Add("mHandMiddle2Right");
|
||||||
|
parts.Add("mHandMiddle3Left");
|
||||||
|
parts.Add("mHandMiddle3Right");
|
||||||
|
parts.Add("mHandRing1Left");
|
||||||
|
parts.Add("mHandRing1Right");
|
||||||
|
parts.Add("mHandRing2Left");
|
||||||
|
parts.Add("mHandRing2Right");
|
||||||
|
parts.Add("mHandRing3Left");
|
||||||
|
parts.Add("mHandRing3Right");
|
||||||
|
parts.Add("mHandPinky1Left");
|
||||||
|
parts.Add("mHandPinky1Right");
|
||||||
|
parts.Add("mHandPinky2Left");
|
||||||
|
parts.Add("mHandPinky2Right");
|
||||||
|
parts.Add("mHandPinky3Left");
|
||||||
|
parts.Add("mHandPinky3Right");
|
||||||
|
///Face
|
||||||
|
parts.Add("mFaceForeheadLeft");
|
||||||
|
parts.Add("mFaceForeheadCenter");
|
||||||
|
parts.Add("mFaceForeheadRight");
|
||||||
|
parts.Add("mFaceEyebrowOuterLeft");
|
||||||
|
parts.Add("mFaceEyebrowCenterLeft");
|
||||||
|
parts.Add("mFaceEyebrowInnerLeft");
|
||||||
|
parts.Add("mFaceEyebrowOuterRight");
|
||||||
|
parts.Add("mFaceEyebrowCenterRight");
|
||||||
|
parts.Add("mFaceEyebrowInnerRight");
|
||||||
|
parts.Add("mFaceEyeLidUpperLeft");
|
||||||
|
parts.Add("mFaceEyeLidLowerLeft");
|
||||||
|
parts.Add("mFaceEyeLidUpperRight");
|
||||||
|
parts.Add("mFaceEyeLidLowerRight");
|
||||||
|
parts.Add("mFaceEyeAltLeft");
|
||||||
|
parts.Add("mFaceEyeAltRight");
|
||||||
|
parts.Add("mFaceEyecornerInnerLeft");
|
||||||
|
parts.Add("mFaceEyecornerInnerRight");
|
||||||
|
parts.Add("mFaceEar1Left");
|
||||||
|
parts.Add("mFaceEar2Left");
|
||||||
|
parts.Add("mFaceEar1Right");
|
||||||
|
parts.Add("mFaceEar2Right");
|
||||||
|
parts.Add("mFaceNoseLeft");
|
||||||
|
parts.Add("mFaceNoseCenter");
|
||||||
|
parts.Add("mFaceNoseRight");
|
||||||
|
parts.Add("mFaceNoseBase");
|
||||||
|
parts.Add("mFaceNoseBridge");
|
||||||
|
parts.Add("mFaceCheekUpperInnerLeft");
|
||||||
|
parts.Add("mFaceCheekUpperOuterLeft");
|
||||||
|
parts.Add("mFaceCheekUpperInnerRight");
|
||||||
|
parts.Add("mFaceCheekUpperOuterRight");
|
||||||
|
parts.Add("mFaceJaw");
|
||||||
|
parts.Add("mFaceLipUpperLeft");
|
||||||
|
parts.Add("mFaceLipUpperCenter");
|
||||||
|
parts.Add("mFaceLipUpperRight");
|
||||||
|
parts.Add("mFaceLipCornerLeft");
|
||||||
|
parts.Add("mFaceLipCornerRight");
|
||||||
|
parts.Add("mFaceTongueBase");
|
||||||
|
parts.Add("mFaceTongueTip");
|
||||||
|
parts.Add("mFaceLipLowerLeft");
|
||||||
|
parts.Add("mFaceLipLowerCenter");
|
||||||
|
parts.Add("mFaceLipLowerRight");
|
||||||
|
parts.Add("mFaceTeethLower");
|
||||||
|
parts.Add("mFaceTeethUpper");
|
||||||
|
parts.Add("mFaceChin");
|
||||||
|
///Spine
|
||||||
|
parts.Add("mSpine1");
|
||||||
|
parts.Add("mSpine2");
|
||||||
|
parts.Add("mSpine3");
|
||||||
|
parts.Add("mSpine4");
|
||||||
|
///Wings
|
||||||
|
parts.Add("mWingsRoot");
|
||||||
|
parts.Add("mWing1Left");
|
||||||
|
parts.Add("mWing2Left");
|
||||||
|
parts.Add("mWing3Left");
|
||||||
|
parts.Add("mWing4Left");
|
||||||
|
parts.Add("mWing1Right");
|
||||||
|
parts.Add("mWing2Right");
|
||||||
|
parts.Add("mWing3Right");
|
||||||
|
parts.Add("mWing4Right");
|
||||||
|
parts.Add("mWing4FanRight");
|
||||||
|
parts.Add("mWing4FanLeft");
|
||||||
|
///Hind Limbs
|
||||||
|
parts.Add("mHindLimbsRoot");
|
||||||
|
parts.Add("mHindLimb1Left");
|
||||||
|
parts.Add("mHindLimb2Left");
|
||||||
|
parts.Add("mHindLimb3Left");
|
||||||
|
parts.Add("mHindLimb4Left");
|
||||||
|
parts.Add("mHindLimb1Right");
|
||||||
|
parts.Add("mHindLimb2Right");
|
||||||
|
parts.Add("mHindLimb3Right");
|
||||||
|
parts.Add("mHindLimb4Right");
|
||||||
|
///Tail
|
||||||
|
parts.Add("mTail1");
|
||||||
|
parts.Add("mTail2");
|
||||||
|
parts.Add("mTail3");
|
||||||
|
parts.Add("mTail4");
|
||||||
|
parts.Add("mTail5");
|
||||||
|
parts.Add("mTail6");
|
||||||
|
|
||||||
anim.HandPose = 1;
|
anim.HandPose = 1;
|
||||||
anim.InPoint = 0;
|
anim.InPoint = 0;
|
||||||
anim.OutPoint = (rnditerations * .10f);
|
anim.OutPoint = (rnditerations * .10f);
|
||||||
|
|
|
@ -1884,7 +1884,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new List<ulong>(KnownRegions.Keys);
|
lock (m_knownChildRegions)
|
||||||
|
return new List<ulong>(m_knownChildRegions.Keys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4407,26 +4408,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* useless. Either use MakeChild or delete the presence
|
|
||||||
public void Reset()
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName);
|
|
||||||
|
|
||||||
// Put the child agent back at the center
|
|
||||||
AbsolutePosition
|
|
||||||
= new Vector3(((float)m_scene.RegionInfo.RegionSizeX * 0.5f), ((float)m_scene.RegionInfo.RegionSizeY * 0.5f), 70);
|
|
||||||
|
|
||||||
Animator.ResetAnimations();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Computes which child agents to close when the scene presence moves to another region.
|
/// Computes which child agents to close when the scene presence moves to another region.
|
||||||
/// Removes those regions from m_knownRegions.
|
/// Removes those regions from m_knownRegions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newRegionX">The new region's x on the map</param>
|
/// <param name="newRegionHandle">The new region's handle</param>
|
||||||
/// <param name="newRegionY">The new region's y on the map</param>
|
/// <param name="newRegionSizeX">The new region's size x</param>
|
||||||
|
/// <param name="newRegionSizeY">The new region's size y</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public void CloseChildAgents(bool logout, ulong newRegionHandle, int newRegionSizeX, int newRegionSizeY)
|
public List<ulong> GetChildAgentsToClose(ulong newRegionHandle, int newRegionSizeX, int newRegionSizeY)
|
||||||
{
|
{
|
||||||
uint newRegionX, newRegionY;
|
uint newRegionX, newRegionY;
|
||||||
List<ulong> byebyeRegions = new List<ulong>();
|
List<ulong> byebyeRegions = new List<ulong>();
|
||||||
|
@ -4442,37 +4432,37 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
foreach (ulong handle in knownRegions)
|
foreach (ulong handle in knownRegions)
|
||||||
{
|
{
|
||||||
// Don't close the agent on this region yet
|
if(newRegionY == 0) // HG
|
||||||
if (handle != Scene.RegionInfo.RegionHandle)
|
byebyeRegions.Add(handle);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (logout)
|
Util.RegionHandleToRegionLoc(handle, out x, out y);
|
||||||
byebyeRegions.Add(handle);
|
if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo))
|
||||||
|
{
|
||||||
|
// if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
|
||||||
|
// for now need to close all but first order bc RegionViewDistance it the target value not ours
|
||||||
|
if (Util.IsOutsideView(255, x, newRegionX, y, newRegionY,
|
||||||
|
regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY))
|
||||||
|
{
|
||||||
|
byebyeRegions.Add(handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Util.RegionHandleToRegionLoc(handle, out x, out y);
|
if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
|
||||||
if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo))
|
(int)Constants.RegionSize, (int)Constants.RegionSize, newRegionSizeX, newRegionSizeY))
|
||||||
{
|
{
|
||||||
if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
|
byebyeRegions.Add(handle);
|
||||||
regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY))
|
|
||||||
{
|
|
||||||
byebyeRegions.Add(handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
|
|
||||||
(int)Constants.RegionSize, (int)Constants.RegionSize, newRegionSizeX, newRegionSizeY))
|
|
||||||
{
|
|
||||||
byebyeRegions.Add(handle);
|
|
||||||
// this should not be here
|
|
||||||
// if(eventQueue != null)
|
|
||||||
// eventQueue.DisableSimulator(handle,UUID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return byebyeRegions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CloseChildAgents(List<ulong> byebyeRegions)
|
||||||
|
{
|
||||||
|
byebyeRegions.Remove(Scene.RegionInfo.RegionHandle);
|
||||||
if (byebyeRegions.Count > 0)
|
if (byebyeRegions.Count > 0)
|
||||||
{
|
{
|
||||||
m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
|
m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
|
||||||
|
|
|
@ -108,12 +108,12 @@ namespace OpenSim.Tests.Common
|
||||||
AddEvent(avatarID, "Enqueue", o);
|
AddEvent(avatarID, "Enqueue", o);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public void DisableSimulator(ulong handle, UUID avatarID)
|
public void DisableSimulator(ulong handle, UUID avatarID)
|
||||||
{
|
{
|
||||||
AddEvent(avatarID, "DisableSimulator", handle);
|
AddEvent(avatarID, "DisableSimulator", handle);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
|
public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
|
||||||
{
|
{
|
||||||
AddEvent(avatarID, "EnableSimulator", handle);
|
AddEvent(avatarID, "EnableSimulator", handle);
|
||||||
|
|
Loading…
Reference in New Issue