aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-10 00:59:31 +0100
committerJustin Clark-Casey (justincc)2011-08-10 00:59:31 +0100
commit4cb8d6379ddb39cfb8b30a63475e154a00a78110 (patch)
tree3305b50ea63ba6eaa6750fd4015697da226f5dbc /OpenSim
parentimplement osNpcStopMoveTo() to cancel any current move target (diff)
downloadopensim-SC-4cb8d6379ddb39cfb8b30a63475e154a00a78110.zip
opensim-SC-4cb8d6379ddb39cfb8b30a63475e154a00a78110.tar.gz
opensim-SC-4cb8d6379ddb39cfb8b30a63475e154a00a78110.tar.bz2
opensim-SC-4cb8d6379ddb39cfb8b30a63475e154a00a78110.tar.xz
Stop trying to deregister caps or close child agents when an NPC is removed
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IScene.cs13
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
7 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 1298f26..b5f975b 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -70,8 +70,19 @@ namespace OpenSim.Framework
70 70
71 event restart OnRestart; 71 event restart OnRestart;
72 72
73 /// <summary>
74 /// Register the new client with the scene. The client starts off as a child agent - the later agent crossing
75 /// will promote it to a root agent during login.
76 /// </summary>
77 /// <param name="client"></param
73 void AddNewClient(IClientAPI client); 78 void AddNewClient(IClientAPI client);
74 void RemoveClient(UUID agentID); 79
80 /// <summary>
81 /// Remove the given client from the scene.
82 /// </summary>
83 /// <param name="agentID"></param>
84 /// <param name="closeChildAgents">Close the neighbour child agents associated with this client.</param>
85 void RemoveClient(UUID agentID, bool closeChildAgents);
75 86
76 void Restart(); 87 void Restart();
77 //RegionInfo OtherRegionUp(RegionInfo thisRegion); 88 //RegionInfo OtherRegionUp(RegionInfo thisRegion);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 46d7f78..977918a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -512,7 +512,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
512 m_udpServer.Flush(m_udpClient); 512 m_udpServer.Flush(m_udpClient);
513 513
514 // Remove ourselves from the scene 514 // Remove ourselves from the scene
515 m_scene.RemoveClient(AgentId); 515 m_scene.RemoveClient(AgentId, true);
516 516
517 // We can't reach into other scenes and close the connection 517 // We can't reach into other scenes and close the connection
518 // We need to do this over grid communications 518 // We need to do this over grid communications
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b3b6cbc..9aa9bf5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3091,11 +3091,7 @@ namespace OpenSim.Region.Framework.Scenes
3091 } 3091 }
3092 } 3092 }
3093 3093
3094 /// <summary> 3094 public override void RemoveClient(UUID agentID, bool closeChildAgents)
3095 /// Remove the given client from the scene.
3096 /// </summary>
3097 /// <param name="agentID"></param>
3098 public override void RemoveClient(UUID agentID)
3099 { 3095 {
3100 CheckHeartbeat(); 3096 CheckHeartbeat();
3101 bool childagentYN = false; 3097 bool childagentYN = false;
@@ -3116,15 +3112,17 @@ namespace OpenSim.Region.Framework.Scenes
3116 (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); 3112 (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
3117 3113
3118 m_sceneGraph.removeUserCount(!childagentYN); 3114 m_sceneGraph.removeUserCount(!childagentYN);
3119 3115
3120 if (CapsModule != null) 3116 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop
3117 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI
3118 if (closeChildAgents && CapsModule != null)
3121 CapsModule.RemoveCaps(agentID); 3119 CapsModule.RemoveCaps(agentID);
3122 3120
3123 // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever 3121 // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever
3124 // this method is doing is HORRIBLE!!! 3122 // this method is doing is HORRIBLE!!!
3125 avatar.Scene.NeedSceneCacheClear(avatar.UUID); 3123 avatar.Scene.NeedSceneCacheClear(avatar.UUID);
3126 3124
3127 if (!avatar.IsChildAgent) 3125 if (closeChildAgents && !avatar.IsChildAgent)
3128 { 3126 {
3129 //List<ulong> childknownRegions = new List<ulong>(); 3127 //List<ulong> childknownRegions = new List<ulong>();
3130 //List<ulong> ckn = avatar.KnownChildRegionHandles; 3128 //List<ulong> ckn = avatar.KnownChildRegionHandles;
@@ -3136,6 +3134,7 @@ namespace OpenSim.Region.Framework.Scenes
3136 regions.Remove(RegionInfo.RegionHandle); 3134 regions.Remove(RegionInfo.RegionHandle);
3137 m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); 3135 m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
3138 } 3136 }
3137
3139 m_eventManager.TriggerClientClosed(agentID, this); 3138 m_eventManager.TriggerClientClosed(agentID, this);
3140 } 3139 }
3141 catch (NullReferenceException) 3140 catch (NullReferenceException)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index c4547f2..2f1cdc1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -175,18 +175,8 @@ namespace OpenSim.Region.Framework.Scenes
175 175
176 #region Add/Remove Agent/Avatar 176 #region Add/Remove Agent/Avatar
177 177
178 /// <summary>
179 /// Register the new client with the scene. The client starts off as a child agent - the later agent crossing
180 /// will promote it to a root agent during login.
181 /// </summary>
182 /// <param name="client"></param
183 public abstract void AddNewClient(IClientAPI client); 178 public abstract void AddNewClient(IClientAPI client);
184 179 public abstract void RemoveClient(UUID agentID, bool closeChildAgents);
185 /// <summary>
186 /// Remove a client from the scene
187 /// </summary>
188 /// <param name="agentID"></param>
189 public abstract void RemoveClient(UUID agentID);
190 180
191 public bool TryGetScenePresence(UUID agentID, out object scenePresence) 181 public bool TryGetScenePresence(UUID agentID, out object scenePresence)
192 { 182 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index af28dd9..2db83eb 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1146,12 +1146,12 @@ namespace OpenSim.Region.Framework.Scenes
1146 /// Complete Avatar's movement into the region. 1146 /// Complete Avatar's movement into the region.
1147 /// </summary> 1147 /// </summary>
1148 /// <param name="client"></param> 1148 /// <param name="client"></param>
1149 /// <param name="enableNeighbourChildAgents"> 1149 /// <param name="openChildAgents">
1150 /// If true, send notification to neighbour regions to expect 1150 /// If true, send notification to neighbour regions to expect
1151 /// a child agent from the client. These neighbours can be some distance away, depending right now on the 1151 /// a child agent from the client. These neighbours can be some distance away, depending right now on the
1152 /// configuration of DefaultDrawDistance in the [Startup] section of config 1152 /// configuration of DefaultDrawDistance in the [Startup] section of config
1153 /// </param> 1153 /// </param>
1154 public void CompleteMovement(IClientAPI client, bool enableNeighbourChildAgents) 1154 public void CompleteMovement(IClientAPI client, bool openChildAgents)
1155 { 1155 {
1156// DateTime startTime = DateTime.Now; 1156// DateTime startTime = DateTime.Now;
1157 1157
@@ -1192,7 +1192,7 @@ namespace OpenSim.Region.Framework.Scenes
1192 SendInitialData(); 1192 SendInitialData();
1193 1193
1194 // Create child agents in neighbouring regions 1194 // Create child agents in neighbouring regions
1195 if (enableNeighbourChildAgents && !m_isChildAgent) 1195 if (openChildAgents && !m_isChildAgent)
1196 { 1196 {
1197 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); 1197 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1198 if (m_agentTransfer != null) 1198 if (m_agentTransfer != null)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 87cb322..7b9457a 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -278,7 +278,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
278 { 278 {
279 if (m_avatars.ContainsKey(agentID)) 279 if (m_avatars.ContainsKey(agentID))
280 { 280 {
281 scene.RemoveClient(agentID); 281 scene.RemoveClient(agentID, false);
282 m_avatars.Remove(agentID); 282 m_avatars.Remove(agentID);
283 283
284 return true; 284 return true;
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 7ec6e10..dd5f6fe 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -887,7 +887,7 @@ namespace OpenSim.Tests.Common.Mock
887 887
888 public void Close() 888 public void Close()
889 { 889 {
890 m_scene.RemoveClient(AgentId); 890 m_scene.RemoveClient(AgentId, true);
891 } 891 }
892 892
893 public void Start() 893 public void Start()