From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- .../Avatar/Attachments/AttachmentsCommandModule.cs | 43 ++++++++++------------ .../Avatar/Attachments/TempAttachmentsModule.cs | 29 ++++++++------- 2 files changed, 34 insertions(+), 38 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/Attachments') diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs index 0333747..3685041 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs @@ -55,41 +55,41 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments // private IAvatarFactoryModule m_avatarFactory; public string Name { get { return "Attachments Command Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); } - + public void RemoveRegion(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Remove(scene); - } - + } + public void RegionLoaded(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Add(scene); @@ -144,14 +144,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments private void GetAttachmentsReport(ScenePresence sp, StringBuilder sb) { - sb.AppendFormat("Attachments for {0}\n", sp.Name); + sb.AppendFormat("Attachments for {0}\n\n", sp.Name); - ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 }; - ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 50)); - ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10)); - ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36)); - ct.Columns.Add(new ConsoleDisplayTableColumn("Attach Point", 14)); - ct.Columns.Add(new ConsoleDisplayTableColumn("Position", 15)); + ConsoleDisplayList ct = new ConsoleDisplayList(); // sb.AppendFormat( // " {0,-36} {1,-10} {2,-36} {3,-14} {4,-15}\n", @@ -177,17 +172,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments // attachmentObject.Name, attachmentObject.LocalId, attachmentObject.FromItemID, // (AttachmentPoint)attachmentObject.AttachmentPoint, attachmentObject.RootPart.AttachedPos); - ct.AddRow( - attachmentObject.Name, - attachmentObject.LocalId, - attachmentObject.FromItemID, - ((AttachmentPoint)attachmentObject.AttachmentPoint), - attachmentObject.RootPart.AttachedPos); + ct.Indent = 2; + ct.AddRow("Attachment Name", attachmentObject.Name); + ct.AddRow("Local ID", attachmentObject.LocalId); + ct.AddRow("Item ID", attachmentObject.UUID); + ct.AddRow("From Item ID", attachmentObject.FromItemID); + ct.AddRow("Attach Point", ((AttachmentPoint)attachmentObject.AttachmentPoint)); + ct.AddRow("Position", attachmentObject.RootPart.AttachedPos + "\n\n"); // } } ct.AddToStringBuilder(sb); - sb.Append("\n"); } } } \ No newline at end of file diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index 535bf67..c3f3851 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs @@ -125,7 +125,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments SendConsoleOutput(agentID, "Command parameter error"); return; } - + m_scene.StoreExtraSetting("auto_grant_attach_perms", val); SendConsoleOutput(agentID, String.Format("auto_grant_attach_perms set to {0}", val)); @@ -134,11 +134,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) { SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); - if (hostPart == null) return 0; - if (hostPart.ParentGroup.IsAttachment) + SceneObjectGroup hostgroup = hostPart.ParentGroup; + + if (hostgroup== null || hostgroup.IsAttachment) return 0; IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface(); @@ -155,33 +156,33 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments ScenePresence target; if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) return 0; - - if (target.UUID != hostPart.ParentGroup.OwnerID) + + if (target.UUID != hostgroup.OwnerID) { - uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); + uint effectivePerms = hostgroup.EffectiveOwnerPerms; if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) return 0; - hostPart.ParentGroup.SetOwnerId(target.UUID); - hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId); + hostgroup.SetOwner(target.UUID, target.ControllingClient.ActiveGroupId); if (m_scene.Permissions.PropagatePermissions()) { - foreach (SceneObjectPart child in hostPart.ParentGroup.Parts) + foreach (SceneObjectPart child in hostgroup.Parts) { child.Inventory.ChangeInventoryOwner(target.UUID); child.TriggerScriptChangedEvent(Changed.OWNER); child.ApplyNextOwnerPermissions(); } + hostgroup.InvalidateEffectivePerms(); } - hostPart.ParentGroup.RootPart.ObjectSaleType = 0; - hostPart.ParentGroup.RootPart.SalePrice = 10; + hostgroup.RootPart.ObjectSaleType = 0; + hostgroup.RootPart.SalePrice = 10; - hostPart.ParentGroup.HasGroupChanged = true; - hostPart.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient); - hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); + hostgroup.HasGroupChanged = true; + hostgroup.RootPart.SendPropertiesToClient(target.ControllingClient); + hostgroup.RootPart.ScheduleFullUpdate(); } return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0; -- cgit v1.1