Merge branch 'master' into careminster

avinationmerge
Melanie 2012-03-27 20:03:41 +01:00
commit a619621c60
3 changed files with 37 additions and 3 deletions

View File

@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
sp.Name, finalDestination.RegionName);
Fail(sp, finalDestination);
Fail(sp, finalDestination, logout);
return;
}
@ -480,7 +480,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.",
sp.Name, finalDestination.RegionName);
Fail(sp, finalDestination);
Fail(sp, finalDestination, logout);
return;
}
@ -531,7 +531,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
private void Fail(ScenePresence sp, GridRegion finalDestination)
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
{
// Client never contacted destination. Let's restore everything back
sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");

View File

@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
private bool m_Initialized = false;
private bool m_RestrictInventoryAccessAbroad = false;
private GatekeeperServiceConnector m_GatekeeperConnector;
#region ISharedRegionModule
@ -68,6 +70,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (name == Name)
{
InitialiseCommon(source);
IConfig transferConfig = source.Configs["HGEntityTransfer"];
if (transferConfig != null)
m_RestrictInventoryAccessAbroad = transferConfig.GetBoolean("RestrictInventoryAccessAbroad", false);
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
}
}
@ -170,6 +176,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
logout = success; // flag for later logout from this grid; this is an HG TP
if (success && m_RestrictInventoryAccessAbroad)
{
// TODO tell the viewer to remove the root folder
}
return success;
}
else
@ -288,6 +299,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
protected override void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
{
base.Fail(sp, finalDestination, logout);
if (logout && m_RestrictInventoryAccessAbroad)
{
// Restore the user's inventory, because we removed it earlier on
InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(sp.UUID);
if (root != null)
{
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring");
sp.ControllingClient.SendBulkUpdateInventory(root);
}
}
}
#endregion
#region IUserAgentVerificationModule

View File

@ -2800,6 +2800,14 @@ namespace OpenSim.Region.Framework.Scenes
// Cache the user's name
CacheUserName(sp, aCircuit);
// Let's send the Suitcase folder for incoming HG agents
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
{
m_log.DebugFormat("[SCENE]: Sending root folder to viewer...");
InventoryFolderBase suitcase = InventoryService.GetRootFolder(client.AgentId);
client.SendBulkUpdateInventory(suitcase);
}
EventManager.TriggerOnNewClient(client);
if (vialogin)
{