From 6941058824e418bcdc2932c35f226bbcc5cea2ad Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 1 Jan 2012 14:57:13 -0500 Subject: Profile Updates Update basic profile to use the replaceable interface, making configuration less error-prone. Add support to query avatar's home user account and profile service for regions usng the updated OpenProfileModule with Hypergrid. --- .../Handlers/Hypergrid/UserAgentServerConnector.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 07c6962..1bd3706 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs @@ -91,6 +91,7 @@ namespace OpenSim.Server.Handlers.Hypergrid server.AddXmlRPCHandler("status_notification", StatusNotification, false); server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false); + server.AddXmlRPCHandler("get_user_info", GetUserInfo, false); server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false); server.AddXmlRPCHandler("locate_user", LocateUser, false); @@ -299,6 +300,38 @@ namespace OpenSim.Server.Handlers.Hypergrid } + public XmlRpcResponse GetUserInfo(XmlRpcRequest request, IPEndPoint remoteClient) + { + Hashtable hash = new Hashtable(); + Hashtable requestData = (Hashtable)request.Params[0]; + + // This needs checking! + if (requestData.ContainsKey("userID")) + { + string userID_str = (string)requestData["userID"]; + UUID userID = UUID.Zero; + UUID.TryParse(userID_str, out userID); + + //int userFlags = m_HomeUsersService.GetUserFlags(userID); + Dictionary userInfo = m_HomeUsersService.GetUserInfo(userID); + if (userInfo.Count > 0) + { + foreach (KeyValuePair kvp in userInfo) + { + hash[kvp.Key] = kvp.Value; + } + } + else + { + hash["result"] = "failure"; + } + } + + XmlRpcResponse response = new XmlRpcResponse(); + response.Value = hash; + return response; + } + public XmlRpcResponse GetServerURLs(XmlRpcRequest request, IPEndPoint remoteClient) { Hashtable hash = new Hashtable(); -- cgit v1.1