public LSL_String llGetOwnerKey(string id)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return "";
UUID key = new UUID();
if (UUID.TryParse(id, out key))
{
try
{
ISceneChildEntity obj = World.GetSceneObjectPart(key);
if (obj == null)
return id; // the key is for an agent so just return the key
return obj.OwnerID.ToString();
}
catch (KeyNotFoundException)
{
return id; // The Object/Agent not in the region so just return the key
}
}
return UUID.Zero.ToString();
}