From d20cae2d03f26f92e88f28ec187de50934144fcb Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 1 Jun 2008 10:05:22 +0000 Subject: * Committing more unfinished stuff. Nothing significant at the moment. IM related. --- OpenSim/Grid/UserServer/UserManager.cs | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 1b47289..3e8f3a2 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -420,6 +420,54 @@ namespace OpenSim.Grid.UserServer return ProfileToXmlRPCResponse(userProfile); } + public XmlRpcResponse XmlRPCGetAgentMethodUUID(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + UserProfileData userProfile; + //CFK: this clogs the UserServer log and is not necessary at this time. + //CFK: Console.WriteLine("METHOD BY UUID CALLED"); + if (requestData.Contains("avatar_uuid")) + { + LLUUID guess = LLUUID.Zero; + + Helpers.TryParse((string)requestData["avatar_uuid"],out guess); + + if (guess == LLUUID.Zero) + { + return CreateUnknownUserErrorResponse(); + } + + userProfile = GetUserProfile(guess); + + if (userProfile == null) + { + return CreateUnknownUserErrorResponse(); + } + + // no agent??? + if (userProfile.CurrentAgent == null) + { + return CreateUnknownUserErrorResponse(); + } + Hashtable responseData = new Hashtable(); + + responseData["handle"]=userProfile.CurrentAgent.Handle.ToString(); + responseData["session"]=userProfile.CurrentAgent.SessionID.ToString(); + if (userProfile.CurrentAgent.AgentOnline) + responseData["agent_online"]="TRUE"; + else + responseData["agent_online"]="FALSE"; + + response.Value = responseData; + } + else + { + return CreateUnknownUserErrorResponse(); + } + + return ProfileToXmlRPCResponse(userProfile); + } public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserProfile(XmlRpcRequest request) -- cgit v1.1