From 0ab65899e407804210666d233e67570b9ffd2401 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 27 Feb 2010 15:37:00 +0000 Subject: Move requestonlinenotification generic message to presence module --- .../CoreModules/Avatar/Friends/FriendsModule.cs | 6 ----- .../Avatar/InstantMessage/PresenceModule.cs | 30 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index b6225ae..1719447 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -211,8 +211,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends client.OnLogout += OnLogout; client.OnEconomyDataRequest += SendPresence; - client.AddGenericPacketHandler("requestonlinenotification", OnRequestOnlineNotification); - if (m_Friends.ContainsKey(client.AgentId)) { m_Friends[client.AgentId].Refcount++; @@ -531,9 +529,5 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends m_FriendsSimConnector.GrantRights(region, requester, target); } } - - public void OnRequestOnlineNotification(Object sender, string method, List args) - { - } } } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index 267a90a..5f51ce1 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs @@ -36,6 +36,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage @@ -48,12 +49,35 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public event PresenceChange OnPresenceChange; public event BulkPresenceData OnBulkPresenceData; + protected List m_Scenes = new List(); + + protected IPresenceService m_PresenceService = null; + + protected IPresenceService PresenceService + { + get + { + if (m_PresenceService == null) + { + if (m_Scenes.Count > 0) + m_PresenceService = m_Scenes[0].RequestModuleInterface(); + } + + return m_PresenceService; + } + } + public void Initialise(IConfigSource config) { } public void AddRegion(Scene scene) { + m_Scenes.Add(scene); + + scene.EventManager.OnNewClient += OnNewClient; + + scene.RegisterModuleInterface(this); } public void RegionLoaded(Scene scene) @@ -62,6 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void RemoveRegion(Scene scene) { + m_Scenes.Remove(scene); } public void PostInitialise() @@ -88,6 +113,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void OnNewClient(IClientAPI client) { + client.AddGenericPacketHandler("requestonlinenotification", OnRequestOnlineNotification); + } + + public void OnRequestOnlineNotification(Object sender, string method, List args) + { } } } -- cgit v1.1