refactor: remove Scene.SetRootAgentScene() in favour of existing event with same name
parent
5f5c65e4ba
commit
fd23f270c6
|
@ -82,6 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
scene.EventManager.OnNewClient += OnNewClient;
|
scene.EventManager.OnNewClient += OnNewClient;
|
||||||
scene.EventManager.OnClientClosed += ClientLoggedOut;
|
scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||||
|
scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegionLoaded(Scene scene)
|
public void RegionLoaded(Scene scene)
|
||||||
|
@ -98,9 +99,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
scene.EventManager.OnNewClient -= OnNewClient;
|
scene.EventManager.OnNewClient -= OnNewClient;
|
||||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||||
|
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveRegion(Scene scene)
|
public void RemoveRegion(Scene scene)
|
||||||
|
@ -108,6 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
scene.EventManager.OnNewClient -= OnNewClient;
|
scene.EventManager.OnNewClient -= OnNewClient;
|
||||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||||
|
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||||
m_Scenelist.Remove(scene);
|
m_Scenelist.Remove(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +138,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
// Inventory giving is conducted via instant message
|
// Inventory giving is conducted via instant message
|
||||||
client.OnInstantMessage += OnInstantMessage;
|
client.OnInstantMessage += OnInstantMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void OnSetRootAgentScene(UUID id, Scene scene)
|
||||||
|
{
|
||||||
|
m_AgentRegions[id] = scene;
|
||||||
|
}
|
||||||
|
|
||||||
private Scene FindClientScene(UUID agentId)
|
private Scene FindClientScene(UUID agentId)
|
||||||
{
|
{
|
||||||
|
@ -160,7 +167,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
if (scene == null) // Something seriously wrong here.
|
if (scene == null) // Something seriously wrong here.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
|
if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0]));
|
//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)
|
public bool NeedSceneCacheClear(UUID agentID, Scene scene)
|
||||||
{
|
{
|
||||||
if (!m_AgentRegions.ContainsKey(agentID))
|
if (!m_AgentRegions.ContainsKey(agentID))
|
||||||
|
|
|
@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IInventoryTransferModule
|
public interface IInventoryTransferModule
|
||||||
{
|
{
|
||||||
void SetRootAgentScene(UUID agentID, Scene scene);
|
|
||||||
bool NeedSceneCacheClear(UUID agentID, Scene scene);
|
bool NeedSceneCacheClear(UUID agentID, Scene scene);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4487,17 +4487,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
|
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)
|
public bool NeedSceneCacheClear(UUID agentID)
|
||||||
{
|
{
|
||||||
IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
|
IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
|
||||||
|
|
|
@ -821,7 +821,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_rootRegionHandle = m_scene.RegionInfo.RegionHandle;
|
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
|
// Moved this from SendInitialData to ensure that m_appearance is initialized
|
||||||
// before the inventory is processed in MakeRootAgent. This fixes a race condition
|
// before the inventory is processed in MakeRootAgent. This fixes a race condition
|
||||||
|
|
Loading…
Reference in New Issue