diff options
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1UserServices.cs')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 17b5a06..d486c40 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |||
@@ -85,6 +85,58 @@ namespace OpenSim.Region.Communications.OGS1 | |||
85 | (float) Convert.ToDecimal((string) data["home_look_z"])); | 85 | (float) Convert.ToDecimal((string) data["home_look_z"])); |
86 | 86 | ||
87 | return userData; | 87 | return userData; |
88 | } | ||
89 | |||
90 | /// <summary> | ||
91 | /// Get a user agent from the user server | ||
92 | /// </summary> | ||
93 | /// <param name="avatarID"></param> | ||
94 | /// <returns>null if the request fails</returns> | ||
95 | public UserAgentData GetAgentByUUID(LLUUID userId) | ||
96 | { | ||
97 | try | ||
98 | { | ||
99 | Hashtable param = new Hashtable(); | ||
100 | param["avatar_uuid"] = userId.ToString(); | ||
101 | IList parameters = new ArrayList(); | ||
102 | parameters.Add(param); | ||
103 | XmlRpcRequest req = new XmlRpcRequest("get_agent_by_uuid", parameters); | ||
104 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 6000); | ||
105 | Hashtable respData = (Hashtable) resp.Value; | ||
106 | if (respData.Contains("error_type")) | ||
107 | { | ||
108 | m_log.Warn("[GRID]: " + | ||
109 | "Error sent by user server when trying to get agent: (" + | ||
110 | (string) respData["error_type"] + | ||
111 | "): " + (string)respData["error_desc"]); | ||
112 | return null; | ||
113 | } | ||
114 | LLUUID sessionid = LLUUID.Zero; | ||
115 | |||
116 | UserAgentData userAgent = new UserAgentData(); | ||
117 | userAgent.Handle = Convert.ToUInt64((string)respData["handle"]); | ||
118 | Helpers.TryParse((string)respData["sessionid"], out sessionid); | ||
119 | userAgent.SessionID = sessionid; | ||
120 | |||
121 | if ((string)respData["agent_online"] == "TRUE") | ||
122 | { | ||
123 | userAgent.AgentOnline = true; | ||
124 | } | ||
125 | else | ||
126 | { | ||
127 | userAgent.AgentOnline = false; | ||
128 | } | ||
129 | |||
130 | return userAgent; | ||
131 | } | ||
132 | catch (Exception e) | ||
133 | { | ||
134 | m_log.ErrorFormat( | ||
135 | "[OGS1 USER SERVICES]: Error when trying to fetch agent data by uuid from remote user server: {0}", | ||
136 | e); | ||
137 | } | ||
138 | |||
139 | return null; | ||
88 | } | 140 | } |
89 | 141 | ||
90 | public AvatarAppearance ConvertXMLRPCDataToAvatarAppearance(Hashtable data) | 142 | public AvatarAppearance ConvertXMLRPCDataToAvatarAppearance(Hashtable data) |
@@ -335,6 +387,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
335 | return null; | 387 | return null; |
336 | } | 388 | } |
337 | 389 | ||
390 | |||
338 | public void clearUserAgent(LLUUID avatarID) | 391 | public void clearUserAgent(LLUUID avatarID) |
339 | { | 392 | { |
340 | // TODO: implement | 393 | // TODO: implement |