Previous topic

helpers

Next topic

llsd_builder

This Page

inventory

class pyogp.lib.base.inventory.InventoryManager(agent=None, settings=None)

is an inventory container

Initialize the event queue client class >>> inventory = InventoryManager()

Sample implementations: agent.py Tests: tests/test_inventory.py

set up the inventory manager

confirm_inventory_offer(FromAgentID, FromAgentName, InventoryName, ID, AssetType, ItemID, accept)
sends an ImprovedInstantMessage packet accepting or declining an inventory offer
create_new_item(folder, name, desc, asset_type, inv_type, wearable_type, next_owner_permission, callback=None)
Creates a new item in folder.
display_folder_contents(folder_id=None)
returns a list of the local representation of a folder’s contents
enable_callbacks()
enable monitors for certain inventory related packet events
give_inventory(ItemID=None, agent_id=None)

offers another agent the specified inventory item

searches the local inventory for the specified ItemID given a match, sends an ImprovedInventoryMessage packet to the specified AgentID

handle_inventory_offer(packet)
parses and handles an incoming inventory offer
onBulkUpdateInventory(packet)
handle the inventory data being delivered in the BullkUpdateInventory packet
onFetchInventoryReply(packet)
onInventoryDescendents(packet)
request_inventory_by_id(id_list=None)
ask for inventory data by id via a list
request_known_folder_contents(folder_id=None)
send requests to the server for contents of all known folders
search_inventory(folder_list=[], item_id=None, name=None, match_list=[])

search through all inventory folders for an id(uuid) or Name, and return a list of matching InventoryItems or InventoryFolders

recursive search, based on folder_id. if no folder id is specified look through everything in self.folders

This does not request inventory from the grid. It could, were we to go about enabling this...

search_inventory_folder(folder_id, _id=None, name=None)

search an inventory folder for _id or name

return a list of matches

sendFetchInventoryDescendentsRequest(folder_id=None)
send a request to the grid for folder contents
sendFetchInventoryRequest(folder_id=None)
send a request to the grid for inventory items in folder
sendFetchLibDescendentsRequest(item_id=None)
send a request to the grid for library folder contents
sendFetchLibRequest(item_id=None)
send a request to the grid for library items
send_CreateInventoryItem(agent_id, session_id, callback_id, folder_id, transaction_id, next_owner_mask, type_, inv_type, wearable_type, name, desc)
sends a CreateInventoryItem message
send_FetchInventory(agent_id, session_id, owner_id, inventory_ids)
send a FetchInventory message to the host simulator each of the ids in inventory_ids will be sent in it’s own InventoryData block
class pyogp.lib.base.inventory.InventoryItem(ItemID=None, FolderID=None, CreatorID=None, OwnerID=None, GroupID=None, BaseMask=None, OwnerMask=None, GroupMask=None, EveryoneMask=None, NextOwnerMask=0, GroupOwned=None, AssetID=None, Type=None, InvType=None, Flags=None, SaleType=None, SalePrice=None, Name=None, Description=None, CreationDate=None, CRC=None, LastOwnerID=00000000-0000-0000-0000-000000000000)

represents an Inventory item

Initialize the InventoryItem class >>> inventoryitem = InventoryItem()

Sample implementations: inventory.py Tests: tests/test_inventory.py

initialize the inventory item

give(agent, to_agent_id)
sends the target agent an inventory offer of this
rez_object(agent, relative_position=(1, 0, 0))
update(agent, name=None, value=None)

allow arbitraty update to any data in the inventory item

accepts a dictionary of key:value pairs which will update the stored inventory items and then send an UpdateInventoryItem packet

class pyogp.lib.base.inventory.UDP_Inventory(agent, settings=None)
confirm_inventory_offer(FromAgentID, FromAgentName, InventoryName, ID, AssetType, ItemID, accept)
sends an ImprovedInstantMessage packet accepting or declining an inventory offer
create_new_item(folder, name, desc, asset_type, inv_type, wearable_type, next_owner_permission, callback=None)
Creates a new item in folder.
display_folder_contents(folder_id=None)
returns a list of the local representation of a folder’s contents
enable_callbacks()
enable monitors for certain inventory related packet events
give_inventory(ItemID=None, agent_id=None)

offers another agent the specified inventory item

searches the local inventory for the specified ItemID given a match, sends an ImprovedInventoryMessage packet to the specified AgentID

handle_inventory_offer(packet)
parses and handles an incoming inventory offer
onBulkUpdateInventory(packet)
handle the inventory data being delivered in the BullkUpdateInventory packet
onFetchInventoryReply(packet)
onInventoryDescendents(packet)
request_inventory_by_id(id_list=None)
ask for inventory data by id via a list
request_known_folder_contents(folder_id=None)
send requests to the server for contents of all known folders
search_inventory(folder_list=[], item_id=None, name=None, match_list=[])

search through all inventory folders for an id(uuid) or Name, and return a list of matching InventoryItems or InventoryFolders

recursive search, based on folder_id. if no folder id is specified look through everything in self.folders

This does not request inventory from the grid. It could, were we to go about enabling this...

search_inventory_folder(folder_id, _id=None, name=None)

search an inventory folder for _id or name

return a list of matches

sendFetchInventoryDescendentsRequest(folder_id=None)
send a request to the grid for folder contents
sendFetchInventoryRequest(folder_id=None)
send a request to the grid for folder attributes
sendFetchLibDescendentsRequest(folder_id=None)
send a request to the grid for library items
sendFetchLibRequest(item_id=None)
send a request to the grid for library items
send_CreateInventoryItem(agent_id, session_id, callback_id, folder_id, transaction_id, next_owner_mask, type_, inv_type, wearable_type, name, desc)
sends a CreateInventoryItem message
send_FetchInventory(agent_id, session_id, owner_id, inventory_ids)
send a FetchInventory message to the host simulator each of the ids in inventory_ids will be sent in it’s own InventoryData block
class pyogp.lib.base.inventory.AIS(agent, capabilities, settings=None)

AIS specific inventory manager

confirm_inventory_offer(FromAgentID, FromAgentName, InventoryName, ID, AssetType, ItemID, accept)
sends an ImprovedInstantMessage packet accepting or declining an inventory offer
create_new_item(folder, name, desc, asset_type, inv_type, wearable_type, next_owner_permission, callback=None)
Creates a new item in folder.
display_folder_contents(folder_id=None)
returns a list of the local representation of a folder’s contents
enable_callbacks()
enable monitors for certain inventory related packet events
give_inventory(ItemID=None, agent_id=None)

offers another agent the specified inventory item

searches the local inventory for the specified ItemID given a match, sends an ImprovedInventoryMessage packet to the specified AgentID

handle_inventory_offer(packet)
parses and handles an incoming inventory offer
onBulkUpdateInventory(packet)
handle the inventory data being delivered in the BullkUpdateInventory packet
onFetchInventoryReply(packet)
onInventoryDescendents(packet)
request_inventory_by_id(id_list=None)
ask for inventory data by id via a list
request_known_folder_contents(folder_id=None)
send requests to the server for contents of all known folders
search_inventory(folder_list=[], item_id=None, name=None, match_list=[])

search through all inventory folders for an id(uuid) or Name, and return a list of matching InventoryItems or InventoryFolders

recursive search, based on folder_id. if no folder id is specified look through everything in self.folders

This does not request inventory from the grid. It could, were we to go about enabling this...

search_inventory_folder(folder_id, _id=None, name=None)

search an inventory folder for _id or name

return a list of matches

sendFetchInventoryDescendentsRequest(folder_id)
send a request to the server for inventory folder contents
sendFetchInventoryRequest(item_ids=[])
send a request to the grid for inventory item attributes
sendFetchLibDescendentsRequest(folder_id)
send a request to the server for folder contents
sendFetchLibRequest(folder_id, item_ids=[])
send a request to the grid for library item attributes
send_CreateInventoryItem(agent_id, session_id, callback_id, folder_id, transaction_id, next_owner_mask, type_, inv_type, wearable_type, name, desc)
sends a CreateInventoryItem message
send_FetchInventory(agent_id, session_id, owner_id, inventory_ids)
send a FetchInventory message to the host simulator each of the ids in inventory_ids will be sent in it’s own InventoryData block
class pyogp.lib.base.inventory.InventoryFolder(Name=None, FolderID=None, ParentID=None, Version=None, Type=None, AgentID=00000000-0000-0000-0000-000000000000, Descendents=0)

represents an Inventory folder

Initialize the event queue client class >>> inventoryfolder = InventoryFolder()

Sample implementations: inventory.py Tests: tests/test_inventory.py

initialize the inventory folder

move(agent, parent_id, restamp=False)
reparents this inventory folder
purge_descendents(agent)
removes inventory from this folder, by unlinking the inventory from this parent folder
remove(agent)
removes this inventory folder
send_MoveInventoryFolder(agent, agent_id, session_id, restamp, folder_id, parent_id)
sends a MoveInventoryFolder message to the host simulator
send_PurgeInventoryDescendents(agent, agent_id, session_id, folder_id)
send a PurgeInventoryDescendents message to the host simulator
send_RemoveInventoryFolder(agent, agent_id, session_id, restamp, folder_id)
sends a RemoveInventoryFolder message to the host simulator