From fe9aea258ff4142e718b4916ccefeeedef229768 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Wed, 24 Sep 2008 21:12:21 +0000 Subject: Add persistence of active gestures. This needs an UGAIM update to work. Active gestures are sent as part of the login-response. Added fetchActiveGestures to SQLite and MySQL; added an empty one for MSSQL and NHibernate. Using the empty ones won't cause errors, but doesn't provide persistence either, of course. --- .../Communications/IInterServiceInventoryServices.cs | 11 +++++++++++ OpenSim/Framework/Communications/InventoryServiceBase.cs | 9 +++++++++ OpenSim/Framework/Communications/LoginResponse.cs | 12 ++++++++++-- OpenSim/Framework/IInventoryData.cs | 11 +++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs b/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs index 5900f4e..661eb91 100644 --- a/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs @@ -49,5 +49,16 @@ namespace OpenSim.Framework.Communications /// A flat list of the user's inventory folder tree, /// null if there is no inventory for this user List GetInventorySkeleton(UUID userId); + + /// + /// Returns a list of all the active gestures in a user's inventory. + /// + /// + /// The of the user + /// + /// + /// A flat list of the gesture items. + /// + List GetActiveGestures(UUID userId); } } diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index e9dc3c4..d6392c4 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -148,6 +148,15 @@ namespace OpenSim.Framework.Communications // See IInventoryServices public abstract void RequestInventoryForUser(UUID userID, InventoryReceiptCallback callback); + public List GetActiveGestures(UUID userId) + { + foreach (IInventoryDataPlugin plugin in m_plugins) + { + return plugin.fetchActiveGestures(userId); + } + return new List(); + } + #endregion #region Methods used by GridInventoryService diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index 435852d4..db504f9 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -60,6 +60,7 @@ namespace OpenSim.Framework.Communications private ArrayList inventoryLibraryOwner; private ArrayList inventoryLibRoot; private ArrayList inventoryLibrary; + private ArrayList activeGestures; private UserInfo userProfile; @@ -124,6 +125,7 @@ namespace OpenSim.Framework.Communications agentInventory = new ArrayList(); inventoryLibrary = new ArrayList(); inventoryLibraryOwner = new ArrayList(); + activeGestures = new ArrayList(); xmlRpcResponse = new XmlRpcResponse(); // defaultXmlRpcResponse = new XmlRpcResponse(); @@ -355,7 +357,7 @@ namespace OpenSim.Framework.Communications responseData["inventory-skel-lib"] = inventoryLibrary; responseData["inventory-root"] = inventoryRoot; responseData["inventory-lib-root"] = inventoryLibRoot; - responseData["gestures"] = new ArrayList(); // todo + responseData["gestures"] = activeGestures; responseData["inventory-lib-owner"] = inventoryLibraryOwner; responseData["initial-outfit"] = initialOutfit; responseData["start_location"] = startLocation; @@ -452,7 +454,7 @@ namespace OpenSim.Framework.Communications #endregion Inventory - map["gestures"] = new LLSDArray(); // todo + map["gestures"] = ArrayListToLLSDArray(activeGestures); map["initial-outfit"] = ArrayListToLLSDArray(initialOutfit); map["start_location"] = LLSD.FromString(startLocation); @@ -699,6 +701,12 @@ namespace OpenSim.Framework.Communications set { inventoryLibRoot = value; } } + public ArrayList ActiveGestures + { + get { return activeGestures; } + set { activeGestures = value; } + } + public string Home { get { return home; } diff --git a/OpenSim/Framework/IInventoryData.cs b/OpenSim/Framework/IInventoryData.cs index d5fa25d..e42e50d 100644 --- a/OpenSim/Framework/IInventoryData.cs +++ b/OpenSim/Framework/IInventoryData.cs @@ -131,6 +131,17 @@ namespace OpenSim.Framework /// /// The id of the folder void deleteInventoryFolder(UUID folder); + + /// + /// Returns all activated gesture-items in the inventory of the specified avatar. + /// + /// + /// The of the avatar + /// + /// + /// The list of gestures (s) + /// + List fetchActiveGestures(UUID avatarID); } public class InventoryDataInitialiser : PluginInitialiserBase -- cgit v1.1