diff options
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 16 |
2 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index b8e2820..78d597d 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | |||
@@ -145,6 +145,8 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
145 | { | 145 | { |
146 | byte[] fileData = NewFiles[fileName].Data; | 146 | byte[] fileData = NewFiles[fileName].Data; |
147 | XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient); | 147 | XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient); |
148 | if (fileName.StartsWith("inventory_")) | ||
149 | transaction.isTaskInventory = true; | ||
148 | 150 | ||
149 | Transfers.Add(xferID, transaction); | 151 | Transfers.Add(xferID, transaction); |
150 | 152 | ||
@@ -228,6 +230,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
228 | public uint Packet = 0; | 230 | public uint Packet = 0; |
229 | public uint Serial = 1; | 231 | public uint Serial = 1; |
230 | public ulong XferID = 0; | 232 | public ulong XferID = 0; |
233 | public bool isTaskInventory = false; | ||
231 | 234 | ||
232 | public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) | 235 | public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) |
233 | { | 236 | { |
@@ -253,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
253 | byte[] transferData = new byte[Data.Length + 4]; | 256 | byte[] transferData = new byte[Data.Length + 4]; |
254 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | 257 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); |
255 | Array.Copy(Data, 0, transferData, 4, Data.Length); | 258 | Array.Copy(Data, 0, transferData, 4, Data.Length); |
256 | Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); | 259 | Client.SendXferPacket(XferID, 0 + 0x80000000, transferData, isTaskInventory); |
257 | complete = true; | 260 | complete = true; |
258 | } | 261 | } |
259 | else | 262 | else |
@@ -261,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
261 | byte[] transferData = new byte[1000 + 4]; | 264 | byte[] transferData = new byte[1000 + 4]; |
262 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | 265 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); |
263 | Array.Copy(Data, 0, transferData, 4, 1000); | 266 | Array.Copy(Data, 0, transferData, 4, 1000); |
264 | Client.SendXferPacket(XferID, 0, transferData); | 267 | Client.SendXferPacket(XferID, 0, transferData, isTaskInventory); |
265 | Packet++; | 268 | Packet++; |
266 | DataPointer = 1000; | 269 | DataPointer = 1000; |
267 | } | 270 | } |
@@ -282,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
282 | { | 285 | { |
283 | byte[] transferData = new byte[1000]; | 286 | byte[] transferData = new byte[1000]; |
284 | Array.Copy(Data, DataPointer, transferData, 0, 1000); | 287 | Array.Copy(Data, DataPointer, transferData, 0, 1000); |
285 | Client.SendXferPacket(XferID, Packet, transferData); | 288 | Client.SendXferPacket(XferID, Packet, transferData, isTaskInventory); |
286 | Packet++; | 289 | Packet++; |
287 | DataPointer += 1000; | 290 | DataPointer += 1000; |
288 | } | 291 | } |
@@ -291,7 +294,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
291 | byte[] transferData = new byte[Data.Length - DataPointer]; | 294 | byte[] transferData = new byte[Data.Length - DataPointer]; |
292 | Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); | 295 | Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); |
293 | uint endPacket = Packet |= (uint) 0x80000000; | 296 | uint endPacket = Packet |= (uint) 0x80000000; |
294 | Client.SendXferPacket(XferID, endPacket, transferData); | 297 | Client.SendXferPacket(XferID, endPacket, transferData, isTaskInventory); |
295 | Packet++; | 298 | Packet++; |
296 | DataPointer += (Data.Length - DataPointer); | 299 | DataPointer += (Data.Length - DataPointer); |
297 | 300 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 394b90a..f073c4a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -757,18 +757,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
757 | m_scene.EventManager.TriggerOnAttach(so.LocalId, so.FromItemID, UUID.Zero); | 757 | m_scene.EventManager.TriggerOnAttach(so.LocalId, so.FromItemID, UUID.Zero); |
758 | sp.RemoveAttachment(so); | 758 | sp.RemoveAttachment(so); |
759 | 759 | ||
760 | // We can only remove the script instances from the script engine after we've retrieved their xml state | ||
761 | // when we update the attachment item. | ||
762 | m_scene.DeleteSceneObject(so, false, false); | ||
763 | |||
764 | // Prepare sog for storage | 760 | // Prepare sog for storage |
765 | so.AttachedAvatar = UUID.Zero; | 761 | so.AttachedAvatar = UUID.Zero; |
766 | so.RootPart.SetParentLocalId(0); | 762 | so.RootPart.SetParentLocalId(0); |
767 | so.IsAttachment = false; | 763 | so.IsAttachment = false; |
768 | so.AbsolutePosition = so.RootPart.AttachedPos; | 764 | |
765 | // We cannot use AbsolutePosition here because that would | ||
766 | // attempt to cross the prim as it is detached | ||
767 | so.ForEachPart(x => { x.GroupPosition = so.RootPart.AttachedPos; }); | ||
769 | 768 | ||
770 | UpdateKnownItem(sp, so, true); | 769 | UpdateKnownItem(sp, so, true); |
771 | so.RemoveScriptInstances(true); | 770 | |
771 | // This MUST happen AFTER serialization because it will | ||
772 | // either stop or remove the scripts. Both will cause scripts | ||
773 | // to be serialized in a stopped state with the true run | ||
774 | // state already lost. | ||
775 | m_scene.DeleteSceneObject(so, false, true); | ||
772 | } | 776 | } |
773 | 777 | ||
774 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( | 778 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( |