30 using System.Collections.Generic;
31 using System.Diagnostics;
32 using System.Threading;
34 using pCampBot.Interfaces;
43 private bool m_initialized;
44 private int m_Requests = 2;
45 private Stopwatch m_StopWatch =
new Stopwatch();
46 private List<UUID> m_processed =
new List<UUID>();
59 Bot.Client.Settings.HTTP_INVENTORY =
true;
60 Bot.Client.Settings.FETCH_MISSING_INVENTORY =
true;
61 Bot.Client.Inventory.FolderUpdated += Inventory_FolderUpdated;
62 Console.WriteLine(
"Lib owner is " + Bot.Client.Inventory.Store.LibraryRootNode.Data.OwnerID);
64 Bot.Client.Inventory.RequestFolderContents(Bot.Client.Inventory.Store.RootFolder.UUID, Bot.Client.Self.AgentID,
true,
true, InventorySortOrder.ByDate);
65 Bot.Client.Inventory.RequestFolderContents(Bot.Client.Inventory.Store.LibraryRootNode.Data.UUID, Bot.Client.Inventory.Store.LibraryRootNode.Data.OwnerID,
true,
true, InventorySortOrder.ByDate);
69 Console.WriteLine(
"Total items: " + Bot.Client.Inventory.Store.Items.Count +
"; Total requests: " + m_Requests +
"; Time: " + m_StopWatch.Elapsed);
73 void Inventory_FolderUpdated(
object sender, FolderUpdatedEventArgs e)
81 if (!m_processed.Contains(e.FolderID))
83 m_processed.Add(e.FolderID);
90 List<InventoryFolder> m_foldersToFetch =
new List<InventoryFolder>();
91 foreach (InventoryBase item
in Bot.
Client.Inventory.Store.GetContents(e.FolderID))
93 if (item is InventoryFolder)
95 InventoryFolder f =
new InventoryFolder(item.UUID);
96 f.OwnerID = item.OwnerID;
97 m_foldersToFetch.Add(f);
100 if (m_foldersToFetch.Count > 0)
103 Bot.Client.Inventory.RequestFolderContentsCap(m_foldersToFetch, Bot.Client.Network.CurrentSim.Caps.CapabilityURI(
"FetchInventoryDescendents2"),
true,
true, InventorySortOrder.ByDate);
107 if (
Bot.
Client.Inventory.Store.Items.Count >= 15739)
110 Console.WriteLine(
"Stop! Total items: " + Bot.Client.Inventory.Store.Items.Count +
"; Total requests: " + m_Requests +
"; Time: " + m_StopWatch.Elapsed);
118 m_interruptEvent.Set();
override void Action()
Action to take when this behaviour is invoked.
InventoryDownloadBehaviour()
string AbbreviatedName
Abbreviated name of this behaviour.
override void Interrupt()
Interrupt the behaviour.
GridClient Client
New instance of a SecondLife client