Exemple #1
0
 void SetupEQ()
 {
     eqID = UUID.Random().ToString();
     NextEQID = eqID;
     EQ = new EventQueue();
     NextEQ = EQ;
     lock (Agents)
     {
         if (!Agents.ContainsKey(eqID))
         {
             Agents.Add(eqID, this);
             Console.WriteLine("[Agent]: Added new agent with EQID " + eqID);
         }
         else
             Console.WriteLine("[Agent]: key already exists???");
     }
 }
Exemple #2
0
        bool LocalEQHandler(CapsRequest req, CapsStage stage)
        {
            if (stage != CapsStage.Response) return true; // shortcircuit, so don't foward to sim
            Console.WriteLine(">> LocalEQHandler " + stage.ToString() + " to " + req.Info.URI);

            int length = req.Info.URI.Length;
            string key = req.Info.URI.Substring(length - 37, 36);
            //Console.WriteLine("       key " + key);
            // it comes back on the Response phase
            EventQueue _eq = Agent.GetEventQueue(key);
            if (_eq == null)
            {
                Console.WriteLine("[GRIDER]: Agent has no EQ??? Creating new one");
                _eq = new EventQueue();
            }
            else
            {
                Console.WriteLine("[GRIDER]: Found Event Queue for agent " + key);
            }

            if (_eq.Run(req) == null)
                Agent.RemoveEventQueue(key);

            //    req.Response = new OSD();

            return false;
        }