diff options
author | Justin Clark-Casey (justincc) | 2013-09-27 22:27:39 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-09-27 22:27:39 +0100 |
commit | 2cd95fac736cc99b1a2ad661e4a03810225ffaca (patch) | |
tree | 537c60270f8b3ce02950ca3486c064f77e38822b /OpenSim | |
parent | refactor: rename Scene.IncomingCloseAgent() to CloseAgent() in order to make ... (diff) | |
download | opensim-SC-2cd95fac736cc99b1a2ad661e4a03810225ffaca.zip opensim-SC-2cd95fac736cc99b1a2ad661e4a03810225ffaca.tar.gz opensim-SC-2cd95fac736cc99b1a2ad661e4a03810225ffaca.tar.bz2 opensim-SC-2cd95fac736cc99b1a2ad661e4a03810225ffaca.tar.xz |
refactor: Rename Scene.AddNewClient() to AddNewAgent() to make it obvious in the code that this is symmetric with CloseAgent()
Diffstat (limited to '')
12 files changed, 23 insertions, 22 deletions
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index c3df37b..e1b6d1e 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -86,14 +86,14 @@ namespace OpenSim.Framework | |||
86 | event restart OnRestart; | 86 | event restart OnRestart; |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Add a new agent. All agents except initial login clients will starts off as a child agent | 89 | /// Add a new agent with an attached client. All agents except initial login clients will starts off as a child agent |
90 | /// - the later agent crossing will promote it to a root agent. | 90 | /// - the later agent crossing will promote it to a root agent. |
91 | /// </summary> | 91 | /// </summary> |
92 | /// <param name="client"></param> | 92 | /// <param name="client"></param> |
93 | /// <param name="type">The type of agent to add.</param> | 93 | /// <param name="type">The type of agent to add.</param> |
94 | /// <returns> | 94 | /// <returns> |
95 | /// The scene agent if the new client was added or if an agent that already existed.</returns> | 95 | /// The scene agent if the new client was added or if an agent that already existed.</returns> |
96 | ISceneAgent AddNewClient(IClientAPI client, PresenceType type); | 96 | ISceneAgent AddNewAgent(IClientAPI client, PresenceType type); |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Tell a single agent to disconnect from the region. | 99 | /// Tell a single agent to disconnect from the region. |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 3609ec1..6b58fb7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -750,7 +750,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
750 | 750 | ||
751 | public virtual void Start() | 751 | public virtual void Start() |
752 | { | 752 | { |
753 | m_scene.AddNewClient(this, PresenceType.User); | 753 | m_scene.AddNewAgent(this, PresenceType.User); |
754 | 754 | ||
755 | RefreshGroupMembership(); | 755 | RefreshGroupMembership(); |
756 | } | 756 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 5296a6d..8d957dc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -1718,7 +1718,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1718 | else if (client.SceneAgent == null) | 1718 | else if (client.SceneAgent == null) |
1719 | { | 1719 | { |
1720 | // This check exists to catch a condition where the new client has been added to the client | 1720 | // This check exists to catch a condition where the new client has been added to the client |
1721 | // manager but the SceneAgent has not yet been set in Scene.AddNewClient(). If we are too | 1721 | // manager but the SceneAgent has not yet been set in Scene.AddNewAgent(). If we are too |
1722 | // eager, then the new ScenePresence may not have registered a listener for this messsage | 1722 | // eager, then the new ScenePresence may not have registered a listener for this messsage |
1723 | // before we try to process it. | 1723 | // before we try to process it. |
1724 | // XXX: A better long term fix may be to add the SceneAgent before the client is added to | 1724 | // XXX: A better long term fix may be to add the SceneAgent before the client is added to |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs index 28b5eb7..e2178e5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
52 | public override void Update(int frames) {} | 52 | public override void Update(int frames) {} |
53 | public override void LoadWorldMap() {} | 53 | public override void LoadWorldMap() {} |
54 | 54 | ||
55 | public override ISceneAgent AddNewClient(IClientAPI client, PresenceType type) | 55 | public override ISceneAgent AddNewAgent(IClientAPI client, PresenceType type) |
56 | { | 56 | { |
57 | client.OnObjectName += RecordObjectNameCall; | 57 | client.OnObjectName += RecordObjectNameCall; |
58 | 58 | ||
@@ -61,6 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
61 | } | 61 | } |
62 | 62 | ||
63 | public override bool CloseAgent(UUID agentID, bool force) { return true; } | 63 | public override bool CloseAgent(UUID agentID, bool force) { return true; } |
64 | |||
64 | public override bool CheckClient(UUID clientId, IPEndPoint endPoint) { return true; } | 65 | public override bool CheckClient(UUID clientId, IPEndPoint endPoint) { return true; } |
65 | 66 | ||
66 | public override void OtherRegionUp(GridRegion otherRegion) { } | 67 | public override void OtherRegionUp(GridRegion otherRegion) { } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 39d7512..37b5776 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
144 | /// Triggered when a new presence is added to the scene | 144 | /// Triggered when a new presence is added to the scene |
145 | /// </summary> | 145 | /// </summary> |
146 | /// <remarks> | 146 | /// <remarks> |
147 | /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> which is used by both | 147 | /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewAgent"/> which is used by both |
148 | /// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see> | 148 | /// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see> |
149 | /// </remarks> | 149 | /// </remarks> |
150 | public event OnNewPresenceDelegate OnNewPresence; | 150 | public event OnNewPresenceDelegate OnNewPresence; |
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
155 | /// Triggered when a presence is removed from the scene | 155 | /// Triggered when a presence is removed from the scene |
156 | /// </summary> | 156 | /// </summary> |
157 | /// <remarks> | 157 | /// <remarks> |
158 | /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> which is used by both | 158 | /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewAgent"/> which is used by both |
159 | /// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see> | 159 | /// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see> |
160 | /// | 160 | /// |
161 | /// Triggered under per-agent lock. So if you want to perform any long-running operations, please | 161 | /// Triggered under per-agent lock. So if you want to perform any long-running operations, please |
@@ -1102,7 +1102,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1102 | /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.ProcessMoneyTransferRequest"/> | 1102 | /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.ProcessMoneyTransferRequest"/> |
1103 | /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientGridEvents"/> | 1103 | /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientGridEvents"/> |
1104 | /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientEvents"/> | 1104 | /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientEvents"/> |
1105 | /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> | 1105 | /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewAgent"/> |
1106 | /// </remarks> | 1106 | /// </remarks> |
1107 | public event MoneyTransferEvent OnMoneyTransfer; | 1107 | public event MoneyTransferEvent OnMoneyTransfer; |
1108 | 1108 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 82abfe9..7772f94 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2802,7 +2802,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2802 | 2802 | ||
2803 | #region Add/Remove Avatar Methods | 2803 | #region Add/Remove Avatar Methods |
2804 | 2804 | ||
2805 | public override ISceneAgent AddNewClient(IClientAPI client, PresenceType type) | 2805 | public override ISceneAgent AddNewAgent(IClientAPI client, PresenceType type) |
2806 | { | 2806 | { |
2807 | ScenePresence sp; | 2807 | ScenePresence sp; |
2808 | bool vialogin; | 2808 | bool vialogin; |
@@ -2810,7 +2810,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2810 | 2810 | ||
2811 | // Validation occurs in LLUDPServer | 2811 | // Validation occurs in LLUDPServer |
2812 | // | 2812 | // |
2813 | // XXX: A race condition exists here where two simultaneous calls to AddNewClient can interfere with | 2813 | // XXX: A race condition exists here where two simultaneous calls to AddNewAgent can interfere with |
2814 | // each other. In practice, this does not currently occur in the code. | 2814 | // each other. In practice, this does not currently occur in the code. |
2815 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); | 2815 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); |
2816 | 2816 | ||
@@ -2818,9 +2818,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2818 | // and a simultaneous one that removes it (as can happen if the client is closed at a particular point | 2818 | // and a simultaneous one that removes it (as can happen if the client is closed at a particular point |
2819 | // whilst connecting). | 2819 | // whilst connecting). |
2820 | // | 2820 | // |
2821 | // It would be easier to lock across all NewUserConnection(), AddNewClient() and | 2821 | // It would be easier to lock across all NewUserConnection(), AddNewAgent() and |
2822 | // RemoveClient() calls for all agents, but this would allow a slow call (e.g. because of slow service | 2822 | // RemoveClient() calls for all agents, but this would allow a slow call (e.g. because of slow service |
2823 | // response in some module listening to AddNewClient()) from holding up unrelated agent calls. | 2823 | // response in some module listening to AddNewAgent()) from holding up unrelated agent calls. |
2824 | // | 2824 | // |
2825 | // In practice, the lock (this) in LLUDPServer.AddNewClient() currently lock across all | 2825 | // In practice, the lock (this) in LLUDPServer.AddNewClient() currently lock across all |
2826 | // AddNewClient() operations (though not other ops). | 2826 | // AddNewClient() operations (though not other ops). |
@@ -2837,7 +2837,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2837 | 2837 | ||
2838 | // XXX: Not sure how good it is to add a new client if a scene presence already exists. Possibly this | 2838 | // XXX: Not sure how good it is to add a new client if a scene presence already exists. Possibly this |
2839 | // could occur if a viewer crashes and relogs before the old client is kicked out. But this could cause | 2839 | // could occur if a viewer crashes and relogs before the old client is kicked out. But this could cause |
2840 | // other problems, and possible the code calling AddNewClient() should ensure that no client is already | 2840 | // other problems, and possibly the code calling AddNewAgent() should ensure that no client is already |
2841 | // connected. | 2841 | // connected. |
2842 | if (sp == null) | 2842 | if (sp == null) |
2843 | { | 2843 | { |
@@ -4306,7 +4306,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4306 | // We have to wait until the viewer contacts this region | 4306 | // We have to wait until the viewer contacts this region |
4307 | // after receiving the EnableSimulator HTTP Event Queue message (for the v1 teleport protocol) | 4307 | // after receiving the EnableSimulator HTTP Event Queue message (for the v1 teleport protocol) |
4308 | // or TeleportFinish (for the v2 teleport protocol). This triggers the viewer to send | 4308 | // or TeleportFinish (for the v2 teleport protocol). This triggers the viewer to send |
4309 | // a UseCircuitCode packet which in turn calls AddNewClient which finally creates the ScenePresence. | 4309 | // a UseCircuitCode packet which in turn calls AddNewAgent which finally creates the ScenePresence. |
4310 | ScenePresence sp = WaitGetScenePresence(cAgentData.AgentID); | 4310 | ScenePresence sp = WaitGetScenePresence(cAgentData.AgentID); |
4311 | 4311 | ||
4312 | if (sp != null) | 4312 | if (sp != null) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 4b37983..4f04706 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
216 | 216 | ||
217 | #region Add/Remove Agent/Avatar | 217 | #region Add/Remove Agent/Avatar |
218 | 218 | ||
219 | public abstract ISceneAgent AddNewClient(IClientAPI client, PresenceType type); | 219 | public abstract ISceneAgent AddNewAgent(IClientAPI client, PresenceType type); |
220 | 220 | ||
221 | public abstract bool CloseAgent(UUID agentID, bool force); | 221 | public abstract bool CloseAgent(UUID agentID, bool force); |
222 | 222 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index e25bcb7..d1aeaee 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
200 | // *** This is the second stage, where the client established a child agent/scene presence using the | 200 | // *** This is the second stage, where the client established a child agent/scene presence using the |
201 | // circuit code given to the scene in stage 1 *** | 201 | // circuit code given to the scene in stage 1 *** |
202 | TestClient client = new TestClient(acd, scene); | 202 | TestClient client = new TestClient(acd, scene); |
203 | scene.AddNewClient(client, PresenceType.User); | 203 | scene.AddNewAgent(client, PresenceType.User); |
204 | 204 | ||
205 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null); | 205 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null); |
206 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); | 206 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); |
@@ -279,7 +279,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
279 | // string reason; | 279 | // string reason; |
280 | // scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); | 280 | // scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); |
281 | // testclient = new TestClient(agent, scene); | 281 | // testclient = new TestClient(agent, scene); |
282 | // scene.AddNewClient(testclient); | 282 | // scene.AddNewAgent(testclient); |
283 | // | 283 | // |
284 | // ScenePresence presence = scene.GetScenePresence(agent1); | 284 | // ScenePresence presence = scene.GetScenePresence(agent1); |
285 | // | 285 | // |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 23a435d..a4fc4ae 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -903,7 +903,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
903 | 903 | ||
904 | public void Start() | 904 | public void Start() |
905 | { | 905 | { |
906 | m_scene.AddNewClient(this, PresenceType.User); | 906 | m_scene.AddNewAgent(this, PresenceType.User); |
907 | 907 | ||
908 | // Mimicking LLClientView which gets always set appearance from client. | 908 | // Mimicking LLClientView which gets always set appearance from client. |
909 | AvatarAppearance appearance; | 909 | AvatarAppearance appearance; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 740f75a..fffe1ab 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
175 | { | 175 | { |
176 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, | 176 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, |
177 | acd); | 177 | acd); |
178 | scene.AddNewClient(npcAvatar, PresenceType.Npc); | 178 | scene.AddNewAgent(npcAvatar, PresenceType.Npc); |
179 | 179 | ||
180 | ScenePresence sp; | 180 | ScenePresence sp; |
181 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) | 181 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) |
diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index ff6608d..52a17e7 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Tests.Common | |||
84 | 84 | ||
85 | TestClient neighbourTc = new TestClient(newAgent, neighbourScene); | 85 | TestClient neighbourTc = new TestClient(newAgent, neighbourScene); |
86 | neighbourTcs.Add(neighbourTc); | 86 | neighbourTcs.Add(neighbourTc); |
87 | neighbourScene.AddNewClient(neighbourTc, PresenceType.User); | 87 | neighbourScene.AddNewAgent(neighbourTc, PresenceType.User); |
88 | }; | 88 | }; |
89 | } | 89 | } |
90 | 90 | ||
@@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common | |||
119 | 119 | ||
120 | TestClient destinationClient = new TestClient(newAgent, destinationScene); | 120 | TestClient destinationClient = new TestClient(newAgent, destinationScene); |
121 | destinationClients.Add(destinationClient); | 121 | destinationClients.Add(destinationClient); |
122 | destinationScene.AddNewClient(destinationClient, PresenceType.User); | 122 | destinationScene.AddNewAgent(destinationClient, PresenceType.User); |
123 | 123 | ||
124 | ThreadPool.UnsafeQueueUserWorkItem(o => destinationClient.CompleteMovement(), null); | 124 | ThreadPool.UnsafeQueueUserWorkItem(o => destinationClient.CompleteMovement(), null); |
125 | }; | 125 | }; |
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index d9bb85e..4cdfe98 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs | |||
@@ -548,7 +548,7 @@ namespace OpenSim.Tests.Common | |||
548 | Console.WriteLine("NewUserConnection failed: " + reason); | 548 | Console.WriteLine("NewUserConnection failed: " + reason); |
549 | 549 | ||
550 | // Stage 2: add the new client as a child agent to the scene | 550 | // Stage 2: add the new client as a child agent to the scene |
551 | scene.AddNewClient(client, PresenceType.User); | 551 | scene.AddNewAgent(client, PresenceType.User); |
552 | 552 | ||
553 | return scene.GetScenePresence(client.AgentId); | 553 | return scene.GetScenePresence(client.AgentId); |
554 | } | 554 | } |