From a1cd3b5b88cc2cc3fcd552085dc9ab46f9d9b10f Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 15 Mar 2010 17:54:39 +0000 Subject: Change GodLevel to UserLevel so gods can teleport freely without having to enter god mode first --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 24179a9..2661dc3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -879,7 +879,7 @@ namespace OpenSim.Region.Framework.Scenes if (land != null) { //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. - if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_godLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid) + if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_userLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid) { pos = land.LandData.UserLocation; } -- cgit v1.1 From 73e9b0be725a73a489b29f3fe2df236c897ef3b5 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Wed, 17 Mar 2010 06:40:00 -0700 Subject: Inconsistent locking of ScenePresence array in SceneGraph. Fixed by eliminating option to return the actual list. Callers can now either request a copy of the array as a new List or ask the SceneGraph to call a delegate function on every ScenePresence. Iteration and locking of the ScenePresences now takes place only within the SceneGraph class. This patch also applies a fix to Combat/CombatModule.cs which had unlocked iteration of the ScenePresences and inconsistent try/catch around the use of those ScenePresences. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f16ff3..766f6d3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -912,14 +912,11 @@ namespace OpenSim.Region.Framework.Scenes m_isChildAgent = false; - ScenePresence[] animAgents = m_scene.GetScenePresences(); - for (int i = 0; i < animAgents.Length; i++) + m_scene.ForEachScenePresence(delegate(ScenePresence presence) { - ScenePresence presence = animAgents[i]; - if (presence != this) presence.Animator.SendAnimPackToClient(ControllingClient); - } + }); m_scene.EventManager.TriggerOnMakeRootAgent(this); } @@ -2469,13 +2466,10 @@ namespace OpenSim.Region.Framework.Scenes public void SendInitialFullUpdateToAllClients() { m_perfMonMS = Util.EnvironmentTickCount(); - - ScenePresence[] avatars = m_scene.GetScenePresences(); - - for (int i = 0; i < avatars.Length; i++) + int avUpdates = 0; + m_scene.ForEachScenePresence(delegate(ScenePresence avatar) { - ScenePresence avatar = avatars[i]; - + ++avUpdates; // only send if this is the root (children are only "listening posts" in a foreign region) if (!IsChildAgent) { @@ -2491,9 +2485,9 @@ namespace OpenSim.Region.Framework.Scenes avatar.Animator.SendAnimPackToClient(ControllingClient); } } - } + }); - m_scene.StatsReporter.AddAgentUpdates(avatars.Length); + m_scene.StatsReporter.AddAgentUpdates(avUpdates); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); //Animator.SendAnimPack(); -- cgit v1.1