示例#1
0
        public bool Check()
        {
            bool didAnything = false;

            foreach (IWorldComm comms in m_modules)
            {
                if (comms.HasMessages())
                {
                    while (comms.HasMessages())
                    {
                        ListenerInfo lInfo = (ListenerInfo)comms.GetNextMessage();

                        //Deliver data to prim's listen handler
                        object[] resobj = new object[]
                        {
                            new LSL_Types.LSLInteger(lInfo.GetChannel()),
                            new LSL_Types.LSLString(lInfo.GetName()),
                            new LSL_Types.LSLString(lInfo.GetID().ToString()),
                            new LSL_Types.LSLString(lInfo.GetMessage())
                        };

                        m_ScriptEngine.PostScriptEvent(
                            lInfo.GetItemID(), lInfo.GetHostID(), new EventParams(
                                "listen", resobj,
                                new DetectParams[0]), EventPriority.Suspended);
                    }
                    didAnything = true;
                }
            }
            return(didAnything);
        }
示例#2
0
        public void Check()
        {
            foreach (IWorldComm comms in m_modules)
            {
                if (comms.HasMessages())
                {
                    while (comms.HasMessages())
                    {
                        ListenerInfo lInfo = (ListenerInfo)comms.GetNextMessage();

                        //Deliver data to prim's listen handler
                        object[] resobj = new object[]
                        {
                            new LSL_Types.LSLInteger(lInfo.GetChannel()),
                            new LSL_Types.LSLString(lInfo.GetName()),
                            new LSL_Types.LSLString(lInfo.GetID().ToString()),
                            new LSL_Types.LSLString(lInfo.GetMessage())
                        };

                        m_ScriptEngine.PostScriptEvent(
                            lInfo.GetItemID(), lInfo.GetHostID(), new EventParams(
                                "listen", resobj,
                                new DetectParams[0]));
                    }
                }
            }
        }