Exemplo n.º 1
0
 public bool IsEventType(SimEventType update)
 {
     if (update == EventType1)
     {
         return(true);
     }
     return((update & EventType1) != 0);
 }
Exemplo n.º 2
0
 public ACogbotEvent(object sender, SimEventType type, string name, IEnumerable paramz)
 {
     Sender = sender;
     SetVerb(name);
     EventType1 = type;
     Parameters = NamedParam.ObjectsToParams(paramz);
     CheckStructure();
 }
Exemplo n.º 3
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();
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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));
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, IEnumerable pzs)
 {
     return(new ACogbotEvent(sender, type, eventName, pzs));
 }
Exemplo n.º 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;
        }
Exemplo n.º 11
0
 public CogbotEvent CreateEvent(SimEventType type, string eventName, params object[] args)
 {
     return(new ACogbotEvent(Publisher, type, eventName, args));
 }
Exemplo n.º 12
0
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, SimEventType status, params NamedParam[] pzs)
 {
     return(new ACogbotEvent(sender, type | status, eventName, pzs));
 }
Exemplo n.º 13
0
 public void SendNewRegionEvent(SimEventType type, string eventName, params object[] args)
 {
     client.SendPipelineEvent(ACogbotEvent.CreateEvent(this, type | SimEventType.REGIONAL, eventName, args));
 }
Exemplo n.º 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);
 }
Exemplo n.º 15
0
 public static CogbotEvent CreateEvent(object sender, SimEventType type, string eventName, IEnumerable pzs)
 {
     return new ACogbotEvent(sender, type, eventName, pzs);
 }
Exemplo n.º 16
0
 public ACogbotEvent(object sender, SimEventType type, string name, IEnumerable paramz)
 {
     Sender = sender;
     SetVerb(name);
     EventType1 = type;
     Parameters = NamedParam.ObjectsToParams(paramz);
     CheckStructure();
 }
Exemplo n.º 17
0
 public CogbotEvent CreateAEvent(SimEventType status, string eventName, SimEventType type, params NamedParam[] pzs)
 {
     return ACogbotEvent.CreateEvent(this, status | type,eventName, pzs);
 }
Exemplo n.º 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();
        }
Exemplo n.º 19
0
 public CogbotEvent CreateAEvent(SimEventType status, string eventName, SimEventType type, params NamedParam[] pzs)
 {
     return(ACogbotEvent.CreateEvent(this, status | type, eventName, pzs));
 }
Exemplo n.º 20
0
 public bool IsEventType(SimEventType update)
 {
     if (update == EventType1) return true;
     return (update & EventType1) != 0;
 }
Exemplo n.º 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));
 }
Exemplo n.º 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);
 }
Exemplo n.º 23
0
 public CogbotEvent CreateEvent(SimEventType type, string eventName, params object[] args)
 {
     return new ACogbotEvent(Publisher, type, eventName, args);
 }