Commit Graph

141 Commits (d87d9af1a524ceb14513b4a9e4afcec1a1401f54)

Author SHA1 Message Date
Justin Clark-Casey (justincc) d87d9af1a5 minor: Add some doc to the extremely unhelpful 'fudge....' comment as to why we're deselecting the prim in code before scheduling an update on attachment 2013-01-04 21:49:55 +00:00
Justin Clark-Casey (justincc) b00935015a Fix problem where object attached from ground often does not get attached properly.
It seems this is happening because we send a kill for objects that are selected when attached.
A code comment says that this is to get the client to deselect it, but v3 and v1 clients do this just fine without the kill.
Aims to address http://opensimulator.org/mantis/view.php?id=6456
2013-01-04 21:49:48 +00:00
Justin Clark-Casey (justincc) 6235d16c31 Make "show object part" command correctly display script status.
Uses new IEntityInventory.TryGetScriptInstanceRunning()
Makes it clearer that TaskInventoryItem.ScriptRunning cannot be used as it is temporary and not updated.
2012-10-31 00:31:18 +00:00
SignpostMarv 35b7c80e0b implementing osDropAttachment & osDropAttachmentAt 2012-10-02 22:14:46 +01:00
Justin Clark-Casey (justincc) 818379ba14 Fire EventManager.TriggerOnAttach (and hence LSL attach event) when an object is attached from the scene.
Enables previously disabled regression test.
Based on SingpostMarv's patch in http://opensimulator.org/mantis/view.php?id=6302 but I prefer a simpler approach that does not expose a resume scripts option right now.
2012-09-29 01:14:23 +01:00
Diva Canto 87d810217e Guard against inventory get failures. 2012-09-22 14:01:51 -07:00
Melanie 9aec62f0ac Fix scripted detach of temp attachments 2012-08-20 15:59:38 +01:00
Melanie 9bd2c1b88a As per lindn spec, disable detach and drop for temp attachments 2012-08-14 01:12:27 +01:00
Melanie fe4c3a37c0 Lay some groundwork for temp attachments. Decouple attachments from inventory. 2012-08-14 00:12:15 +01:00
Melanie e126915bc1 Change attachment handling to remove object from the scene first as per
justincc's original work. Sample scripts before doing so. Also refactor some
crucial common code and eliminate parameters that were only ever used with
the same constant value.
2012-07-23 21:39:26 +01:00
Melanie fe99948c58 Fix the order of operations on detach. The object must always be serialized
while still in the scene to avoid losing important script state.
DeleteSceneObject can not be called before doing this!
2012-07-20 11:54:59 +02:00
Justin Clark-Casey (justincc) 356d597296 Restore update of inventory item on derez/logout. This is necessary to update the name if this has been changed whilst attached.
Note, this behaviour appears to be at variance with the ll grid as of Tues 17 July 2012, testing with viewer 3.2.1.
The item name in inventory does not change either at the point of detach or after a relog.
2012-07-17 00:17:51 +01:00
Justin Clark-Casey (justincc) b6476eaac3 Stop sending the viewer an inventory create message if a known attachment item is updated.
This doesn't seem to make any sense and probably stems from a period when this code was directly involved in attaching objects directly from the scene.
This message is already being sent by InventoryAccessModule code instead.
2012-07-17 00:00:26 +01:00
Justin Clark-Casey (justincc) fc24563206 Add regression TestDetachScriptedAttachmentToInventory()
This currently only does a relatively crude check for a ScriptState node in the serialized xml
2012-07-11 21:43:35 +01:00
Justin Clark-Casey (justincc) f3134b5cf6 When an attachment is detached to inv or derezzed, stop the scripts, update the known item with script state still in the script engine and then remove the scripts.
This is to fix a regression starting from 5301648 where attachments had to start being deleted before persistence in order to avoid race conditions with hud update threads.
2012-07-10 22:41:11 +01:00
Justin Clark-Casey (justincc) 2eaa6d5ace Do not allow a script to attach a prim if its being sat upon.
This prevents a stack overflow where a get position on the avatar will refer to the attachment which will in turn refer back to the avatar.
This required recording of all sitting avatars on a prim which is done separately from recording the sit target avatar.
Recording HashSet is null if there are no sitting avatars in order to save memory.
2012-07-09 21:24:32 +01:00
Justin Clark-Casey (justincc) f6e5791ecd refactor: extract method UpdateUserInventoryWithAttachment() from AttachObject() for better code comprehension 2012-07-06 22:07:19 +01:00
Justin Clark-Casey (justincc) bfa6896678 Change AttachmentsModule.DetachSingleAttachmentToInv() to accept a SOG directly instead of an item ID to then shuffle through attachments, saving CPU busywork.
Almost all callers already had the sog to hand.
Still checking that it's really an attachment, but now by inspecting SOG.AttachedAvatar
2012-06-28 23:31:23 +01:00
Justin Clark-Casey (justincc) 571fd966cb Rather than iterating through all SOGs in the scene looking for the one that matches out fromItemID on detach, go through the agent's attachment sog list instead. 2012-06-28 23:01:12 +01:00
Justin Clark-Casey (justincc) f263d6a910 Remove code that tried to delete an attachment back to inventory if RezSingleAttachmentFromInventoryInternal() returned null.
null would only ever be returned if the item couldn't be located within inventory and this would happen immediately.
In this case, derezzing wouldn't work anyway since there is no item to derez.
2012-06-28 22:48:49 +01:00
Justin Clark-Casey (justincc) d043213317 refactor: Move ScenePresence <-> AgentData attachments copying code into AttachmentsModule. 2012-06-27 00:41:46 +01:00
Justin Clark-Casey (justincc) e5b739aaeb When attachments are being saved and deleted for a closing root agent, delete first to avoid a hud race condition with update threads.
If delete doesn't occur first then the update thread can outrace the IsAttachment = false necessary to save attachments and send hud artifacts to other viewers.
2012-06-25 22:48:13 +01:00
Justin Clark-Casey (justincc) 5301648cff In AttachmentsModule.DetachSingleAttachmentToInvInternal(), remove attachment before changing properties for correct inventory serialization.
Serialization of attachments requires IsAttachment = false so that correct positions are serialized instead of avatar position.
However, doing this when a hud is still attached allows race conditions with update threads, resulting in hud artifacts on other viewers.
This change sets SOG.IsDeleted before serialization changes take place (IsDeleted itself is not a serialized property).
LLClientView then screens out any deleted SOGs before sending updates to viewers.
2012-06-25 21:08:19 +01:00
Justin Clark-Casey (justincc) 4cf49369b5 Stop flicking IsAttachment false and then true in AttachmentsModule.UpdateAttachmentPosition() in order to avoid a hud update race condition.
Previously, setting IsAttachment to false then true was necessary to serialize the updated attachment object information.
However, UpdateAttachmentPosition no longer does this update.
Whilst IsAttachment is set to false there is a race condition where the update thread can wrongly send hud object updates to clients that do not own the hud, resulting in screen artifacts.
2012-06-22 01:43:26 +01:00
Justin Clark-Casey (justincc) 1aa7469253 correct wrong incomplete comment from previous commit 3c3ea19 in AttachmentsModule 2012-06-14 02:30:40 +01:00
Justin Clark-Casey (justincc) 3c3ea19620 Fix a bug where scene objects attached as HUDs through scripts would not disappear for other avatars.
We do this by sending a kill message for that object to all other avatars apart from the one that has the hud.
2012-06-14 02:26:38 +01:00
Justin Clark-Casey (justincc) 67ebe80dd9 Resolve some mono compiler warnings. 2012-05-25 04:03:16 +01:00
Justin Clark-Casey (justincc) 68918d632f Fetch the dialog module reference in AttachmentsModule in RegionLoaded() not AddRegion()
The reference is not guaranteed to be there when AddRegion() is called but will definitely be present at RegionLoaded() if it's going to be present at all.
2012-05-23 02:09:31 +01:00
Justin Clark-Casey (justincc) ff429a259b Fix bug where an avatar that had an object they owned attached through llAttachToAvatar() or osForceAttachToAvatar() would wrongly have next permissions come into play when they detached that object and rezzed it in scene.
This is because the attachments module code was setting the 'object slam' bit by using PermissionMask.All
Solution here is to route the attachment item creation call through the existing inventory code in BasicInventoryAccessModule rather than copy/pasted code in AttachmentsModule itself.
2012-05-23 01:58:10 +01:00
Justin Clark-Casey (justincc) 01b00ad0d5 Fire the scripting changed event with CHANGED_OWNER when an object that has changed owners is rezzed.
This needs to occur after the script is resumed rather than before, when the event is just dropped.
Addresses http://opensimulator.org/mantis/view.php?id=5890 and http://opensimulator.org/mantis/view.php?id=5952
2012-05-05 00:29:14 +01:00
Justin Clark-Casey (justincc) 6b299a4287 Comment out some debug ATTACHMENTS log messages for now. 2012-04-25 00:52:33 +01:00
Oren Hurvitz 2f398231ac Minor improvements to logging
Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]").
2012-04-24 21:38:09 +01:00
Justin Clark-Casey (justincc) 7d8bb33c5b Store FromItemID for attachments once on SOG instead of on every SOP and only ever using the root part entry.
This eliminates some pointless memory use.
2012-04-07 00:33:02 +01:00
Melanie c08d6df7e1 Prevent a changed attachment that has been saved from being saved again. 2012-02-01 09:38:20 +00:00
Melanie fcc1fa2c32 Straighten out some attachment mess. Don't save attachment states for HG
visitors at all. On Leaving a sim, save only the changed ones. Don't save
all scripted stuff when leaving a sim.
2012-02-01 09:36:14 +00:00
Melanie 6f19e231b6 Don't try to save a NPCs attachment states on NPC delete 2012-01-07 18:09:45 +00:00
Justin Clark-Casey (justincc) 4e9f50b878 Add commented log lines to FetchInventoryDescendents2 path for future use.
Haven't been able to resolve issue where attachments are removed by the viewer on relog on a localhost
2011-12-09 22:32:28 +00:00
Melanie c7dd7b13a2 Convert SendKillObject to take a list of uint rather than sending one
packet per prim. More to come as we change to make use of this.
2011-11-06 20:38:07 +00:00
Justin Clark-Casey (justincc) 5ddefc2564 remove now redundant m_physical_prim flag from SOP.ApplyPhysics() 2011-10-15 02:47:27 +01:00
Justin Clark-Casey (justincc) c93c9ea072 factor common code out into SOP.RemoveFromPhysics() 2011-10-15 02:02:39 +01:00
Dan Lake 92c88121c7 Removed all refs to IClientAPI from IAttachmentsModule. Separated client handlers for attachments to call public interface and rearranged module file into sections 2011-10-04 14:40:39 -07:00
Dan Lake 460946ad62 Removed redundant code in AttachmentsModule and simplified interfaces which converted back and forth between ScenePresence and IClientAPI. More to be done still. 2011-10-03 16:44:32 -07:00
Dan Lake e77c919290 Remove usage of Linden packet types from inside Attachments Module and interface 2011-10-03 11:55:54 -07:00
Justin Clark-Casey (justincc) e742cffe15 Add Enabled switch in new [Attachments] section in OpenSimDefaults.ini to allow attachments to be temporarily turned off.
This is for debugging purposes.  Defaults to Attachments Enabled
2011-09-30 01:19:22 +01:00
Justin Clark-Casey (justincc) 1084d8f6a2 Remove code from DetachSingleAttachmentToInv() that sets group changed on all parts, now that we're performing this check in UpdateKnownItem() for other purposes 2011-09-13 22:39:06 +01:00
Justin Clark-Casey (justincc) 61affee814 remove redunant itemID and agentID arguments from UpdateKnownItem().
itemID is always taken taken from the group's stored item id, and agentID is never used.
2011-09-13 22:33:15 +01:00
Justin Clark-Casey (justincc) 2d62484f11 Remove UpdateKnownItem() from IAttachmentsModule.
It's not appropriate for code outside the attachments module to call this.
2011-09-13 22:27:33 +01:00
Justin Clark-Casey (justincc) 62b3e74bc5 minor: remove redundant grp != null check from AM.UpdateKnownItem() 2011-09-13 22:24:33 +01:00
Justin Clark-Casey (justincc) 8880aea728 Stop attempts to rewear already worn items from removing and reattaching.
Viewer 2/3 will sometimes attempt to rewear attachments, even though they have already been attached during the main login process.
This change ignores those attempts.
This stops script failures during login, as the rewearing was racing with the script startup code.
It might also help with attachments being abnormally put into deleted state.
Hopefully resolves some more of http://opensimulator.org/mantis/view.php?id=5644
2011-09-13 22:13:58 +01:00
Justin Clark-Casey (justincc) 618277e797 Comment out attachments code in Scene.IncomingCreateObject(UUID userID, UUID itemID) for now
As far as I can see, this is only invoked by a PUT request to ObjectHandlers, which is not being used anyway.
Invoking attachments code at this point is probably inappropriate since it would still be invoked when the client entered the scene.
Being commented to simplify analysis of attachments issues.  Can be uncommented when in use.
Also, small tweak to lock and log removal of a SOG from the SceneObjectGroupsByLocalPartID collection in SceneGraph.GetGroupByPrim() if an inconsistency is found.
2011-09-13 20:25:32 +01:00