diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 3f560d0ec4..1e36b061d0 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -710,7 +710,7 @@ namespace OpenSim.Framework
/// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it
/// is connected).
///
- ISceneAgent SceneAgent { get; }
+ ISceneAgent SceneAgent { get; set; }
UUID SessionId { get; }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index cd81df5e68..98996693e0 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -384,7 +384,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
set { m_startpos = value; }
}
public UUID AgentId { get { return m_agentId; } }
- public ISceneAgent SceneAgent { get; private set; }
+ public ISceneAgent SceneAgent { get; set; }
public UUID ActiveGroupId { get { return m_activeGroupID; } }
public string ActiveGroupName { get { return m_activeGroupName; } }
public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } }
@@ -695,7 +695,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public virtual void Start()
{
- SceneAgent = m_scene.AddNewClient(this, PresenceType.User);
+ m_scene.AddNewClient(this, PresenceType.User);
RefreshGroupMembership();
}
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index aadd3bc16b..0c83679055 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -261,6 +261,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
client.OnTerminateFriendship += (thisClient, agentID, exfriendID) => RemoveFriendship(thisClient, exfriendID);
client.OnGrantUserRights += OnGrantUserRights;
+ // We need to cache information for child agents as well as root agents so that friend edit/move/delete
+ // permissions will work across borders where both regions are on different simulators.
+ //
// Do not do this asynchronously. If we do, then subsequent code can outrace CacheFriends() and
// return misleading results from the still empty friends cache.
// If we absolutely need to do this asynchronously, then a signalling mechanism is needed so that calls
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 7993abed72..fe3438e175 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -71,6 +71,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Triggered when a new client is added to the scene.
///
///
+ /// This is triggered for both child and root agent client connections.
/// Triggered before OnClientLogin.
///
public event OnNewClientDelegate OnNewClient;
@@ -191,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void ClientClosed(UUID clientID, Scene scene);
///
- /// Fired when a client is removed from a scene.
+ /// Fired when a client is removed from a scene whether it's a child or a root agent.
///
///
/// At the point of firing, the scene still contains the client's scene presence.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c887b4ed09..44cd30a70b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2670,6 +2670,10 @@ namespace OpenSim.Region.Framework.Scenes
sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName);
}
+ // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the
+ // client is for a root or child agent.
+ client.SceneAgent = sp;
+
m_LastLogin = Util.EnvironmentTickCount();
// Cache the user's name
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 5cf478ac10..43548e673f 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
private UUID m_agentID = UUID.Random();
- public ISceneAgent SceneAgent { get; private set; }
+ public ISceneAgent SceneAgent { get; set; }
private string m_username;
private string m_nick;
@@ -895,7 +895,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public void Start()
{
- SceneAgent = m_scene.AddNewClient(this, PresenceType.User);
+ m_scene.AddNewClient(this, PresenceType.User);
// Mimicking LLClientView which gets always set appearance from client.
AvatarAppearance appearance;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 16ec34f62c..5ea5af74a2 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
get { return m_ownerID; }
}
- public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } }
+ public ISceneAgent SceneAgent { get; set; }
public void Say(string message)
{
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 455b51e595..d6e72005b5 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -327,7 +327,7 @@ namespace OpenSim.Tests.Common.Mock
///
private UUID m_agentId;
- public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } }
+ public ISceneAgent SceneAgent { get; set; }
///
/// The last caps seed url that this client was given.