Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Open Simulator Technical Help
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
OpenSimulator Internals/Walkthroughs/Avatar Rezzes Inventory
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= OpenSimulator Internals/Walkthroughs/Avatar Rezzes Inventory = == Overview == Traces what happens in code, connectors, and database when an avatar rezzes an object from inventory into the world. ---- == 1. Client Sends RezObject == OpenSim/Region/Framework/Scenes/Scene.cs -- RezObject() # Viewer sends RezObject packet with itemID, ray start/end, and rez flags. # Scene.RezObject() calls IInventoryAccessModule.RezObject(). ---- == 2. Item and Asset Fetched == BasicInventoryAccessModule -- RezObject() # Calls InventoryService.GetItem(agentID, itemID) -- reads inventoryitems table. # Validates item exists and is owned by agent. # Calls AssetService.Get(assetID) -- fetches object XML asset. # If asset null or empty: sends alert to client, returns null. For HG foreign users (HGInventoryAccessModule): * If IsForeignUser: calls m_assMapper.Get(item.AssetID, agentID, foreignAssetServer) before asset fetch -- pulls asset from foreign grid if not cached locally. ; DB reads: * inventoryitems -- SELECT by item UUID * assets -- SELECT by asset UUID ---- == 3. Deserialise and Position == BasicInventoryAccessModule -- RezObject() continued # Calls Scene.GetObjectsToRez() -- deserialises XML into List<SceneObjectGroup> and position offsets. #* Single object: SceneObjectSerializer.FromOriginalXmlFormat(). #* Coalesced: CoalescedSceneObjectsSerializer.FromXml(). # Calls Scene.GetNewRezLocation() -- raycasts from RayStart to RayEnd against physics scene to find surface position. # Checks CanRezObject permission at target position. # If no-copy item fails perm check: sends SendBulkUpdateInventory to restore item to client display. ---- == 4. Ownership and Permissions Applied == BasicInventoryAccessModule -- DoPreRezWhenFromItem() # Sets rootPart.Name and Description from inventory item (single object only). # Applies ObjectSlamSale if flagged. # Sets FromFolderID on SOG. # If ownership change (new owner or Slam flag): #* Changes OwnerID on all parts, sets LastOwnerID, calls Inventory.ChangeInventoryOwner(). #* Calls ApplyNextOwnerPermissions() -- applies NextOwnerMask to BasePermissions. #* Applies any ObjectOverwrite flags from item. # If same owner: sets FromUserInventoryItemID if item is copyable (links rezzed object back to inventory item for "save changes" support). # Calls TrimPermissions() and InvalidateDeepEffectivePerms(). ---- == 5. Object Added to Scene == BasicInventoryAccessModule -- RezObject() continued # group.ResetIDs() -- assigns new UUIDs to all parts. # Clears attachment data (ClearPartAttachmentData()). # Sets IsSelected if RezSelected flag. # Sets AbsolutePosition from ray result. # Calls Scene.AddNewSceneObject(group, true, false) -- adds to scene graph, schedules persistence. # Calls CreateScriptInstances(0, true, DefaultScriptEngine, 1) -- starts scripts with on_rez state source. # Calls ResumeScripts(). # Schedules full update to clients. ; DB writes: * prims -- INSERT: new prim rows for each part * primshapes -- INSERT: shape data for each part * primitems -- INSERT: task inventory for each part ---- == 6. No-Copy Item Removed from Inventory == BasicInventoryAccessModule -- DoPostRezWhenFromItem() # If item.CurrentPermissions has no Copy bit: calls InventoryService.DeleteItems(owner, [itemID]). # Item is consumed on rez. ; DB writes (no-copy only): * inventoryitems -- DELETE: item removed ---- == 7. HG Asset Push (HG users only) == Not applicable on standard rez. HG asset push (ExportAsset) is triggered on CopyToInventory, not on rez. ---- == Summary: DB Tables Touched == {| class="wikitable" ! Table !! Operation !! Notes |- | inventoryitems || SELECT || Fetch item record |- | assets || SELECT || Fetch object XML |- | prims || INSERT || New object in region |- | primshapes || INSERT || Shape data |- | primitems || INSERT || Task inventory per part |- | inventoryitems || DELETE || No-copy items only |} ---- == Edge Cases == Attachment rez (from RezAttachments or RezSingleAttachmentFromInventory): uses same RezObject() path but attachment=true. AddNewSceneObject() is called without script start (scripts start later in AttachToAgent). See [[OpenSimulator Internals/Walkthroughs/Avatar Rez In Region]]. Coalesced object: multiple SOGs deserialised from one asset, each positioned using the stored offsets from CoalescedSceneObjectsSerializer. Each gets its own DB rows. ---- == See Also == * [[OpenSimulator Internals/Walkthroughs]] * [[OpenSimulator Internals/Code Map/InventoryAccessModule]] * [[OpenSimulator Internals/Walkthroughs/Avatar Acquires Inventory]] * [[OpenSimulator Internals/Walkthroughs/Avatar Derezzes Object]] * [[OpenSimulator Internals/Walkthroughs/Avatar Rezzes Box]]
Summary:
Please note that all contributions to Open Simulator Technical Help may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Open Simulator Technical Help:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
OpenSimulator Internals/Walkthroughs/Avatar Rezzes Inventory
(section)
Add topic