Esempio n. 1
0
        /// <summary>
        ///     Fires the events after the compiling has occured
        /// </summary>
        public void FireEvents()
        {
            if (RezzedFrom != UUID.Zero)
            {
                //Post the event for the prim that rezzed us
                m_ScriptEngine.AddToObjectQueue(RezzedFrom, "object_rez", new DetectParams[0],
                                                new object[]
                                                { (LSL_Types.LSLString)Part.ParentEntity.RootChild.UUID.ToString() });
                RezzedFrom = UUID.Zero;
            }
            if (StartedFromSavedState)
            {
                if (PostOnRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "on_rez", new DetectParams[0], EventPriority.FirstStart,
                                                    new object[] { new LSL_Types.LSLInteger(StartParam) });
                }

                if (stateSource == StateSource.AttachedRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "attach", new DetectParams[0], EventPriority.FirstStart,
                                                    new object[]
                                                    { new LSL_Types.LSLString(Part.AttachedAvatar.ToString()) });
                }
                else if (stateSource == StateSource.RegionStart)
                {
                    // CHANGED_REGION_START
                    m_ScriptEngine.AddToScriptQueue(this, "changed", new DetectParams[0], EventPriority.FirstStart,
                                                    new Object[]
                                                    { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) });
                }
                else if (stateSource == StateSource.PrimCrossing)
                {
                    // CHANGED_REGION
                    // note: CHANGED_TELEPORT should occur on any teleport of an attachment within a region too and is taken care of elsewhere
                    m_ScriptEngine.AddToScriptQueue(this, "changed", new DetectParams[0], EventPriority.FirstStart,
                                                    new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) });
                }
                // note: StateSource.NewRez doesn't do anything (PostOnRez controls on_rez)
            }
            else
            {
                m_ScriptEngine.AddToScriptQueue(this, "state_entry", new DetectParams[0], EventPriority.FirstStart,
                                                new object[0]);

                if (PostOnRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "on_rez", new DetectParams[0], EventPriority.FirstStart,
                                                    new object[] { new LSL_Types.LSLInteger(StartParam) });
                }

                if (stateSource == StateSource.AttachedRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "attach", new DetectParams[0], EventPriority.FirstStart,
                                                    new object[]
                                                    { new LSL_Types.LSLString(Part.AttachedAvatar.ToString()) });
                }
            }
        }
Esempio n. 2
0
        public bool Check()
        {
            bool needToContinue = false;
            foreach (IHttpRequestModule iHttpReq in m_modules)
            {
                IServiceRequest httpInfo = null;

                if (iHttpReq != null)
                {
                    httpInfo = iHttpReq.GetNextCompletedRequest();
                    if (!needToContinue)
                        needToContinue = iHttpReq.GetRequestCount() > 0;
                }

                if (httpInfo == null)
                    continue;

                while (httpInfo != null)
                {
                    IHttpRequestClass info = (IHttpRequestClass) httpInfo;
                    //MainConsole.Instance.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status);

                    // Deliver data to prim's remote_data handler

                    iHttpReq.RemoveCompletedRequest(info);

                    object[] resobj = new object[]
                                          {
                                              new LSL_Types.LSLString(info.ReqID.ToString()),
                                              new LSL_Types.LSLInteger(info.Status),
                                              new LSL_Types.list(info.Metadata),
                                              new LSL_Types.LSLString(info.ResponseBody)
                                          };

                    m_ScriptEngine.AddToObjectQueue(info.PrimID, "http_response", new DetectParams[0], resobj);
                    if (info.Status == (int)499 && //Too many for this prim
                        info.VerbroseThrottle)
                    {
                        ISceneChildEntity part = m_ScriptEngine.Scene.GetSceneObjectPart(info.PrimID);
                        if (part != null)
                        {
                            IChatModule chatModule = m_ScriptEngine.Scene.RequestModuleInterface<IChatModule>();
                            if (chatModule != null)
                                chatModule.SimChat(
                                    part.Name + "(" + part.AbsolutePosition +
                                    ") http_response error: Too many outgoing requests.", ChatTypeEnum.DebugChannel,
                                    2147483647, part.AbsolutePosition, part.Name, part.UUID, false, m_ScriptEngine.Scene);
                        }
                    }
                    httpInfo = iHttpReq.GetNextCompletedRequest();
                }
            }
            return needToContinue;
        }
Esempio n. 3
0
        /// <summary>
        /// Fires the events after the compiling has occured
        /// </summary>
        public void FireEvents()
        {
            if (RezzedFrom != UUID.Zero)
            {
                //Post the event for the prim that rezzed us
                m_ScriptEngine.AddToObjectQueue(RezzedFrom, "object_rez", new DetectParams[0],
                                                -1, new object[] { (LSL_Types.LSLString)Part.ParentEntity.RootChild.UUID.ToString() });
                RezzedFrom = UUID.Zero;
            }
            if (StartedFromSavedState)
            {
                if (PostOnRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "on_rez", new DetectParams[0], VersionID, new object[] { new LSL_Types.LSLInteger(StartParam) });
                }

                if (stateSource == StateSource.AttachedRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "attach", new DetectParams[0], VersionID, new object[] { new LSL_Types.LSLString(Part.AttachedAvatar.ToString()) });
                }
                else if (stateSource == StateSource.NewRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "changed", new DetectParams[0], VersionID, new Object[] { new LSL_Types.LSLInteger(256) });
                }
                else if (stateSource == StateSource.PrimCrossing)
                {
                    // CHANGED_REGION
                    m_ScriptEngine.AddToScriptQueue(this, "changed", new DetectParams[0], VersionID, new Object[] { new LSL_Types.LSLInteger(512) });
                }
            }
            else
            {
                m_ScriptEngine.AddToScriptQueue(this, "state_entry", new DetectParams[0], VersionID, new object[0]);

                if (PostOnRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "on_rez", new DetectParams[0], VersionID, new object[] { new LSL_Types.LSLInteger(StartParam) });
                }

                if (stateSource == StateSource.AttachedRez)
                {
                    m_ScriptEngine.AddToScriptQueue(this, "attach", new DetectParams[0], VersionID, new object[] { new LSL_Types.LSLString(Part.AttachedAvatar.ToString()) });
                }
            }
        }
Esempio n. 4
0
        public bool Check()
        {
            bool needToContinue = false;

            foreach (IHttpRequestModule iHttpReq in m_modules)
            {
                IServiceRequest httpInfo = null;

                if (iHttpReq != null)
                {
                    httpInfo = iHttpReq.GetNextCompletedRequest();
                    if (!needToContinue)
                    {
                        needToContinue = iHttpReq.GetRequestCount() > 0;
                    }
                }

                if (httpInfo == null)
                {
                    continue;
                }

                while (httpInfo != null)
                {
                    IHttpRequestClass info = (IHttpRequestClass)httpInfo;
                    //MainConsole.Instance.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status);

                    // Deliver data to prim's remote_data handler

                    iHttpReq.RemoveCompletedRequest(info);

                    object[] resobj = new object[]
                    {
                        new LSL_Types.LSLString(info.ReqID.ToString()),
                        new LSL_Types.LSLInteger(info.Status),
                        new LSL_Types.list(info.Metadata),
                        new LSL_Types.LSLString(info.ResponseBody)
                    };

                    m_ScriptEngine.AddToObjectQueue(info.PrimID, "http_response", new DetectParams[0], resobj);
                    httpInfo = iHttpReq.GetNextCompletedRequest();
                }
            }
            return(needToContinue);
        }
Esempio n. 5
0
        public void Check()
        {
            foreach (IHttpRequestModule iHttpReq in m_modules)
            {
                IServiceRequest httpInfo = null;

                if (iHttpReq != null)
                {
                    httpInfo = iHttpReq.GetNextCompletedRequest();
                }

                if (httpInfo == null)
                {
                    return;
                }

                while (httpInfo != null)
                {
                    HttpRequestClass info = (HttpRequestClass)httpInfo;
                    //m_log.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status);

                    // Deliver data to prim's remote_data handler

                    iHttpReq.RemoveCompletedRequest(info);

                    object[] resobj = new object[]
                    {
                        new LSL_Types.LSLString(info.ReqID.ToString()),
                        new LSL_Types.LSLInteger(info.Status),
                        new LSL_Types.list(info.Metadata),
                        new LSL_Types.LSLString(info.ResponseBody)
                    };

                    m_ScriptEngine.AddToObjectQueue(info.PrimID, "http_response", new DetectParams[0], -1, resobj);
                    httpInfo = iHttpReq.GetNextCompletedRequest();
                }
            }
        }