aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-29 01:26:30 +0100
committerJustin Clark-Casey (justincc)2012-03-29 01:26:30 +0100
commit22a85b947a16074525343a56203211806ce16834 (patch)
tree0ce05c1edf757ed7d0d611bbdefe79816b6d65dc
parentChange namespace on CallingCardModule and correct interface file placemant. A... (diff)
downloadopensim-SC_OLD-22a85b947a16074525343a56203211806ce16834.zip
opensim-SC_OLD-22a85b947a16074525343a56203211806ce16834.tar.gz
opensim-SC_OLD-22a85b947a16074525343a56203211806ce16834.tar.bz2
opensim-SC_OLD-22a85b947a16074525343a56203211806ce16834.tar.xz
Add back parts of reverted changes that were not concerned with child agent caching.
This adds ScenePresence to IClientAPI.SceneAgent earlier on in the add client process so that its information is available to EventManager.OnNewClient() and OnClientLogin() Also add a code comment as to why we're caching friend information for child agents.
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
8 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 3f560d0..1e36b06 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -710,7 +710,7 @@ namespace OpenSim.Framework
710 /// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it 710 /// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it
711 /// is connected). 711 /// is connected).
712 /// </summary> 712 /// </summary>
713 ISceneAgent SceneAgent { get; } 713 ISceneAgent SceneAgent { get; set; }
714 714
715 UUID SessionId { get; } 715 UUID SessionId { get; }
716 716
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index cd81df5..9899669 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
384 set { m_startpos = value; } 384 set { m_startpos = value; }
385 } 385 }
386 public UUID AgentId { get { return m_agentId; } } 386 public UUID AgentId { get { return m_agentId; } }
387 public ISceneAgent SceneAgent { get; private set; } 387 public ISceneAgent SceneAgent { get; set; }
388 public UUID ActiveGroupId { get { return m_activeGroupID; } } 388 public UUID ActiveGroupId { get { return m_activeGroupID; } }
389 public string ActiveGroupName { get { return m_activeGroupName; } } 389 public string ActiveGroupName { get { return m_activeGroupName; } }
390 public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } } 390 public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } }
@@ -695,7 +695,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
695 695
696 public virtual void Start() 696 public virtual void Start()
697 { 697 {
698 SceneAgent = m_scene.AddNewClient(this, PresenceType.User); 698 m_scene.AddNewClient(this, PresenceType.User);
699 699
700 RefreshGroupMembership(); 700 RefreshGroupMembership();
701 } 701 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index aadd3bc..0c83679 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
261 client.OnTerminateFriendship += (thisClient, agentID, exfriendID) => RemoveFriendship(thisClient, exfriendID); 261 client.OnTerminateFriendship += (thisClient, agentID, exfriendID) => RemoveFriendship(thisClient, exfriendID);
262 client.OnGrantUserRights += OnGrantUserRights; 262 client.OnGrantUserRights += OnGrantUserRights;
263 263
264 // We need to cache information for child agents as well as root agents so that friend edit/move/delete
265 // permissions will work across borders where both regions are on different simulators.
266 //
264 // Do not do this asynchronously. If we do, then subsequent code can outrace CacheFriends() and 267 // Do not do this asynchronously. If we do, then subsequent code can outrace CacheFriends() and
265 // return misleading results from the still empty friends cache. 268 // return misleading results from the still empty friends cache.
266 // If we absolutely need to do this asynchronously, then a signalling mechanism is needed so that calls 269 // 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 7993abe..fe3438e 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -71,6 +71,7 @@ namespace OpenSim.Region.Framework.Scenes
71 /// Triggered when a new client is added to the scene. 71 /// Triggered when a new client is added to the scene.
72 /// </summary> 72 /// </summary>
73 /// <remarks> 73 /// <remarks>
74 /// This is triggered for both child and root agent client connections.
74 /// Triggered before OnClientLogin. 75 /// Triggered before OnClientLogin.
75 /// </remarks> 76 /// </remarks>
76 public event OnNewClientDelegate OnNewClient; 77 public event OnNewClientDelegate OnNewClient;
@@ -191,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
191 public delegate void ClientClosed(UUID clientID, Scene scene); 192 public delegate void ClientClosed(UUID clientID, Scene scene);
192 193
193 /// <summary> 194 /// <summary>
194 /// Fired when a client is removed from a scene. 195 /// Fired when a client is removed from a scene whether it's a child or a root agent.
195 /// </summary> 196 /// </summary>
196 /// <remarks> 197 /// <remarks>
197 /// At the point of firing, the scene still contains the client's scene presence. 198 /// 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 c887b4e..44cd30a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2670,6 +2670,10 @@ namespace OpenSim.Region.Framework.Scenes
2670 sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); 2670 sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName);
2671 } 2671 }
2672 2672
2673 // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the
2674 // client is for a root or child agent.
2675 client.SceneAgent = sp;
2676
2673 m_LastLogin = Util.EnvironmentTickCount(); 2677 m_LastLogin = Util.EnvironmentTickCount();
2674 2678
2675 // Cache the user's name 2679 // 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 5cf478a..43548e6 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
55 55
56 private UUID m_agentID = UUID.Random(); 56 private UUID m_agentID = UUID.Random();
57 57
58 public ISceneAgent SceneAgent { get; private set; } 58 public ISceneAgent SceneAgent { get; set; }
59 59
60 private string m_username; 60 private string m_username;
61 private string m_nick; 61 private string m_nick;
@@ -895,7 +895,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
895 895
896 public void Start() 896 public void Start()
897 { 897 {
898 SceneAgent = m_scene.AddNewClient(this, PresenceType.User); 898 m_scene.AddNewClient(this, PresenceType.User);
899 899
900 // Mimicking LLClientView which gets always set appearance from client. 900 // Mimicking LLClientView which gets always set appearance from client.
901 AvatarAppearance appearance; 901 AvatarAppearance appearance;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 16ec34f..5ea5af7 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
72 get { return m_ownerID; } 72 get { return m_ownerID; }
73 } 73 }
74 74
75 public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } 75 public ISceneAgent SceneAgent { get; set; }
76 76
77 public void Say(string message) 77 public void Say(string message)
78 { 78 {
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 455b51e..d6e7200 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -327,7 +327,7 @@ namespace OpenSim.Tests.Common.Mock
327 /// </value> 327 /// </value>
328 private UUID m_agentId; 328 private UUID m_agentId;
329 329
330 public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } 330 public ISceneAgent SceneAgent { get; set; }
331 331
332 /// <value> 332 /// <value>
333 /// The last caps seed url that this client was given. 333 /// The last caps seed url that this client was given.