public bool IsEventType(SimEventType update)
 {
     if (update == EventType1)
     {
         return(true);
     }
     return((update & EventType1) != 0);
 }
 public ACogbotEvent(object sender, SimEventType type, string name, IEnumerable paramz)
 {
     Sender = sender;
     SetVerb(name);
     EventType1 = type;
     Parameters = NamedParam.ObjectsToParams(paramz);
     CheckStructure();
 }
        /*
         * public ACogbotEvent(SimEventStatus status, string eventName, SimEventType type, SimEventClass clazz, IEnumerable<NamedParam> args)
         * {
         *  SetVerb(eventName);
         *  Parameters = NamedParam.ToArray(args);
         *  EventType = type;
         *  EventStatus = status;
         *  EventClass = clazz;
         *  CheckStructure();
         * }
         */

        public ACogbotEvent(object sender, SimEventType type, string name, params NamedParam[] paramz)
        {
            Sender = sender;
            SetVerb(name);
            EventType1 = type;
            Parameters = NamedParam.ToArray(paramz);
            CheckStructure();
        }
Example #4
0
 public SimEvent(SimEventType evType, TimeSpan evTime, string nameId = "", string inValue = "0.0")
 {
     this.evType = evType;
     this.time   = evTime;
     if (evType == SimEventType.etCompEv || evType == SimEventType.etTimer)
     {
         this.itemData = new ItemData(nameId, inValue);
     }
 }
Example #5
0
 private void LogSitEvent(SimObject user, SimEventType updown, string p, params NamedParam[] args)
 {
     if (!MaintainActions)
     {
         return;
     }
     if (user != null)
     {
         user.Parent = null;
         user.LogEvent(SendPipelineEvent(ACogbotEvent.CreateEvent(client, p, updown | SimEventType.SIT | SimEventType.REGIONAL, args)));
     }
     //DLRConsole.WriteLine(user + " " + p + " " + ScriptEngines.ScriptEventListener.argsListString(args));
 }
Example #6
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);
        }
Example #7
0
        public void SendPersonalEvent(SimEventType type, string eventName, params object[] args)
        {
            if (args.Length > 0)
            {
                if (args[0] is BotClient)
                {
                    args[0] = ((BotClient)args[0]).GetAvatar();
                }
            }
            CogbotEvent evt = botPipeline.CreateEvent(type | SimEventType.PERSONAL, eventName, args);

            evt.AddParam("recipientOfInfo", GetAvatar());
            SendPipelineEvent(evt);
        }
        private CogbotEvent AnimEvent(UUID uuid, SimEventType status, int serial)
        {
            SimAsset a = SimAssetStore.FindOrCreateAsset(uuid, AssetType.Animation);

            string headingString;

            switch (status)
            {
            case SimEventType.Start:
            {
                headingString = "eventOccursAt";
                break;
            }

            case SimEventType.Stop:
            {
                headingString = "toLocation";
                break;
            }

            default:
            {
                headingString = "eventOccursAt";
                break;
            }
            }
            object      m  = a.GetMeaning();
            CogbotEvent oe = CreateAEvent(status, "OnAnim", SimEventType.ANIM | SimEventType.REGIONAL,
                                          WorldObjects.ToParameter("doneBy", this),
                                          WorldObjects.ToParameter("isa", a),
                                          WorldObjects.ToParameter(headingString, GetHeading()));

            oe.Serial = serial;
            if (m != null)
            {
                oe.AddParam("isa", m);
            }
            return(oe);
        }
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, IEnumerable pzs)
 {
     return(new ACogbotEvent(sender, type, eventName, pzs));
 }
Example #10
0
        private CogbotEvent AnimEvent(UUID uuid, SimEventType status, int serial)
        {
            SimAsset a = SimAssetStore.FindOrCreateAsset(uuid, AssetType.Animation);

            string headingString;
            switch (status)
            {
                case SimEventType.Start:
                    {
                        headingString = "eventOccursAt";
                        break;
                    }
                case SimEventType.Stop:
                    {
                        headingString = "toLocation";
                        break;
                    }
                default:
                    {
                        headingString = "eventOccursAt";
                        break;
                    }
            }
            object m = a.GetMeaning();
            CogbotEvent oe = CreateAEvent(status, "OnAnim", SimEventType.ANIM | SimEventType.REGIONAL,
                                      WorldObjects.ToParameter("doneBy", this),
                                      WorldObjects.ToParameter("isa", a),
                                      WorldObjects.ToParameter(headingString, GetHeading()));
            oe.Serial = serial;
            if (m != null) oe.AddParam("isa", m);
            return oe;
        }
Example #11
0
 public CogbotEvent CreateEvent(SimEventType type, string eventName, params object[] args)
 {
     return(new ACogbotEvent(Publisher, type, eventName, args));
 }
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, SimEventType status, params NamedParam[] pzs)
 {
     return(new ACogbotEvent(sender, type | status, eventName, pzs));
 }
Example #13
0
 public void SendNewRegionEvent(SimEventType type, string eventName, params object[] args)
 {
     client.SendPipelineEvent(ACogbotEvent.CreateEvent(this, type | SimEventType.REGIONAL, eventName, args));
 }
Example #14
0
 public void SendPersonalEvent(SimEventType type, string eventName, params object[] args)
 {
     if (args.Length > 0)
     {
         if (args[0] is BotClient)
         {
             args[0] = ((BotClient)args[0]).GetAvatar();
         }
     }
     CogbotEvent evt = botPipeline.CreateEvent(type | SimEventType.PERSONAL, eventName, args);
     evt.AddParam("recipientOfInfo", GetAvatar());
     SendPipelineEvent(evt);
 }
Example #15
0
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, IEnumerable pzs)
 {
     return new ACogbotEvent(sender, type, eventName, pzs);
 }
Example #16
0
 public ACogbotEvent(object sender, SimEventType type, string name, IEnumerable paramz)
 {
     Sender = sender;
     SetVerb(name);
     EventType1 = type;
     Parameters = NamedParam.ObjectsToParams(paramz);
     CheckStructure();
 }
Example #17
0
 public CogbotEvent CreateAEvent(SimEventType status, string eventName, SimEventType type, params NamedParam[] pzs)
 {
     return ACogbotEvent.CreateEvent(this, status | type,eventName, pzs);
 }
Example #18
0
        /*
        public ACogbotEvent(SimEventStatus status, string eventName, SimEventType type, SimEventClass clazz, IEnumerable<NamedParam> args)
        {
            SetVerb(eventName);
            Parameters = NamedParam.ToArray(args);
            EventType = type;
            EventStatus = status;
            EventClass = clazz;
            CheckStructure();
        }
        */

        public ACogbotEvent(object sender, SimEventType type, string name, params NamedParam[] paramz)
        {
            Sender = sender;
            SetVerb(name);
            EventType1 = type;
            Parameters = NamedParam.ToArray(paramz);
            CheckStructure();
        }
 public CogbotEvent CreateAEvent(SimEventType status, string eventName, SimEventType type, params NamedParam[] pzs)
 {
     return(ACogbotEvent.CreateEvent(this, status | type, eventName, pzs));
 }
Example #20
0
 public bool IsEventType(SimEventType update)
 {
     if (update == EventType1) return true;
     return (update & EventType1) != 0;
 }
Example #21
0
 private void LogSitEvent(SimObject user, SimEventType updown, string p, params NamedParam[] args)
 {
     if (!MaintainActions) return;
     if (user !=null)
     {
         user.Parent = null;
         user.LogEvent(SendPipelineEvent(ACogbotEvent.CreateEvent(client, p, updown | SimEventType.SIT | SimEventType.REGIONAL, args)));
     }
     //DLRConsole.WriteLine(user + " " + p + " " + ScriptEngines.ScriptEventListener.argsListString(args));
 }
Example #22
0
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, SimEventType status, params NamedParam[] pzs)
 {
     return new ACogbotEvent(sender, type | status, eventName, pzs);
 }
Example #23
0
 public CogbotEvent CreateEvent(SimEventType type, string eventName, params object[] args)
 {
     return new ACogbotEvent(Publisher, type, eventName, args);
 }