diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | 30 |
1 files changed, 30 insertions, 0 deletions
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; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Services.Interfaces; | ||
39 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | 42 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage |
@@ -48,12 +49,35 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
48 | public event PresenceChange OnPresenceChange; | 49 | public event PresenceChange OnPresenceChange; |
49 | public event BulkPresenceData OnBulkPresenceData; | 50 | public event BulkPresenceData OnBulkPresenceData; |
50 | 51 | ||
52 | protected List<Scene> m_Scenes = new List<Scene>(); | ||
53 | |||
54 | protected IPresenceService m_PresenceService = null; | ||
55 | |||
56 | protected IPresenceService PresenceService | ||
57 | { | ||
58 | get | ||
59 | { | ||
60 | if (m_PresenceService == null) | ||
61 | { | ||
62 | if (m_Scenes.Count > 0) | ||
63 | m_PresenceService = m_Scenes[0].RequestModuleInterface<IPresenceService>(); | ||
64 | } | ||
65 | |||
66 | return m_PresenceService; | ||
67 | } | ||
68 | } | ||
69 | |||
51 | public void Initialise(IConfigSource config) | 70 | public void Initialise(IConfigSource config) |
52 | { | 71 | { |
53 | } | 72 | } |
54 | 73 | ||
55 | public void AddRegion(Scene scene) | 74 | public void AddRegion(Scene scene) |
56 | { | 75 | { |
76 | m_Scenes.Add(scene); | ||
77 | |||
78 | scene.EventManager.OnNewClient += OnNewClient; | ||
79 | |||
80 | scene.RegisterModuleInterface<IPresenceModule>(this); | ||
57 | } | 81 | } |
58 | 82 | ||
59 | public void RegionLoaded(Scene scene) | 83 | public void RegionLoaded(Scene scene) |
@@ -62,6 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
62 | 86 | ||
63 | public void RemoveRegion(Scene scene) | 87 | public void RemoveRegion(Scene scene) |
64 | { | 88 | { |
89 | m_Scenes.Remove(scene); | ||
65 | } | 90 | } |
66 | 91 | ||
67 | public void PostInitialise() | 92 | public void PostInitialise() |
@@ -88,6 +113,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
88 | 113 | ||
89 | public void OnNewClient(IClientAPI client) | 114 | public void OnNewClient(IClientAPI client) |
90 | { | 115 | { |
116 | client.AddGenericPacketHandler("requestonlinenotification", OnRequestOnlineNotification); | ||
117 | } | ||
118 | |||
119 | public void OnRequestOnlineNotification(Object sender, string method, List<String> args) | ||
120 | { | ||
91 | } | 121 | } |
92 | } | 122 | } |
93 | } | 123 | } |