OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llGetOwnerKey C# (CSharp) Method

llGetOwnerKey() public method

public llGetOwnerKey ( string id ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
id string
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
        public LSL_String llGetOwnerKey(string id)
        {
            m_host.AddScriptLPS(1);
            UUID key = new UUID();
            if (UUID.TryParse(id, out key))
            {
                try
                {
                    SceneObjectPart obj = World.GetSceneObjectPart(key);
                    if (obj == null)
                        return id; // the key is for an agent so just return the key
                    else
                        return obj.OwnerID.ToString();
                }
                catch (KeyNotFoundException)
                {
                    return id; // The Object/Agent not in the region so just return the key
                }
            }
            else
            {
                return UUID.Zero.ToString();
            }
        }
LSL_Api