Addresses mantis #4929. Agent was being logged off the grid too soon -- things may still fail.
parent
c1a20c8567
commit
7421708ba1
|
@ -307,7 +307,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
string reason = String.Empty;
|
string reason = String.Empty;
|
||||||
|
|
||||||
// Let's create an agent there if one doesn't exist yet.
|
// Let's create an agent there if one doesn't exist yet.
|
||||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason))
|
bool logout = false;
|
||||||
|
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
||||||
{
|
{
|
||||||
sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
|
sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
|
||||||
reason));
|
reason));
|
||||||
|
@ -434,8 +435,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
|
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
|
||||||
CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
|
CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
|
||||||
|
|
||||||
|
// Well, this is it. The agent is over there.
|
||||||
|
|
||||||
KillEntity(sp.Scene, sp.LocalId);
|
KillEntity(sp.Scene, sp.LocalId);
|
||||||
|
|
||||||
|
// May need to logout or other cleanup
|
||||||
|
AgentHasMovedAway(sp.ControllingClient.SessionId, logout);
|
||||||
|
|
||||||
// Now let's make it officially a child agent
|
// Now let's make it officially a child agent
|
||||||
sp.MakeChildAgent();
|
sp.MakeChildAgent();
|
||||||
|
|
||||||
|
@ -483,8 +489,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
||||||
{
|
{
|
||||||
|
logout = false;
|
||||||
return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
|
return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,6 +507,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void AgentHasMovedAway(UUID sessionID, bool logout)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
protected void KillEntity(Scene scene, uint localID)
|
protected void KillEntity(Scene scene, uint localID)
|
||||||
{
|
{
|
||||||
scene.SendKillObject(localID);
|
scene.SendKillObject(localID);
|
||||||
|
|
|
@ -140,9 +140,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
protected override void AgentHasMovedAway(UUID sessionID, bool logout)
|
||||||
|
{
|
||||||
|
if (logout)
|
||||||
|
// Log them out of this grid
|
||||||
|
m_aScene.PresenceService.LogoutAgent(sessionID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
logout = false;
|
||||||
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
|
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
|
||||||
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
||||||
{
|
{
|
||||||
|
@ -152,9 +160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
|
string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
|
||||||
IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver);
|
IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver);
|
||||||
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
|
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
|
||||||
if (success)
|
logout = success;
|
||||||
// Log them out of this grid
|
|
||||||
m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID);
|
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue