diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 2f1e9dd74e..8b77a5f4ee 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -82,6 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnClientClosed += ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; } public void RegionLoaded(Scene scene) @@ -98,9 +99,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnClientClosed -= ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; } } - } public void RemoveRegion(Scene scene) @@ -108,6 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnClientClosed -= ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; m_Scenelist.Remove(scene); } @@ -136,6 +138,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer // Inventory giving is conducted via instant message client.OnInstantMessage += OnInstantMessage; } + + protected void OnSetRootAgentScene(UUID id, Scene scene) + { + m_AgentRegions[id] = scene; + } private Scene FindClientScene(UUID agentId) { @@ -160,7 +167,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (scene == null) // Something seriously wrong here. return; - if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) { //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0])); @@ -346,11 +352,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer } } - public void SetRootAgentScene(UUID agentID, Scene scene) - { - m_AgentRegions[agentID] = scene; - } - public bool NeedSceneCacheClear(UUID agentID, Scene scene) { if (!m_AgentRegions.ContainsKey(agentID)) diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs index 2390ff428e..1e92fde00b 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs @@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces /// public interface IInventoryTransferModule { - void SetRootAgentScene(UUID agentID, Scene scene); bool NeedSceneCacheClear(UUID agentID, Scene scene); } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4d5c1e7873..631046a162 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4487,17 +4487,6 @@ namespace OpenSim.Region.Framework.Scenes client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } - public void SetRootAgentScene(UUID agentID) - { - IInventoryTransferModule inv = RequestModuleInterface(); - if (inv == null) - return; - - inv.SetRootAgentScene(agentID, this); - - EventManager.TriggerSetRootAgentScene(agentID, this); - } - public bool NeedSceneCacheClear(UUID agentID) { IInventoryTransferModule inv = RequestModuleInterface(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 14d7d6a4bf..08c6e270db 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -821,7 +821,7 @@ namespace OpenSim.Region.Framework.Scenes m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; - m_scene.SetRootAgentScene(m_uuid); + m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); // Moved this from SendInitialData to ensure that m_appearance is initialized // before the inventory is processed in MakeRootAgent. This fixes a race condition