示例#1
0
        private void RezScript(Scene scene, UUID soId, string script, string itemName, UUID userId)
        {
            InventoryItemBase itemTemplate = new InventoryItemBase();
            //            itemTemplate.ID = itemId;
            itemTemplate.Name = itemName;
            itemTemplate.Folder = soId;
            itemTemplate.InvType = (int)InventoryType.LSL;

            // XXX: Ultimately it would be better to be able to directly manipulate the script engine to rez a script
            // immediately for tests rather than chunter through it's threaded mechanisms.
            AutoResetEvent chatEvent = new AutoResetEvent(false);

            scene.EventManager.OnChatFromWorld += (s, c) => 
            {
//                Console.WriteLine("Got chat [{0}]", c.Message);           
                chatEvent.Set();
            };

            scene.RezNewScript(userId, itemTemplate, script);

//            Console.WriteLine("HERE");
            Assert.IsTrue(chatEvent.WaitOne(60000), "Chat event in HGAssetMapperTests.RezScript not received");
        }