Пример #1
0
        void SimEventSubscriber.OnEvent(CogbotEvent evt)
        {
            if (!EventsEnabled) return;
            const SimEventType du = SimEventType.DATA_UPDATE;
            if (evt.IsEventType(du)) return;

            if (evt.IsEventType(SimEventType.EFFECT))
            {
                if (evt.Verb == "LookAtType-Idle") return;
                if (evt.Verb == "LookAtType-FreeLook") return;
            }
            String eventName = evt.Verb;
            object[] args = evt.GetArgs();

            String msg = "["+ From.GetName() + ": " + eventName.ToLower()+"]";
            int start = 0;
            if (args.Length > 1)
            {
                if (args[0] is Simulator)
                {
                   // start = 1;
                }
            }
            for (int i = start; i < args.Length; i++)
            {
                msg += " ";
                msg += From.argString(args[i]);
            }
            if (msg.Contains("Transfer failed with status code")) return;
            msg += "";
            
            textForm(msg);
        }
Пример #2
0
 void SimEventSubscriber.OnEvent(CogbotEvent evt)
 {
     if (evt.Verb == "On-Execute-Command")
     {
         ExecuteCommand(evt.GetArgs()[0].ToString(), null, WriteLine, CMDFLAGS.NoResult);
     }
 }
Пример #3
0
        //public override bool OnEffect(string effectType, object t, object p, float duration, UUID id)
        //{
        //    bool noteable = LogEvent(new SimObjectEvent(effectType, SimEventType.EFFECT, SimEventStatus.Once, this, t, p, duration, id));
        //    //todo
        //    if (noteable) WorldSystem.SendNewEvent("on-effect", effectType, this, t, p, duration, id);
        //    return noteable;
        //    //throw new NotImplementedException();
        //}

        public override bool LogEvent(CogbotEvent SE)
        {
            string typeUse = SE.Verb;

            object[] args1_N = SE.GetArgs();
            // does this backwards to the first argument is the most reliavant object
            for (int i = args1_N.Length - 1; i >= 0; i--)
            {
                object o = args1_N[i];
                if (o == this)
                {
                    continue;            //skip self
                }
                if (o is SimObject)
                {
                    KnownSimObjects.Add((SimObject)o);
                }
            }
            _knownTypeUsages.AddTo(SimTypeSystem.CreateTypeUsage(typeUse));
            bool noteable = base.LogEvent(SE);

            if (noteable)
            //if (theAvatar.Name.Contains("rael"))
            {
                //DLRConsole.DebugWriteLine(SE);
            }
            return(noteable);
        }
Пример #4
0
        void SimEventSubscriber.OnEvent(CogbotEvent evt)
        {
            if (!EventsEnabled)
            {
                return;
            }
            const SimEventType du = SimEventType.DATA_UPDATE;

            if (evt.IsEventType(du))
            {
                return;
            }

            if (evt.IsEventType(SimEventType.EFFECT))
            {
                if (evt.Verb == "LookAtType-Idle")
                {
                    return;
                }
                if (evt.Verb == "LookAtType-FreeLook")
                {
                    return;
                }
            }
            String eventName = evt.Verb;

            object[] args = evt.GetArgs();

            String msg   = "[" + From.GetName() + ": " + eventName.ToLower() + "]";
            int    start = 0;

            if (args.Length > 1)
            {
                if (args[0] is Simulator)
                {
                    // start = 1;
                }
            }
            for (int i = start; i < args.Length; i++)
            {
                msg += " ";
                msg += From.argString(args[i]);
            }
            if (msg.Contains("Transfer failed with status code"))
            {
                return;
            }
            msg += "";

            textForm(msg);
        }
Пример #5
0
        //public override bool OnEffect(string effectType, object t, object p, float duration, UUID id)
        //{
        //    bool noteable = LogEvent(new SimObjectEvent(effectType, SimEventType.EFFECT, SimEventStatus.Once, this, t, p, duration, id));
        //    //todo
        //    if (noteable) WorldSystem.SendNewEvent("on-effect", effectType, this, t, p, duration, id);
        //    return noteable;
        //    //throw new NotImplementedException();
        //}

        public override bool LogEvent(CogbotEvent SE)
        {
            string typeUse = SE.Verb;
            object[] args1_N = SE.GetArgs();
            // does this backwards to the first argument is the most reliavant object
            for (int i = args1_N.Length - 1; i >= 0; i--)
            {
                object o = args1_N[i];
                if (o == this) continue; //skip self
                if (o is SimObject) KnownSimObjects.Add((SimObject)o);
            }
            _knownTypeUsages.AddTo(SimTypeSystem.CreateTypeUsage(typeUse));
            bool noteable = base.LogEvent(SE);
            if (noteable)
            //if (theAvatar.Name.Contains("rael"))
            {
                //DLRConsole.DebugWriteLine(SE);
            }
            return noteable;
        }
Пример #6
0
        public void OnEvent(CogbotEvent evt)
        {
            String s = evt.Verb.ToLower();

            if (s.StartsWith("on-chat"))
            {
                return;
            }
            string aimlCall = string.Format("SimEvent {0} {1}", evt.Verb, argsListString(evt.GetArgs()));
            //DLRConsole.DebugWriteLine(aimlCall);
            //Result r = AimlBot.Chat(aimlCall,"EventSystem");
        }
Пример #7
0
 private object lispCodeFromEvent(CogbotEvent evt)
 {
     return genLispCodeTree("(" + evt.Verb.ToLower() + " " + argsListString(evt.GetArgs()) + ")");
 }
Пример #8
0
 static internal string EventToString(CogbotEvent evt, BotClient parent)
 {
     return string.Format("({0} {1})", evt.Verb, parent.argsListString(evt.GetArgs()));
 }
 static internal string EventToString(CogbotEvent evt, BotClient parent)
 {
     return(string.Format("({0} {1})", evt.Verb, parent.argsListString(evt.GetArgs())));
 }
 private object lispCodeFromEvent(CogbotEvent evt)
 {
     return(genLispCodeTree("(" + evt.Verb.ToLower() + " " + argsListString(evt.GetArgs()) + ")"));
 }
Пример #11
0
 void SimEventSubscriber.OnEvent(CogbotEvent evt)
 {
     if (evt.Verb == "On-Execute-Command")
     {
         ExecuteCommand(evt.GetArgs()[0].ToString(), null, WriteLine, CMDFLAGS.NoResult);
     }
 }