diff options
author | Diva Canto | 2012-03-21 09:14:17 -0700 |
---|---|---|
committer | Diva Canto | 2012-03-21 09:14:17 -0700 |
commit | d8bcb78b10faf1e4b213a7caa7ee8fcb8d10cf52 (patch) | |
tree | 8df932312784721f6ef24b0e57ec2185e85e6e71 /OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |
parent | Removed extraneous debug message (diff) | |
download | opensim-SC_OLD-d8bcb78b10faf1e4b213a7caa7ee8fcb8d10cf52.zip opensim-SC_OLD-d8bcb78b10faf1e4b213a7caa7ee8fcb8d10cf52.tar.gz opensim-SC_OLD-d8bcb78b10faf1e4b213a7caa7ee8fcb8d10cf52.tar.bz2 opensim-SC_OLD-d8bcb78b10faf1e4b213a7caa7ee8fcb8d10cf52.tar.xz |
HG Friends: pulled sim-bound notification code to HGStatusNotifier, so that we can better manage this traffic.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 46b0b84..f50e52b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
62 | } | 62 | } |
63 | 63 | ||
64 | protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector(); | 64 | protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector(); |
65 | protected HGStatusNotifier m_StatusNotifier; | ||
65 | 66 | ||
66 | #region ISharedRegionModule | 67 | #region ISharedRegionModule |
67 | public override string Name | 68 | public override string Name |
@@ -78,6 +79,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
78 | scene.RegisterModuleInterface<IFriendsSimConnector>(this); | 79 | scene.RegisterModuleInterface<IFriendsSimConnector>(this); |
79 | } | 80 | } |
80 | 81 | ||
82 | public override void RegionLoaded(Scene scene) | ||
83 | { | ||
84 | if (!m_Enabled) | ||
85 | return; | ||
86 | if (m_StatusNotifier == null) | ||
87 | m_StatusNotifier = new HGStatusNotifier(this); | ||
88 | } | ||
89 | |||
81 | #endregion | 90 | #endregion |
82 | 91 | ||
83 | #region IFriendsSimConnector | 92 | #region IFriendsSimConnector |
@@ -230,25 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
230 | if (friendsPerDomain.ContainsKey("local")) | 239 | if (friendsPerDomain.ContainsKey("local")) |
231 | base.StatusNotify(friendsPerDomain["local"], userID, online); | 240 | base.StatusNotify(friendsPerDomain["local"], userID, online); |
232 | 241 | ||
233 | foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain) | 242 | m_StatusNotifier.Notify(userID, friendsPerDomain, online); |
234 | { | ||
235 | if (kvp.Key != "local") | ||
236 | { | ||
237 | // For the others, call the user agent service | ||
238 | List<string> ids = new List<string>(); | ||
239 | foreach (FriendInfo f in kvp.Value) | ||
240 | ids.Add(f.Friend); | ||
241 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); | ||
242 | List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online); | ||
243 | |||
244 | if (online && friendsOnline.Count > 0) | ||
245 | { | ||
246 | IClientAPI client = LocateClientObject(userID); | ||
247 | if (client != null) | ||
248 | client.SendAgentOnline(friendsOnline.ToArray()); | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | 243 | ||
253 | // m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID); | 244 | // m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID); |
254 | } | 245 | } |