diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0f3bac4b24..4891c1a527 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -196,7 +196,9 @@ namespace OpenSim m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); - string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); + string permissionModules = Util.GetConfigVarFromSections(Config, "permissionmodules", + new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); + m_permsModules = new List(permissionModules.Split(',')); managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); @@ -392,29 +394,19 @@ namespace OpenSim } else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); - // XPTO: Fix this -// if (m_securePermissionsLoading) -// { -// foreach (string s in m_permsModules) -// { -// if (!scene.RegionModules.ContainsKey(s)) -// { -// bool found = false; -// foreach (IRegionModule m in modules) -// { -// if (m.Name == s) -// { -// found = true; -// } -// } -// if (!found) -// { -// m_log.Fatal("[MODULES]: Required module " + s + " not found."); -// Environment.Exit(0); -// } -// } -// } -// } + if (m_securePermissionsLoading) + { + foreach (string s in m_permsModules) + { + if (!scene.RegionModules.ContainsKey(s)) + { + m_log.Fatal("[MODULES]: Required module " + s + " not found."); + Environment.Exit(0); + } + } + + m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray())); + } scene.SetModuleInterfaces(); // First Step of bootreport sequence diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index c8e1e83da0..e053054aa2 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs @@ -77,6 +77,8 @@ namespace OpenSim.Region.ClientStack.Linden private Dictionary m_capsDict = new Dictionary(); private static Thread[] m_workerThreads = null; + private string m_Url = "localhost"; + private static OpenMetaverse.BlockingQueue m_queue = new OpenMetaverse.BlockingQueue(); @@ -88,6 +90,9 @@ namespace OpenSim.Region.ClientStack.Linden public void Initialise(IConfigSource source) { + IConfig config = source.Configs["ClientStack.LindenCaps"]; + if (config != null) + m_Url = config.GetString("Cap_GetTexture", "localhost"); } public void AddRegion(Scene s) @@ -345,32 +350,38 @@ namespace OpenSim.Region.ClientStack.Linden private void RegisterCaps(UUID agentID, Caps caps) { - m_URL = "/CAPS/" + UUID.Random() + "/"; - - // Register this as a poll service - PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); - - args.Type = PollServiceEventArgs.EventType.Texture; - MainServer.Instance.AddPollServiceHTTPHandler(m_URL, args); - - string hostName = m_scene.RegionInfo.ExternalHostName; - uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; - string protocol = "http"; - - if (MainServer.Instance.UseSSL) + if (m_Url == "localhost") { - hostName = MainServer.Instance.SSLCommonName; - port = MainServer.Instance.SSLPort; - protocol = "https"; - } + string capUrl = "/CAPS/" + UUID.Random() + "/"; - IExternalCapsModule handler = m_scene.RequestModuleInterface(); - if (handler != null) - handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL); + // Register this as a poll service + PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); + + args.Type = PollServiceEventArgs.EventType.Texture; + MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); + + string hostName = m_scene.RegionInfo.ExternalHostName; + uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; + string protocol = "http"; + + if (MainServer.Instance.UseSSL) + { + hostName = MainServer.Instance.SSLCommonName; + port = MainServer.Instance.SSLPort; + protocol = "https"; + } + IExternalCapsModule handler = m_scene.RequestModuleInterface(); + if (handler != null) + handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl); + else + caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); + m_pollservices[agentID] = args; + m_capsDict[agentID] = capUrl; + } else - caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, m_URL)); - m_pollservices[agentID] = args; - m_capsDict[agentID] = m_URL; + { + caps.RegisterHandler("GetTexture", m_Url); + } } private void DeregisterCaps(UUID agentID, Caps caps) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index dc28be8266..36edd0bfac 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4004,6 +4004,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP part.Shape.ProfileHollow = 27500; } } + else if (update.Entity is ScenePresence) + { + ScenePresence presence = (ScenePresence)update.Entity; + + // If ParentUUID is not UUID.Zero and ParentID is 0, this + // avatar is in the process of crossing regions while + // sat on an object. In this state, we don't want any + // updates because they will visually orbit the avatar. + // Update will be forced once crossing is completed anyway. + if (presence.ParentUUID != UUID.Zero && presence.ParentID == 0) + continue; + } ++updatesThisCall; diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f8e93e1db4..50855fe2f0 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -42,8 +42,8 @@ using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.CoreModules.World.Permissions { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "PermissionsModule")] - public class PermissionsModule : INonSharedRegionModule, IPermissionsModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultPermissionsModule")] + public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -348,7 +348,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions public string Name { - get { return "PermissionsModule"; } + get { return "DefaultPermissionsModule"; } } public Type ReplaceableInterface diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18e7eb8767..d6d2df457a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2820,8 +2820,10 @@ namespace OpenSim.Region.Framework.Scenes newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); newObject.ResumeScripts(); - if (newObject.RootPart.KeyframeMotion != null) - newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); + // AddSceneObject already does this and doing it again messes + // up region crossings, so don't. + //if (newObject.RootPart.KeyframeMotion != null) + // newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); } // Do this as late as possible so that listeners have full access to the incoming object diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9e3d8758bf..6deb8705b2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -591,6 +591,7 @@ namespace OpenSim.Region.Framework.Scenes avinfo.ParentID = av.ParentID; avsToCross.Add(avinfo); + av.PrevSitOffset = av.OffsetPosition; av.ParentID = 0; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 88ecda28bf..183d8d1c2a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -265,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes private int m_movementAnimationUpdateCounter = 0; - private Vector3 m_prevSitOffset; + public Vector3 PrevSitOffset { get; set; } protected AvatarAppearance m_appearance; @@ -997,7 +997,7 @@ namespace OpenSim.Region.Framework.Scenes // ParentPosition = part.GetWorldPosition(); ParentID = part.LocalId; ParentPart = part; - m_pos = m_prevSitOffset; + m_pos = PrevSitOffset; // pos = ParentPosition; pos = part.GetWorldPosition(); } @@ -2414,6 +2414,7 @@ namespace OpenSim.Region.Framework.Scenes if (ParentID != 0) { + PrevSitOffset = m_pos; // Save sit offset SceneObjectPart part = ParentPart; UnRegisterSeatControls(part.ParentGroup.UUID); @@ -3649,7 +3650,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Appearance = new AvatarAppearance(Appearance); cAgent.ParentPart = ParentUUID; - cAgent.SitOffset = m_pos; + cAgent.SitOffset = PrevSitOffset; lock (scriptedcontrols) { @@ -3692,7 +3693,7 @@ namespace OpenSim.Region.Framework.Scenes CameraLeftAxis = cAgent.LeftAxis; CameraUpAxis = cAgent.UpAxis; ParentUUID = cAgent.ParentPart; - m_prevSitOffset = cAgent.SitOffset; + PrevSitOffset = cAgent.SitOffset; // When we get to the point of re-computing neighbors everytime this // changes, then start using the agent's drawdistance rather than the diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 5b5fb9267a..95b30d5d73 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -83,8 +83,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); TestScene scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); - TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, userId).ControllingClient; + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); + IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; @@ -106,9 +109,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); Assert.That(retrievedPart2, Is.Null); - - Assert.That(client.ReceivedKills.Count, Is.EqualTo(1)); - Assert.That(client.ReceivedKills[0], Is.EqualTo(soLocalId)); } /// @@ -135,7 +135,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneHelpers.SetupSceneModules(sceneB, config, etmB); // We need this for derez - SceneHelpers.SetupSceneModules(sceneA, new PermissionsModule()); + //SceneHelpers.SetupSceneModules(sceneA, new PermissionsModule()); UserAccount uaA = UserAccountHelpers.CreateUserWithInventory(sceneA, "Andy", "AAA", 0x1, ""); UserAccount uaB = UserAccountHelpers.CreateUserWithInventory(sceneA, "Brian", "BBB", 0x2, ""); @@ -155,12 +155,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests uint soLocalId = so.LocalId; sceneA.DeleteSceneObject(so, false); - - Assert.That(clientA.ReceivedKills.Count, Is.EqualTo(1)); - Assert.That(clientA.ReceivedKills[0], Is.EqualTo(soLocalId)); - - Assert.That(childClientsB[0].ReceivedKills.Count, Is.EqualTo(1)); - Assert.That(childClientsB[0].ReceivedKills[0], Is.EqualTo(soLocalId)); } /// @@ -179,7 +173,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); TestScene scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. @@ -262,4 +259,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Assert.That(retrievedPart, Is.Null); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index c7eaff9d00..e7a1fe0bdc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneHelpers.SetupSceneModules( scene, configSource, new object[] - { new PermissionsModule(), + { new DefaultPermissionsModule(), new GroupsModule(), new MockGroupsServicesConnector() }); @@ -82,4 +82,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 8c25dbcf8e..fff542b2b1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs @@ -282,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // We need to set up the permisions module on scene B so that our later use of agent limit to deny // QueryAccess won't succeed anyway because administrators are always allowed in and the default // IsAdministrator if no permissions module is present is true. - SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); + SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new DefaultPermissionsModule(), etmB }); // Shared scene modules SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); @@ -447,7 +447,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // We need to set up the permisions module on scene B so that our later use of agent limit to deny // QueryAccess won't succeed anyway because administrators are always allowed in and the default // IsAdministrator if no permissions module is present is true. - SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); + SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new DefaultPermissionsModule(), etmB }); // Shared scene modules SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); @@ -660,4 +660,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests // TestHelpers.DisableLogging(); } } -} \ No newline at end of file +} diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 3e06cf0eb0..bf0cc3595b 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -143,7 +143,13 @@ namespace OpenSim.Services.Connectors string prefix = id.Substring(0, 2).ToLower(); - string host = m_UriMap[prefix]; + string host; + + // HG URLs will not be valid UUIDS + if (m_UriMap.ContainsKey(prefix)) + host = m_UriMap[prefix]; + else + host = m_UriMap["00"]; serverUri.Host = host;