diff options
author | Melanie | 2010-02-27 15:50:41 +0000 |
---|---|---|
committer | Melanie | 2010-02-27 15:50:41 +0000 |
commit | a4472ceeac7d95997d9a143bfc002da22de416c6 (patch) | |
tree | efa4b1b469def49f37962647084e4202eb2abed6 /OpenSim | |
parent | Move requestonlinenotification generic message to presence module (diff) | |
download | opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.zip opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.tar.gz opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.tar.bz2 opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.tar.xz |
Implement the requestonlinenotification method
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index 5f51ce1..4e57394 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | |||
@@ -38,6 +38,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
41 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | 43 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage |
43 | { | 44 | { |
@@ -118,6 +119,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
118 | 119 | ||
119 | public void OnRequestOnlineNotification(Object sender, string method, List<String> args) | 120 | public void OnRequestOnlineNotification(Object sender, string method, List<String> args) |
120 | { | 121 | { |
122 | if (!(sender is IClientAPI)) | ||
123 | return; | ||
124 | |||
125 | IClientAPI client = (IClientAPI)sender; | ||
126 | |||
127 | PresenceInfo[] status = PresenceService.GetAgents(args.ToArray()); | ||
128 | |||
129 | List<UUID> online = new List<UUID>(); | ||
130 | List<UUID> offline = new List<UUID>(); | ||
131 | |||
132 | foreach (PresenceInfo pi in status) | ||
133 | { | ||
134 | if (pi.Online) | ||
135 | online.Add(new UUID(pi.UserID)); | ||
136 | else | ||
137 | offline.Add(new UUID(pi.UserID)); | ||
138 | } | ||
139 | |||
140 | if (online.Count > 0) | ||
141 | client.SendAgentOnline(online.ToArray()); | ||
142 | if (offline.Count > 0) | ||
143 | client.SendAgentOffline(offline.ToArray()); | ||
121 | } | 144 | } |
122 | } | 145 | } |
123 | } | 146 | } |