aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer
diff options
context:
space:
mode:
authorMelanie2012-03-27 20:03:41 +0100
committerMelanie2012-03-27 20:03:41 +0100
commita619621c60467ad40119205b9e00ea0792d6fbb3 (patch)
tree16516c63ae12e1747e846c162a8907040532d27a /OpenSim/Region/CoreModules/Framework/EntityTransfer
parentMerge branch 'master' into careminster (diff)
parentHG: beginning of a more restrictive inventory access procedure (optional). Ex... (diff)
downloadopensim-SC-a619621c60467ad40119205b9e00ea0792d6fbb3.zip
opensim-SC-a619621c60467ad40119205b9e00ea0792d6fbb3.tar.gz
opensim-SC-a619621c60467ad40119205b9e00ea0792d6fbb3.tar.bz2
opensim-SC-a619621c60467ad40119205b9e00ea0792d6fbb3.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs26
2 files changed, 29 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index feab40e..a2d833b 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
448 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.", 448 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
449 sp.Name, finalDestination.RegionName); 449 sp.Name, finalDestination.RegionName);
450 450
451 Fail(sp, finalDestination); 451 Fail(sp, finalDestination, logout);
452 return; 452 return;
453 } 453 }
454 454
@@ -480,7 +480,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
480 "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", 480 "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.",
481 sp.Name, finalDestination.RegionName); 481 sp.Name, finalDestination.RegionName);
482 482
483 Fail(sp, finalDestination); 483 Fail(sp, finalDestination, logout);
484 return; 484 return;
485 } 485 }
486 486
@@ -531,7 +531,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
531 } 531 }
532 } 532 }
533 533
534 private void Fail(ScenePresence sp, GridRegion finalDestination) 534 protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
535 { 535 {
536 // Client never contacted destination. Let's restore everything back 536 // Client never contacted destination. Let's restore everything back
537 sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); 537 sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 5c7ca22..4a563f9 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
@@ -288,6 +299,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
288 299
289 } 300 }
290 301
302 protected override void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
303 {
304 base.Fail(sp, finalDestination, logout);
305 if (logout && m_RestrictInventoryAccessAbroad)
306 {
307 // Restore the user's inventory, because we removed it earlier on
308 InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(sp.UUID);
309 if (root != null)
310 {
311 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring");
312 sp.ControllingClient.SendBulkUpdateInventory(root);
313 }
314 }
315 }
316
291 #endregion 317 #endregion
292 318
293 #region IUserAgentVerificationModule 319 #region IUserAgentVerificationModule