Add root agent tracking to presence module
parent
2fa072b579
commit
7aa32ac6e0
|
@ -50,6 +50,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
|||
private bool m_Gridmode = false;
|
||||
private List<Scene> m_Scenes = new List<Scene>();
|
||||
|
||||
private Dictionary<UUID, Scene> m_RootAgents =
|
||||
new Dictionary<UUID, Scene>();
|
||||
|
||||
public event PresenceChange OnPresenceChange;
|
||||
public event BulkPresenceData OnBulkPresenceData;
|
||||
|
||||
|
@ -69,10 +72,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
|||
|
||||
lock (m_Scenes)
|
||||
{
|
||||
if (m_Scenes.Count == 0)
|
||||
{
|
||||
}
|
||||
|
||||
if (m_Gridmode)
|
||||
NotifyMessageServerOfStartup(scene);
|
||||
|
||||
|
@ -119,10 +118,23 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
|||
|
||||
public void OnConnectionClosed(IClientAPI client)
|
||||
{
|
||||
if (!(client.Scene is Scene))
|
||||
return;
|
||||
|
||||
if (!(m_RootAgents.ContainsKey(client.AgentId)))
|
||||
return;
|
||||
|
||||
Scene scene = (Scene)client.Scene;
|
||||
|
||||
if (m_RootAgents[client.AgentId] != scene)
|
||||
return;
|
||||
|
||||
m_RootAgents.Remove(client.AgentId);
|
||||
}
|
||||
|
||||
public void OnSetRootAgentScene(UUID agentID)
|
||||
public void OnSetRootAgentScene(UUID agentID, Scene scene)
|
||||
{
|
||||
m_RootAgents[agentID] = scene;
|
||||
}
|
||||
|
||||
private void NotifyMessageServerOfStartup(Scene scene)
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
public delegate void OnPermissionErrorDelegate(UUID user, string reason);
|
||||
|
||||
public delegate void OnSetRootAgentSceneDelegate(UUID agentID);
|
||||
public delegate void OnSetRootAgentSceneDelegate(UUID agentID, Scene scene);
|
||||
|
||||
public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
|
||||
|
||||
|
@ -919,11 +919,11 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
handlerCollidingEnd(localId, colliders);
|
||||
}
|
||||
|
||||
public void TriggerSetRootAgentScene(UUID agentID)
|
||||
public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
|
||||
{
|
||||
handlerSetRootAgentScene = OnSetRootAgentScene;
|
||||
if (handlerSetRootAgentScene != null)
|
||||
handlerSetRootAgentScene(agentID);
|
||||
handlerSetRootAgentScene(agentID, scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4215,7 +4215,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
inv.SetRootAgentScene(agentID, this);
|
||||
|
||||
EventManager.TriggerSetRootAgentScene(agentID);
|
||||
EventManager.TriggerSetRootAgentScene(agentID, this);
|
||||
}
|
||||
|
||||
public bool NeedSceneCacheClear(UUID agentID)
|
||||
|
|
Loading…
Reference in New Issue