diff options
author | Melanie | 2012-03-27 20:03:41 +0100 |
---|---|---|
committer | Melanie | 2012-03-27 20:03:41 +0100 |
commit | a619621c60467ad40119205b9e00ea0792d6fbb3 (patch) | |
tree | 16516c63ae12e1747e846c162a8907040532d27a /OpenSim | |
parent | Merge branch 'master' into careminster (diff) | |
parent | HG: beginning of a more restrictive inventory access procedure (optional). Ex... (diff) | |
download | opensim-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 '')
3 files changed, 37 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 |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6ac7846..fc1034d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2800,6 +2800,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2800 | // Cache the user's name | 2800 | // Cache the user's name |
2801 | CacheUserName(sp, aCircuit); | 2801 | CacheUserName(sp, aCircuit); |
2802 | 2802 | ||
2803 | // Let's send the Suitcase folder for incoming HG agents | ||
2804 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) | ||
2805 | { | ||
2806 | m_log.DebugFormat("[SCENE]: Sending root folder to viewer..."); | ||
2807 | InventoryFolderBase suitcase = InventoryService.GetRootFolder(client.AgentId); | ||
2808 | client.SendBulkUpdateInventory(suitcase); | ||
2809 | } | ||
2810 | |||
2803 | EventManager.TriggerOnNewClient(client); | 2811 | EventManager.TriggerOnNewClient(client); |
2804 | if (vialogin) | 2812 | if (vialogin) |
2805 | { | 2813 | { |