diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 114 |
1 files changed, 65 insertions, 49 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c132c5d..96e45ed 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -230,6 +230,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
230 | public bool m_seeIntoBannedRegion = false; | 230 | public bool m_seeIntoBannedRegion = false; |
231 | public int MaxUndoCount = 5; | 231 | public int MaxUndoCount = 5; |
232 | 232 | ||
233 | public bool SeeIntoRegion { get; set; } | ||
234 | |||
233 | // Using this for RegionReady module to prevent LoginsDisabled from changing under our feet; | 235 | // Using this for RegionReady module to prevent LoginsDisabled from changing under our feet; |
234 | public bool LoginLock = false; | 236 | public bool LoginLock = false; |
235 | 237 | ||
@@ -861,9 +863,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
861 | //Animation states | 863 | //Animation states |
862 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); | 864 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); |
863 | 865 | ||
866 | |||
867 | MaxUndoCount = startupConfig.GetInt("MaxPrimUndos", 20); | ||
868 | |||
864 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); | 869 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); |
865 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); | 870 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); |
866 | |||
867 | m_minNonphys = startupConfig.GetFloat("NonPhysicalPrimMin", m_minNonphys); | 871 | m_minNonphys = startupConfig.GetFloat("NonPhysicalPrimMin", m_minNonphys); |
868 | if (RegionInfo.NonphysPrimMin > 0) | 872 | if (RegionInfo.NonphysPrimMin > 0) |
869 | { | 873 | { |
@@ -3910,15 +3914,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3910 | 3914 | ||
3911 | try | 3915 | try |
3912 | { | 3916 | { |
3913 | // Always check estate if this is a login. Always | 3917 | if (!AuthorizeUser(agent, SeeIntoRegion, out reason)) |
3914 | // check if banned regions are to be blacked out. | ||
3915 | if (vialogin || (!m_seeIntoBannedRegion)) | ||
3916 | { | 3918 | { |
3917 | if (!AuthorizeUser(agent, out reason)) | 3919 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); |
3918 | { | 3920 | return false; |
3919 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); | ||
3920 | return false; | ||
3921 | } | ||
3922 | } | 3921 | } |
3923 | } | 3922 | } |
3924 | catch (Exception e) | 3923 | catch (Exception e) |
@@ -4158,7 +4157,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4158 | /// <param name="reason">outputs the reason to this string</param> | 4157 | /// <param name="reason">outputs the reason to this string</param> |
4159 | /// <returns>True if the region accepts this agent. False if it does not. False will | 4158 | /// <returns>True if the region accepts this agent. False if it does not. False will |
4160 | /// also return a reason.</returns> | 4159 | /// also return a reason.</returns> |
4161 | protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason) | 4160 | protected virtual bool AuthorizeUser(AgentCircuitData agent, bool bypassAccessControl, out string reason) |
4162 | { | 4161 | { |
4163 | reason = String.Empty; | 4162 | reason = String.Empty; |
4164 | 4163 | ||
@@ -4193,51 +4192,58 @@ namespace OpenSim.Region.Framework.Scenes | |||
4193 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); | 4192 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); |
4194 | } | 4193 | } |
4195 | 4194 | ||
4196 | List<UUID> agentGroups = new List<UUID>(); | 4195 | // We only test the things below when we want to cut off |
4197 | 4196 | // child agents from being present in the scene for which their root | |
4198 | if (m_groupsModule != null) | 4197 | // agent isn't allowed. Otherwise, we allow child agents. The test for |
4198 | // the root is done elsewhere (QueryAccess) | ||
4199 | if (!bypassAccessControl) | ||
4199 | { | 4200 | { |
4200 | GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); | 4201 | List<UUID> agentGroups = new List<UUID>(); |
4201 | 4202 | ||
4202 | if (GroupMembership != null) | 4203 | if (m_groupsModule != null) |
4203 | { | 4204 | { |
4204 | for (int i = 0; i < GroupMembership.Length; i++) | 4205 | GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); |
4205 | agentGroups.Add(GroupMembership[i].GroupID); | 4206 | |
4206 | } | 4207 | if (GroupMembership != null) |
4207 | else | 4208 | { |
4208 | { | 4209 | for (int i = 0; i < GroupMembership.Length; i++) |
4209 | m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); | 4210 | agentGroups.Add(GroupMembership[i].GroupID); |
4211 | } | ||
4212 | else | ||
4213 | { | ||
4214 | m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); | ||
4215 | } | ||
4210 | } | 4216 | } |
4211 | } | ||
4212 | 4217 | ||
4213 | bool groupAccess = false; | 4218 | bool groupAccess = false; |
4214 | UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups; | 4219 | UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups; |
4215 | 4220 | ||
4216 | if (estateGroups != null) | 4221 | if (estateGroups != null) |
4217 | { | ||
4218 | foreach (UUID group in estateGroups) | ||
4219 | { | 4222 | { |
4220 | if (agentGroups.Contains(group)) | 4223 | foreach (UUID group in estateGroups) |
4221 | { | 4224 | { |
4222 | groupAccess = true; | 4225 | if (agentGroups.Contains(group)) |
4223 | break; | 4226 | { |
4227 | groupAccess = true; | ||
4228 | break; | ||
4229 | } | ||
4224 | } | 4230 | } |
4225 | } | 4231 | } |
4226 | } | 4232 | else |
4227 | else | 4233 | { |
4228 | { | 4234 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); |
4229 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); | 4235 | } |
4230 | } | ||
4231 | 4236 | ||
4232 | if (!RegionInfo.EstateSettings.PublicAccess && | 4237 | if (!RegionInfo.EstateSettings.PublicAccess && |
4233 | !RegionInfo.EstateSettings.HasAccess(agent.AgentID) && | 4238 | !RegionInfo.EstateSettings.HasAccess(agent.AgentID) && |
4234 | !groupAccess) | 4239 | !groupAccess) |
4235 | { | 4240 | { |
4236 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", | 4241 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", |
4237 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | 4242 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
4238 | reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", | 4243 | reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", |
4239 | RegionInfo.RegionName); | 4244 | RegionInfo.RegionName); |
4240 | return false; | 4245 | return false; |
4246 | } | ||
4241 | } | 4247 | } |
4242 | 4248 | ||
4243 | // TODO: estate/region settings are not properly hooked up | 4249 | // TODO: estate/region settings are not properly hooked up |
@@ -4402,6 +4408,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4402 | } | 4408 | } |
4403 | 4409 | ||
4404 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 4410 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); |
4411 | |||
4412 | int ntimes = 20; | ||
4413 | if (cAgentData.SenderWantsToWaitForRoot) | ||
4414 | { | ||
4415 | while (childAgentUpdate.IsChildAgent && ntimes-- > 0) | ||
4416 | Thread.Sleep(1000); | ||
4417 | |||
4418 | m_log.DebugFormat( | ||
4419 | "[SCENE]: Found presence {0} {1} {2} in {3} after {4} waits", | ||
4420 | childAgentUpdate.Name, childAgentUpdate.UUID, childAgentUpdate.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 20 - ntimes); | ||
4421 | |||
4422 | if (childAgentUpdate.IsChildAgent) | ||
4423 | return false; | ||
4424 | } | ||
4405 | return true; | 4425 | return true; |
4406 | } | 4426 | } |
4407 | return false; | 4427 | return false; |
@@ -4459,10 +4479,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4459 | m_log.WarnFormat( | 4479 | m_log.WarnFormat( |
4460 | "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout", | 4480 | "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout", |
4461 | agentID, RegionInfo.RegionName); | 4481 | agentID, RegionInfo.RegionName); |
4462 | // else | ||
4463 | // m_log.DebugFormat( | ||
4464 | // "[SCENE PRESENCE]: Found presence {0} {1} {2} in {3} after {4} waits", | ||
4465 | // sp.Name, sp.UUID, sp.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 10 - ntimes); | ||
4466 | 4482 | ||
4467 | return sp; | 4483 | return sp; |
4468 | } | 4484 | } |
@@ -5873,7 +5889,7 @@ Environment.Exit(1); | |||
5873 | 5889 | ||
5874 | try | 5890 | try |
5875 | { | 5891 | { |
5876 | if (!AuthorizeUser(aCircuit, out reason)) | 5892 | if (!AuthorizeUser(aCircuit, false, out reason)) |
5877 | { | 5893 | { |
5878 | // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); | 5894 | // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); |
5879 | return false; | 5895 | return false; |