aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie2012-02-01 10:08:45 +0000
committerMelanie2012-02-01 10:08:45 +0000
commit16aa00e944f73a0a8fd2bd4ae9577f5dfb210bbe (patch)
tree1ffd8f2989976713ea79bbc1017a58a8925f1793 /OpenSim/Region/Framework/Scenes/Scene.cs
parentMerge branch 'master' into careminster (diff)
parentSmall optimization to last commit (diff)
downloadopensim-SC-16aa00e944f73a0a8fd2bd4ae9577f5dfb210bbe.zip
opensim-SC-16aa00e944f73a0a8fd2bd4ae9577f5dfb210bbe.tar.gz
opensim-SC-16aa00e944f73a0a8fd2bd4ae9577f5dfb210bbe.tar.bz2
opensim-SC-16aa00e944f73a0a8fd2bd4ae9577f5dfb210bbe.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs22
1 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 273d8bd..b37df82 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3191,11 +3191,11 @@ namespace OpenSim.Region.Framework.Scenes
3191 public override void RemoveClient(UUID agentID, bool closeChildAgents) 3191 public override void RemoveClient(UUID agentID, bool closeChildAgents)
3192 { 3192 {
3193 CheckHeartbeat(); 3193 CheckHeartbeat();
3194 bool childagentYN = false; 3194 bool isChildAgent = false;
3195 ScenePresence avatar = GetScenePresence(agentID); 3195 ScenePresence avatar = GetScenePresence(agentID);
3196 if (avatar != null) 3196 if (avatar != null)
3197 { 3197 {
3198 childagentYN = avatar.IsChildAgent; 3198 isChildAgent = avatar.IsChildAgent;
3199 3199
3200 if (avatar.ParentID != 0) 3200 if (avatar.ParentID != 0)
3201 { 3201 {
@@ -3206,9 +3206,9 @@ namespace OpenSim.Region.Framework.Scenes
3206 { 3206 {
3207 m_log.DebugFormat( 3207 m_log.DebugFormat(
3208 "[SCENE]: Removing {0} agent {1} from region {2}", 3208 "[SCENE]: Removing {0} agent {1} from region {2}",
3209 (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); 3209 (isChildAgent ? "child" : "root"), agentID, RegionInfo.RegionName);
3210 3210
3211 m_sceneGraph.removeUserCount(!childagentYN); 3211 m_sceneGraph.removeUserCount(!isChildAgent);
3212 3212
3213 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop 3213 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop
3214 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI 3214 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI
@@ -3239,8 +3239,18 @@ namespace OpenSim.Region.Framework.Scenes
3239 { 3239 {
3240 m_eventManager.TriggerOnRemovePresence(agentID); 3240 m_eventManager.TriggerOnRemovePresence(agentID);
3241 3241
3242 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) 3242 if (AttachmentsModule != null && !isChildAgent && avatar.PresenceType != PresenceType.Npc)
3243 AttachmentsModule.SaveChangedAttachments(avatar); 3243 {
3244 IUserManagement uMan = RequestModuleInterface<IUserManagement>();
3245 // Don't save attachments for HG visitors, it
3246 // messes up their inventory. When a HG visitor logs
3247 // out on a foreign grid, their attachments will be
3248 // reloaded in the state they were in when they left
3249 // the home grid. This is best anyway as the visited
3250 // grid may use an incompatible script engine.
3251 if (uMan == null || uMan.IsLocalGridUser(avatar.UUID))
3252 AttachmentsModule.SaveChangedAttachments(avatar, false);
3253 }
3244 3254
3245 ForEachClient( 3255 ForEachClient(
3246 delegate(IClientAPI client) 3256 delegate(IClientAPI client)