Commit Graph

109 Commits (d3a4d67a207976cd0d116bb9021f7dfc896784e8)

Author SHA1 Message Date
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
Justin Clark-Casey (justincc) ea0f78c971 Start locking entire add/remove operations on an 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-12 21:57:22 +01:00
Justin Clark-Casey (justincc) 1a8f5b97b9 refactor: Make logic in AM.AttachObject() clearer by not reusing existing variables in different contexts 2011-09-06 02:40:19 +01:00
Justin Clark-Casey (justincc) 5beee42809 rename AM.AddSceneObjectAsAttachment() to AddSceneObjectAsNewAttachmentInInv 2011-09-06 02:29:22 +01:00
Justin Clark-Casey (justincc) c6ec573d10 Get rid of the confusing version of IAttachmentsModule.RezSingleAttachmentFromInventory() with the updateInventoryStatus switch, since this is never called with false 2011-09-06 00:36:38 +01:00
Justin Clark-Casey (justincc) 05a4bedc30 get rid of the unused AttachmentsModule.ShowAttachInUserInventory() 2011-09-06 00:32:52 +01:00
Justin Clark-Casey (justincc) 0cb0140a1d Stop the pointless double setting of every attachment in AvatarAppearance.
The second was already being filtered out so this has no user level effect
2011-09-06 00:29:37 +01:00
Justin Clark-Casey (justincc) 5c1fa968ab Stop NPCs losing attachments when the source avatar takes them off.
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-03 01:11:16 +01:00
Justin Clark-Casey (justincc) 7eca929686 Eliminate pointless checks of SOG.RootPart != null
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-09-01 02:11:00 +01:00
Justin Clark-Casey (justincc) 7d58b5fa15 move common code into AttachmentsModule.DeleteAttachmentsFromScene() 2011-08-31 17:53:58 +01:00
Justin Clark-Casey (justincc) 32444d98cb Make SP.Attachments available as sp.GetAttachments() instead.
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-31 16:29:51 +01:00
Justin Clark-Casey (justincc) 2acfff9f6d remove pointless ToArray() call in AttachmentsModule.SaveChangedAttachments() 2011-08-30 23:39:26 +01:00
Justin Clark-Casey (justincc) 1809aaf74c minor: remove already processed avatar null check in Scene.RemoveClient()
remove some now duplicated method doc
2011-08-30 23:36:45 +01:00
Justin Clark-Casey (justincc) ddc733cd3d refactor: move SP.SaveChangedAttachments() fully into AttachmentsModule 2011-08-30 23:32:30 +01:00
Justin Clark-Casey (justincc) 04bafd2122 refactor: Move ScenePresence.RezAttachments() into AttachmentsModule
This adds an incomplete IScenePresence to match ISceneEntity
2011-08-30 23:06:10 +01:00
Justin Clark-Casey (justincc) 1de68b34d9 refactor: migrate DropObject handling fully into AttachmentsModule from Scene 2011-08-30 22:25:38 +01:00
Justin Clark-Casey (justincc) e7a515bab0 Fix bug where attachments were remaining on the avatar after being dropped.
If the inventory service is configured not to allow deletion then these will not disappear from inventory
2011-08-30 22:06:24 +01:00
Justin Clark-Casey (justincc) 1615e7d29f Eliminate duplicate AttachmentPoint properties by always using the one stored in the root part's state field. 2011-08-27 00:33:24 +01:00
Justin Clark-Casey (justincc) b7700428ec refactor: camel case AttachmentPoint method arg as per code standards 2011-08-27 00:20:15 +01:00
Justin Clark-Casey (justincc) 33a894f3d2 refactor: move SOP.IsAttachment and AttachmentPoint up into SOG to avoid pointless duplication of identical values 2011-08-27 00:15:21 +01:00
Justin Clark-Casey (justincc) 15a514fcbc refactor: simplify SOP.AttachedAvatar into SOG.AttachedAvatar
This does a tiny bit to reduce code complexity, memory requirement and the cpu time of pointlessly setting this field to the same value in every SOP
2011-08-26 23:06:41 +01:00
Justin Clark-Casey (justincc) 5f3ffc195f refactor: move SOG.DetachToGround() to AttachmentsModule.DetachSceneObjectToGround() and remove redundant code 2011-08-26 22:49:11 +01:00
Justin Clark-Casey (justincc) ae614c1264 refactor: simplify DetachSingleAttachmentToGround() by retrieving the scene object group direct 2011-08-26 22:37:53 +01:00
Justin Clark-Casey (justincc) 002313bf13 refactor: move sog.DetachToInventoryPrep() into AttachmentsModule.DetachSingleAttachmentToInv() 2011-08-26 22:02:23 +01:00
Justin Clark-Casey (justincc) fcbed6479a Downgrade warning about not saving unchanged attachment to debug instead, and change text to better indicate what it's saying 2011-08-26 21:46:12 +01:00
Justin Clark-Casey (justincc) 6c692d2e21 Fix a very recent regression from llAttachToAvatar() fix where I accidentally stopped normal script state persistence on login/logout and attach/detach 2011-08-26 21:26:29 +01:00
Justin Clark-Casey (justincc) 4b4c5e69e5 Remove forcing of phantom on ground attached objects - attachments can be both non-phantom and flagged as physical.
As per Melanie
2011-08-24 22:45:51 +01:00
Justin Clark-Casey (justincc) 73d913dad2 Make objects attached from the ground phantom 2011-08-24 22:12:51 +01:00
Justin Clark-Casey (justincc) 801b7f18a7 return InventoryItemBase from AddSceneObjectAsAttachment() 2011-08-24 21:40:36 +01:00
Justin Clark-Casey (justincc) 5eeee480d4 refactor: move Scene.Inventory.attachObjectAssetStore() into AttachmentsModule.AddSceneObjectAsAttachment() 2011-08-24 21:35:44 +01:00
Justin Clark-Casey (justincc) ccf07f6ae3 refactor: remove pointless AgentId argument from attachObjectAssetStore() 2011-08-24 21:14:57 +01:00
Justin Clark-Casey (justincc) b9ec625dbf add TestAddAttachmentFromGround() regression test 2011-08-24 21:07:46 +01:00
Justin Clark-Casey (justincc) cf3ffe5bb4 Fix llAttachToAvatar()
Apart from one obvious bug, this was failing because attempting to serialize the script from inside the script (as part of saving the attachment as an inventory asset) was triggering an extremely long delay.
So we now don't do this.  The state will be serialized anyway when the avatar normally logs out.
The worst that can happen is that if the client/server crashes, the attachment scripts start without previous state.
2011-08-24 20:49:23 +01:00