예제 #1
0
        internal VM.PostedEvent ToPostedEvent()
        {
            VM.PostedEvent evt = new VM.PostedEvent();
            evt.EventType = this.EventType;

            evt.Args = SerializedLSLPrimitive.ToPrimitiveList(this.Args);

            evt.DetectVars = this.DetectVars;

            evt.TransitionToState = this.TransitionToState;

            return(evt);
        }
        internal VM.PostedEvent ToPostedEvent()
        {
            VM.PostedEvent evt = new VM.PostedEvent();
            evt.EventType = this.EventType;

            evt.Args = SerializedLSLPrimitive.ToPrimitiveList(this.Args);

            evt.DetectVars = this.DetectVars;

            evt.TransitionToState = this.TransitionToState;

            return evt;
        }
예제 #3
0
        /// <summary>
        /// Creates a new serialized event from a posted event
        /// </summary>
        /// <param name="evt"></param>
        /// <returns></returns>
        public static SerializedPostedEvent FromPostedEvent(VM.PostedEvent evt)
        {
            if (evt == null)
            {
                return(null);
            }

            SerializedPostedEvent serEvent = new SerializedPostedEvent();

            serEvent.EventType = evt.EventType;

            serEvent.Args = SerializedLSLPrimitive.FromPrimitiveList(evt.Args);

            serEvent.DetectVars = evt.DetectVars;

            serEvent.TransitionToState = evt.TransitionToState;

            return(serEvent);
        }
예제 #4
0
        public bool PostScriptEvent(OpenMetaverse.UUID itemID, OpenSim.Region.ScriptEngine.Shared.EventParams parms)
        {
            FunctionSig eventInfo = _eventList.GetEventByName(parms.EventName);

            VM.DetectVariables[] detectVars = this.DetectParamsArrayToDetectVariablesArray(parms.DetectParams);

            VM.PostedEvent evt =
                new VM.PostedEvent {
                EventType  = (SupportedEventList.Events)eventInfo.TableIndex,
                Args       = parms.Params,
                DetectVars = detectVars
            };

            evt.Normalize();

            _exeScheduler.PostEvent(itemID, evt);

            return(true);
        }
        /// <summary>
        /// Add a new deferred event
        /// </summary>
        /// <param name="itemId"></param>
        /// <param name="eventInfo"></param>
        public void AddEvent(UUID itemId, VM.PostedEvent eventInfo)
        {
            DeferredEventList eventList;

            if (_eventsByScript.TryGetValue(itemId, out eventList))
            {
                if (eventList.EvtList.Count < MAX_DEFERRED_EVENTS)
                {
                    eventList.EvtList.Add(eventInfo);
                }
            }
            else
            {
                eventList = new DeferredEventList(itemId);
                eventList.EvtList.Add(eventInfo);
                _eventsByScript.Add(itemId, eventList);

                C5.IPriorityQueueHandle <DeferredEventList> handle = null;
                _sortedEvents.Add(ref handle, eventList);
                eventList.Handle = handle;
            }
        }
예제 #6
0
        public bool PostScriptEvent(OpenMetaverse.UUID itemID, OpenSim.Region.ScriptEngine.Shared.EventParams parms)
        {
            FunctionSig eventInfo = _eventList.GetEventByName(parms.EventName);
            VM.DetectVariables[] detectVars = this.DetectParamsArrayToDetectVariablesArray(parms.DetectParams);

            VM.PostedEvent evt = 
                new VM.PostedEvent { 
                    EventType = (SupportedEventList.Events) eventInfo.TableIndex, 
                    Args = parms.Params,
                    DetectVars = detectVars
                };

            evt.Normalize();

            _exeScheduler.PostEvent(itemID, evt);

            return true;
        }