From a3b10caa07530d4016bd3606a7fe892703e3fdb3 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 16 May 2008 14:48:09 +0000 Subject: starting to put appearance into grid comms. now I know why everyone hates OGS1 --- .../Region/Communications/OGS1/OGS1UserServices.cs | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 63fad4a..d77f190 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -87,6 +87,19 @@ namespace OpenSim.Region.Communications.OGS1 return userData; } + public AvatarAppearance ConvertXMLRPCDataToAvatarAppearance(Hashtable data) + { + if (data.Contains("error_type")) + { + m_log.Warn("[GRID]: " + + "Error sent by user server when trying to get user appearance: (" + + data["error_type"] + + "): " + data["error_desc"]); + return null; + } + return null; + } + public List ConvertXMLRPCDataToAvatarPickerList(LLUUID queryID, Hashtable data) { List pickerlist = new List(); @@ -552,7 +565,27 @@ namespace OpenSim.Region.Communications.OGS1 /// TODO: stubs for now to get us to a compiling state gently public AvatarAppearance GetUserAppearance(LLUUID user) { - return new AvatarAppearance(); + AvatarAppearance appearance = null; + try + { + Hashtable param = new Hashtable(); + param["ownerID"] = user.ToString(); + + IList parameters = new ArrayList(); + parameters.Add(param); + XmlRpcRequest req = new XmlRpcRequest("get_user_appearance", parameters); + XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); + Hashtable respData = (Hashtable) resp.Value; + + return ConvertXMLRPCDataToAvatarAppearance(respData); + } + catch (WebException e) + { + m_log.Warn("[OGS1 USER SERVICES]: Error when trying to fetch Avatar's appearance: " + + e.Message); + // Return Empty list (no friends) + } + return appearance; } public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) -- cgit v1.1