From ac866a1c46583e50e74aefad0a1bc6de720a7211 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Sep 2014 00:25:56 +0100 Subject: Add [EntityTransfer] AllowAvatarCrossing setting to determine whether avatars are allowed to cross regions at all. Defaults to true. For test purposes. --- OpenSim/Region/Framework/Scenes/Scene.cs | 17 +++++++++++++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18376c3..5f0dbd7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -224,6 +224,12 @@ namespace OpenSim.Region.Framework.Scenes public bool m_clampPrimSize; public bool m_trustBinaries; public bool m_allowScriptCrossings = true; + + /// + /// Can avatars cross from and to this region? + /// + public bool AllowAvatarCrossing { get; set; } + public bool m_useFlySlow; public bool m_useTrashOnDelete = true; @@ -1023,6 +1029,12 @@ namespace OpenSim.Region.Framework.Scenes #endregion Region Config + IConfig entityTransferConfig = m_config.Configs["EntityTransfer"]; + if (entityTransferConfig != null) + { + AllowAvatarCrossing = entityTransferConfig.GetBoolean("AllowAvatarCrossing", AllowAvatarCrossing); + } + #region Interest Management IConfig interestConfig = m_config.Configs["InterestManagement"]; @@ -1091,6 +1103,8 @@ namespace OpenSim.Region.Framework.Scenes CollidablePrims = true; PhysicsEnabled = true; + AllowAvatarCrossing = true; + PeriodicBackup = true; UseBackup = true; @@ -5613,6 +5627,9 @@ namespace OpenSim.Region.Framework.Scenes return true; } + if (!AllowAvatarCrossing && !viaTeleport) + return false; + // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check. // However, the long term fix is to make sure root agent count is always accurate. m_sceneGraph.RecalculateStats(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f2a636a..3c37de8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3226,7 +3226,8 @@ namespace OpenSim.Region.Framework.Scenes m_lastVelocity = Velocity; } - CheckForBorderCrossing(); + if (Scene.AllowAvatarCrossing) + CheckForBorderCrossing(); CheckForSignificantMovement(); // sends update to the modules. } -- cgit v1.1