28 using System.Collections;
29 using System.Collections.Generic;
31 using System.Reflection;
37 using OpenSim.Framework;
38 using OpenSim.Region.Framework.Interfaces;
39 using OpenSim.Region.Framework.Scenes;
40 using OpenSim.Services.Interfaces;
44 namespace OpenSim.
Region.CoreModules.
Avatar.InstantMessage
46 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"PresenceModule")]
49 private static readonly ILog m_log = LogManager.GetLogger(
50 MethodBase.GetCurrentMethod().DeclaringType);
52 #pragma warning disable 0067
55 #pragma warning restore 0067
57 protected List<Scene> m_Scenes =
new List<Scene>();
65 if (m_PresenceService == null)
67 if (m_Scenes.Count > 0)
71 return m_PresenceService;
83 scene.EventManager.OnNewClient += OnNewClient;
94 m_Scenes.Remove(scene);
107 get {
return "PresenceModule"; }
110 public Type ReplaceableInterface
121 client.AddGenericPacketHandler(
"requestonlinenotification", OnRequestOnlineNotification);
129 IClientAPI client = (IClientAPI)sender;
130 m_log.DebugFormat(
"[PRESENCE MODULE]: OnlineNotification requested by {0}", client.Name);
132 PresenceInfo[] status = PresenceService.GetAgents(args.ToArray());
134 List<UUID> online =
new List<UUID>();
135 List<UUID> offline =
new List<UUID>();
140 if (!online.Contains(uuid))
143 foreach (
string s
in args)
146 if (!online.Contains(uuid) && !offline.Contains(uuid))
150 if (online.Count > 0)
151 client.SendAgentOnline(online.ToArray());
152 if (offline.Count > 0)
153 client.SendAgentOffline(offline.ToArray());
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void OnRequestOnlineNotification(Object sender, string method, List< String > args)
void Initialise(IConfigSource config)
This is called to initialize the region module. For shared modules, this is called exactly once...
PresenceChange OnPresenceChange
OpenSim.Services.Interfaces.GridRegion GridRegion
void OnNewClient(IClientAPI client)
OpenSim.Services.Interfaces.PresenceInfo PresenceInfo
delegate void BulkPresenceData(PresenceInfo[] info)
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
BulkPresenceData OnBulkPresenceData
delegate void PresenceChange(PresenceInfo info)
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void RequestBulkPresenceData(UUID[] users)