29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Collections.Specialized;
33 using System.Drawing.Imaging;
34 using System.Reflection;
40 using OpenMetaverse.StructuredData;
41 using OpenMetaverse.Imaging;
42 using OpenSim.Framework;
43 using OpenSim.Framework.Capabilities;
44 using OpenSim.Framework.Servers;
45 using OpenSim.Framework.Servers.HttpServer;
46 using OpenSim.Region.Framework.Interfaces;
47 using OpenSim.Services.Interfaces;
52 namespace OpenSim.Capabilities.Handlers
56 private static readonly ILog m_log =
57 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
61 : base(
"GET", path, name, description)
63 m_UserManagement = umService;
70 NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
71 string[] ids = query.GetValues(
"ids");
74 if (m_UserManagement == null)
76 m_log.Error(
"[GET_DISPLAY_NAMES]: Cannot fetch display names without a user management component");
77 httpResponse.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
84 osdReply[
"agents"] = agents;
85 foreach (
string id in ids)
87 UUID uuid = UUID.Zero;
88 if (
UUID.TryParse(
id, out uuid))
90 string name = m_UserManagement.GetUserName(uuid);
91 if (!
string.IsNullOrEmpty(name))
93 string[] parts = name.Split(
new char[] {
' '});
98 osdname[
"display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8));
99 osdname[
"display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1));
100 osdname[
"display_name"] = OSD.FromString(name);
101 osdname[
"legacy_first_name"] = parts[0];
102 osdname[
"legacy_last_name"] = parts[1];
103 osdname[
"username"] = OSD.FromString(name);
104 osdname[
"id"] = OSD.FromUUID(uuid);
105 osdname[
"is_display_name_default"] = OSD.FromBoolean(
true);
113 httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK;
115 httpResponse.ContentType =
"application/llsd+xml";
117 string reply = OSDParser.SerializeLLSDXmlString(osdReply);
118 return System.Text.Encoding.UTF8.GetBytes(reply);
OpenMetaverse.StructuredData.OSDArray OSDArray
GetDisplayNamesHandler(string path, IUserManagement umService, string name, string description)
Base streamed request handler.
OpenMetaverse.StructuredData.OSDMap OSDMap
OpenSim.Framework.Capabilities.Caps Caps
override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
This maintains the relationship between a UUID and a user name.