From 3d0778bcd6ca6711850257a7d666fc30919e7e66 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Fri, 21 Mar 2014 20:43:26 -0400 Subject: Allow Mono Plugin Registry setting for Regions Signed-off-by: Melanie --- OpenSim/Framework/PluginLoader.cs | 13 +++++++------ OpenSim/Region/Application/OpenSimBase.cs | 5 ++++- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 819cb7b..a2bf9f3 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs @@ -215,7 +215,7 @@ namespace OpenSim.Framework AddinManager.AddinLoadError += on_addinloaderror_; AddinManager.AddinLoaded += on_addinloaded_; - clear_registry_(); + clear_registry_(dir); suppress_console_output_(true); AddinManager.Initialize(dir); @@ -239,18 +239,19 @@ namespace OpenSim.Framework + args.Exception.StackTrace); } - private void clear_registry_() + private void clear_registry_(string dir) { // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) // occasionally seems to corrupt its addin cache // Hence, as a temporary solution we'll remove it before each startup + try { - if (Directory.Exists("addin-db-000")) - Directory.Delete("addin-db-000", true); + if (Directory.Exists(dir + "/addin-db-000")) + Directory.Delete(dir + "/addin-db-000", true); - if (Directory.Exists("addin-db-001")) - Directory.Delete("addin-db-001", true); + if (Directory.Exists(dir + "/addin-db-001")) + Directory.Delete(dir + "/addin-db-001", true); } catch (IOException) { diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0dc9306..8a27967 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -158,7 +158,10 @@ namespace OpenSim protected virtual void LoadPlugins() { - using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + IConfig startupConfig = Config.Configs["Startup"]; + string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation",".") : "."; + + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) { loader.Load("/OpenSim/Startup"); m_plugins = loader.Plugins; -- cgit v1.1 From a4d322dcd1d7f7796180d63b9d9f7405332577c7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 22 Mar 2014 01:47:48 +0000 Subject: Allow the setting from the environment to take effect if no explicit setting is given. This is done by calling the constructor only with a directory if one is actually given. --- OpenSim/Region/Application/OpenSimBase.cs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 8a27967..9d36986 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -159,12 +159,26 @@ namespace OpenSim protected virtual void LoadPlugins() { IConfig startupConfig = Config.Configs["Startup"]; - string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation",".") : "."; + string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty; - using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + // The location can also be specified in the environment. If there + // is no location in the configuration, we must call the constructor + // without a location parameter to allow that to happen. + if (registryLocation == String.Empty) { - loader.Load("/OpenSim/Startup"); - m_plugins = loader.Plugins; + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } + } + else + { + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } } } @@ -1052,4 +1066,4 @@ namespace OpenSim { public IConfigSource Source; } -} \ No newline at end of file +} -- cgit v1.1 From d4dad75a3c73fdfd4f156e1684d04f13b92f2362 Mon Sep 17 00:00:00 2001 From: Vegaslon Date: Sat, 22 Mar 2014 15:03:13 -0400 Subject: BulletSim: Fix jumping while running. Was unintentional taking way all upward target motion for avatar when running. Signed-off-by: Michael Cerquoni --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index fc18960..c9b134c 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -426,7 +426,7 @@ public sealed class BSCharacter : BSPhysObject m_targetVelocity = value; OMV.Vector3 targetVel = value; if (_setAlwaysRun && !_flying) - targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 0f); + targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); if (m_moveActor != null) m_moveActor.SetVelocityAndTarget(RawVelocity, targetVel, false /* inTaintTime */); -- cgit v1.1 From 58def34dbe01af970ca0cbd7362aa24cd85fc43d Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sun, 16 Jun 2013 12:00:58 -0400 Subject: Set default name for mute list module as shown in OpenSim.ini.example --- OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 7ce2813..a087569 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } - if (cnf != null && cnf.GetString("MuteListModule", "None") != + if (cnf != null && cnf.GetString("MuteListModule", "MuteListModule") != "MuteListModule") { enabled = false; -- cgit v1.1 From fe16a72a9a10c5b9057351f798d9098ada3002ae Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Tue, 22 Oct 2013 15:43:18 -0400 Subject: Pass method to offline.php using ?blah instead of /blah/. Avoids issue with Apache web servers running PHP via CGI. --- .../Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 7f3d0a2..5900e21 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage List msglist = SynchronousRestObjectRequester.MakeRequest>( - "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); + "POST", m_RestURL + "?RetrieveMessages", client.AgentId); if (msglist == null) { @@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage scene = m_SceneList[0]; bool success = SynchronousRestObjectRequester.MakeRequest( - "POST", m_RestURL+"/SaveMessage/", im); + "POST", m_RestURL+"?SaveMessage", im); if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) { -- cgit v1.1 From 58d7e3b8ed24b2f7c68c7943b2b7a7a96c6a1565 Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sat, 22 Mar 2014 16:22:36 -0400 Subject: Reverting "Pass method to offline.php" commit that was pushed by mistake. This reverts commit fe16a72a9a10c5b9057351f798d9098ada3002ae. --- .../Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 5900e21..7f3d0a2 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage List msglist = SynchronousRestObjectRequester.MakeRequest>( - "POST", m_RestURL + "?RetrieveMessages", client.AgentId); + "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); if (msglist == null) { @@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage scene = m_SceneList[0]; bool success = SynchronousRestObjectRequester.MakeRequest( - "POST", m_RestURL+"?SaveMessage", im); + "POST", m_RestURL+"/SaveMessage/", im); if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) { -- cgit v1.1 From ff5c38534d3bedbe10547409064f3410246bb9e6 Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sat, 22 Mar 2014 16:38:11 -0400 Subject: Reverting "Set default name for mute list" that was pushed by mistake. This reverts commit 58def34dbe01af970ca0cbd7362aa24cd85fc43d. --- OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index a087569..7ce2813 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } - if (cnf != null && cnf.GetString("MuteListModule", "MuteListModule") != + if (cnf != null && cnf.GetString("MuteListModule", "None") != "MuteListModule") { enabled = false; -- cgit v1.1 From db83208794fe6bef3e2d7f0574739c48fd36edc5 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Sat, 22 Mar 2014 21:47:23 -0400 Subject: Fix negative stat for Active Scripts Signed-off-by: Michael Cerquoni --- OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1ca142e..c3846d9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -245,8 +245,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments string state = sog.GetStateSnapshot(); ad.AttachmentObjectStates.Add(state); sp.InTransitScriptStates.Add(state); - // Let's remove the scripts of the original object here - sog.RemoveScriptInstances(true); + + // Scripts of the originals will be removed when the Agent is successfully removed. + // sog.RemoveScriptInstances(true); } } } -- cgit v1.1 From b0cb0ec02f5f567539b340727727bee1a43836e6 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 23 Mar 2014 13:08:31 -0700 Subject: BulletSim: fix problem where axis constraints were also constraining linear motion. The code was limiting linear motion to be only in the positive direction for any axis that was constrained. --- OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs index 8b0fdeb..7e61007 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -121,8 +121,10 @@ public class BSActorLockAxis : BSActor // The constraint is tied to the world and oriented to the prim. // Free to move linearly in the region - OMV.Vector3 linearLow = OMV.Vector3.Zero; - OMV.Vector3 linearHigh = m_physicsScene.TerrainManager.DefaultRegionSize; + // OMV.Vector3 linearLow = OMV.Vector3.Zero; + // OMV.Vector3 linearHigh = m_physicsScene.TerrainManager.DefaultRegionSize; + OMV.Vector3 linearLow = new OMV.Vector3(-10000f, -10000f, -10000f); + OMV.Vector3 linearHigh = new OMV.Vector3(10000f, 10000f, 10000f); if (m_controllingPrim.LockedLinearAxis.X != BSPhysObject.FreeAxis) { linearLow.X = m_controllingPrim.RawPosition.X; -- cgit v1.1 From 62b3bdf0fc7a64dd9b845eb27fa8e1a2a1866c2b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 24 Oct 2013 11:18:15 +0300 Subject: When linking two groups, and then deleting the combined group: delete *all* of the combined group's prims, including those that came from the second subgroup This fixes http://opensimulator.org/mantis/view.php?id=6175 --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++---- .../Region/Framework/Scenes/SceneObjectGroup.cs | 38 ++++++++++++++++++---- .../Scenes/Tests/SceneObjectLinkingTests.cs | 8 ++--- 3 files changed, 41 insertions(+), 17 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d16b73b..08a2301 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1757,6 +1757,7 @@ namespace OpenSim.Region.Framework.Scenes { if (group != null) { + group.HasGroupChanged = true; group.ProcessBackup(SimulationDataService, true); } } @@ -2345,13 +2346,12 @@ namespace OpenSim.Region.Framework.Scenes { if (!softDelete) { - // Force a database update so that the scene object group ID is accurate. It's possible that the - // group has recently been delinked from another group but that this change has not been persisted - // to the DB. + // If the group contains prims whose SceneGroupID is incorrect then force a + // database update, because RemoveObject() works by searching on the SceneGroupID. // This is an expensive thing to do so only do it if absolutely necessary. - if (so.HasGroupChangedDueToDelink) - ForceSceneObjectBackup(so); - + if (so.GroupContainsForeignPrims) + ForceSceneObjectBackup(so); + so.DetachFromBackup(); SimulationDataService.RemoveObject(so.UUID, RegionInfo.RegionID); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6f26176..a78a0cb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -150,12 +150,27 @@ namespace OpenSim.Region.Framework.Scenes get { return m_hasGroupChanged; } } + + private bool m_groupContainsForeignPrims = false; /// - /// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since - /// an unlinked group currently has to be persisted to the database before we can perform an unlink operation. + /// Whether the group contains prims that came from a different group. This happens when + /// linking or delinking groups. The implication is that until the group is persisted, + /// the prims in the database still use the old SceneGroupID. That's a problem if the group + /// is deleted, because we delete groups by searching for prims by their SceneGroupID. /// - public bool HasGroupChangedDueToDelink { get; private set; } + public bool GroupContainsForeignPrims + { + private set + { + m_groupContainsForeignPrims = value; + if (m_groupContainsForeignPrims) + HasGroupChanged = true; + } + + get { return m_groupContainsForeignPrims; } + } + private bool isTimeToPersist() { @@ -1624,7 +1639,7 @@ namespace OpenSim.Region.Framework.Scenes backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; HasGroupChanged = false; - HasGroupChangedDueToDelink = false; + GroupContainsForeignPrims = false; m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this); datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); @@ -2388,6 +2403,8 @@ namespace OpenSim.Region.Framework.Scenes // If linking prims with different permissions, fix them AdjustChildPrimPermissions(); + GroupContainsForeignPrims = true; + AttachToBackup(); // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the @@ -2531,9 +2548,16 @@ namespace OpenSim.Region.Framework.Scenes linkPart.Rezzed = RootPart.Rezzed; - // When we delete a group, we currently have to force persist to the database if the object id has changed - // (since delete works by deleting all rows which have a given object id) - objectGroup.HasGroupChangedDueToDelink = true; + // We must persist the delinked group to the database immediately, for safety. The problem + // is that although in memory the new group has a new SceneGroupID, in the database it + // still has the parent group's SceneGroupID (until the next backup). This means that if the + // parent group is deleted then the delinked group will also be deleted from the database. + // This problem will disappear if the region remains alive long enough for another backup, + // since at that time the delinked group's new SceneGroupID will be written to the database. + // But if the region crashes before that then the prims will be permanently gone, and this must + // not happen. (We can't use a just-in-time trick like GroupContainsForeignPrims in this case + // because the delinked group doesn't know when the source group is deleted.) + m_scene.ForceSceneObjectBackup(objectGroup); return objectGroup; } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 9378e20..fa8277c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -143,7 +143,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink."); Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); - Assert.That(grp3.HasGroupChangedDueToDelink, Is.True); + Assert.That(grp3.GroupContainsForeignPrims, Is.True); } [Test] @@ -349,10 +349,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests // These changes should occur immediately without waiting for a backup pass SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); - - Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True); + + Assert.That(groupToDelete.GroupContainsForeignPrims, Is.True); scene.DeleteSceneObject(groupToDelete, false); - Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False); + Assert.That(groupToDelete.GroupContainsForeignPrims, Is.False); List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); -- cgit v1.1 From 773ffcafc3dbbda29534b26d0a4813e1cf422a79 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 24 Oct 2013 12:21:20 +0300 Subject: Removed "hacktastic" code that is no longer needed. We no longer set the object's AbsolutePosition in this place, so the IsAttachment hack doesn't do anything anymore. This resolves http://opensimulator.org/mantis/view.php?id=6936 --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a78a0cb..b70e9df 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1701,28 +1701,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); dupe.Backup = false; dupe.m_parts = new MapAndArray(); - - // Warning, The following code related to previousAttachmentStatus is needed so that clones of - // attachments do not bordercross while they're being duplicated. This is hacktastic! - // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region! - // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state - // (which should be false anyway) set it as an Attachment and then set it's Absolute Position, - // then restore it's attachment state - - // This is only necessary when userExposed is false! - - bool previousAttachmentStatus = dupe.IsAttachment; - - if (!userExposed) - dupe.IsAttachment = true; - dupe.m_sittingAvatars = new List(); - - if (!userExposed) - { - dupe.IsAttachment = previousAttachmentStatus; - } - dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; -- cgit v1.1 From 6734b94761a4a8b1d03ea97fd6832c51af32bd8c Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 30 Oct 2013 15:10:29 +0200 Subject: Better error messages This resolves http://opensimulator.org/mantis/view.php?id=6936 --- .../Hypergrid/HGGroupsServiceRobustConnector.cs | 4 +-- .../Groups/Remote/GroupsServiceRobustConnector.cs | 2 +- .../Remote/OfflineIMServiceRobustConnector.cs | 2 +- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 11 ++++---- OpenSim/Server/Base/ServerUtils.cs | 6 ++--- .../Handlers/Inventory/XInventoryInConnector.cs | 2 +- .../Neighbour/NeighbourServicesConnector.cs | 30 +++++++++++----------- 7 files changed, 28 insertions(+), 29 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs index d2bcba5..dc36787 100644 --- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -158,7 +158,7 @@ namespace OpenSim.Groups } catch (Exception e) { - m_log.DebugFormat("[Groups.RobustHGConnector]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[Groups.RobustHGConnector]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 249d974..616afa9 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs @@ -140,7 +140,7 @@ namespace OpenSim.Groups } catch (Exception e) { - m_log.DebugFormat("[GROUPS HANDLER]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[GROUPS HANDLER]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs index 13b0e7e..ed5c742 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs @@ -109,7 +109,7 @@ namespace OpenSim.OfflineIM } catch (Exception e) { - m_log.DebugFormat("[OFFLINE IM HANDLER]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[OFFLINE IM HANDLER]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 6264f5d..978e567 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -897,15 +897,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance Part.Name, Part.UUID, false); - m_log.DebugFormat( - "[SCRIPT INSTANCE]: Runtime error in script {0}, part {1} {2} at {3} in {4}, displayed error {5}, actual exception {6}", + m_log.Debug(string.Format( + "[SCRIPT INSTANCE]: Runtime error in script {0}, part {1} {2} at {3} in {4} ", ScriptName, PrimName, Part.UUID, Part.AbsolutePosition, - Part.ParentGroup.Scene.Name, - text.Replace("\n", "\\n"), - e.InnerException); + Part.ParentGroup.Scene.Name), + e); } catch (Exception) { @@ -1220,4 +1219,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance return null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 08ba50d..c92e23c 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -280,11 +280,11 @@ namespace OpenSim.Server.Base { if (!(e is System.MissingMethodException)) { - m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}, {3}", + m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}", interfaceName, dllName, - e.InnerException == null ? e.Message : e.InnerException.Message, - e.StackTrace); + e.InnerException == null ? e.Message : e.InnerException.Message), + e); } m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length); return null; diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 0d7c136..5df3dda 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs @@ -155,7 +155,7 @@ namespace OpenSim.Server.Handlers.Asset } catch (Exception e) { - m_log.ErrorFormat("[XINVENTORY HANDLER]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[XINVENTORY HANDLER]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index 0f8033d..eecf096 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs @@ -97,9 +97,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Unable to parse uri {0} to send HelloNeighbour from {1} to {2}. Exception {3}{4}", - uri, thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Unable to parse uri {0} to send HelloNeighbour from {1} to {2}. Exception {3} ", + uri, thisRegion.RegionName, region.RegionName, e.Message), e); return false; } @@ -116,9 +116,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: PackRegionInfoData failed for HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: PackRegionInfoData failed for HelloNeighbour from {0} to {1}. Exception {2} ", + thisRegion.RegionName, region.RegionName, e.Message), e); return false; } @@ -136,9 +136,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Exception thrown on serialization of HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Exception thrown on serialization of HelloNeighbour from {0} to {1}. Exception {2} ", + thisRegion.RegionName, region.RegionName, e.Message), e); return false; } @@ -153,9 +153,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1} (uri {2}). Exception {3} ", + thisRegion.RegionName, region.RegionName, uri, e.Message), e); return false; } @@ -192,9 +192,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Exception on reply of DoHelloNeighbourCall from {0} back to {1}. Exception {2}{3}", - region.RegionName, thisRegion.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Exception on reply of DoHelloNeighbourCall from {0} back to {1}. Exception {2} ", + region.RegionName, thisRegion.RegionName, e.Message), e); return false; } -- cgit v1.1 From 921f0052f43e0e4553e970a8d560c5635fcd3ca6 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 8 Dec 2013 16:50:24 +0200 Subject: Get the full viewer name even if it's (incorrectly) sent in the 'Channel' field Recent versions of Firestorm and Singularity have started sending the viewer name in the 'Channel' field, leaving only their version number in the 'Viewer' field. So we need to search both of these fields for the viewer name. This resolves http://opensimulator.org/mantis/view.php?id=6952 --- OpenSim/Framework/Util.cs | 32 ++++++++++++++++++++++ OpenSim/Region/Application/OpenSim.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++--- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- .../Agent/UDP/Linden/LindenUDPInfoModule.cs | 4 +-- .../Services/HypergridService/GatekeeperService.cs | 12 ++++---- 6 files changed, 48 insertions(+), 13 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index efaed62..5805dc8 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2288,6 +2288,38 @@ namespace OpenSim.Framework { return str.Replace("_", "\\_").Replace("%", "\\%"); } + + /// + /// Returns the name of the user's viewer. + /// + /// + /// This method handles two ways that viewers specify their name: + /// 1. Viewer = "Firestorm-Release 4.4.2.34167", Channel = "(don't care)" -> "Firestorm-Release 4.4.2.34167" + /// 2. Viewer = "4.5.1.38838", Channel = "Firestorm-Beta" -> "Firestorm-Beta 4.5.1.38838" + /// + public static string GetViewerName(AgentCircuitData agent) + { + string name = agent.Viewer; + if (name == null) + name = ""; + else + name = name.Trim(); + + // Check if 'Viewer' is just a version number. If it's *not*, then we + // assume that it contains the real viewer name, and we return it. + foreach (char c in name) + { + if (Char.IsLetter(c)) + return name; + } + + // The 'Viewer' string contains just a version number. If there's anything in + // 'Channel' then assume that it's the viewer name. + if ((agent.Channel != null) && (agent.Channel.Length > 0)) + name = agent.Channel.Trim() + " " + name; + + return name; + } } public class DoubleQueue where T:class diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6d3331b..5c3039d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -982,7 +982,7 @@ namespace OpenSim aCircuit.child ? "child" : "root", aCircuit.circuitcode.ToString(), aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set", - aCircuit.Viewer); + Util.GetViewerName(aCircuit)); }); MainConsole.Instance.Output(cdt.ToString()); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 08a2301..51f6c5e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3413,6 +3413,7 @@ namespace OpenSim.Region.Framework.Scenes // TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport // Don't disable this log message - it's too helpful + string curViewer = Util.GetViewerName(acd); m_log.DebugFormat( "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})", RegionInfo.RegionName, @@ -3422,7 +3423,7 @@ namespace OpenSim.Region.Framework.Scenes acd.AgentID, acd.circuitcode, acd.IPAddress, - acd.Viewer, + curViewer, ((TPFlags)teleportFlags).ToString(), acd.startpos ); @@ -3442,7 +3443,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (string viewer in m_AllowedViewers) { - if (viewer == acd.Viewer.Substring(0, viewer.Length).Trim().ToLower()) + if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower()) { ViewerDenied = false; break; @@ -3459,7 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (string viewer in m_BannedViewers) { - if (viewer == acd.Viewer.Substring(0, viewer.Length).Trim().ToLower()) + if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower()) { ViewerDenied = true; break; @@ -3471,7 +3472,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE]: Access denied for {0} {1} using {2}", - acd.firstname, acd.lastname, acd.Viewer); + acd.firstname, acd.lastname, curViewer); reason = "Access denied, your viewer is banned by the region owner"; return false; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 491d0bf..64c464d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes public string Viewer { - get { return m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode).Viewer; } + get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); } } #endregion diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index ec18db0..44d4e93 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -669,7 +669,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden aCircuit = new AgentCircuitData(); if (!llClient.SceneAgent.IsChildAgent) - m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, aCircuit.Viewer, aCircuit.Id0); + m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0); int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); @@ -706,4 +706,4 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden m_log.InfoFormat("[INFO]: {0,25} {1,-6}", "Total", sum); } } -} \ No newline at end of file +} diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index f6136b5..7a0228b 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -228,17 +228,19 @@ namespace OpenSim.Services.HypergridService aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString()); + string curViewer = Util.GetViewerName(aCircuit); + // // Check client // if (m_AllowedClients != string.Empty) { Regex arx = new Regex(m_AllowedClients); - Match am = arx.Match(aCircuit.Viewer); + Match am = arx.Match(curViewer); if (!am.Success) { - m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", aCircuit.Viewer); + m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", curViewer); return false; } } @@ -246,11 +248,11 @@ namespace OpenSim.Services.HypergridService if (m_DeniedClients != string.Empty) { Regex drx = new Regex(m_DeniedClients); - Match dm = drx.Match(aCircuit.Viewer); + Match dm = drx.Match(curViewer); if (dm.Success) { - m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", aCircuit.Viewer); + m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", curViewer); return false; } } -- cgit v1.1 From 4bccfed80cf28746345301f525cfd17afc24c182 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 24 Mar 2014 14:20:19 +0200 Subject: When logging in UserAgentServiceConnector, always log the original server URL (the hostname), not the IP This resolves http://opensimulator.org/mantis/view.php?id=6955 (that patch was modified a bit) --- .../Hypergrid/UserAgentServiceConnector.cs | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index f869060..54191f6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -50,6 +50,7 @@ namespace OpenSim.Services.Connectors.Hypergrid LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + private string m_ServerURLHost; private string m_ServerURL; private GridRegion m_Gatekeeper; @@ -59,7 +60,7 @@ namespace OpenSim.Services.Connectors.Hypergrid public UserAgentServiceConnector(string url, bool dnsLookup) { - m_ServerURL = url; + m_ServerURL = m_ServerURLHost = url; if (dnsLookup) { @@ -75,7 +76,7 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", url, e.Message); } } @@ -99,11 +100,12 @@ namespace OpenSim.Services.Connectors.Hypergrid m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); throw new Exception("UserAgent connector init error"); } - m_ServerURL = serviceURI; + + m_ServerURL = m_ServerURLHost = serviceURI; if (!m_ServerURL.EndsWith("/")) m_ServerURL += "/"; - m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); + //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL); } protected override string AgentPath() @@ -206,20 +208,20 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURL, e.Message); + m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURLHost, e.Message); throw; } if (response.IsFault) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURL, response.FaultString)); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURLHost, response.FaultString)); } hash = (Hashtable)response.Value; if (hash == null) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURL)); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURLHost)); } return hash; @@ -370,14 +372,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURL); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURLHost); // reason = "Exception: " + e.Message; return friendsOnline; } if (response.IsFault) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURLHost, response.FaultString); // reason = "XMLRPC Fault"; return friendsOnline; } @@ -389,7 +391,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { if (hash == null) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost); // reason = "Internal error 1"; return friendsOnline; } @@ -442,14 +444,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURL); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURLHost); // reason = "Exception: " + e.Message; return online; } if (response.IsFault) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURLHost, response.FaultString); // reason = "XMLRPC Fault"; return online; } @@ -461,7 +463,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { if (hash == null) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost); // reason = "Internal error 1"; return online; } @@ -570,13 +572,13 @@ namespace OpenSim.Services.Connectors.Hypergrid if (!hash.ContainsKey("UUID")) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURL)); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURLHost)); } UUID uuid; if (!UUID.TryParse(hash["UUID"].ToString(), out uuid)) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURL, hash["UUID"].ToString())); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURLHost, hash["UUID"].ToString())); } return uuid; @@ -584,7 +586,7 @@ namespace OpenSim.Services.Connectors.Hypergrid private bool GetBoolResponse(XmlRpcRequest request, out string reason) { - //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); + //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURLHost); XmlRpcResponse response = null; try { @@ -592,14 +594,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURL); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURLHost); reason = "Exception: " + e.Message; return false; } if (response.IsFault) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURLHost, response.FaultString); reason = "XMLRPC Fault"; return false; } @@ -611,7 +613,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { if (hash == null) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost); reason = "Internal error 1"; return false; } @@ -622,7 +624,7 @@ namespace OpenSim.Services.Connectors.Hypergrid else { reason = "Internal error 2"; - m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL); + m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURLHost); } return success; -- cgit v1.1 From 7496d0b0f7c22b8571c56f9356f186f5f74dbabc Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 24 Mar 2014 15:05:39 +0200 Subject: Fixed unit tests for delinking objects --- .../Scenes/Tests/SceneObjectLinkingTests.cs | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index fa8277c..c928b1e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -91,7 +91,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests grp2.RootPart.ClearUpdateSchedule(); // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. + Assert.IsFalse(grp1.GroupContainsForeignPrims); grp1.LinkToGroup(grp2); + Assert.IsTrue(grp1.GroupContainsForeignPrims); + + scene.Backup(true); + Assert.IsFalse(grp1.GroupContainsForeignPrims); // FIXME: Can't do this test yet since group 2 still has its root part! We can't yet null this since // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed. @@ -143,7 +148,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink."); Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); - Assert.That(grp3.GroupContainsForeignPrims, Is.True); } [Test] @@ -335,30 +339,34 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectPart rootPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; + SceneObjectPart linkPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = linkPartName, UUID = linkPartUuid }; + SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart); + scene.AddNewSceneObject(linkGroup, true); SceneObjectGroup sog = new SceneObjectGroup(rootPart); - sog.AddPart(linkPart); - scene.AddNewSceneObject(sog, true); - - // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked - // scene backup thread. + scene.AddNewSceneObject(sog, true); + + Assert.IsFalse(sog.GroupContainsForeignPrims); + sog.LinkToGroup(linkGroup); + Assert.IsTrue(sog.GroupContainsForeignPrims); + scene.Backup(true); - + Assert.AreEqual(1, scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID).Count); + // These changes should occur immediately without waiting for a backup pass SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); + Assert.IsFalse(groupToDelete.GroupContainsForeignPrims); - Assert.That(groupToDelete.GroupContainsForeignPrims, Is.True); scene.DeleteSceneObject(groupToDelete, false); - Assert.That(groupToDelete.GroupContainsForeignPrims, Is.False); List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); - - Assert.That(storedObjects.Count, Is.EqualTo(1)); - Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1)); - Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); + + Assert.AreEqual(1, storedObjects.Count); + Assert.AreEqual(1, storedObjects[0].Parts.Length); + Assert.IsTrue(storedObjects[0].ContainsPart(rootPartUuid)); } } } -- cgit v1.1 From df9845a283d34c65d47b858a1c45934ee2ea6b3b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 24 Mar 2014 18:00:59 +0200 Subject: When a user logs-in, automatically create the Suitcase folder This is only done if the Suitcase Inventory Service is used. Previously the Suitcase was created at a later time, which meant that it wasn't shown in the viewer until the viewer was restarted. --- .../HypergridService/HGSuitcaseInventoryService.cs | 22 +++++++--------------- OpenSim/Services/LLLoginService/LLLoginService.cs | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 15 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 90ce44a..1608039 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -215,25 +215,17 @@ namespace OpenSim.Services.HypergridService if (suitcase == null) { m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); + return null; } - else - { - m_Database.StoreFolder(suitcase); - - // Create System folders - CreateSystemFolders(principalID, suitcase.folderID); + + m_Database.StoreFolder(suitcase); - SetAsNormalFolder(suitcase); - - return ConvertToOpenSim(suitcase); - } - } - else - { - return ConvertToOpenSim(suitcase); + CreateSystemFolders(principalID, suitcase.folderID); } - return null; + SetAsNormalFolder(suitcase); + + return ConvertToOpenSim(suitcase); } protected void CreateSystemFolders(UUID principalID, UUID rootID) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 46a5c18..d8f036a 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -58,6 +58,7 @@ namespace OpenSim.Services.LLLoginService protected IGridUserService m_GridUserService; protected IAuthenticationService m_AuthenticationService; protected IInventoryService m_InventoryService; + protected IInventoryService m_HGInventoryService; protected IGridService m_GridService; protected IPresenceService m_PresenceService; protected ISimulationService m_LocalSimulationService; @@ -165,6 +166,14 @@ namespace OpenSim.Services.LLLoginService if (agentService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin(agentService, args); + // Get the Hypergrid inventory service (exists only if Hypergrid is enabled) + string hgInvService = Util.GetConfigVarFromSections(config, "LocalServiceModule", new string[] { "HGInventoryService" }, String.Empty); + if (hgInvService != string.Empty) + { + Object[] args2 = new Object[] { config, "HGInventoryService" }; + m_HGInventoryService = ServerUtils.LoadPlugin(hgInvService, args2); + } + // // deal with the services given as argument // @@ -350,6 +359,13 @@ namespace OpenSim.Services.LLLoginService return LLFailedLoginResponse.InventoryProblem; } + if (m_HGInventoryService != null) + { + // Give the Suitcase service a chance to create the suitcase folder. + // (If we're not using the Suitcase inventory service then this won't do anything.) + m_HGInventoryService.GetRootFolder(account.PrincipalID); + } + List inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) { -- cgit v1.1 From 5b2af7f99ea9caf7c00674abd87b33797ce13ef4 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 24 Mar 2014 18:33:18 +0200 Subject: Moved the linkage between LoginService and HGInventoryService to the config file --- OpenSim/Services/LLLoginService/LLLoginService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index d8f036a..b61b5e8 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -167,11 +167,12 @@ namespace OpenSim.Services.LLLoginService m_UserAgentService = ServerUtils.LoadPlugin(agentService, args); // Get the Hypergrid inventory service (exists only if Hypergrid is enabled) - string hgInvService = Util.GetConfigVarFromSections(config, "LocalServiceModule", new string[] { "HGInventoryService" }, String.Empty); - if (hgInvService != string.Empty) + string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty); + if (hgInvServicePlugin != string.Empty) { - Object[] args2 = new Object[] { config, "HGInventoryService" }; - m_HGInventoryService = ServerUtils.LoadPlugin(hgInvService, args2); + string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty); + Object[] args2 = new Object[] { config, hgInvServiceArg }; + m_HGInventoryService = ServerUtils.LoadPlugin(hgInvServicePlugin, args2); } // -- cgit v1.1 From edc04d4184bb9ec224b27cc7b463bec6e4e65dde Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Oct 2013 09:45:18 +0300 Subject: When updating the CreatorId of an inventory item, automatically update the CreatorIdAsUuid field as well Resolves http://opensimulator.org/mantis/view.php?id=6933 --- OpenSim/Framework/InventoryItemBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 558dfd0..5761200 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -82,12 +82,15 @@ namespace OpenSim.Framework set { m_creatorId = value; + + if ((m_creatorId == null) || !UUID.TryParse(m_creatorId, out m_creatorIdAsUuid)) + m_creatorIdAsUuid = UUID.Zero; } } protected string m_creatorId; /// - /// The CreatorId expressed as a UUID.tely + /// The CreatorId expressed as a UUID. /// public UUID CreatorIdAsUuid { -- cgit v1.1 From 89945f8829dcc1ee889aad1bafd1d6c2938a6cc7 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 31 Oct 2013 13:02:57 +0200 Subject: Refactored: ExternalRepresentationUtils should be the only place where the "CreatorData" field is calculated, to ensure uniformity Resolves http://opensimulator.org/mantis/view.php?id=6933 --- .../External/ExternalRepresentationUtils.cs | 16 +++++++++++++--- .../External/UserInventoryItemSerializer.cs | 3 ++- OpenSim/Framework/Util.cs | 9 +++++++-- .../Scenes/Serialization/SceneObjectSerializer.cs | 4 ++-- 4 files changed, 24 insertions(+), 8 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index c56f213..db46ea8 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -161,7 +161,7 @@ namespace OpenSim.Framework.Serialization.External if (!hasCreatorData && creator != null) { XmlElement creatorData = doc.CreateElement("CreatorData"); - creatorData.InnerText = homeURL + ";" + creator.FirstName + " " + creator.LastName; + creatorData.InnerText = CalcCreatorData(homeURL, creator.FirstName + " " + creator.LastName); sop.AppendChild(creatorData); } } @@ -172,5 +172,15 @@ namespace OpenSim.Framework.Serialization.External return wr.ToString(); } } + + public static string CalcCreatorData(string homeURL, string name) + { + return homeURL + ";" + name; + } + + internal static string CalcCreatorData(string homeURL, UUID uuid, string name) + { + return homeURL + "/" + uuid + ";" + name; + } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index f2a6b8b..135cefb 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs @@ -286,7 +286,8 @@ namespace OpenSim.Framework.Serialization.External UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid); if (account != null) { - writer.WriteElementString("CreatorData", (string)options["home"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName); + string creatorData = ExternalRepresentationUtils.CalcCreatorData((string)options["home"], inventoryItem.CreatorIdAsUuid, account.FirstName + " " + account.LastName); + writer.WriteElementString("CreatorData", creatorData); } writer.WriteElementString("CreatorID", inventoryItem.CreatorId); } diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 5805dc8..c2c9698 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2250,10 +2250,15 @@ namespace OpenSim.Framework { string[] parts = firstName.Split(new char[] { '.' }); if (parts.Length == 2) - return id.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1]; + return CalcUniversalIdentifier(id, agentsURI, parts[0] + " " + parts[1]); } - return id.ToString() + ";" + agentsURI + ";" + firstName + " " + lastName; + + return CalcUniversalIdentifier(id, agentsURI, firstName + " " + lastName); + } + private static string CalcUniversalIdentifier(UUID id, string agentsURI, string name) + { + return id.ToString() + ";" + agentsURI + ";" + name; } /// diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index f07dee9..4deca00 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -1230,7 +1230,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (m_UserManagement == null) m_UserManagement = sop.ParentGroup.Scene.RequestModuleInterface(); string name = m_UserManagement.GetUserName(sop.CreatorID); - writer.WriteElementString("CreatorData", (string)options["home"] + ";" + name); + writer.WriteElementString("CreatorData", ExternalRepresentationUtils.CalcCreatorData((string)options["home"], name)); } WriteUUID(writer, "FolderID", sop.FolderID, options); @@ -1403,7 +1403,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (m_UserManagement == null) m_UserManagement = scene.RequestModuleInterface(); string name = m_UserManagement.GetUserName(item.CreatorID); - writer.WriteElementString("CreatorData", (string)options["home"] + ";" + name); + writer.WriteElementString("CreatorData", ExternalRepresentationUtils.CalcCreatorData((string)options["home"], name)); } writer.WriteElementString("Description", item.Description); -- cgit v1.1 From bf68dbabd753ecfab812a4d533c16ad269dc64ad Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 24 Oct 2013 15:40:47 +0300 Subject: Save to database these parcel updates: Force Owner, Abandon Request, Reclaim. (Previously these updates only changed the parcel in memory) Resolves http://opensimulator.org/mantis/view.php?id=6934 --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 7f17aff..0ecf13b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1340,6 +1340,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); + UpdateLandObject(land.LandData.LocalID, land.LandData); } } } @@ -1360,8 +1361,10 @@ namespace OpenSim.Region.CoreModules.World.Land land.LandData.GroupID = UUID.Zero; land.LandData.IsGroupOwned = false; land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); + m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); + UpdateLandObject(land.LandData.LocalID, land.LandData); } } } @@ -1388,6 +1391,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); + UpdateLandObject(land.LandData.LocalID, land.LandData); } } } -- cgit v1.1 From 6edc4467807e227d7d62e3b6ab3ae7101ea2015c Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Fri, 25 Oct 2013 12:44:27 +0300 Subject: Fixed: OnRegionInfoChange was never triggered Resolves http://opensimulator.org/mantis/view.php?id=6934 --- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 3 --- 1 file changed, 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 3bd7b4a..cb9ad4a 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -1342,10 +1342,7 @@ namespace OpenSim.Region.CoreModules.World.Estate { m_regionChangeTimer.Stop(); m_regionChangeTimer.Start(); - } - protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e) - { ChangeDelegate change = OnRegionInfoChange; if (change != null) -- cgit v1.1 From a2dd8f31dea20d43c942aeee7aae8b208989bbe7 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 30 Oct 2013 12:46:03 +0200 Subject: Trim search queries (for users, groups, etc.). I have found that sometimes the viewer adds a space at the end, which causes searches to fail. Resolves http://opensimulator.org/mantis/view.php?id=6935 --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 05dd764..86161c9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -10387,7 +10387,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerDirFindQuery(this, dirFindQueryPacket.QueryData.QueryID, Utils.BytesToString( - dirFindQueryPacket.QueryData.QueryText), + dirFindQueryPacket.QueryData.QueryText).Trim(), dirFindQueryPacket.QueryData.QueryFlags, dirFindQueryPacket.QueryData.QueryStart); } diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs index 8838612..3849996 100644 --- a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs @@ -150,6 +150,8 @@ namespace OpenSim.Region.CoreModules.Framework.Search void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) { + queryText = queryText.Trim(); + if (((DirFindFlags)queryFlags & DirFindFlags.People) == DirFindFlags.People) { if (string.IsNullOrEmpty(queryText)) @@ -194,4 +196,4 @@ namespace OpenSim.Region.CoreModules.Framework.Search } -} \ No newline at end of file +} -- cgit v1.1 From c8583e566dd03d4a854e77c1c690fdc35c550398 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 30 Oct 2013 12:46:42 +0200 Subject: When searching for users, don't add users from the local cache if they have an invalid UUID Resolves http://opensimulator.org/mantis/view.php?id=6935 --- .../CoreModules/Framework/UserManagement/UserManagementModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 9f0a719..3455e2c 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -278,7 +278,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement { foreach (UserData data in m_UserCache.Values) { - if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && + if (data.Id != UUID.Zero && + users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower()))) users.Add(data); } @@ -725,4 +726,4 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement } -} \ No newline at end of file +} -- cgit v1.1 From 1d4551e52fc02db9393c5c3653139c671a2e6c97 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 30 Oct 2013 15:59:53 +0200 Subject: Check settings for groups module Resolves http://opensimulator.org/mantis/view.php?id=6937 --- OpenSim/Addons/Groups/GroupsMessagingModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index 92528a2..bbb5e05 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs @@ -110,7 +110,15 @@ namespace OpenSim.Groups m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", false); if (m_messageOnlineAgentsOnly) + { m_usersOnlineCache = new ExpiringCache(); + } + else + { + m_log.Error("[Groups.Messaging]: GroupsMessagingModule V2 requires MessageOnlineUsersOnly = true"); + m_groupMessagingEnabled = false; + return; + } m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); @@ -260,7 +268,7 @@ namespace OpenSim.Groups // Sending to offline members is not an option. string[] t1 = groupMembers.ConvertAll(gmd => gmd.AgentID.ToString()).ToArray(); - // We cache in order not to overwhlem the presence service on large grids with many groups. This does + // We cache in order not to overwhelm the presence service on large grids with many groups. This does // mean that members coming online will not see all group members until after m_usersOnlineCacheExpirySeconds has elapsed. // (assuming this is the same across all grid simulators). if (!m_usersOnlineCache.TryGetValue(groupID, out onlineAgents)) -- cgit v1.1 From b9e0d0fdb217f4e5cd90883dca1b2f622dc61c1d Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 30 Oct 2013 16:15:06 +0200 Subject: Don't show hidden groups in search results Resolves http://opensimulator.org/mantis/view.php?id=6937 --- OpenSim/Data/MySQL/MySQLGroupsData.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/MySQLGroupsData.cs b/OpenSim/Data/MySQL/MySQLGroupsData.cs index 0318284..8e39229 100644 --- a/OpenSim/Data/MySQL/MySQLGroupsData.cs +++ b/OpenSim/Data/MySQL/MySQLGroupsData.cs @@ -86,11 +86,11 @@ namespace OpenSim.Data.MySQL public GroupData[] RetrieveGroups(string pattern) { if (string.IsNullOrEmpty(pattern)) - pattern = "1 ORDER BY Name LIMIT 100"; + pattern = "1"; else - pattern = string.Format("Name LIKE '%{0}%' ORDER BY Name LIMIT 100", pattern); + pattern = string.Format("Name LIKE '%{0}%'", pattern); - return m_Groups.Get(pattern); + return m_Groups.Get(string.Format("ShowInList=1 AND ({0}) ORDER BY Name LIMIT 100", pattern)); } public bool DeleteGroup(UUID groupID) -- cgit v1.1 From 1b30ae81b5501fbd21b0f589df6286421b0c083a Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 5 Jan 2014 11:28:33 +0200 Subject: Fixed updating usersettings in the database Resolves http://opensimulator.org/mantis/view.php?id=6938 --- OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index 6ed3b06..cc4c5b0 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs @@ -974,8 +974,8 @@ namespace OpenSim.Data.MySQL dbcon.Open(); using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { - cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail); - cmd.Parameters.AddWithValue("?Visible", pref.Visible); + cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail.ToString().ToLower()); + cmd.Parameters.AddWithValue("?Visible", pref.Visible.ToString().ToLower()); cmd.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); cmd.ExecuteNonQuery(); -- cgit v1.1 From 8cec0b3fa1fa36dd8823cc718dc914e8f7c0b9c8 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 31 Oct 2013 09:00:59 +0200 Subject: If updating a user's profile notes fails then return an error Resolves http://opensimulator.org/mantis/view.php?id=6938 --- OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs index d30cc22..d55142e 100644 --- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs +++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs @@ -273,10 +273,10 @@ namespace OpenSim.Server.Handlers response.Result = OSD.SerializeMembers(note); return true; } - - object Notes = (object) note; - OSD.DeserializeMembers(ref Notes, (OSDMap)json["params"]); - return true; + + response.Error.Code = ErrorCode.InternalError; + response.Error.Message = "Error reading notes"; + return false; } public bool NotesUpdate(OSDMap json, ref JsonRpcResponse response) -- cgit v1.1 From 0ff61341e479423125daa180eb7ee83bd643939b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 31 Oct 2013 11:17:28 +0200 Subject: HGAssetService searches for the "HomeURI" setting in several sections: Startup, Hypergrid, HGAssetService Resolves http://opensimulator.org/mantis/view.php?id=6940 --- OpenSim/Services/HypergridService/HGAssetService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs index 84dec8d..5c804d4 100644 --- a/OpenSim/Services/HypergridService/HGAssetService.cs +++ b/OpenSim/Services/HypergridService/HGAssetService.cs @@ -76,10 +76,10 @@ namespace OpenSim.Services.HypergridService if (m_UserAccountService == null) throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll)); - // legacy configuration [obsolete] - m_HomeURL = assetConfig.GetString("ProfileServerURI", string.Empty); - // Preferred - m_HomeURL = assetConfig.GetString("HomeURI", m_HomeURL); + m_HomeURL = Util.GetConfigVarFromSections(config, "HomeURI", + new string[] { "Startup", "Hypergrid", configName }, string.Empty); + if (m_HomeURL == string.Empty) + throw new Exception("[HGAssetService] No HomeURI specified"); m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); -- cgit v1.1 From 5fd94111434c2faa742d4eb7357d7a6b02253988 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 18 Nov 2013 12:48:23 +0200 Subject: Refactored Load IAR: created a generic mechanism to modify the SOG's as they are being loaded Resolves http://opensimulator.org/mantis/view.php?id=6942 --- .../Archiver/InventoryArchiveReadRequest.cs | 66 ++++++--------------- .../Scenes/Serialization/SceneObjectSerializer.cs | 67 ++++++++++++++++++++++ 2 files changed, 86 insertions(+), 47 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index f7057fe..9963521 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -483,52 +483,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { if (m_creatorIdForAssetId.ContainsKey(assetId)) { - string xmlData = Utils.BytesToString(data); - List sceneObjects = new List(); + data = SceneObjectSerializer.ModifySerializedObject(assetId, data, + sog => { + bool modified = false; + + foreach (SceneObjectPart sop in sog.Parts) + { + if (string.IsNullOrEmpty(sop.CreatorData)) + { + sop.CreatorID = m_creatorIdForAssetId[assetId]; + modified = true; + } + } + + return modified; + }); - CoalescedSceneObjects coa = null; - if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) - { -// m_log.DebugFormat( -// "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); - - if (coa.Objects.Count == 0) - { - m_log.WarnFormat( - "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of coalesced object from asset {0} as it has zero loaded components", - assetId); - return false; - } - - sceneObjects.AddRange(coa.Objects); - } - else - { - SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); - - if (deserializedObject != null) - { - sceneObjects.Add(deserializedObject); - } - else - { - m_log.WarnFormat( - "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of object from asset {0} as deserialization failed", - assetId); - - return false; - } - } - - foreach (SceneObjectGroup sog in sceneObjects) - foreach (SceneObjectPart sop in sog.Parts) - if (string.IsNullOrEmpty(sop.CreatorData)) - sop.CreatorID = m_creatorIdForAssetId[assetId]; - - if (coa != null) - data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa)); - else - data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sceneObjects[0])); + if (data == null) + return false; } } @@ -550,7 +522,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver return false; } } - + /// /// Load control file /// @@ -656,4 +628,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_assetsLoaded = true; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 4deca00..a93f3c8 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -299,6 +299,73 @@ namespace OpenSim.Region.Framework.Scenes.Serialization } } + + /// + /// Modifies a SceneObjectGroup. + /// + /// The object + /// Whether the object was actually modified + public delegate bool SceneObjectModifier(SceneObjectGroup sog); + + /// + /// Modifies an object by deserializing it; applying 'modifier' to each SceneObjectGroup; and reserializing. + /// + /// The object's UUID + /// Serialized data + /// The function to run on each SceneObjectGroup + /// The new serialized object's data, or null if an error occurred + public static byte[] ModifySerializedObject(UUID assetId, byte[] data, SceneObjectModifier modifier) + { + List sceneObjects = new List(); + CoalescedSceneObjects coa = null; + + string xmlData = Utils.BytesToString(data); + + if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) + { + // m_log.DebugFormat("[SERIALIZER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); + + if (coa.Objects.Count == 0) + { + m_log.WarnFormat("[SERIALIZER]: Aborting load of coalesced object from asset {0} as it has zero loaded components", assetId); + return null; + } + + sceneObjects.AddRange(coa.Objects); + } + else + { + SceneObjectGroup deserializedObject = FromOriginalXmlFormat(xmlData); + + if (deserializedObject != null) + { + sceneObjects.Add(deserializedObject); + } + else + { + m_log.WarnFormat("[SERIALIZER]: Aborting load of object from asset {0} as deserialization failed", assetId); + return null; + } + } + + bool modified = false; + foreach (SceneObjectGroup sog in sceneObjects) + { + if (modifier(sog)) + modified = true; + } + + if (modified) + { + if (coa != null) + data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa)); + else + data = Utils.StringToBytes(ToOriginalXmlFormat(sceneObjects[0])); + } + + return data; + } + #region manual serialization -- cgit v1.1 From 35078e03e5a0c0fe6f691eddb3a4cc843d7b3243 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 18 Nov 2013 12:53:11 +0200 Subject: During Load OAR, fix the User and Group ID's in objects that are embedded in assets (previously only rezzed objects were fixed) Resolves http://opensimulator.org/mantis/view.php?id=6942 --- .../World/Archiver/ArchiveReadRequest.cs | 130 ++++++++++++--------- 1 file changed, 77 insertions(+), 53 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 2e638d4..0c7be6f 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -523,58 +523,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver oldTelehubUUID = UUID.Zero; } - // Try to retain the original creator/owner/lastowner if their uuid is present on this grid - // or creator data is present. Otherwise, use the estate owner instead. - foreach (SceneObjectPart part in sceneObject.Parts) - { - if (string.IsNullOrEmpty(part.CreatorData)) - { - if (!ResolveUserUuid(scene, part.CreatorID)) - part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; - } - if (UserManager != null) - UserManager.AddUser(part.CreatorID, part.CreatorData); - - if (!ResolveUserUuid(scene, part.OwnerID)) - part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - - if (!ResolveUserUuid(scene, part.LastOwnerID)) - part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - - if (!ResolveGroupUuid(part.GroupID)) - part.GroupID = UUID.Zero; - - // And zap any troublesome sit target information -// part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); -// part.SitTargetPosition = new Vector3(0, 0, 0); - - // Fix ownership/creator of inventory items - // Not doing so results in inventory items - // being no copy/no mod for everyone - lock (part.TaskInventory) - { - TaskInventoryDictionary inv = part.TaskInventory; - foreach (KeyValuePair kvp in inv) - { - if (!ResolveUserUuid(scene, kvp.Value.OwnerID)) - { - kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - } - - if (string.IsNullOrEmpty(kvp.Value.CreatorData)) - { - if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) - kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; - } - - if (UserManager != null) - UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); - - if (!ResolveGroupUuid(kvp.Value.GroupID)) - kvp.Value.GroupID = UUID.Zero; - } - } - } + ModifySceneObject(scene, sceneObject); if (scene.AddRestoredSceneObject(sceneObject, true, false)) { @@ -598,6 +547,67 @@ namespace OpenSim.Region.CoreModules.World.Archiver scene.RegionInfo.RegionSettings.ClearSpawnPoints(); } } + + /// + /// Optionally modify a loaded SceneObjectGroup. Currently this just ensures that the + /// User IDs and Group IDs are valid, but other manipulations could be done as well. + /// + private void ModifySceneObject(Scene scene, SceneObjectGroup sceneObject) + { + // Try to retain the original creator/owner/lastowner if their uuid is present on this grid + // or creator data is present. Otherwise, use the estate owner instead. + foreach (SceneObjectPart part in sceneObject.Parts) + { + if (string.IsNullOrEmpty(part.CreatorData)) + { + if (!ResolveUserUuid(scene, part.CreatorID)) + part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; + } + if (UserManager != null) + UserManager.AddUser(part.CreatorID, part.CreatorData); + + if (!ResolveUserUuid(scene, part.OwnerID)) + part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; + + if (!ResolveUserUuid(scene, part.LastOwnerID)) + part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; + + if (!ResolveGroupUuid(part.GroupID)) + part.GroupID = UUID.Zero; + + // And zap any troublesome sit target information + // part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); + // part.SitTargetPosition = new Vector3(0, 0, 0); + + // Fix ownership/creator of inventory items + // Not doing so results in inventory items + // being no copy/no mod for everyone + lock (part.TaskInventory) + { + TaskInventoryDictionary inv = part.TaskInventory; + foreach (KeyValuePair kvp in inv) + { + if (!ResolveUserUuid(scene, kvp.Value.OwnerID)) + { + kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; + } + + if (string.IsNullOrEmpty(kvp.Value.CreatorData)) + { + if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) + kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; + } + + if (UserManager != null) + UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); + + if (!ResolveGroupUuid(kvp.Value.GroupID)) + kvp.Value.GroupID = UUID.Zero; + } + } + } + } + /// /// Load serialized parcels. @@ -754,7 +764,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; if (assetType == (sbyte)AssetType.Unknown) + { m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); + } + else if (assetType == (sbyte)AssetType.Object) + { + data = SceneObjectSerializer.ModifySerializedObject(UUID.Parse(uuid), data, + sog => + { + ModifySceneObject(m_rootScene, sog); + return true; + }); + + if (data == null) + return false; + } //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); @@ -977,4 +1001,4 @@ namespace OpenSim.Region.CoreModules.World.Archiver return dearchivedScenes; } } -} \ No newline at end of file +} -- cgit v1.1 From 305f5110c6d8c57ce2d4f9d0d052b564f3d1a4b9 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 24 Oct 2013 17:40:55 +0300 Subject: In Load OAR: Zero isn't a valid Group ID Resolves http://opensimulator.org/mantis/view.php?id=6943 --- OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 0c7be6f..f5707eb 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -189,8 +189,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"] : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f); - // Zero can never be a valid user id + // Zero can never be a valid user or group id m_validUserUuids[UUID.Zero] = false; + m_validGroupUuids[UUID.Zero] = false; m_groupsModule = m_rootScene.RequestModuleInterface(); m_assetService = m_rootScene.AssetService; @@ -705,9 +706,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// private bool ResolveGroupUuid(UUID uuid) { - if (uuid == UUID.Zero) - return true; // this means the object has no group - lock (m_validGroupUuids) { if (!m_validGroupUuids.ContainsKey(uuid)) -- cgit v1.1 From 1a32b352791fe5dd3a344ab6797f6fd62e3e5391 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 12 Jan 2014 12:07:30 +0200 Subject: In Load OAR, correctly restore group-owned objects Resolves http://opensimulator.org/mantis/view.php?id=6943 --- OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index f5707eb..7920748 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -567,10 +567,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (UserManager != null) UserManager.AddUser(part.CreatorID, part.CreatorData); - if (!ResolveUserUuid(scene, part.OwnerID)) + if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID))) part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - if (!ResolveUserUuid(scene, part.LastOwnerID)) + if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID))) part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; if (!ResolveGroupUuid(part.GroupID)) @@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver TaskInventoryDictionary inv = part.TaskInventory; foreach (KeyValuePair kvp in inv) { - if (!ResolveUserUuid(scene, kvp.Value.OwnerID)) + if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID))) { kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; } -- cgit v1.1 From 1769e93c42384125eb75fcc21dee43bb52a6090a Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 18 Nov 2013 13:14:49 +0200 Subject: Fixed parsing of coalesced objects if the XML starts with an XML Declaration ("") Resolves http://opensimulator.org/mantis/view.php?id=6944 --- .../CoalescedSceneObjectsSerializer.cs | 89 +++++++++++----------- 1 file changed, 45 insertions(+), 44 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index 5cb271d..a556f9d 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs @@ -119,21 +119,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization return output; } } - + public static bool TryFromXml(string xml, out CoalescedSceneObjects coa) { // m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml); coa = null; - int i = 0; - using (StringReader sr = new StringReader(xml)) - { - using (XmlTextReader reader = new XmlTextReader(sr)) - { - try + try + { + // Quickly check if this is a coalesced object, without fully parsing the XML + using (StringReader sr = new StringReader(xml)) + { + using (XmlTextReader reader = new XmlTextReader(sr)) { - reader.Read(); + reader.MoveToContent(); // skip possible xml declaration + if (reader.Name != "CoalescedObject") { // m_log.DebugFormat( @@ -142,49 +143,49 @@ namespace OpenSim.Region.Framework.Scenes.Serialization return false; } - - coa = new CoalescedSceneObjects(UUID.Zero); - reader.Read(); - - while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject") - { - if (reader.Name == "SceneObjectGroup") - { - string soXml = reader.ReadOuterXml(); - - SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(soXml); - - if (so != null) - { - coa.Add(so); - } - else - { - // XXX: Possibly we should fail outright here rather than continuing if a particular component of the - // coalesced object fails to load. - m_log.WarnFormat( - "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", - i); - } + } + } - i++; - } - } + XmlDocument doc = new XmlDocument(); + doc.LoadXml(xml); + XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); + if (e == null) + return false; - reader.ReadEndElement(); // CoalescedObject + coa = new CoalescedSceneObjects(UUID.Zero); + + XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); + int i = 0; + + foreach (XmlNode n in groups) + { + SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); + if (so != null) + { + coa.Add(so); } - catch (Exception e) + else { - m_log.ErrorFormat( - "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} {1}", - e.Message, e.StackTrace); - - return false; - } + // XXX: Possibly we should fail outright here rather than continuing if a particular component of the + // coalesced object fails to load. + m_log.WarnFormat( + "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", + i); + } + + i++; } } + catch (Exception e) + { + m_log.Error(string.Format( + "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} ", + e.Message), e); + + return false; + } return true; } } -} \ No newline at end of file +} -- cgit v1.1 From 6a477e044dfee014ff99b1ac56a39bd5e629283a Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 25 Nov 2013 18:28:23 +0200 Subject: If prim region crossing fails then don't delete the prim from the original region Resolves http://opensimulator.org/mantis/view.php?id=6946 --- .../Services/Connectors/Simulation/SimulationServiceConnector.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index aca414b..171beaa 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -421,11 +421,18 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); - WebUtil.PostToService(uri, args, 40000); + OSDMap result = WebUtil.PostToService(uri, args, 40000); + + if (result == null) + return false; + bool success = result["success"].AsBoolean(); + if (!success) + return false; } catch (Exception e) { m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString()); + return false; } return true; -- cgit v1.1 From 8276a9e5f7f91e6c774658228df7bf84f45fc252 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 1 Dec 2013 14:35:17 +0200 Subject: Fixed Debug command for Groups. (Use of wrong capitalization caused *two* "debug" options to appear in "help") This is a (small) part of http://opensimulator.org/mantis/view.php?id=6949 --- OpenSim/Addons/Groups/GroupsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 7f453db..f11606a 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -101,7 +101,7 @@ namespace OpenSim.Groups { scene.RegisterModuleInterface(this); scene.AddCommand( - "debug", + "Debug", this, "debug groups verbose", "debug groups verbose ", -- cgit v1.1