a few more changes to tp home
parent
796a8efe25
commit
cc19957e0a
|
@ -1394,30 +1394,42 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
public virtual bool TeleportHome(UUID id, IClientAPI client)
|
public virtual bool TeleportHome(UUID id, IClientAPI client)
|
||||||
{
|
{
|
||||||
bool isSame = false;
|
bool notsame = false;
|
||||||
if (client != null && id == client.AgentId)
|
if (client == null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Request to teleport {0} home", id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (id == client.AgentId)
|
||||||
{
|
{
|
||||||
isSame = true;
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, id);
|
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
notsame = true;
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: Request to teleport {0} home by {1} {2}", id, client.Name, client.AgentId);
|
"[ENTITY TRANSFER MODULE]: Request to teleport {0} home by {1} {2}", id, client.Name, client.AgentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(id);
|
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(id);
|
||||||
if (sp == null || sp.IsDeleted || sp.IsChildAgent || sp.ControllingClient == null || !sp.ControllingClient.IsActive)
|
if (sp == null || sp.IsDeleted || sp.IsChildAgent || sp.ControllingClient == null || !sp.ControllingClient.IsActive)
|
||||||
{
|
{
|
||||||
if (isSame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Internal error, agent presence not found");
|
client.SendAlertMessage("TeleportHome: Agent not found in the scene");
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IClientAPI targetClient = sp.ControllingClient;
|
||||||
if (sp.IsInTransit)
|
if (sp.IsInTransit)
|
||||||
{
|
{
|
||||||
if (isSame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Already processing a teleport");
|
client.SendAlertMessage("TeleportHome: Agent already processing a teleport");
|
||||||
|
targetClient.SendTeleportFailed("Already processing a teleport");
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent still in teleport");
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent still in teleport");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1427,8 +1439,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if(uinfo == null)
|
if(uinfo == null)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] Griduser info not found for {1}. Cannot send home.", id);
|
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] Griduser info not found for {1}. Cannot send home.", id);
|
||||||
if (isSame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Your home region could not be found.");
|
client.SendAlertMessage("TeleportHome: Agent home region not found");
|
||||||
|
targetClient.SendTeleportFailed("Your home region not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1436,8 +1449,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
// can't find the Home region: Tell viewer and abort
|
// can't find the Home region: Tell viewer and abort
|
||||||
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] no home set {0}", id);
|
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] no home set {0}", id);
|
||||||
if (isSame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("home position set not");
|
client.SendAlertMessage("TeleportHome: Agent home not set");
|
||||||
|
targetClient.SendTeleportFailed("Home set not");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1446,8 +1460,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
// can't find the Home region: Tell viewer and abort
|
// can't find the Home region: Tell viewer and abort
|
||||||
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] {0} home region {1} not found", id, uinfo.HomeRegionID);
|
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] {0} home region {1} not found", id, uinfo.HomeRegionID);
|
||||||
if (isSame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Your home region could not be found.");
|
client.SendAlertMessage("TeleportHome: Agent home region not found");
|
||||||
|
targetClient.SendTeleportFailed("Home region not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -442,48 +442,70 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (uMan != null && uMan.IsLocalGridUser(id))
|
if (uMan != null && uMan.IsLocalGridUser(id))
|
||||||
{
|
{
|
||||||
// local grid user
|
// local grid user
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
|
|
||||||
return base.TeleportHome(id, client);
|
return base.TeleportHome(id, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool issame = false;
|
bool notsame = false;
|
||||||
if (client != null && id == client.AgentId)
|
if (client == null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[HG ENTITY TRANSFER MODULE]: Request to teleport {0} home", id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (id == client.AgentId)
|
||||||
{
|
{
|
||||||
issame = true;
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, id);
|
"[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
notsame = true;
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[HG ENTITY TRANSFER MODULE]: Request to teleport {0} home by {1} {2}", id, client.Name, client.AgentId);
|
"[HG ENTITY TRANSFER MODULE]: Request to teleport {0} home by {1} {2}", id, client.Name, client.AgentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(id);
|
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(id);
|
||||||
if (sp == null || sp.IsDeleted || sp.IsChildAgent || sp.ControllingClient == null || !sp.ControllingClient.IsActive)
|
if (sp == null || sp.IsDeleted || sp.IsChildAgent || sp.ControllingClient == null || !sp.ControllingClient.IsActive)
|
||||||
{
|
{
|
||||||
if (issame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Internal error, agent presence not found");
|
client.SendAlertMessage("TeleportHome: Agent not found in the scene");
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene");
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IClientAPI targetClient = sp.ControllingClient;
|
||||||
|
|
||||||
if (sp.IsInTransit)
|
if (sp.IsInTransit)
|
||||||
{
|
{
|
||||||
if (issame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Already processing a teleport");
|
client.SendAlertMessage("TeleportHome: Agent already processing a teleport");
|
||||||
|
targetClient.SendTeleportFailed("Already processing a teleport");
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent still in teleport");
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent still in teleport");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Foreign user wants to go home
|
// Foreign user wants to go home
|
||||||
//
|
//
|
||||||
AgentCircuitData aCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
AgentCircuitData aCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(targetClient.CircuitCode);
|
||||||
if (aCircuit == null || !aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
if (aCircuit == null)
|
||||||
{
|
{
|
||||||
if (issame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Agent Home information has been lost");
|
client.SendAlertMessage("TeleportHome: Agent information not found");
|
||||||
|
targetClient.SendTeleportFailed("Home information not found");
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
|
{
|
||||||
|
if (notsame)
|
||||||
|
client.SendAlertMessage("TeleportHome: Agent home not set");
|
||||||
|
targetClient.SendTeleportFailed("Home not set");
|
||||||
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent home not set");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
string homeURI = aCircuit.ServiceURLs["HomeURI"].ToString();
|
string homeURI = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||||
|
|
||||||
IUserAgentService userAgentService = new UserAgentServiceConnector(homeURI);
|
IUserAgentService userAgentService = new UserAgentServiceConnector(homeURI);
|
||||||
|
@ -501,20 +523,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
if (finalDestination == null)
|
if (finalDestination == null)
|
||||||
{
|
{
|
||||||
if (issame)
|
if (notsame)
|
||||||
client.SendTeleportFailed("Home region could not be found");
|
client.SendAlertMessage("TeleportHome: Agent Home region not found");
|
||||||
|
targetClient.SendTeleportFailed("Home region not found");
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp.IsDeleted || sp.IsChildAgent || sp.IsInTransit)
|
|
||||||
{
|
|
||||||
if (issame)
|
|
||||||
client.SendTeleportFailed("Agent lost or started other tp");
|
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent lost or started other tp");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
GridRegion homeGatekeeper = MakeGateKeeperRegion(homeURI);
|
GridRegion homeGatekeeper = MakeGateKeeperRegion(homeURI);
|
||||||
|
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
|
||||||
|
|
Loading…
Reference in New Issue