diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 26 |
2 files changed, 42 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index f6e4dbf..2d73594 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -304,6 +304,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
304 | return; | 304 | return; |
305 | } | 305 | } |
306 | 306 | ||
307 | if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this. | ||
308 | return; | ||
309 | |||
307 | m_log.DebugFormat( | 310 | m_log.DebugFormat( |
308 | "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}", | 311 | "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}", |
309 | reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); | 312 | reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); |
@@ -444,7 +447,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
444 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.", | 447 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.", |
445 | sp.Name, finalDestination.RegionName); | 448 | sp.Name, finalDestination.RegionName); |
446 | 449 | ||
447 | Fail(sp, finalDestination); | 450 | Fail(sp, finalDestination, logout); |
448 | return; | 451 | return; |
449 | } | 452 | } |
450 | 453 | ||
@@ -476,7 +479,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
476 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", | 479 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", |
477 | sp.Name, finalDestination.RegionName); | 480 | sp.Name, finalDestination.RegionName); |
478 | 481 | ||
479 | Fail(sp, finalDestination); | 482 | Fail(sp, finalDestination, logout); |
480 | return; | 483 | return; |
481 | } | 484 | } |
482 | 485 | ||
@@ -527,7 +530,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
527 | } | 530 | } |
528 | } | 531 | } |
529 | 532 | ||
530 | private void Fail(ScenePresence sp, GridRegion finalDestination) | 533 | protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) |
531 | { | 534 | { |
532 | // Client never contacted destination. Let's restore everything back | 535 | // Client never contacted destination. Let's restore everything back |
533 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); | 536 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); |
@@ -1861,6 +1864,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1861 | } | 1864 | } |
1862 | } | 1865 | } |
1863 | 1866 | ||
1867 | protected bool IsInTransit(UUID id) | ||
1868 | { | ||
1869 | lock (m_agentsInTransit) | ||
1870 | { | ||
1871 | if (m_agentsInTransit.Contains(id)) | ||
1872 | return true; | ||
1873 | } | ||
1874 | return false; | ||
1875 | } | ||
1876 | |||
1864 | protected bool ResetFromTransit(UUID id) | 1877 | protected bool ResetFromTransit(UUID id) |
1865 | { | 1878 | { |
1866 | lock (m_agentsInTransit) | 1879 | lock (m_agentsInTransit) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 38a7805..b277095 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
50 | 50 | ||
51 | private bool m_Initialized = false; | 51 | private bool m_Initialized = false; |
52 | 52 | ||
53 | private bool m_RestrictInventoryAccessAbroad = false; | ||
54 | |||
53 | private GatekeeperServiceConnector m_GatekeeperConnector; | 55 | private GatekeeperServiceConnector m_GatekeeperConnector; |
54 | 56 | ||
55 | #region ISharedRegionModule | 57 | #region ISharedRegionModule |
@@ -68,6 +70,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
68 | if (name == Name) | 70 | if (name == Name) |
69 | { | 71 | { |
70 | InitialiseCommon(source); | 72 | InitialiseCommon(source); |
73 | IConfig transferConfig = source.Configs["HGEntityTransfer"]; | ||
74 | if (transferConfig != null) | ||
75 | m_RestrictInventoryAccessAbroad = transferConfig.GetBoolean("RestrictInventoryAccessAbroad", false); | ||
76 | |||
71 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); | 77 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); |
72 | } | 78 | } |
73 | } | 79 | } |
@@ -170,6 +176,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
170 | bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); | 176 | bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); |
171 | logout = success; // flag for later logout from this grid; this is an HG TP | 177 | logout = success; // flag for later logout from this grid; this is an HG TP |
172 | 178 | ||
179 | if (success && m_RestrictInventoryAccessAbroad) | ||
180 | { | ||
181 | // TODO tell the viewer to remove the root folder | ||
182 | } | ||
183 | |||
173 | return success; | 184 | return success; |
174 | } | 185 | } |
175 | else | 186 | else |
@@ -283,6 +294,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
283 | 294 | ||
284 | } | 295 | } |
285 | 296 | ||
297 | protected override void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) | ||
298 | { | ||
299 | base.Fail(sp, finalDestination, logout); | ||
300 | if (logout && m_RestrictInventoryAccessAbroad) | ||
301 | { | ||
302 | // Restore the user's inventory, because we removed it earlier on | ||
303 | InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(sp.UUID); | ||
304 | if (root != null) | ||
305 | { | ||
306 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring"); | ||
307 | sp.ControllingClient.SendBulkUpdateInventory(root); | ||
308 | } | ||
309 | } | ||
310 | } | ||
311 | |||
286 | #endregion | 312 | #endregion |
287 | 313 | ||
288 | #region IUserAgentVerificationModule | 314 | #region IUserAgentVerificationModule |