public LSL_Key llRequestDisplayName(LSL_Key uuid)
{
UUID userID = UUID.Zero;
if (!UUID.TryParse(uuid, out userID))
{
// => complain loudly, as specified by the LSL docs
ShoutError("Failed to parse uuid for avatar.");
return UUID.Zero.ToString();
}
DataserverPlugin dataserverPlugin = (DataserverPlugin)m_ScriptEngine.GetScriptPlugin("Dataserver");
UUID tid = dataserverPlugin.RegisterRequest(m_host.UUID, m_itemID, uuid.ToString());
Util.FireAndForget(delegate
{
string name = "";
IProfileConnector connector = DataManager.DataManager.RequestPlugin<IProfileConnector>();
if (connector != null)
{
IUserProfileInfo info = connector.GetUserProfile(userID);
if (info != null)
name = info.DisplayName;
}
dataserverPlugin.AddReply(uuid.ToString(),
name, 100);
});
ScriptSleep(100);
return tid.ToString();
}