From 830626999c08f959bf1434939298b7a453a4f548 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 28 Mar 2008 14:47:51 +0000 Subject: Applied patch from mantis# 825, thanks A_Biondi --- OpenSim/Framework/Communications/LoginResponse.cs | 39 +++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'OpenSim/Framework/Communications/LoginResponse.cs') diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index 4a31986..763274a 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -416,12 +416,9 @@ namespace OpenSim.Framework.UserManagement map["seed_capability"] = LLSD.FromString(seedCapability); - // FIXME: Need a function that will convert these ArrayLists in to LLSDArrays, - // and convert the data inside them to LLSD objects as well - - //map["event_categories"] = eventCategories; + map["event_categories"] = ArrayListToLLSDArray(eventCategories); //map["event_notifications"] = new LLSDArray(); // todo - //map["classified_categories"] = classifiedCategories; + map["classified_categories"] = ArrayListToLLSDArray(classifiedCategories); #region UI Config @@ -433,18 +430,19 @@ namespace OpenSim.Framework.UserManagement #region Inventory - //map["inventory-skeleton"] = agentInventory; - //map["inventory-skel-lib"] = inventoryLibrary; - //map["inventory-root"] = inventoryRoot; - //map["inventory-lib-root"] = inventoryLibRoot; - //map["inventory-lib-owner"] = inventoryLibraryOwner; + map["inventory-skeleton"] = ArrayListToLLSDArray(agentInventory); + + map["inventory-skel-lib"] = ArrayListToLLSDArray(inventoryLibrary); + map["inventory-root"] = ArrayListToLLSDArray(inventoryRoot); ; + map["inventory-lib-root"] = ArrayListToLLSDArray(inventoryLibRoot); + map["inventory-lib-owner"] = ArrayListToLLSDArray(inventoryLibraryOwner); #endregion Inventory map["gestures"] = new LLSDArray(); // todo - //responseData["initial-outfit"] = initialOutfit; - //responseData["start_location"] = startLocation; + map["initial-outfit"] = ArrayListToLLSDArray(initialOutfit); + map["start_location"] = LLSD.FromString(startLocation); map["seed_capability"] = LLSD.FromString(seedCapability); map["home"] = LLSD.FromString(home); @@ -455,7 +453,7 @@ namespace OpenSim.Framework.UserManagement if (m_buddyList != null) { - //map["buddy-list"] = m_buddyList.ToArray(); + map["buddy-list"] = ArrayListToLLSDArray(m_buddyList.ToArray()); } map["login"] = LLSD.FromString("true"); @@ -470,6 +468,21 @@ namespace OpenSim.Framework.UserManagement } } + public LLSDArray ArrayListToLLSDArray(ArrayList arrlst) + { + LLSDArray llsdBack = new LLSDArray(); + foreach (Hashtable ht in arrlst) + { + LLSDMap mp = new LLSDMap(); + foreach (DictionaryEntry deHt in ht) + { + mp.Add((string)deHt.Key, LLSDString.FromObject(deHt.Value)); + } + llsdBack.Add(mp); + } + return llsdBack; + } + private LLSDArray WrapLLSDMap(LLSDMap wrapMe) { LLSDArray array = new LLSDArray(); -- cgit v1.1