aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs (unfollow)
Commit message (Collapse)AuthorFilesLines
2012-07-10When an attachment is detached to inv or derezzed, stop the scripts, update ↵Justin Clark-Casey (justincc)1-6/+14
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-09Do not allow a script to attach a prim if its being sat upon.Justin Clark-Casey (justincc)1-0/+9
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-06refactor: extract method UpdateUserInventoryWithAttachment() from ↵Justin Clark-Casey (justincc)1-29/+38
AttachObject() for better code comprehension
2012-06-28Change AttachmentsModule.DetachSingleAttachmentToInv() to accept a SOG ↵Justin Clark-Casey (justincc)1-37/+41
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-28Rather than iterating through all SOGs in the scene looking for the one that ↵Justin Clark-Casey (justincc)1-24/+17
matches out fromItemID on detach, go through the agent's attachment sog list instead.
2012-06-28Remove code that tried to delete an attachment back to inventory if ↵Justin Clark-Casey (justincc)1-6/+1
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-27refactor: Move ScenePresence <-> AgentData attachments copying code into ↵Justin Clark-Casey (justincc)1-0/+50
AttachmentsModule.
2012-06-25When attachments are being saved and deleted for a closing root agent, ↵Justin Clark-Casey (justincc)1-12/+21
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-25In AttachmentsModule.DetachSingleAttachmentToInvInternal(), remove ↵Justin Clark-Casey (justincc)1-1/+1
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-22Stop flicking IsAttachment false and then true in ↵Justin Clark-Casey (justincc)1-10/+0
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-14correct wrong incomplete comment from previous commit 3c3ea19 in ↵Justin Clark-Casey (justincc)1-1/+2
AttachmentsModule
2012-06-14Fix a bug where scene objects attached as HUDs through scripts would not ↵Justin Clark-Casey (justincc)1-0/+13
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-05-25Resolve some mono compiler warnings.Justin Clark-Casey (justincc)1-2/+0
2012-05-23Fetch the dialog module reference in AttachmentsModule in RegionLoaded() not ↵Justin Clark-Casey (justincc)1-1/+1
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-23Fix bug where an avatar that had an object they owned attached through ↵Justin Clark-Casey (justincc)1-135/+71
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-05Fire the scripting changed event with CHANGED_OWNER when an object that has ↵Justin Clark-Casey (justincc)1-9/+9
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-04-25Comment out some debug ATTACHMENTS log messages for now.Justin Clark-Casey (justincc)1-15/+14
2012-04-24Minor improvements to loggingOren Hurvitz1-1/+3
Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]").
2012-04-07Store FromItemID for attachments once on SOG instead of on every SOP and ↵Justin Clark-Casey (justincc)1-10/+10
only ever using the root part entry. This eliminates some pointless memory use.
2012-02-01Prevent a changed attachment that has been saved from being saved again.Melanie1-0/+1
2012-02-01Straighten out some attachment mess. Don't save attachment states for HGMelanie1-11/+8
visitors at all. On Leaving a sim, save only the changed ones. Don't save all scripted stuff when leaving a sim.
2012-01-07Don't try to save a NPCs attachment states on NPC deleteMelanie1-0/+8
2011-12-09Add commented log lines to FetchInventoryDescendents2 path for future use.Justin Clark-Casey (justincc)1-0/+2
Haven't been able to resolve issue where attachments are removed by the viewer on relog on a localhost
2011-11-06Convert SendKillObject to take a list of uint rather than sending oneMelanie1-1/+1
packet per prim. More to come as we change to make use of this.
2011-10-15remove now redundant m_physical_prim flag from SOP.ApplyPhysics()Justin Clark-Casey (justincc)1-1/+1
2011-10-15factor common code out into SOP.RemoveFromPhysics()Justin Clark-Casey (justincc)1-4/+1
2011-10-04Removed all refs to IClientAPI from IAttachmentsModule. Separated client ↵Dan Lake1-360/+374
handlers for attachments to call public interface and rearranged module file into sections
2011-10-03Removed redundant code in AttachmentsModule and simplified interfaces which ↵Dan Lake1-90/+68
converted back and forth between ScenePresence and IClientAPI. More to be done still.
2011-10-03Remove usage of Linden packet types from inside Attachments Module and interfaceDan Lake1-5/+4
2011-09-30Add Enabled switch in new [Attachments] section in OpenSimDefaults.ini to ↵Justin Clark-Casey (justincc)1-3/+53
allow attachments to be temporarily turned off. This is for debugging purposes. Defaults to Attachments Enabled
2011-09-13Remove code from DetachSingleAttachmentToInv() that sets group changed on ↵Justin Clark-Casey (justincc)1-11/+0
all parts, now that we're performing this check in UpdateKnownItem() for other purposes
2011-09-13remove redunant itemID and agentID arguments from UpdateKnownItem().Justin Clark-Casey (justincc)1-6/+4
itemID is always taken taken from the group's stored item id, and agentID is never used.
2011-09-13Remove UpdateKnownItem() from IAttachmentsModule.Justin Clark-Casey (justincc)1-1/+1
It's not appropriate for code outside the attachments module to call this.
2011-09-13minor: remove redundant grp != null check from AM.UpdateKnownItem()Justin Clark-Casey (justincc)1-36/+33
2011-09-13Stop attempts to rewear already worn items from removing and reattaching.Justin Clark-Casey (justincc)1-42/+77
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-13Comment out attachments code in Scene.IncomingCreateObject(UUID userID, UUID ↵Justin Clark-Casey (justincc)1-3/+14
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-12Start locking entire add/remove operations on an ↵Justin Clark-Casey (justincc)1-175/+207
IScenePresence.AttachmentsSyncLock object Attach and detach packets are processed asynchronously when received from a viewer. Bugs like http://opensimulator.org/mantis/view.php?id=5644 indicate that in some situations (such as attaching/detaching entire folders of objects at once), there are race conditions between these threads. Since multiple data structures need to be updated on attach/detach, it's not enough to lock the individual collections. Therefore, this commit introduces a new IScenePresence.AttachmentsSyncLock which add/remove operations lock on.
2011-09-06refactor: Make logic in AM.AttachObject() clearer by not reusing existing ↵Justin Clark-Casey (justincc)1-14/+19
variables in different contexts
2011-09-06rename AM.AddSceneObjectAsAttachment() to AddSceneObjectAsNewAttachmentInInvJustin Clark-Casey (justincc)1-3/+3
2011-09-06Get rid of the confusing version of ↵Justin Clark-Casey (justincc)1-11/+2
IAttachmentsModule.RezSingleAttachmentFromInventory() with the updateInventoryStatus switch, since this is never called with false
2011-09-06get rid of the unused AttachmentsModule.ShowAttachInUserInventory()Justin Clark-Casey (justincc)1-28/+0
2011-09-06Stop the pointless double setting of every attachment in AvatarAppearance.Justin Clark-Casey (justincc)1-6/+2
The second was already being filtered out so this has no user level effect
2011-09-03Stop NPCs losing attachments when the source avatar takes them off.Justin Clark-Casey (justincc)1-28/+48
This was happening because we were using the source avatar's item IDs in the clone appearance. Switch to using the asset IDs of attachments instead for NPCs. The InventoryAccessModule and AttachmentModule had to be changed to allow rezzing of an object without an associated inventory item. Hopefully goes some way towards resolving http://opensimulator.org/mantis/view.php?id=5653
2011-09-01Eliminate pointless checks of SOG.RootPart != nullJustin Clark-Casey (justincc)1-6/+0
It's never possible for SOG to have no RootPart, except in the first few picosends of the big bang when it's pulled from region persistence or deserialized
2011-08-31move common code into AttachmentsModule.DeleteAttachmentsFromScene()Justin Clark-Casey (justincc)1-0/+10
2011-08-31Make SP.Attachments available as sp.GetAttachments() instead.Justin Clark-Casey (justincc)1-12/+7
The approach here, as in other parts of OpenSim, is to return a copy of the list rather than the attachments list itself This prevents callers from forgetting to lock the list when they read it, as was happening in various parts of the codebase. It also improves liveness. This might improve attachment anomolies when performing region crossings.
2011-08-30remove pointless ToArray() call in AttachmentsModule.SaveChangedAttachments()Justin Clark-Casey (justincc)1-1/+1
2011-08-30minor: remove already processed avatar null check in Scene.RemoveClient()Justin Clark-Casey (justincc)1-1/+0
remove some now duplicated method doc
2011-08-30refactor: move SP.SaveChangedAttachments() fully into AttachmentsModuleJustin Clark-Casey (justincc)1-0/+18
2011-08-30refactor: Move ScenePresence.RezAttachments() into AttachmentsModuleJustin Clark-Casey (justincc)1-0/+38
This adds an incomplete IScenePresence to match ISceneEntity