HG: beginning of a more restrictive inventory access procedure (optional). Experimental: we'll try switching the root folder from under the viewer.
parent
79d1d3ca55
commit
89ee03a24d
|
@ -467,7 +467,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
|
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
|
||||||
sp.Name, finalDestination.RegionName);
|
sp.Name, finalDestination.RegionName);
|
||||||
|
|
||||||
Fail(sp, finalDestination);
|
Fail(sp, finalDestination, logout);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +499,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.",
|
"[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);
|
sp.Name, finalDestination.RegionName);
|
||||||
|
|
||||||
Fail(sp, finalDestination);
|
Fail(sp, finalDestination, logout);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,7 +550,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
|
// Client never contacted destination. Let's restore everything back
|
||||||
sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
|
sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
|
||||||
|
|
|
@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
private bool m_Initialized = false;
|
private bool m_Initialized = false;
|
||||||
|
|
||||||
|
private bool m_RestrictInventoryAccessAbroad = false;
|
||||||
|
|
||||||
private GatekeeperServiceConnector m_GatekeeperConnector;
|
private GatekeeperServiceConnector m_GatekeeperConnector;
|
||||||
|
|
||||||
#region ISharedRegionModule
|
#region ISharedRegionModule
|
||||||
|
@ -68,6 +70,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
{
|
||||||
InitialiseCommon(source);
|
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);
|
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);
|
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
|
||||||
logout = success; // flag for later logout from this grid; this is an HG TP
|
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;
|
return success;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -284,6 +295,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
|
#endregion
|
||||||
|
|
||||||
#region IUserAgentVerificationModule
|
#region IUserAgentVerificationModule
|
||||||
|
|
|
@ -2664,6 +2664,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Cache the user's name
|
// Cache the user's name
|
||||||
CacheUserName(sp, aCircuit);
|
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);
|
EventManager.TriggerOnNewClient(client);
|
||||||
if (vialogin)
|
if (vialogin)
|
||||||
EventManager.TriggerOnClientLogin(client);
|
EventManager.TriggerOnClientLogin(client);
|
||||||
|
|
Loading…
Reference in New Issue