Index: OpenMetaverse/GridClient.cs =================================================================== --- OpenMetaverse/GridClient.cs (revision 2042) +++ OpenMetaverse/GridClient.cs (working copy) @@ -99,6 +99,8 @@ /// Throttling total bandwidth usage, or allocating bandwidth /// for specific data stream types public AgentThrottle Throttle; + public Inventory InventoryStore; + public Inventory LibraryStore; /// /// Default constructor @@ -122,6 +124,22 @@ Terrain = new TerrainManager(this); Sound = new SoundManager(this); Throttle = new AgentThrottle(this); + + if (Settings.ENABLE_INVENTORY_STORE || Settings.ENABLE_LIBRARY_STORE) + { + Inventory.OnSkeletonsReceived += + delegate(InventoryManager manager) + { + if (Settings.ENABLE_INVENTORY_STORE) + { + InventoryStore = new Inventory(Inventory, Inventory.InventorySkeleton); + } + if (Settings.ENABLE_LIBRARY_STORE) + { + LibraryStore = new Inventory(Inventory, Inventory.LibrarySkeleton); + } + }; + } } /// Index: OpenMetaverse/InventoryManager.cs =================================================================== --- OpenMetaverse/InventoryManager.cs (revision 2042) +++ OpenMetaverse/InventoryManager.cs (working copy) @@ -680,6 +680,11 @@ #region Delegates /// + /// Delegate for + /// + public delegate void SkeletonsReceived(InventoryManager manager); + + /// /// Callback for inventory item creation finishing /// /// Whether the request to create an inventory @@ -784,6 +789,11 @@ #endregion Delegates #region Events + /// + /// Raised when the inventory and library skeletons are received. + /// and + /// + public event SkeletonsReceived OnSkeletonsReceived; public event AssetUpdate OnAssetUpdate; public event ItemCreatedCallback OnItemCreated; @@ -965,11 +975,22 @@ _Agents.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage); // Register extra parameters with login and parse the inventory data that comes back + List options = new List(5); + if (Settings.ENABLE_INVENTORY_STORE) + { + options.Add("inventory_root"); + options.Add("inventory-skeleton"); + } + if (Settings.ENABLE_LIBRARY_STORE) + { + options.Add("inventory-lib-root"); + options.Add("inventory-lib-owner"); + options.Add("inventory-skel-lib"); + } + // Register extra parameters with login and parse the inventory data that comes back _Network.RegisterLoginResponseCallback( new NetworkManager.LoginResponseCallback(Network_OnLoginResponse), - new string[] { - "inventory-root", "inventory-skeleton", "inventory-lib-root", - "inventory-lib-owner", "inventory-skel-lib"}); + options.ToArray()); } #region Fetch @@ -3352,10 +3373,22 @@ { if (loginSuccess) { - InventorySkeleton = new InventorySkeleton(replyData.InventoryRoot, replyData.AgentID); - InventorySkeleton.Folders = replyData.InventoryFolders; - LibrarySkeleton = new InventorySkeleton(replyData.LibraryRoot, replyData.LibraryOwner); - LibrarySkeleton.Folders = replyData.LibraryFolders; + if (Settings.ENABLE_INVENTORY_STORE) + { + InventorySkeleton = new InventorySkeleton(replyData.InventoryRoot, replyData.AgentID); + InventorySkeleton.Folders = replyData.InventoryFolders; + } + if (Settings.ENABLE_LIBRARY_STORE) + { + LibrarySkeleton = new InventorySkeleton(replyData.LibraryRoot, replyData.LibraryOwner); + LibrarySkeleton.Folders = replyData.LibraryFolders; + } + if (OnSkeletonsReceived != null) + { + try { OnSkeletonsReceived(this); } + catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, _Client, e); } + + } } } Index: OpenMetaverse/Settings.cs =================================================================== --- OpenMetaverse/Settings.cs (revision 2042) +++ OpenMetaverse/Settings.cs (working copy) @@ -39,7 +39,7 @@ /// happen at login or dynamically public class Settings { - #region Login/Networking Settings + #region Login/Networking Settings /// Main grid login server public const string AGNI_LOGIN_SERVER = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; @@ -57,6 +57,18 @@ public static System.Net.IPAddress BIND_ADDR = System.Net.IPAddress.Any; #endregion + #region Inventory + /// + /// InventoryManager requests inventory information on login, + /// GridClient initializes an Inventory store for main inventory. + /// + public const bool ENABLE_INVENTORY_STORE = true; + /// + /// InventoryManager requests library information on login, + /// GridClient initializes an Inventory store for the library. + /// + public const bool ENABLE_LIBRARY_STORE = true; + #endregion #region Timeouts and Intervals /// Number of milliseconds before an asset transfer will time @@ -133,7 +145,7 @@ throw new ArgumentOutOfRangeException("Too many ACKs to fit in a single packet"); else if (value < 1) throw new ArgumentOutOfRangeException("Cannot send a non-positive number of ACKs"); - + max_pending_acks = value; } } @@ -194,8 +206,8 @@ /// servers for simulators public bool ENABLE_CAPS = true; - /// Whether to decode sim stats - public bool ENABLE_SIMSTATS = true; + /// Whether to decode sim stats + public bool ENABLE_SIMSTATS = true; /// The capabilities servers are currently designed to /// periodically return a 502 error which signals for the client to