From a5fb0110410a849387addf0bb99a065b07397c6e Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 16 May 2008 18:23:13 +0000 Subject: in theory implement the backend of appearance for grid. testers encouraged so I can track down issues. --- OpenSim/Grid/UserServer/Main.cs | 2 ++ OpenSim/Grid/UserServer/UserManager.cs | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index f8aa0f1..810c24e 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -127,6 +127,8 @@ namespace OpenSim.Grid.UserServer m_httpServer.AddXmlRPCHandler("remove_user_friend", m_userManager.XmlRpcResponseXmlRPCRemoveUserFriend); m_httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); m_httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); + m_httpServer.AddXmlRPCHandler("get_avatar_appearance", m_userManager.XmlRPCGetAvatarAppearance); + m_httpServer.AddXmlRPCHandler("update_avatar_appearance", m_userManager.XmlRPCUpdateAvatarAppearance); m_httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID); // Message Server ---> User Server diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 8372d6a..63e77cf 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -247,6 +247,50 @@ namespace OpenSim.Grid.UserServer return FriendListItemListtoXmlRPCResponse(returndata); } + public XmlRpcResponse XmlRPCGetAvatarAppearance(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + AvatarAppearance appearance = null; + Hashtable responseData = null; + if (requestData.Contains("owner")) + { + appearance = GetUserAppearance(new LLUUID((string)requestData["owner"])); + responseData = appearance.ToHashTable(); + } + else + { + responseData = new Hashtable(); + responseData["error_type"] = "unknown_avatar"; + responseData["error_desc"] = "The avatar appearance requested is not in the database"; + } + + response.Value = responseData; + return response; + } + + public XmlRpcResponse XmlRPCUpdateAvatarAppearance(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable responseData = null; + if (requestData.Contains("owner")) + { + AvatarAppearance appearance = new AvatarAppearance(requestData); + UpdateUserAppearance(new LLUUID((string)requestData["owner"]), appearance); + responseData = new Hashtable(); + responseData["returnString"] = "TRUE"; + } + else + { + responseData = new Hashtable(); + responseData["error_type"] = "unknown_avatar"; + responseData["error_desc"] = "The avatar appearance requested is not in the database"; + } + response.Value = responseData; + return response; + } + public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) { XmlRpcResponse response = new XmlRpcResponse(); -- cgit v1.1