aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs34
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
3 files changed, 25 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b58e7c4..cb12d65 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4416,10 +4416,27 @@ namespace OpenSim.Region.Framework.Scenes
4416 4416
4417 // Check that the auth_token is valid 4417 // Check that the auth_token is valid
4418 AgentCircuitData acd = AuthenticateHandler.GetAgentCircuitData(agentID); 4418 AgentCircuitData acd = AuthenticateHandler.GetAgentCircuitData(agentID);
4419 if (acd != null && acd.SessionID.ToString() == auth_token) 4419
4420 if (acd == null)
4421 {
4422 m_log.DebugFormat(
4423 "[SCENE]: Request to close agent {0} but no such agent in scene {1}. May have been closed previously.",
4424 agentID, Name);
4425
4426 return false;
4427 }
4428
4429 if (acd.SessionID.ToString() == auth_token)
4430 {
4420 return IncomingCloseAgent(agentID, force); 4431 return IncomingCloseAgent(agentID, force);
4432 }
4421 else 4433 else
4422 m_log.ErrorFormat("[SCENE]: Request to close agent {0} with invalid authorization token {1}", agentID, auth_token); 4434 {
4435 m_log.WarnFormat(
4436 "[SCENE]: Request to close agent {0} with invalid authorization token {1} in {2}",
4437 agentID, auth_token, Name);
4438 }
4439
4423 return false; 4440 return false;
4424 } 4441 }
4425 4442
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index bb7ae7f..0a5bfd2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -561,39 +561,15 @@ namespace OpenSim.Region.Framework.Scenes
561 protected internal ScenePresence CreateAndAddChildScenePresence( 561 protected internal ScenePresence CreateAndAddChildScenePresence(
562 IClientAPI client, AvatarAppearance appearance, PresenceType type) 562 IClientAPI client, AvatarAppearance appearance, PresenceType type)
563 { 563 {
564 ScenePresence newAvatar = null;
565
566 // ScenePresence always defaults to child agent 564 // ScenePresence always defaults to child agent
567 newAvatar = new ScenePresence(client, m_parentScene, appearance, type); 565 ScenePresence presence = new ScenePresence(client, m_parentScene, appearance, type);
568
569 AddScenePresence(newAvatar);
570
571 return newAvatar;
572 }
573
574 /// <summary>
575 /// Add a presence to the scene
576 /// </summary>
577 /// <param name="presence"></param>
578 protected internal void AddScenePresence(ScenePresence presence)
579 {
580 // Always a child when added to the scene
581 bool child = presence.IsChildAgent;
582
583 if (child)
584 {
585 m_numChildAgents++;
586 }
587 else
588 {
589 m_numRootAgents++;
590 presence.AddToPhysicalScene(false);
591 }
592 566
593 Entities[presence.UUID] = presence; 567 Entities[presence.UUID] = presence;
594 568
595 lock (m_presenceLock) 569 lock (m_presenceLock)
596 { 570 {
571 m_numChildAgents++;
572
597 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap); 573 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
598 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray); 574 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
599 575
@@ -604,7 +580,7 @@ namespace OpenSim.Region.Framework.Scenes
604 } 580 }
605 else 581 else
606 { 582 {
607 // Remember the old presene reference from the dictionary 583 // Remember the old presence reference from the dictionary
608 ScenePresence oldref = newmap[presence.UUID]; 584 ScenePresence oldref = newmap[presence.UUID];
609 // Replace the presence reference in the dictionary with the new value 585 // Replace the presence reference in the dictionary with the new value
610 newmap[presence.UUID] = presence; 586 newmap[presence.UUID] = presence;
@@ -616,6 +592,8 @@ namespace OpenSim.Region.Framework.Scenes
616 m_scenePresenceMap = newmap; 592 m_scenePresenceMap = newmap;
617 m_scenePresenceArray = newlist; 593 m_scenePresenceArray = newlist;
618 } 594 }
595
596 return presence;
619 } 597 }
620 598
621 /// <summary> 599 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 4fc207a..b4e8f09 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3243,11 +3243,6 @@ namespace OpenSim.Region.Framework.Scenes
3243 } 3243 }
3244 } 3244 }
3245 3245
3246 public void RestoreInCurrentScene()
3247 {
3248 AddToPhysicalScene(false); // not exactly false
3249 }
3250
3251 public void Reset() 3246 public void Reset()
3252 { 3247 {
3253// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName); 3248// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName);