diff options
author | Melanie Thielker | 2008-11-22 23:38:25 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-22 23:38:25 +0000 |
commit | 7aa32ac6e0992249391b4d62d93c3ebb7bca82bf (patch) | |
tree | b1c90146bb14bcc9033e1200559537f779debd1d /OpenSim/Region/Environment/Modules/Avatar/InstantMessage | |
parent | Next step in the presence module - some core plumbing included at (diff) | |
download | opensim-SC_OLD-7aa32ac6e0992249391b4d62d93c3ebb7bca82bf.zip opensim-SC_OLD-7aa32ac6e0992249391b4d62d93c3ebb7bca82bf.tar.gz opensim-SC_OLD-7aa32ac6e0992249391b4d62d93c3ebb7bca82bf.tar.bz2 opensim-SC_OLD-7aa32ac6e0992249391b4d62d93c3ebb7bca82bf.tar.xz |
Add root agent tracking to presence module
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/InstantMessage')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/InstantMessage/PresenceModule.cs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/PresenceModule.cs index 48c7717..003ca8e 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/PresenceModule.cs | |||
@@ -50,6 +50,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
50 | private bool m_Gridmode = false; | 50 | private bool m_Gridmode = false; |
51 | private List<Scene> m_Scenes = new List<Scene>(); | 51 | private List<Scene> m_Scenes = new List<Scene>(); |
52 | 52 | ||
53 | private Dictionary<UUID, Scene> m_RootAgents = | ||
54 | new Dictionary<UUID, Scene>(); | ||
55 | |||
53 | public event PresenceChange OnPresenceChange; | 56 | public event PresenceChange OnPresenceChange; |
54 | public event BulkPresenceData OnBulkPresenceData; | 57 | public event BulkPresenceData OnBulkPresenceData; |
55 | 58 | ||
@@ -69,10 +72,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
69 | 72 | ||
70 | lock (m_Scenes) | 73 | lock (m_Scenes) |
71 | { | 74 | { |
72 | if (m_Scenes.Count == 0) | ||
73 | { | ||
74 | } | ||
75 | |||
76 | if (m_Gridmode) | 75 | if (m_Gridmode) |
77 | NotifyMessageServerOfStartup(scene); | 76 | NotifyMessageServerOfStartup(scene); |
78 | 77 | ||
@@ -119,10 +118,23 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
119 | 118 | ||
120 | public void OnConnectionClosed(IClientAPI client) | 119 | public void OnConnectionClosed(IClientAPI client) |
121 | { | 120 | { |
121 | if (!(client.Scene is Scene)) | ||
122 | return; | ||
123 | |||
124 | if (!(m_RootAgents.ContainsKey(client.AgentId))) | ||
125 | return; | ||
126 | |||
127 | Scene scene = (Scene)client.Scene; | ||
128 | |||
129 | if (m_RootAgents[client.AgentId] != scene) | ||
130 | return; | ||
131 | |||
132 | m_RootAgents.Remove(client.AgentId); | ||
122 | } | 133 | } |
123 | 134 | ||
124 | public void OnSetRootAgentScene(UUID agentID) | 135 | public void OnSetRootAgentScene(UUID agentID, Scene scene) |
125 | { | 136 | { |
137 | m_RootAgents[agentID] = scene; | ||
126 | } | 138 | } |
127 | 139 | ||
128 | private void NotifyMessageServerOfStartup(Scene scene) | 140 | private void NotifyMessageServerOfStartup(Scene scene) |