diff options
author | UbitUmarov | 2016-07-26 22:30:51 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-26 22:30:51 +0100 |
commit | 800044ceadf1cfde3cdbb75cfa2622c62f11530c (patch) | |
tree | 43e26d97fa4efbf7dc16e68c13ac2cf988a07028 /OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |
parent | do GridUserService.SetLastPosition async on crossings (diff) | |
download | opensim-SC-800044ceadf1cfde3cdbb75cfa2622c62f11530c.zip opensim-SC-800044ceadf1cfde3cdbb75cfa2622c62f11530c.tar.gz opensim-SC-800044ceadf1cfde3cdbb75cfa2622c62f11530c.tar.bz2 opensim-SC-800044ceadf1cfde3cdbb75cfa2622c62f11530c.tar.xz |
take friends out of onMakeRoot if crossing
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d6c4d5b..c88142a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
217 | 217 | ||
218 | scene.EventManager.OnNewClient += OnNewClient; | 218 | scene.EventManager.OnNewClient += OnNewClient; |
219 | scene.EventManager.OnClientClosed += OnClientClosed; | 219 | scene.EventManager.OnClientClosed += OnClientClosed; |
220 | scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; | 220 | // scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; |
221 | scene.EventManager.OnClientLogin += OnClientLogin; | 221 | scene.EventManager.OnClientLogin += OnClientLogin; |
222 | } | 222 | } |
223 | 223 | ||
@@ -255,6 +255,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
255 | return 0; | 255 | return 0; |
256 | } | 256 | } |
257 | 257 | ||
258 | private void OnMakeRootAgent(ScenePresence sp) | ||
259 | { | ||
260 | if(sp.gotCrossUpdate) | ||
261 | return; | ||
262 | |||
263 | RecacheFriends(sp.ControllingClient); | ||
264 | |||
265 | lock (m_NeedsToNotifyStatus) | ||
266 | { | ||
267 | if (m_NeedsToNotifyStatus.Remove(sp.UUID)) | ||
268 | { | ||
269 | // Inform the friends that this user is online. This can only be done once the client is a Root Agent. | ||
270 | StatusChange(sp.UUID, true); | ||
271 | } | ||
272 | } | ||
273 | } | ||
274 | |||
258 | private void OnNewClient(IClientAPI client) | 275 | private void OnNewClient(IClientAPI client) |
259 | { | 276 | { |
260 | client.OnInstantMessage += OnInstantMessage; | 277 | client.OnInstantMessage += OnInstantMessage; |
@@ -327,20 +344,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
327 | } | 344 | } |
328 | } | 345 | } |
329 | 346 | ||
330 | private void OnMakeRootAgent(ScenePresence sp) | ||
331 | { | ||
332 | RecacheFriends(sp.ControllingClient); | ||
333 | |||
334 | lock (m_NeedsToNotifyStatus) | ||
335 | { | ||
336 | if (m_NeedsToNotifyStatus.Remove(sp.UUID)) | ||
337 | { | ||
338 | // Inform the friends that this user is online. This can only be done once the client is a Root Agent. | ||
339 | StatusChange(sp.UUID, true); | ||
340 | } | ||
341 | } | ||
342 | } | ||
343 | |||
344 | private void OnClientLogin(IClientAPI client) | 347 | private void OnClientLogin(IClientAPI client) |
345 | { | 348 | { |
346 | UUID agentID = client.AgentId; | 349 | UUID agentID = client.AgentId; |
@@ -359,6 +362,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
359 | m_NeedsListOfOnlineFriends.Add(agentID); | 362 | m_NeedsListOfOnlineFriends.Add(agentID); |
360 | } | 363 | } |
361 | 364 | ||
365 | public void IsNpwRoot(ScenePresence sp) | ||
366 | { | ||
367 | RecacheFriends(sp.ControllingClient); | ||
368 | |||
369 | lock (m_NeedsToNotifyStatus) | ||
370 | { | ||
371 | if (m_NeedsToNotifyStatus.Remove(sp.UUID)) | ||
372 | { | ||
373 | // Inform the friends that this user is online. This can only be done once the client is a Root Agent. | ||
374 | StatusChange(sp.UUID, true); | ||
375 | } | ||
376 | } | ||
377 | } | ||
378 | |||
362 | public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client) | 379 | public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client) |
363 | { | 380 | { |
364 | UUID agentID = client.AgentId; | 381 | UUID agentID = client.AgentId; |