Attachment Protocols
From OpenSimulator
Contents |
Introduction
WIP: These are rough notes on some aspects of attachments - will be filled out as time goes on -- Justincc 22:50, 4 April 2013 (UTC)
On login, the simulator sends information to the viewer about the current attachments and rezzes them attached to the avatar in the region. This information is pulled from the avatar service.
On viewers without a "Current Outfit" folder (version 1 viewers and some version 2 viewers), this is the primary way in which a viewer is notified as to what is attached.
On viewers that do have a "Current Outfit" folder, they will issues RezMultipleAttachmentFromInventory UDP requests to re-rez the objects. However, OpenSimulator will also use the data in the avatar service to wear items. Hence, if for some reason an item is registered as worn in the avatar service then it will be worn even if it's not in the current outfit folder. Conversely, if an item is worn in the current outfit folder but for some reason is not registered in the avatar service then it will still be worn. In the later case, the two will come into sync as the current outfit folder item will be added to the avatar service.
Protocol
Below is a list of the UDP messages involved in attachment manipulation that flow between the viewer and the simulator. This list may not be complete.
Direct UDP messages
ObjectAttach
Viewer -> Simulator.
Attachment an object in the scene.
ObjectDetach
Viewer -> Simulator.
Detach an attachment into the user's inventory.
ObjectDrop
Viewer -> Simulator.
Detach an attachment into the scene.
RezSingleAttachmentFromInv
Viewer -> Simulator.
Attach an object from the user's inventory.
RezMultipleAttachmentsFromInv
Viewer -> Simulator.
Rez multiple attachments at once from the user's inventory.
Associated UDP messages
KillObject
Simulator -> Viewer.
Sent by the simulator to tell the viewer that an object has been detached. For a V3 viewer, this will trigger a subsequent RemoveInventoryItem to remove the item's link in the Current Outfit folder.
ObjectUpdate
Simulator -> Viewer.
Tells the viewer about the properties of the new attachment (position, attachment point, etc.). Also conveys the attachment point, the position and which item this attachment comes from (if appropriate).
UpdateCreateInventoryItem
Simulator -> Viewer.
Tells the viewer that a new inventory item is present for a newly received attachment. For a V3 viewer, this will trigger a further LinkInventoryItem message to create a link for that item in the Current Outfit folder.
Current Outfit Folder
As discussed above, viewer 2/3 onwards (i.e. all modern viewers) have a "Current Outfit" folder which lists the clothing, body parts and objects that the avatar is currently wearing. These are actually links to other inventory items. In turn, these reference assets as do all other inventory items. For instance
Current Outfit/Default Eyes => Body Parts/Default Eyes => eyes asset