Move requestonlinenotification generic message to presence module

slimupdates
Melanie 2010-02-27 15:37:00 +00:00
parent 6f770af5fb
commit 0ab65899e4
2 changed files with 30 additions and 6 deletions

View File

@ -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<String> args)
{
}
}
}

View File

@ -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<Scene> m_Scenes = new List<Scene>();
protected IPresenceService m_PresenceService = null;
protected IPresenceService PresenceService
{
get
{
if (m_PresenceService == null)
{
if (m_Scenes.Count > 0)
m_PresenceService = m_Scenes[0].RequestModuleInterface<IPresenceService>();
}
return m_PresenceService;
}
}
public void Initialise(IConfigSource config)
{
}
public void AddRegion(Scene scene)
{
m_Scenes.Add(scene);
scene.EventManager.OnNewClient += OnNewClient;
scene.RegisterModuleInterface<IPresenceModule>(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()
@ -87,6 +112,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
public void OnNewClient(IClientAPI client)
{
client.AddGenericPacketHandler("requestonlinenotification", OnRequestOnlineNotification);
}
public void OnRequestOnlineNotification(Object sender, string method, List<String> args)
{
}
}