refactor: remove Scene.SetRootAgentScene() in favour of existing event with same name

prebuild-update
Justin Clark-Casey (justincc) 2010-08-13 21:01:10 +01:00
parent 5f5c65e4ba
commit fd23f270c6
4 changed files with 10 additions and 21 deletions

View File

@ -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))

View File

@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces
/// </summary>
public interface IInventoryTransferModule
{
void SetRootAgentScene(UUID agentID, Scene scene);
bool NeedSceneCacheClear(UUID agentID, Scene scene);
}
}
}

View File

@ -4487,17 +4487,6 @@ namespace OpenSim.Region.Framework.Scenes
client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
}
public void SetRootAgentScene(UUID agentID)
{
IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
if (inv == null)
return;
inv.SetRootAgentScene(agentID, this);
EventManager.TriggerSetRootAgentScene(agentID, this);
}
public bool NeedSceneCacheClear(UUID agentID)
{
IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();

View File

@ -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