mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Implement the requestonlinenotification method
This commit is contained in:
@@ -38,6 +38,7 @@ using OpenSim.Region.Framework.Interfaces;
|
|||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||||
|
using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
{
|
{
|
||||||
@@ -118,6 +119,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
|||||||
|
|
||||||
public void OnRequestOnlineNotification(Object sender, string method, List<String> args)
|
public void OnRequestOnlineNotification(Object sender, string method, List<String> args)
|
||||||
{
|
{
|
||||||
|
if (!(sender is IClientAPI))
|
||||||
|
return;
|
||||||
|
|
||||||
|
IClientAPI client = (IClientAPI)sender;
|
||||||
|
|
||||||
|
PresenceInfo[] status = PresenceService.GetAgents(args.ToArray());
|
||||||
|
|
||||||
|
List<UUID> online = new List<UUID>();
|
||||||
|
List<UUID> offline = new List<UUID>();
|
||||||
|
|
||||||
|
foreach (PresenceInfo pi in status)
|
||||||
|
{
|
||||||
|
if (pi.Online)
|
||||||
|
online.Add(new UUID(pi.UserID));
|
||||||
|
else
|
||||||
|
offline.Add(new UUID(pi.UserID));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (online.Count > 0)
|
||||||
|
client.SendAgentOnline(online.ToArray());
|
||||||
|
if (offline.Count > 0)
|
||||||
|
client.SendAgentOffline(offline.ToArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user