aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-05-19 13:34:44 +0100
committerMelanie2012-05-19 13:34:44 +0100
commitebd9d2618bc88eafdc0bbf86c9f1755476cc68e4 (patch)
tree2d63da14ca345487a27f2202b2490eae0d86b60c /OpenSim/Region/Framework/Scenes
parentMerge branch 'avination' into careminster (diff)
parentRemove recent IRegionCombinerModule.IsMegaregion(). In theory, there can be ... (diff)
downloadopensim-SC-ebd9d2618bc88eafdc0bbf86c9f1755476cc68e4.zip
opensim-SC-ebd9d2618bc88eafdc0bbf86c9f1755476cc68e4.tar.gz
opensim-SC-ebd9d2618bc88eafdc0bbf86c9f1755476cc68e4.tar.bz2
opensim-SC-ebd9d2618bc88eafdc0bbf86c9f1755476cc68e4.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
3 files changed, 54 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3e11db3..e3bd527 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -591,13 +591,18 @@ namespace OpenSim.Region.Framework.Scenes
591 get { return m_sceneGraph.Entities; } 591 get { return m_sceneGraph.Entities; }
592 } 592 }
593 593
594 // can be closest/random/sequence 594
595 private string m_SpawnPointRouting = "closest";
596 // used in sequence see: SpawnPoint() 595 // used in sequence see: SpawnPoint()
597 private int m_SpawnPoint; 596 private int m_SpawnPoint;
597 // can be closest/random/sequence
598 public string SpawnPointRouting 598 public string SpawnPointRouting
599 { 599 {
600 get { return m_SpawnPointRouting; } 600 get; private set;
601 }
602 // allow landmarks to pass
603 public bool TelehubAllowLandmarks
604 {
605 get; private set;
601 } 606 }
602 607
603 #endregion Properties 608 #endregion Properties
@@ -737,7 +742,8 @@ namespace OpenSim.Region.Framework.Scenes
737 m_maxPhys = RegionInfo.PhysPrimMax; 742 m_maxPhys = RegionInfo.PhysPrimMax;
738 } 743 }
739 744
740 m_SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest"); 745 SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest");
746 TelehubAllowLandmarks = startupConfig.GetBoolean("TelehubAllowLandmark", false);
741 747
742 // Here, if clamping is requested in either global or 748 // Here, if clamping is requested in either global or
743 // local config, it will be used 749 // local config, it will be used
@@ -2794,7 +2800,8 @@ namespace OpenSim.Region.Framework.Scenes
2794 if (sp == null) 2800 if (sp == null)
2795 { 2801 {
2796 m_log.DebugFormat( 2802 m_log.DebugFormat(
2797 "[SCENE]: Adding new child scene presence {0} to scene {1} at pos {2}", client.Name, RegionInfo.RegionName, client.StartPos); 2803 "[SCENE]: Adding new child scene presence {0} {1} to scene {2} at pos {3}",
2804 client.Name, client.AgentId, RegionInfo.RegionName, client.StartPos);
2798 2805
2799 m_clientManager.Add(client); 2806 m_clientManager.Add(client);
2800 SubscribeToClientEvents(client); 2807 SubscribeToClientEvents(client);
@@ -4098,6 +4105,7 @@ namespace OpenSim.Region.Framework.Scenes
4098 return false; 4105 return false;
4099 } 4106 }
4100 4107
4108 // TODO: This check should probably be in QueryAccess().
4101 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2); 4109 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
4102 if (nearestParcel == null) 4110 if (nearestParcel == null)
4103 { 4111 {
@@ -4108,14 +4116,8 @@ namespace OpenSim.Region.Framework.Scenes
4108 return false; 4116 return false;
4109 } 4117 }
4110 4118
4111 int num = m_sceneGraph.GetNumberOfScenePresences(); 4119 // We have to wait until the viewer contacts this region after receiving EAC.
4112 4120 // That calls AddNewClient, which finally creates the ScenePresence
4113 if (num >= RegionInfo.RegionSettings.AgentLimit)
4114 {
4115 if (!Permissions.IsAdministrator(cAgentData.AgentID))
4116 return false;
4117 }
4118
4119 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 4121 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
4120 4122
4121 if (childAgentUpdate != null) 4123 if (childAgentUpdate != null)
@@ -4159,14 +4161,28 @@ namespace OpenSim.Region.Framework.Scenes
4159 return false; 4161 return false;
4160 } 4162 }
4161 4163
4164 /// <summary>
4165 /// Poll until the requested ScenePresence appears or we timeout.
4166 /// </summary>
4167 /// <returns>The scene presence is found, else null.</returns>
4168 /// <param name='agentID'></param>
4162 protected virtual ScenePresence WaitGetScenePresence(UUID agentID) 4169 protected virtual ScenePresence WaitGetScenePresence(UUID agentID)
4163 { 4170 {
4164 int ntimes = 10; 4171 int ntimes = 10;
4165 ScenePresence childAgentUpdate = null; 4172 ScenePresence sp = null;
4166 while ((childAgentUpdate = GetScenePresence(agentID)) == null && (ntimes-- > 0)) 4173 while ((sp = GetScenePresence(agentID)) == null && (ntimes-- > 0))
4167 Thread.Sleep(1000); 4174 Thread.Sleep(1000);
4168 return childAgentUpdate;
4169 4175
4176 if (sp == null)
4177 m_log.WarnFormat(
4178 "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout",
4179 agentID, RegionInfo.RegionName);
4180// else
4181// m_log.DebugFormat(
4182// "[SCENE PRESENCE]: Found presence {0} {1} {2} in {3} after {4} waits",
4183// sp.Name, sp.UUID, sp.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 10 - ntimes);
4184
4185 return sp;
4170 } 4186 }
4171 4187
4172 public virtual bool IncomingRetrieveRootAgent(UUID id, out IAgentData agent) 4188 public virtual bool IncomingRetrieveRootAgent(UUID id, out IAgentData agent)
@@ -5493,13 +5509,22 @@ Environment.Exit(1);
5493 return true; 5509 return true;
5494 } 5510 }
5495 5511
5496 int num = m_sceneGraph.GetNumberOfScenePresences(); 5512 // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check.
5513 // However, the long term fix is to make sure root agent count is always accurate.
5514 m_sceneGraph.RecalculateStats();
5515
5516 int num = m_sceneGraph.GetRootAgentCount();
5497 5517
5498 if (num >= RegionInfo.RegionSettings.AgentLimit) 5518 if (num >= RegionInfo.RegionSettings.AgentLimit)
5499 { 5519 {
5500 if (!Permissions.IsAdministrator(agentID)) 5520 if (!Permissions.IsAdministrator(agentID))
5501 { 5521 {
5502 reason = "The region is full"; 5522 reason = "The region is full";
5523
5524 m_log.DebugFormat(
5525 "[SCENE]: Denying presence with id {0} entry into {1} since region is at agent limit of {2}",
5526 agentID, RegionInfo.RegionName, RegionInfo.RegionSettings.AgentLimit);
5527
5503 return false; 5528 return false;
5504 } 5529 }
5505 } 5530 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 00f76e0..23a0550 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -860,11 +860,6 @@ namespace OpenSim.Region.Framework.Scenes
860 return m_scenePresenceArray; 860 return m_scenePresenceArray;
861 } 861 }
862 862
863 public int GetNumberOfScenePresences()
864 {
865 return m_scenePresenceArray.Count;
866 }
867
868 /// <summary> 863 /// <summary>
869 /// Request a scene presence by UUID. Fast, indexed lookup. 864 /// Request a scene presence by UUID. Fast, indexed lookup.
870 /// </summary> 865 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 913942f..e0872d0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1299,6 +1299,12 @@ namespace OpenSim.Region.Framework.Scenes
1299 Scene.SimulationService.ReleaseAgent(m_originRegionID, UUID, m_callbackURI); 1299 Scene.SimulationService.ReleaseAgent(m_originRegionID, UUID, m_callbackURI);
1300 m_callbackURI = null; 1300 m_callbackURI = null;
1301 } 1301 }
1302// else
1303// {
1304// m_log.DebugFormat(
1305// "[SCENE PRESENCE]: No callback provided on CompleteMovement of {0} {1} to {2}",
1306// client.Name, client.AgentId, m_scene.RegionInfo.RegionName);
1307// }
1302 1308
1303 ValidateAndSendAppearanceAndAgentData(); 1309 ValidateAndSendAppearanceAndAgentData();
1304 1310
@@ -2691,7 +2697,7 @@ namespace OpenSim.Region.Framework.Scenes
2691 // If we are using the the cached appearance then send it out to everyone 2697 // If we are using the the cached appearance then send it out to everyone
2692 if (cachedappearance) 2698 if (cachedappearance)
2693 { 2699 {
2694 m_log.DebugFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); 2700 m_log.DebugFormat("[SCENE PRESENCE]: baked textures are in the cache for {0}", Name);
2695 2701
2696 // If the avatars baked textures are all in the cache, then we have a 2702 // If the avatars baked textures are all in the cache, then we have a
2697 // complete appearance... send it out, if not, then we'll send it when 2703 // complete appearance... send it out, if not, then we'll send it when
@@ -3153,7 +3159,7 @@ namespace OpenSim.Region.Framework.Scenes
3153 3159
3154 public void ChildAgentDataUpdate(AgentData cAgentData) 3160 public void ChildAgentDataUpdate(AgentData cAgentData)
3155 { 3161 {
3156 //m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); 3162// m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
3157 if (!IsChildAgent) 3163 if (!IsChildAgent)
3158 return; 3164 return;
3159 3165
@@ -3297,6 +3303,9 @@ namespace OpenSim.Region.Framework.Scenes
3297 m_originRegionID = cAgent.RegionID; 3303 m_originRegionID = cAgent.RegionID;
3298 3304
3299 m_callbackURI = cAgent.CallbackURI; 3305 m_callbackURI = cAgent.CallbackURI;
3306// m_log.DebugFormat(
3307// "[SCENE PRESENCE]: Set callback for {0} in {1} to {2} in CopyFrom()",
3308// Name, m_scene.RegionInfo.RegionName, m_callbackURI);
3300 3309
3301 m_pos = cAgent.Position; 3310 m_pos = cAgent.Position;
3302 m_velocity = cAgent.Velocity; 3311 m_velocity = cAgent.Velocity;
@@ -4120,7 +4129,7 @@ namespace OpenSim.Region.Framework.Scenes
4120 { 4129 {
4121 if ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) == 4130 if ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) ==
4122 (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) || 4131 (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) ||
4123 (m_teleportFlags & TeleportFlags.ViaLandmark) != 0 || 4132 (m_scene.TelehubAllowLandmarks == true ? false : ((m_teleportFlags & TeleportFlags.ViaLandmark) != 0 )) ||
4124 (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || 4133 (m_teleportFlags & TeleportFlags.ViaLocation) != 0 ||
4125 (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0) 4134 (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)
4126 { 4135 {