aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie2011-01-27 05:18:28 +0000
committerMelanie2011-01-27 05:18:28 +0000
commit42c22f41ddfac9777484be136f80de4251ef6d00 (patch)
treeb13c6e256bcc3fb02a4f3f14ec487b6565c08d28 /OpenSim/Region/Framework/Scenes/Scene.cs
parentAdd a TeleportFlags member to SP so we can tell how we got there. (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-42c22f41ddfac9777484be136f80de4251ef6d00.zip
opensim-SC-42c22f41ddfac9777484be136f80de4251ef6d00.tar.gz
opensim-SC-42c22f41ddfac9777484be136f80de4251ef6d00.tar.bz2
opensim-SC-42c22f41ddfac9777484be136f80de4251ef6d00.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs77
1 files changed, 10 insertions, 67 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9bad644..56eaf06 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -516,12 +516,6 @@ namespace OpenSim.Region.Framework.Scenes
516 get { return m_sceneGraph.Entities; } 516 get { return m_sceneGraph.Entities; }
517 } 517 }
518 518
519 public Dictionary<UUID, ScenePresence> m_restorePresences
520 {
521 get { return m_sceneGraph.RestorePresences; }
522 set { m_sceneGraph.RestorePresences = value; }
523 }
524
525 #endregion Properties 519 #endregion Properties
526 520
527 #region Constructors 521 #region Constructors
@@ -2584,56 +2578,24 @@ namespace OpenSim.Region.Framework.Scenes
2584 (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; 2578 (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
2585 2579
2586 CheckHeartbeat(); 2580 CheckHeartbeat();
2587 ScenePresence presence;
2588 2581
2589 if (m_restorePresences.ContainsKey(client.AgentId)) 2582 if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here
2590 { 2583 {
2591 m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName); 2584 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
2592 2585
2593 m_clientManager.Add(client); 2586 m_clientManager.Add(client);
2594 SubscribeToClientEvents(client); 2587 SubscribeToClientEvents(client);
2595 2588
2596 presence = m_restorePresences[client.AgentId]; 2589 ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance);
2597 m_restorePresences.Remove(client.AgentId); 2590 m_eventManager.TriggerOnNewPresence(sp);
2598
2599 // This is one of two paths to create avatars that are
2600 // used. This tends to get called more in standalone
2601 // than grid, not really sure why, but as such needs
2602 // an explicity appearance lookup here.
2603 AvatarAppearance appearance = null;
2604 GetAvatarAppearance(client, out appearance);
2605 presence.Appearance = appearance;
2606
2607 presence.initializeScenePresence(client, RegionInfo, this);
2608
2609 m_sceneGraph.AddScenePresence(presence);
2610 2591
2611 lock (m_restorePresences) 2592 // HERE!!! Do the initial attachments right here
2593 // first agent upon login is a root agent by design.
2594 // All other AddNewClient calls find aCircuit.child to be true
2595 if (aCircuit.child == false)
2612 { 2596 {
2613 Monitor.PulseAll(m_restorePresences); 2597 sp.IsChildAgent = false;
2614 } 2598 Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
2615 }
2616 else
2617 {
2618 if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here
2619 {
2620 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
2621
2622 m_clientManager.Add(client);
2623 SubscribeToClientEvents(client);
2624
2625 ScenePresence sp = CreateAndAddScenePresence(client);
2626 if (aCircuit != null)
2627 sp.Appearance = aCircuit.Appearance;
2628
2629 // HERE!!! Do the initial attachments right here
2630 // first agent upon login is a root agent by design.
2631 // All other AddNewClient calls find aCircuit.child to be true
2632 if (aCircuit == null || (aCircuit != null && aCircuit.child == false))
2633 {
2634 sp.IsChildAgent = false;
2635 Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
2636 }
2637 } 2599 }
2638 } 2600 }
2639 2601
@@ -3110,25 +3072,6 @@ namespace OpenSim.Region.Framework.Scenes
3110 } 3072 }
3111 3073
3112 /// <summary> 3074 /// <summary>
3113 /// Create a child agent scene presence and add it to this scene.
3114 /// </summary>
3115 /// <param name="client"></param>
3116 /// <returns></returns>
3117 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client)
3118 {
3119 CheckHeartbeat();
3120 AvatarAppearance appearance = null;
3121 GetAvatarAppearance(client, out appearance);
3122
3123 ScenePresence avatar = m_sceneGraph.CreateAndAddChildScenePresence(client, appearance);
3124 //avatar.KnownRegions = GetChildrenSeeds(avatar.UUID);
3125
3126 m_eventManager.TriggerOnNewPresence(avatar);
3127
3128 return avatar;
3129 }
3130
3131 /// <summary>
3132 /// Get the avatar apperance for the given client. 3075 /// Get the avatar apperance for the given client.
3133 /// </summary> 3076 /// </summary>
3134 /// <param name="client"></param> 3077 /// <param name="client"></param>