public LSL_Key llRequestInventoryData(string name)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return "";
TaskInventoryDictionary itemDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
foreach (TaskInventoryItem item in itemDictionary.Values)
{
if (item.Type == 3 && item.Name == name)
{
UUID rq = UUID.Random();
DataserverPlugin dataserverPlugin = (DataserverPlugin)m_ScriptEngine.GetScriptPlugin("Dataserver");
UUID tid = dataserverPlugin.RegisterRequest(m_host.UUID,
m_itemID, rq.ToString());
Vector3 region = new Vector3(
World.RegionInfo.RegionLocX,
World.RegionInfo.RegionLocY,
0);
World.AssetService.Get(item.AssetID.ToString(), this,
delegate(string i, object sender, AssetBase a)
{
AssetLandmark lm = new AssetLandmark(a);
float rx = (uint)(lm.RegionHandle >> 32);
float ry = (uint)lm.RegionHandle;
region = lm.Position + new Vector3(rx, ry, 0) - region;
string reply = region.ToString();
dataserverPlugin.AddReply(rq.ToString(),
reply, 1000);
});
ScriptSleep(1000);
return tid.ToString();
}
}
ScriptSleep(1000);
return String.Empty;
}