Exemplo n.º 1
0
 public void osTriggerSoundLimited(LSL_Integer linknum, LSL_String sound, LSL_Float volume,
                                   vector top_north_east, vector bottom_south_west)
 {
     m_OSSL_Functions.osTriggerSoundLimited(linknum, sound, volume,
                                            top_north_east, bottom_south_west);
 }
Exemplo n.º 2
0
 public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules)
 {
     m_host.AddScriptLPS(1);
     ScriptSleep(1000);
     return SetPrimMediaParams(m_host, face, rules);
 }
Exemplo n.º 3
0
        private LSL_Integer ClearPrimMedia(SceneObjectPart part, LSL_Integer face)
        {
            // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
            // Assuming silently fail means sending back LSL_STATUS_OK.  Ideally, need to check this.
            // FIXME: Don't perform the media check directly
            if (face < 0 || face > part.GetNumberOfSides() - 1)
                return ScriptBaseClass.LSL_STATUS_NOT_FOUND;

            IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
            if (null == module)
                return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;

            module.ClearMediaEntry(part, face);

            return ScriptBaseClass.LSL_STATUS_OK;
        }
Exemplo n.º 4
0
 public LSL_Integer llClearPrimMedia(LSL_Integer face)
 {
     return m_LSL_Functions.llClearPrimMedia(face);
 }
Exemplo n.º 5
0
 public void llScriptProfiler(LSL_Integer flags)
 {
     m_host.AddScriptLPS(1);
     // This does nothing for LSO scripts in SL
 }
Exemplo n.º 6
0
 public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
 {
     m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
 }
Exemplo n.º 7
0
 public void llScriptProfiler(LSL_Integer flags)
 {
     m_LSL_Functions.llScriptProfiler(flags);
 }
Exemplo n.º 8
0
 public LSL_Integer osStringIndexOf(LSL_String src, LSL_String value, LSL_Integer ignorecase)
 {
     return(m_OSSL_Functions.osStringIndexOf(src, value, ignorecase));
 }
Exemplo n.º 9
0
 public LSL_Integer osStringLastIndexOf(LSL_String src, LSL_String value, LSL_Integer offset, LSL_Integer count, LSL_Integer ignorecase)
 {
     return(m_OSSL_Functions.osStringLastIndexOf(src, value, offset, count, ignorecase));
 }
Exemplo n.º 10
0
 public LSL_String osStringSubString(LSL_String src, LSL_Integer offset, LSL_Integer length)
 {
     return(m_OSSL_Functions.osStringSubString(src, offset, length));
 }
Exemplo n.º 11
0
 public LSL_Integer osStringStartsWith(LSL_String src, LSL_String value, LSL_Integer ignorecase)
 {
     return(m_OSSL_Functions.osStringStartsWith(src, value, ignorecase));
 }
Exemplo n.º 12
0
 public LSL_String osDetectedCountry(LSL_Integer number)
 {
     return(m_OSSL_Functions.osDetectedCountry(number));
 }
Exemplo n.º 13
0
 public void osPreloadSound(LSL_Integer linknum, LSL_String sound)
 {
     m_OSSL_Functions.osPreloadSound(linknum, sound);
 }
Exemplo n.º 14
0
 public void osStopSound(LSL_Integer linknum)
 {
     m_OSSL_Functions.osStopSound(linknum);
 }
Exemplo n.º 15
0
 public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
 {
     m_LSL_Functions.llSetLinkCamera(link, eye, at);
 }
Exemplo n.º 16
0
 public LSL_String osStringRemove(LSL_String src, LSL_Integer offset, LSL_Integer count)
 {
     return(m_OSSL_Functions.osStringRemove(src, offset, count));
 }
Exemplo n.º 17
0
        public void llSetContentType(LSL_Key id, LSL_Integer type)
        {
            m_host.AddScriptLPS(1);

            if (m_UrlModule == null)
                return;

            // Make sure the content type is text/plain to start with
            m_UrlModule.HttpContentType(new UUID(id), "text/plain");

            // Is the object owner online and in the region
            ScenePresence agent = World.GetScenePresence(m_host.ParentGroup.OwnerID);
            if (agent == null || agent.IsChildAgent)
                return;  // Fail if the owner is not in the same region

            // Is it the embeded browser?
            string userAgent = m_UrlModule.GetHttpHeader(new UUID(id), "user-agent");
            if (userAgent.IndexOf("SecondLife") < 0)
                return; // Not the embedded browser. Is this check good enough?

            // Use the IP address of the client and check against the request
            // seperate logins from the same IP will allow all of them to get non-text/plain as long
            // as the owner is in the region. Same as SL!
            string logonFromIPAddress = agent.ControllingClient.RemoteEndPoint.Address.ToString();
            string requestFromIPAddress = m_UrlModule.GetHttpHeader(new UUID(id), "remote_addr");
            //m_log.Debug("IP from header='" + requestFromIPAddress + "' IP from endpoint='" + logonFromIPAddress + "'");
            if (requestFromIPAddress == null || requestFromIPAddress.Trim() == "")
                return;
            if (logonFromIPAddress == null || logonFromIPAddress.Trim() == "")
                return;

            // If the request isnt from the same IP address then the request cannot be from the owner
            if (!requestFromIPAddress.Trim().Equals(logonFromIPAddress.Trim()))
                return;

            switch (type)
            {
                case ScriptBaseClass.CONTENT_TYPE_HTML:
                    m_UrlModule.HttpContentType(new UUID(id), "text/html");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_XML:
                    m_UrlModule.HttpContentType(new UUID(id), "application/xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_XHTML:
                    m_UrlModule.HttpContentType(new UUID(id), "application/xhtml+xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_ATOM:
                    m_UrlModule.HttpContentType(new UUID(id), "application/atom+xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_JSON:
                    m_UrlModule.HttpContentType(new UUID(id), "application/json");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_LLSD:
                    m_UrlModule.HttpContentType(new UUID(id), "application/llsd+xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_FORM:
                    m_UrlModule.HttpContentType(new UUID(id), "application/x-www-form-urlencoded");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_RSS:
                    m_UrlModule.HttpContentType(new UUID(id), "application/rss+xml");
                    break;
                default:
                    m_UrlModule.HttpContentType(new UUID(id), "text/plain");
                    break;
            }
        }
Exemplo n.º 18
0
 public void osResetAllScripts(LSL_Integer allLinkSet)
 {
     m_OSSL_Functions.osResetAllScripts(allLinkSet);
 }
Exemplo n.º 19
0
        public void llScriptProfiler( LSL_Integer flags )
        {
            m_host.AddScriptLPS(1);
            NotImplemented("llScriptProfiler");

        }
Exemplo n.º 20
0
 public void osSetLinkSitActiveRange(LSL_Integer linkNumber, LSL_Float v)
 {
     m_OSSL_Functions.osSetLinkSitActiveRange(linkNumber, v);
 }
Exemplo n.º 21
0
 public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
 {
     m_LSL_Functions.llLinkSitTarget(link, offset, rot);
 }
Exemplo n.º 22
0
 public LSL_Float osGetLinkSitActiveRange(LSL_Integer linkNumber)
 {
     return(m_OSSL_Functions.osGetLinkSitActiveRange(linkNumber));
 }
Exemplo n.º 23
0
 public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
 {
     return m_LSL_Functions.llGetAgentList(scope, options);
 }
Exemplo n.º 24
0
 public void osSetLinkStandTarget(LSL_Integer linkNumber, vector v)
 {
     m_OSSL_Functions.osSetLinkStandTarget(linkNumber, v);
 }
Exemplo n.º 25
0
 public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
 {
     m_host.AddScriptLPS(1);
     if (link == ScriptBaseClass.LINK_ROOT)
         SitTarget(m_host.ParentGroup.RootPart, offset, rot);
     else if (link == ScriptBaseClass.LINK_THIS)
         SitTarget(m_host, offset, rot);
     else
     {
         SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
         if (null != part)
         {
             SitTarget(part, offset, rot);
         }
     }
 }
Exemplo n.º 26
0
 public vector osGetLinkStandTarget(LSL_Integer linkNumber)
 {
     return(m_OSSL_Functions.osGetLinkStandTarget(linkNumber));
 }
Exemplo n.º 27
0
 public LSL_Integer llClearPrimMedia(LSL_Integer face)
 {
     m_host.AddScriptLPS(1);
     ScriptSleep(1000);
     return ClearPrimMedia(m_host, face);
 }
Exemplo n.º 28
0
 public LSL_String osGetApparentRegionTimeString(LSL_Integer format24)
 {
     return(m_OSSL_Functions.osGetApparentRegionTimeString(format24));
 }
Exemplo n.º 29
0
        public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints)
        {
            CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments");

            m_host.AddScriptLPS(1);

            UUID targetUUID;
            ScenePresence target;
            LSL_List resp = new LSL_List();

            if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target))
            {
                foreach (object point in attachmentPoints.Data)
                {
                    LSL_Integer ipoint = new LSL_Integer(
                        (point is LSL_Integer || point is int || point is uint) ?
                            (int)point :
                            0
                    );
                    resp.Add(ipoint);
                    if (ipoint == 0)
                    {
                        // indicates zero attachments
                        resp.Add(new LSL_Integer(0));
                    }
                    else
                    {
                        // gets the number of attachments on the attachment point
                        resp.Add(new LSL_Integer(target.GetAttachments((uint)ipoint).Count));
                    }
                }
            }

            return resp;
        }
Exemplo n.º 30
0
 public LSL_Integer osReplaceAgentEnvironment(LSL_Key agentkey, LSL_Integer transition, LSL_String daycycle)
 {
     return(m_OSSL_Functions.osReplaceAgentEnvironment(agentkey, transition, daycycle));
 }
Exemplo n.º 31
0
        public LSL_List modInvokeL(string fname, params object[] parms)
        {
//            m_log.DebugFormat(
//                "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type", 
//                fname, 
//                string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())), 
//                ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);

            Type returntype = m_comms.LookupReturnType(fname);
            if (returntype != typeof(object[]))
                MODError(String.Format("return type mismatch for {0}",fname));

            object[] result = (object[])modInvoke(fname,parms);
            object[] llist = new object[result.Length];
            for (int i = 0; i < result.Length; i++)
            {
                if (result[i] is string)
                {
                    llist[i] = new LSL_String((string)result[i]);
                }
                else if (result[i] is int)
                {
                    llist[i] = new LSL_Integer((int)result[i]);
                }
                else if (result[i] is float)
                {
                    llist[i] = new LSL_Float((float)result[i]);
                }
                else if (result[i] is double)
                {
                    llist[i] = new LSL_Float((double)result[i]);
                }
                else if (result[i] is UUID)
                {
                    llist[i] = new LSL_Key(result[i].ToString());
                }
                else if (result[i] is OpenMetaverse.Vector3)
                {
                    OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
                    llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
                }
                else if (result[i] is OpenMetaverse.Quaternion)
                {
                    OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
                    llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
                }
                else
                {
                    MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
                }
            }

            return new LSL_List(llist);
        }
Exemplo n.º 32
0
 public LSL_Integer osReplaceParcelEnvironment(LSL_Integer transition, LSL_String daycycle)
 {
     return(m_OSSL_Functions.osReplaceParcelEnvironment(transition, daycycle));
 }
Exemplo n.º 33
0
        public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
        {
            m_host.AddScriptLPS(1);
            ScriptSleep(m_sleepMsOnSetLinkMedia);
            if (link == ScriptBaseClass.LINK_ROOT)
                return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
            else if (link == ScriptBaseClass.LINK_THIS)
                return SetPrimMediaParams(m_host, face, rules);
            else
            {
                SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
                if (null != part)
                    return SetPrimMediaParams(part, face, rules);
            }

            return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
        }
Exemplo n.º 34
0
 public LSL_Integer osReplaceRegionEnvironment(LSL_Integer transition, LSL_String daycycle,
                                               LSL_Float daylen, LSL_Float dayoffset, LSL_Float altitude1, LSL_Float altitude2, LSL_Float altitude3)
 {
     return(m_OSSL_Functions.osReplaceRegionEnvironment(transition, daycycle, daylen,
                                                        dayoffset, altitude1, altitude2, altitude3));
 }
Exemplo n.º 35
0
        public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
        {
            m_host.AddScriptLPS(1);

            if (link == ScriptBaseClass.LINK_SET ||
                link == ScriptBaseClass.LINK_ALL_CHILDREN ||
                link == ScriptBaseClass.LINK_ALL_OTHERS) return;

            SceneObjectPart part = null;

            switch (link)
            {
                case ScriptBaseClass.LINK_ROOT:
                    part = m_host.ParentGroup.RootPart;
                    break;
                case ScriptBaseClass.LINK_THIS:
                    part = m_host;
                    break;
                default:
                    part = m_host.ParentGroup.GetLinkNumPart(link);
                    break;
            }

            if (null != part)
            {
                part.SetCameraEyeOffset(eye);
                part.SetCameraAtOffset(at);
            }
        }
Exemplo n.º 36
0
 public LSL_Integer osResetEnvironment(LSL_Integer parcelOrRegion, LSL_Integer transition)
 {
     return(m_OSSL_Functions.osResetEnvironment(parcelOrRegion, transition));
 }
Exemplo n.º 37
0
        public void  llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg )
        {
            m_host.AddScriptLPS(1);
            NotImplemented("llRegionSayTo");

        }
Exemplo n.º 38
0
        // Teleport Functions

        public void osLocalTeleportAgent(LSL_Key agent, vector position, vector velocity, vector lookat, LSL_Integer flags)
        {
            m_OSSL_Functions.osLocalTeleportAgent(agent, position, velocity, lookat, flags);
        }
Exemplo n.º 39
0
        public LSL_Integer llClearPrimMedia(LSL_Integer face)
        {
            m_host.AddScriptLPS(1);
            ScriptSleep(1000);

            // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
            // Assuming silently fail means sending back LSL_STATUS_OK.  Ideally, need to check this.
            // FIXME: Don't perform the media check directly
            if (face < 0 || face > m_host.GetNumberOfSides() - 1)
                return ScriptBaseClass.LSL_STATUS_OK;

            IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
            if (null == module)
                throw new Exception("Media on a prim functions not available");

            module.ClearMediaEntry(m_host, face);

            return ScriptBaseClass.LSL_STATUS_OK;
        }
Exemplo n.º 40
0
 public key osNpcSaveAppearance(key npc, LSL_String notecard, LSL_Integer includeHuds)
 {
     return(m_OSSL_Functions.osNpcSaveAppearance(npc, notecard, includeHuds));
 }
Exemplo n.º 41
0
 public LSL_Integer llSetMemoryLimit(LSL_Integer limit)
 {
     return m_LSL_Functions.llSetMemoryLimit(limit);
 }
Exemplo n.º 42
0
 public LSL_Key osOwnerSaveAppearance(LSL_String notecard, LSL_Integer includeHuds)
 {
     return(m_OSSL_Functions.osOwnerSaveAppearance(notecard, includeHuds));
 }
Exemplo n.º 43
0
 public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
 {
     return m_LSL_Functions.llSetLinkMedia(link, face, rules);
 }
Exemplo n.º 44
0
 public LSL_Key osAgentSaveAppearance(LSL_Key agentId, LSL_String notecard, LSL_Integer includeHuds)
 {
     return(m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard, includeHuds));
 }
Exemplo n.º 45
0
 public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face)
 {
     return m_LSL_Functions.llClearLinkMedia(link, face);
 }
Exemplo n.º 46
0
 public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
 {
     m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
 }
Exemplo n.º 47
0
 public LSL_Integer llSetMemoryLimit(LSL_Integer limit)
 {
     m_host.AddScriptLPS(1);
     // Treat as an LSO script
     return ScriptBaseClass.FALSE;
 }
Exemplo n.º 48
0
 public void osSetProjectionParams(LSL_Key prim, LSL_Integer projection, LSL_Key texture, double fov, double focus, double amb)
 {
     m_OSSL_Functions.osSetProjectionParams(prim, projection, texture, fov, focus, amb);
 }
Exemplo n.º 49
0
        /// <summary>
        /// http://wiki.secondlife.com/wiki/LlGetAgentList
        /// The list of options is currently not used in SL
        /// scope is one of:-
        /// AGENT_LIST_REGION - all in the region
        /// AGENT_LIST_PARCEL - all in the same parcel as the scripted object
        /// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the
        /// current parcel.
        /// </summary>
        public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
        {
            m_host.AddScriptLPS(1);

            // the constants are 1, 2 and 4 so bits are being set, but you
            // get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4
            bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION;
            bool parcelOwned = scope == ScriptBaseClass.AGENT_LIST_PARCEL_OWNER;
            bool parcel = scope == ScriptBaseClass.AGENT_LIST_PARCEL;

            LSL_List result = new LSL_List();

            if (!regionWide && !parcelOwned && !parcel)
            {
                result.Add("INVALID_SCOPE");
                return result;
            }

            ILandObject land;
            Vector3 pos;
            UUID id = UUID.Zero;
            if (parcel || parcelOwned)
            {
                pos = m_host.ParentGroup.RootPart.GetWorldPosition();
                land = World.LandChannel.GetLandObject(pos.X, pos.Y);
                if (land == null)
                {
                    id = UUID.Zero;
                }
                else
                {
                    if (parcelOwned)
                    {
                        id = land.LandData.OwnerID;
                    }
                    else
                    {
                        id = land.LandData.GlobalID;
                    }
                }
            }
            List<UUID> presenceIds = new List<UUID>();

            World.ForEachRootScenePresence(
                delegate (ScenePresence ssp)
                {
                    // Gods are not listed in SL
                    if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent)
                    {
                        if (!regionWide)
                        {
                            pos = ssp.AbsolutePosition;
                            land = World.LandChannel.GetLandObject(pos.X, pos.Y);
                            if (land != null)
                            {
                                if (parcelOwned && land.LandData.OwnerID == id ||
                                    parcel && land.LandData.GlobalID == id)
                                {
                                    result.Add(ssp.UUID.ToString());
                                }
                            }
                        }
                        else
                        {
                            result.Add(ssp.UUID.ToString());
                        }
                    }
                    // Maximum of 100 results
                    if (result.Length > 99)
                    {
                        return;
                    }
                }
            );
            return result;
        }
Exemplo n.º 50
0
 public void osSetProjectionParams(LSL_Integer linknumber, LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb)
 {
     m_OSSL_Functions.osSetProjectionParams(linknumber, projection, texture, fov, focus, amb);
 }
Exemplo n.º 51
0
        public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
        {
            m_host.AddScriptLPS(1);
            ScriptSleep(1000);
            if (link == ScriptBaseClass.LINK_ROOT)
                return GetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
            else if (link == ScriptBaseClass.LINK_THIS)
                return GetPrimMediaParams(m_host, face, rules);
            else
            {
                SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
                if (null != part)
                    return GetPrimMediaParams(part, face, rules);
            }

            return new LSL_List();
        }
Exemplo n.º 52
0
 public LSL_String osUnixTimeToTimestamp(LSL_Integer time)
 {
     return(m_OSSL_Functions.osUnixTimeToTimestamp(time));
 }
Exemplo n.º 53
0
        private LSL_Integer SetPrimMediaParams(SceneObjectPart part, LSL_Integer face, LSL_List rules)
        {
            // LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid
            // Assuming silently fail means sending back LSL_STATUS_OK.  Ideally, need to check this.
            // Don't perform the media check directly
            if (face < 0 || face > part.GetNumberOfSides() - 1)
                return ScriptBaseClass.LSL_STATUS_NOT_FOUND;

            IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
            if (null == module)
                return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;

            MediaEntry me = module.GetMediaEntry(part, face);
            if (null == me)
                me = new MediaEntry();

            int i = 0;

            while (i < rules.Length - 1)
            {
                int code = rules.GetLSLIntegerItem(i++);

                switch (code)
                {
                    case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE:
                        me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_CONTROLS:
                        int v = rules.GetLSLIntegerItem(i++);
                        if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v)
                            me.Controls = MediaControls.Standard;
                        else
                            me.Controls = MediaControls.Mini;
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL:
                        me.CurrentURL = rules.GetLSLStringItem(i++);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_HOME_URL:
                        me.HomeURL = rules.GetLSLStringItem(i++);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP:
                        me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY:
                        me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE:
                        me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM:
                        me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT:
                        me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS:
                        me.Width = (int)rules.GetLSLIntegerItem(i++);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS:
                        me.Height = (int)rules.GetLSLIntegerItem(i++);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE:
                        me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_WHITELIST:
                        string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' });
                        List<string> whiteListUrls = new List<string>();
                        Array.ForEach(
                            rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); });
                        me.WhiteList = whiteListUrls.ToArray();
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT:
                        me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
                        break;

                    case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
                        me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
                        break;

                    default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
                }
            }

            module.SetMediaEntry(part, face, me);

            return ScriptBaseClass.LSL_STATUS_OK;
        }
Exemplo n.º 54
0
 public LSL_Integer osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags)
 {
     return(m_OSSL_Functions.osTeleportObject(objectUUID, targetPos, targetrotation, flags));
 }
Exemplo n.º 55
0
        public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face)
        {
            m_host.AddScriptLPS(1);
            ScriptSleep(1000);
            if (link == ScriptBaseClass.LINK_ROOT)
                return ClearPrimMedia(m_host.ParentGroup.RootPart, face);
            else if (link == ScriptBaseClass.LINK_THIS)
                return ClearPrimMedia(m_host, face);
            else
            {
                SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
                if (null != part)
                    return ClearPrimMedia(part, face);
            }

            return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
        }
Exemplo n.º 56
0
 public LSL_Float osRound(LSL_Float value, LSL_Integer digits)
 {
     return(m_OSSL_Functions.osRound(value, digits));
 }
Exemplo n.º 57
0
        public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
        {
            CheckThreatLevel(ThreatLevel.High, "osNpcTouch");
            m_host.AddScriptLPS(1);
            
            INPCModule module = World.RequestModuleInterface<INPCModule>();
            int linkNum = link_num.value;
            if (module != null || (linkNum < 0 && linkNum != ScriptBaseClass.LINK_THIS))
            {
                UUID npcId;
                if (!UUID.TryParse(npcLSL_Key, out npcId) || !module.CheckPermissions(npcId, m_host.OwnerID))
                    return;

                SceneObjectPart part = null;
                UUID objectId;
                if (UUID.TryParse(LSL_String.ToString(object_key), out objectId))
                    part = World.GetSceneObjectPart(objectId);

                if (part == null)
                    return;

                if (linkNum != ScriptBaseClass.LINK_THIS)
                {
                    if (linkNum == 0 || linkNum == ScriptBaseClass.LINK_ROOT)
                    { // 0 and 1 are treated as root, find the root if the current part isnt it
                        if (!part.IsRoot)
                            part = part.ParentGroup.RootPart;
                    }
                    else
                    { // Find the prim with the given link number if not found then fail silently
                        part = part.ParentGroup.GetLinkNumPart(linkNum);
                        if (part == null)
                            return;
                    }
                }

                module.Touch(npcId, part.UUID);
            }
        }
Exemplo n.º 58
0
 public void llSetContentType(LSL_Key id, LSL_Integer type)
 {
     m_LSL_Functions.llSetContentType(id, type);
 }
Exemplo n.º 59
0
        public LSL_List modInvokeL(string fname, params object[] parms)
        {
            Type returntype = m_comms.LookupReturnType(fname);
            if (returntype != typeof(object[]))
                MODError(String.Format("return type mismatch for {0}",fname));

            object[] result = (object[])modInvoke(fname,parms);
            object[] llist = new object[result.Length];
            for (int i = 0; i < result.Length; i++)
            {
                if (result[i] is string)
                {
                    llist[i] = new LSL_String((string)result[i]);
                }
                else if (result[i] is int)
                {
                    llist[i] = new LSL_Integer((int)result[i]);
                }
                else if (result[i] is float)
                {
                    llist[i] = new LSL_Float((float)result[i]);
                }
                else if (result[i] is UUID)
                {
                    llist[i] = new LSL_Key(result[i].ToString());
                }
                else if (result[i] is OpenMetaverse.Vector3)
                {
                    OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
                    llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
                }
                else if (result[i] is OpenMetaverse.Quaternion)
                {
                    OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
                    llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
                }
                else
                {
                    MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
                }
            }

            return new LSL_List(llist);
        }
Exemplo n.º 60
0
 public void osTriggerSound(LSL_Integer linknum, LSL_String sound, LSL_Float volume)
 {
     m_OSSL_Functions.osTriggerSound(linknum, sound, volume);
 }