aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-02-27 15:37:00 +0000
committerMelanie2010-02-27 15:37:00 +0000
commit0ab65899e407804210666d233e67570b9ffd2401 (patch)
treeabb1e2f1fc532caac2b9349aaff3ef1fc28c97fb
parentImplement a handler for requestonlinenotification generic message (diff)
downloadopensim-SC_OLD-0ab65899e407804210666d233e67570b9ffd2401.zip
opensim-SC_OLD-0ab65899e407804210666d233e67570b9ffd2401.tar.gz
opensim-SC_OLD-0ab65899e407804210666d233e67570b9ffd2401.tar.bz2
opensim-SC_OLD-0ab65899e407804210666d233e67570b9ffd2401.tar.xz
Move requestonlinenotification generic message to presence module
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs30
2 files changed, 30 insertions, 6 deletions
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
211 client.OnLogout += OnLogout; 211 client.OnLogout += OnLogout;
212 client.OnEconomyDataRequest += SendPresence; 212 client.OnEconomyDataRequest += SendPresence;
213 213
214 client.AddGenericPacketHandler("requestonlinenotification", OnRequestOnlineNotification);
215
216 if (m_Friends.ContainsKey(client.AgentId)) 214 if (m_Friends.ContainsKey(client.AgentId))
217 { 215 {
218 m_Friends[client.AgentId].Refcount++; 216 m_Friends[client.AgentId].Refcount++;
@@ -531,9 +529,5 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
531 m_FriendsSimConnector.GrantRights(region, requester, target); 529 m_FriendsSimConnector.GrantRights(region, requester, target);
532 } 530 }
533 } 531 }
534
535 public void OnRequestOnlineNotification(Object sender, string method, List<String> args)
536 {
537 }
538 } 532 }
539} 533}
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;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Services.Interfaces;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion; 40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
40 41
41namespace OpenSim.Region.CoreModules.Avatar.InstantMessage 42namespace 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}