diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d6c4d5bdf5..c88142a47f 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 scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnClientClosed += OnClientClosed; - scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; +// scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; scene.EventManager.OnClientLogin += OnClientLogin; } @@ -255,6 +255,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends return 0; } + private void OnMakeRootAgent(ScenePresence sp) + { + if(sp.gotCrossUpdate) + return; + + RecacheFriends(sp.ControllingClient); + + lock (m_NeedsToNotifyStatus) + { + if (m_NeedsToNotifyStatus.Remove(sp.UUID)) + { + // Inform the friends that this user is online. This can only be done once the client is a Root Agent. + StatusChange(sp.UUID, true); + } + } + } + private void OnNewClient(IClientAPI client) { client.OnInstantMessage += OnInstantMessage; @@ -327,20 +344,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends } } - private void OnMakeRootAgent(ScenePresence sp) - { - RecacheFriends(sp.ControllingClient); - - lock (m_NeedsToNotifyStatus) - { - if (m_NeedsToNotifyStatus.Remove(sp.UUID)) - { - // Inform the friends that this user is online. This can only be done once the client is a Root Agent. - StatusChange(sp.UUID, true); - } - } - } - private void OnClientLogin(IClientAPI client) { UUID agentID = client.AgentId; @@ -359,6 +362,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends m_NeedsListOfOnlineFriends.Add(agentID); } + public void IsNpwRoot(ScenePresence sp) + { + RecacheFriends(sp.ControllingClient); + + lock (m_NeedsToNotifyStatus) + { + if (m_NeedsToNotifyStatus.Remove(sp.UUID)) + { + // Inform the friends that this user is online. This can only be done once the client is a Root Agent. + StatusChange(sp.UUID, true); + } + } + } + public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client) { UUID agentID = client.AgentId; diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs index 7e87006706..5c43b366cd 100644 --- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; namespace OpenSim.Region.Framework.Interfaces @@ -93,6 +94,7 @@ namespace OpenSim.Region.Framework.Interfaces /// These come from the FriendRights enum. void GrantRights(IClientAPI remoteClient, UUID friendID, int perms); + void IsNpwRoot(ScenePresence sp); bool SendFriendsOnlineIfNeeded(IClientAPI client); } } \ No newline at end of file