示例#1
0
        public override void SetUp()
        {
            base.SetUp();

            uint port = 9999;
            uint sslPort = 9998;

            // This is an unfortunate bit of clean up we have to do because MainServer manages things through static
            // variables and the VM is not restarted between tests.
            MainServer.RemoveHttpServer(port);

            BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
            MainServer.AddHttpServer(server);
            MainServer.Instance = server;

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Startup");
            config.Configs["Startup"].Set("EventQueue", "true");

            CapabilitiesModule capsModule = new CapabilitiesModule();
            EventQueueGetModule eqgModule = new EventQueueGetModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
        }
        private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB)
        {            
            // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the 
            // CapabilitiesModule complain when it can't set up HTTP endpoints.
            //            BaseHttpServer httpServer = new BaseHttpServer(99999);
            //            MainServer.AddHttpServer(httpServer);
            //            MainServer.Instance = httpServer;

            // We need entity transfer modules so that when sp2 logs into the east region, the region calls 
            // EntityTransferModuleto set up a child agent on the west region.
            // XXX: However, this is not an entity transfer so is misleading.
            EntityTransferModule etmA = new EntityTransferModule();
            EntityTransferModule etmB = new EntityTransferModule();
            LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Chat");
            IConfig modulesConfig = config.AddConfig("Modules");
            modulesConfig.Set("EntityTransferModule", etmA.Name);
            modulesConfig.Set("SimulationServices", lscm.Name);

            SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
            SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule());           
            SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule());
        }
示例#3
0
        public override void SetUp()
        {
            base.SetUp();

            uint port = 9999;

            // This is an unfortunate bit of clean up we have to do because MainServer manages things through static
            // variables and the VM is not restarted between tests.
            MainServer.RemoveHttpServer(port);

            BaseHttpServer server = new BaseHttpServer(port, false, "", "", "");

            MainServer.AddHttpServer(server);
            MainServer.Instance = server;

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Startup");

            CapabilitiesModule capsModule = new CapabilitiesModule();

            m_eqgMod = new EventQueueGetModule();

            // For NPC test support
            config.AddConfig("NPC");
            config.Configs["NPC"].Set("Enabled", "true");
            m_npcMod = new NPCModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, m_eqgMod, m_npcMod);
        }
示例#4
0
 public void TearDown()
 {
     m_scene.Close();
     m_scene = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
        private void CreateScenes()
        {
            TitleTextBlock.Text =
                string.Format(
                    "Rendering {0} boxes with different transparency sorting",
                    XCount * YCount * ZCount);

            _testScenes = new TestScene[3];

            _testScenes[0] = new TestScene("No transparency sorting", useDXEngine: true, useTransparencySorter: false, useDXEngineSorting: false, subtitle: "(incorrect rendering: not all objects are visible through)");
            _testScenes[1] = new TestScene("Using TransparencySorter", useDXEngine: true, useTransparencySorter: true, useDXEngineSorting: false);
            _testScenes[2] = new TestScene("Using Ab3d.DXEngine sorting", useDXEngine: true, useTransparencySorter: false, useDXEngineSorting: true, subtitle: "Set DXScene.IsTransparencySortingEnabled to true to enable it.");

            for (int i = 0; i < 3; i++)
            {
                var sceneFrameworkElement = _testScenes[i].CreateScene();
                Grid.SetRow(sceneFrameworkElement, 1);
                Grid.SetColumn(sceneFrameworkElement, i);

                RootGrid.Children.Add(sceneFrameworkElement);

                _testScenes[i].CameraChanged += OnCameraChanged;
            }

            _testScenes[0].StartAnimation();
        }
示例#6
0
        public override void SetUp()
        {
            if (TheInstance == null)
            {
                TheInstance = this;
            }

            base.SetUp();
            TestHelpers.EnableLogging();

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Messaging");
            config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");

            config.AddConfig("Modules");
            config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");

            config.AddConfig("InventoryService");
            config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService");
            config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin");

            config.AddConfig("Groups");
            config.Configs["Groups"].Set("Enabled", "true");
            config.Configs["Groups"].Set("Module", "Groups Module V2");
            config.Configs["Groups"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestGroupsDataPlugin");
            config.Configs["Groups"].Set("ServicesConnectorModule", "Groups Local Service Connector");
            config.Configs["Groups"].Set("LocalService", "local");

            m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config);
            // Add modules
            SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule());

            SetUpBasicEnvironment();
        }
示例#7
0
 protected override void Initialize()
 {
     base.Initialize();
     debugRenderEnabled       = true;
     Window.AllowUserResizing = false;
     scene = new TestScene();
 }
示例#8
0
            public override void RunTestBlocking(TestScene test)
            {
                base.RunTestBlocking(test);

                // This will only ever trigger via NUnit
                Assert.That(test.StepsContainer, Has.Count.GreaterThan(0));
            }
        public void TestCachedUserNameForNewAgent()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();

            HGUserManagementModule hgumm = new HGUserManagementModule();
            UUID   userId    = TestHelpers.ParseStem("11");
            string firstName = "Fred";
            string lastName  = "Astaire";
            string homeUri   = "example.com:8002";

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Modules");
            config.Configs["Modules"].Set("UserManagementModule", hgumm.Name);

            SceneHelpers sceneHelpers = new SceneHelpers();
            TestScene    scene        = sceneHelpers.SetupScene();

            SceneHelpers.SetupSceneModules(scene, config, hgumm);

            AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId);

            acd.firstname = firstName;
            acd.lastname  = lastName;
            acd.ServiceURLs["HomeURI"] = "http://" + homeUri;

            SceneHelpers.AddScenePresence(scene, acd);

            string name = hgumm.GetUserName(userId);

            Assert.That(name, Is.EqualTo(string.Format("{0}.{1} @{2}", firstName, lastName, homeUri)));
        }
        public void TestShareWithGroup()
        {
            TestHelper.InMethod();
//            log4net.Config.XmlConfigurator.Configure();

            UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");

            TestScene     scene        = SceneSetupHelpers.SetupScene();
            IConfigSource configSource = new IniConfigSource();

            IConfig startupConfig = configSource.AddConfig("Startup");

            startupConfig.Set("serverside_object_permissions", true);

            IConfig groupsConfig = configSource.AddConfig("Groups");

            groupsConfig.Set("Enabled", true);
            groupsConfig.Set("Module", "GroupsModule");
            groupsConfig.Set("DebugEnabled", true);

            SceneSetupHelpers.SetupSceneModules(
                scene, configSource, new object[]
                { new PermissionsModule(),
                  new GroupsModule(),
                  new MockGroupsServicesConnector() });

            TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);

            IGroupsModule groupsModule = scene.RequestModuleInterface <IGroupsModule>();

            groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true);
        }
示例#11
0
        public void SetUp()
        {
            m_iam = new BasicInventoryAccessModule();

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Modules");
            config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");

            SceneHelpers sceneHelpers = new SceneHelpers();

            m_scene = sceneHelpers.SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, m_iam);

            // Create user
            string userFirstName = "Jock";
            string userLastName  = "Stirrup";
            string userPassword  = "******";

            UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);

            AgentCircuitData acd = new AgentCircuitData();

            acd.AgentID = m_userId;
            m_tc        = new TestClient(acd, m_scene);
        }
示例#12
0
        protected override void BeginTransitionOn()
        {
            scene = kernel.Get<TestScene>();

            //var sun = kernel.Get<EntityDescription>();
            //sun.AddProperty<Vector3>("direction", Vector3.Down);
            //sun.AddProperty<Vector3>("colour", Vector3.One);
            //sun.AddProperty<int>("shadowresolution", 1024);
            //sun.AddBehaviour<SunLight>();
            //light = sun.Create();
            //scene.Scene.Add(light);

            var toneMap = kernel.Get<ToneMapComponent>();
            var renderer = scene.Scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<GeometryBufferComponent>()
                //.Then<EdgeDetectComponent>()
                .Then<Ssao>()
                .Then<LightingComponent>()
                .Then(toneMap)
                .Then(new Phase(this, device, toneMap))
                .Then<RestoreDepthPhase>()
                .Then<TranslucentComponent>()
                //.Then<AntiAliasComponent>()
                .Apply();

            base.OnShown();
        }
示例#13
0
        public override void SetUp()
        {
            base.SetUp();

            m_pcm = new PrimCountModule();
            LandManagementModule lmm = new LandManagementModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm);

            int xParcelDivider = (int)Constants.RegionSize - 1;

            ILandObject lo = new LandObject(m_userId, false, m_scene);

            lo.LandData.Name = "m_lo";
            lo.SetLandBitmap(
                lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize));
            m_lo = lmm.AddLandObject(lo);

            ILandObject lo2 = new LandObject(m_userId, false, m_scene);

            lo2.SetLandBitmap(
                lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
            lo2.LandData.Name = "m_lo2";
            m_lo2             = lmm.AddLandObject(lo2);
        }
示例#14
0
        private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB)
        {
            // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
            // CapabilitiesModule complain when it can't set up HTTP endpoints.
            BaseHttpServer httpServer = new BaseHttpServer(99999);

            MainServer.AddHttpServer(httpServer);
            MainServer.Instance = httpServer;

            // We need entity transfer modules so that when sp2 logs into the east region, the region calls
            // EntityTransferModuleto set up a child agent on the west region.
            // XXX: However, this is not an entity transfer so is misleading.
            EntityTransferModule           etmA = new EntityTransferModule();
            EntityTransferModule           etmB = new EntityTransferModule();
            LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Chat");
            IConfig modulesConfig = config.AddConfig("Modules");

            modulesConfig.Set("EntityTransferModule", etmA.Name);
            modulesConfig.Set("SimulationServices", lscm.Name);

            SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
            SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule());
            SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule());
        }
示例#15
0
        protected override void BeginTransitionOn()
        {
            _scene = new TestScene(_kernel, _kernel.Get<Game>(), _kernel.Get<ContentManager>(), _kernel.Get<GraphicsDevice>(), new TestScene.SceneConfiguration()
            {
                View = false
            });

            _renderer = _scene.Scene.GetService<Renderer>();
            _renderer.StartPlan()
                    .Then<GeometryBufferComponent>()
                    .Then<EdgeDetectComponent>()
                    .Then<Ssao>()
                    .Then<LightingComponent>()
                    .Then<RestoreDepthPhase>()
                    .Then<TranslucentComponent>()
                    .Then<ToneMapComponent>()
                    .Then<AntiAliasComponent>()
                    .Apply();

            var w = _renderer.Device.Viewport.Width / 2;
            var h = _renderer.Device.Viewport.Height / 2;
            AddCamera("gbuffer_depth", new Viewport { X = 0, Y = 0, Width = w, Height = h });
            AddCamera("gbuffer_normals", new Viewport { X = w, Y = 0, Width = w, Height = h });
            AddCamera("gbuffer_diffuse", new Viewport { X = 0, Y = h, Width = w, Height = h });
            AddCamera("lightbuffer", new Viewport { X = w, Y = h, Width = w, Height = h });

            base.OnShown();
        }
        public void Init()
        {
            //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
//            Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
            m_xEngine = new XEngine();

            // Necessary to stop serialization complaining
            WorldCommModule wcModule = new WorldCommModule();

            IniConfigSource configSource = new IniConfigSource();

            IConfig startupConfig = configSource.AddConfig("Startup");

            startupConfig.Set("DefaultScriptEngine", "XEngine");

            IConfig xEngineConfig = configSource.AddConfig("XEngine");

            xEngineConfig.Set("Enabled", "true");

            // These tests will not run with AppDomainLoading = true, at least on mono.  For unknown reasons, the call
            // to AssemblyResolver.OnAssemblyResolve fails.
            xEngineConfig.Set("AppDomainLoading", "false");

            m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
            SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);

            m_scene.EventManager.OnChatFromWorld += OnChatFromWorld;
            m_scene.StartScripts();
        }
示例#17
0
        public void Update(float fTimer)
        {
            // FPS temp code
#if UNITY_EDITOR
            ++m_fpsCount;
            m_fpsTimer += Time.deltaTime;
            if (m_fpsTimer >= 0.5f)
            {
                TestScene.ShowLabel("FPS      ", (m_fpsCount / m_fpsTimer).ToString("f2"));
                m_fpsCount = 0;
                m_fpsTimer = 0f;
            }
#endif


            if (Input.GetKey(KeyCode.A))
            {
                PlayerMove(Direction.Left, fTimer);
            }
            else if (Input.GetKey(KeyCode.D))
            {
                PlayerMove(Direction.Right, fTimer);
            }
            else if (Input.GetKey(KeyCode.W))
            {
                PlayerMove(Direction.Up, fTimer);
            }
            else if (Input.GetKey(KeyCode.S))
            {
                PlayerMove(Direction.Down, fTimer);
            }
        }
        public ImprovedTextBlockVisual3D()
        {
            InitializeComponent();

            var rnd = new Random();

            _randomIndexes = Enumerable.Range(0, 10).OrderBy(n => rnd.Next(100)).ToArray(); // randomize an array of 10 integers

            _wpfTestScene = new TestScene(WpfViewport3D, isInDXEngine: false);
            _wpfTestScene.CreatesTestScene(_randomIndexes);

            _dxTestScene = new TestScene(DXViewport3D, isInDXEngine: true);
            _dxTestScene.CreatesTestScene(_randomIndexes);

            var alphaClipThreshold = (AlphaClipCheckBox.IsChecked ?? false) ? UsedAlphaClipThreshold : 0f;

            _dxTestScene.SetDXEngineSettings(UseSolidColorEffectCheckBox.IsChecked ?? false, alphaClipThreshold);


            CopyWpfCamera(); // Copy settings from WpfCamera to DXCamera

            WpfCamera.StartRotation(20, 0);

            this.Unloaded += (sender, args) => MainDXViewportView.Dispose();
        }
示例#19
0
        public void TestDeleteSceneObjectAsync()
        {
            TestHelpers.InMethod();
            //log4net.Config.XmlConfigurator.Configure();

            UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");

            TestScene scene = SceneHelpers.SetupScene();

            // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
            AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;

            sogd.Enabled = false;

            SceneObjectPart part = SceneHelpers.AddSceneObject(scene);

            IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient;

            scene.DeRezObjects(client, new System.Collections.Generic.List <uint>()
            {
                part.LocalId
            }, UUID.Zero, DeRezAction.Delete, UUID.Zero);

            SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);

            Assert.That(retrievedPart, Is.Not.Null);

            sogd.InventoryDeQueueAndDelete();

            SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId);

            Assert.That(retrievedPart2, Is.Null);
        }
示例#20
0
        public void SetUp()
        {
            uint port    = 9999;
            uint sslPort = 9998;

            // This is an unfortunate bit of clean up we have to do because MainServer manages things through static
            // variables and the VM is not restarted between tests.
            MainServer.RemoveHttpServer(port);

            BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");

            MainServer.AddHttpServer(server);
            MainServer.Instance = server;

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Startup");
            config.Configs["Startup"].Set("EventQueue", "true");

            CapabilitiesModule  capsModule = new CapabilitiesModule();
            EventQueueGetModule eqgModule  = new EventQueueGetModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
        }
示例#21
0
        protected override void BeginTransitionOn()
        {
            _scene = _kernel.Get<TestScene>();

            _renderer = _scene.Scene.GetService<Renderer>();

            _fullPlan = _renderer.StartPlan()
                               .Then<GeometryBufferComponent>()
                               .Then<EdgeDetectComponent>()
                               .Then<Ssao>()
                               .Then<LightingComponent>()
                               .Then<RestoreDepthPhase>()
                               .Then<TranslucentComponent>()
                               .Then<ToneMapComponent>()
                               .Then<AntiAliasComponent>()
                               .Show("antialiased");

            _noAaPlan = _renderer.StartPlan()
                               .Then<GeometryBufferComponent>()
                               .Then<EdgeDetectComponent>()
                               .Then<Ssao>()
                               .Then<LightingComponent>()
                               .Then<RestoreDepthPhase>()
                               .Then<TranslucentComponent>()
                               .Then<ToneMapComponent>()
                               .Show("tonemapped");

            base.OnShown();
        }
示例#22
0
        public void Init()
        {
            //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
//            Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
            m_xEngine = new XEngine();

            // Necessary to stop serialization complaining
            WorldCommModule wcModule = new WorldCommModule();

            IniConfigSource configSource = new IniConfigSource();
            
            IConfig startupConfig = configSource.AddConfig("Startup");
            startupConfig.Set("DefaultScriptEngine", "XEngine");

            IConfig xEngineConfig = configSource.AddConfig("XEngine");
            xEngineConfig.Set("Enabled", "true");

            // These tests will not run with AppDomainLoading = true, at least on mono.  For unknown reasons, the call
            // to AssemblyResolver.OnAssemblyResolve fails.
            xEngineConfig.Set("AppDomainLoading", "false");

            m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource);
            SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
            m_scene.StartScripts();
        }
示例#23
0
 public Game1()
 {
     God.Graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     God.Content = Content;
     Scene = new TestScene();
 }
示例#24
0
        public override void SetUp()
        {
            base.SetUp();

            m_module = new MoapModule();
            m_scene  = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, m_module);
        }
示例#25
0
        public override void SetUp()
        {
            base.SetUp();

            m_module = new MoapModule();
            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, m_module);            
        }        
        private void NewGameButton_Click(object sender, RoutedEventArgs e)
        {
            TestScene page = new TestScene(_progressTracker);

            _progressTracker.MarkSceneViewed("menu");
            _progressTracker.SaveGame();
            NavigationService.Navigate(page);
        }
        /// <summary>
        /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
        /// or a different, to get a brand new scene with new shared region modules.
        /// </summary>
        /// <param name="name">Name of the region</param>
        /// <param name="id">ID of the region</param>
        /// <param name="x">X co-ordinate of the region</param>
        /// <param name="y">Y co-ordinate of the region</param>
        /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
        /// <returns></returns>
        public static TestScene SetupScene(string name, UUID id, uint x, uint y)
        {
            Console.WriteLine("Setting up test scene {0}", name);

            // We must set up a console otherwise setup of some modules may fail
            MainConsole.Instance = new MockConsole("TEST PROMPT");

            RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");

            regInfo.RegionName = name;
            regInfo.RegionID   = id;

            AgentCircuitManager       acm = new AgentCircuitManager();
            SceneCommunicationService scs = new SceneCommunicationService();

            ISimulationDataService simDataService    = OpenSim.Server.Base.ServerUtils.LoadPlugin <ISimulationDataService>("OpenSim.Tests.Common.dll", null);
            IEstateDataService     estateDataService = null;
            IConfigSource          configSource      = new IniConfigSource();

            TestScene testScene = new TestScene(
                regInfo, acm, scs, simDataService, estateDataService, null, false, false, false, configSource, null);

            IRegionModule godsModule = new GodsModule();

            godsModule.Initialise(testScene, new IniConfigSource());
            testScene.AddModule(godsModule.Name, godsModule);

            LocalAssetServicesConnector assetService = StartAssetService(testScene);

            StartAuthenticationService(testScene);
            LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene);

            StartGridService(testScene);
            LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
            LocalPresenceServicesConnector    presenceService    = StartPresenceService(testScene);

            inventoryService.PostInitialise();
            assetService.PostInitialise();
            userAccountService.PostInitialise();
            presenceService.PostInitialise();

            testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
            testScene.SetModuleInterfaces();

            testScene.LandChannel = new TestLandChannel(testScene);
            testScene.LoadWorldMap();

            PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();

            physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
            testScene.PhysicsScene
                = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test");

            testScene.RegionInfo.EstateSettings = new EstateSettings();
            testScene.LoginsDisabled            = false;

            return(testScene);
        }
示例#28
0
        // Use this for initialization
        void Start()
        {
#if UNITY_EDITOR
            TestScene.SetEnable(true);
#endif
            EventDispatcher.AddEventListener(BattleEvent.BossAngry, BossAngry);
            m_controller = transform.GetComponent <CharacterController>();
            InitPlayerImage();
        }
示例#29
0
        public void SetUp()
        {
            m_archiverModule = new ArchiverModule();
            SerialiserModule serialiserModule = new SerialiserModule();
            VoxelModule terrainModule = new VoxelModule();

            m_scene = SceneSetupHelpers.SetupScene();
            SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
        }
示例#30
0
        public void SetUp()
        {
            m_archiverModule = new ArchiverModule();
            SerialiserModule serialiserModule = new SerialiserModule();
            TerrainModule terrainModule = new TerrainModule();

            m_scene = SceneSetupHelpers.SetupScene("useraccounts");
            SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
        }
示例#31
0
            public void RunTestBlocking(TestScene test)
            {
                while (runner?.IsLoaded != true && Host.ExecutionState == ExecutionState.Running)
                {
                    Thread.Sleep(10);
                }

                runner?.RunTestBlocking(test);
            }
示例#32
0
        public void SetUp()
        {
            m_archiverModule = new ArchiverModule();
            SerialiserModule serialiserModule = new SerialiserModule();
            TerrainModule    terrainModule    = new TerrainModule();

            m_scene = SceneSetupHelpers.SetupScene();
            SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
        }
示例#33
0
        protected override void Initialize()
        {
            sceneManager = new SceneManager();
            scene        = new TestScene(Content, graphics.GraphicsDevice);
            sceneManager.AddScene(scene);

            Viewport = new PixelatedViewport(graphics, new Vector2(Settings.VIRTUAL_VIEWPORT_WIDTH, Settings.VIRTUAL_VIEWPORT_HEIGHT));

            base.Initialize();
        }
        public override void SetUp()
        {
            base.SetUp();
            
            SerialiserModule serialiserModule = new SerialiserModule();
            m_archiverModule = new InventoryArchiverModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);            
        }
示例#35
0
        /// <summary>
        /// Delete a scene object asynchronously
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="part"></param>
        /// <param name="action"></param>
        /// <param name="destinationId"></param>
        /// <param name="client"></param>
        public static void DeleteSceneObjectAsync(
            TestScene scene, SceneObjectPart part, DeRezAction action, UUID destinationId, IClientAPI client)
        {
            // Turn off the timer on the async sog deleter - we'll crank it by hand within a unit test
            AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;

            sogd.Enabled = false;

            scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId);
            sogd.InventoryDeQueueAndDelete();
        }
示例#36
0
        public override void SetUp()
        {
            base.SetUp();

            SerialiserModule serialiserModule = new SerialiserModule();

            m_archiverModule = new InventoryArchiverModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
        }
示例#37
0
        public void TearDown()
        {
            scene.Close();
            scene = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();

            // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
            // threads.  Possibly, later tests should be rewritten not to worry about such things.
            Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
        }
        public override void SetUp()
        {
            base.SetUp();

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Messaging");
            config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");

            m_scene = new SceneHelpers().SetupScene();            
            SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule());
        } 
示例#39
0
        public void TearDown()
        {
            scene.Close();
            scene = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();

            // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
            // threads.  Possibly, later tests should be rewritten not to worry about such things.
            Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
        }
        public void TestCrossOnSameSimulatorPrimLimitsOkay()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();

            UUID userId            = TestHelpers.ParseTail(0x1);
            int  sceneObjectIdTail = 0x2;

            EntityTransferModule           etmA = new EntityTransferModule();
            EntityTransferModule           etmB = new EntityTransferModule();
            LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
            LandManagementModule           lmmA = new LandManagementModule();
            LandManagementModule           lmmB = new LandManagementModule();

            IConfigSource config        = new IniConfigSource();
            IConfig       modulesConfig = config.AddConfig("Modules");

            modulesConfig.Set("EntityTransferModule", etmA.Name);
            modulesConfig.Set("SimulationServices", lscm.Name);

            IConfig permissionsConfig = config.AddConfig("Permissions");

            permissionsConfig.Set("permissionmodules", "PrimLimitsModule");

            SceneHelpers sh     = new SceneHelpers();
            TestScene    sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
            TestScene    sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1000, 999);

            SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
            SceneHelpers.SetupSceneModules(
                sceneA, config, etmA, lmmA, new PrimLimitsModule(), new PrimCountModule());
            SceneHelpers.SetupSceneModules(
                sceneB, config, etmB, lmmB, new PrimLimitsModule(), new PrimCountModule());

            // We must set up the parcel for this to work.  Normally this is taken care of by OpenSimulator startup
            // code which is not yet easily invoked by tests.
            lmmA.EventManagerOnNoLandDataFromStorage();
            lmmB.EventManagerOnNoLandDataFromStorage();

            SceneObjectGroup so1   = SceneHelpers.AddSceneObject(sceneA, 1, userId, "", sceneObjectIdTail);
            UUID             so1Id = so1.UUID;

            so1.AbsolutePosition = new Vector3(128, 10, 20);

            // Cross with a negative value.  We must make this call rather than setting AbsolutePosition directly
            // because only this will execute permission checks in the source region.
            sceneA.SceneGraph.UpdatePrimGroupPosition(so1.LocalId, new Vector3(128, -10, 20), userId);

            // crossing is async
            Thread.Sleep(500);

            Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id));
            Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id));
        }
示例#41
0
        protected override void BeginTransitionOn()
        {
            _scene = _kernel.Get<TestScene>();

            var renderer = _scene.Scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<GeometryBufferComponent>()
                .Then<Phase>()
                .Apply();

            base.OnShown();
        }
        public void Init()
        {
            m_osChatMessageReceived = null;
            m_chatMessagesReceived  = 0;
            m_chatMessagesThreshold = 0;
            m_chatEvent             = new AutoResetEvent(false);
            m_stoppedEvent          = new AutoResetEvent(false);

            //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
            //            Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
            m_xEngine            = new OpenSim.Region.ScriptEngine.XEngine.XEngine();
            m_xEngine.DebugLevel = 1;

            IniConfigSource configSource = new IniConfigSource();

            IConfig startupConfig = configSource.AddConfig("Startup");

            startupConfig.Set("DefaultScriptEngine", "XEngine");

            IConfig xEngineConfig = configSource.AddConfig("XEngine");

            xEngineConfig.Set("Enabled", "true");
            xEngineConfig.Set("StartDelay", "0");

            // These tests will not run with AppDomainLoading = true, at least on mono.  For unknown reasons, the call
            // to AssemblyResolver.OnAssemblyResolve fails.
            xEngineConfig.Set("AppDomainLoading", "false");

            xEngineConfig.Set("ScriptStopStrategy", "co-op");

            // Make sure loops aren't actually being terminated by a script delay wait.
            xEngineConfig.Set("ScriptDelayFactor", 0);

            // This is really just set for debugging the test.
            xEngineConfig.Set("WriteScriptSourceToDebugFile", true);

            // Set to false if we need to debug test so the old scripts don't get wiped before each separate test
            //            xEngineConfig.Set("DeleteScriptsOnStartup", false);

            // This is not currently used at all for co-op termination.  Bumping up to demonstrate that co-op termination
            // has an effect - without it tests will fail due to a 120 second wait for the event to finish.
            xEngineConfig.Set("WaitForEventCompletionOnScriptStop", 120000);

            IConfig config = configSource.AddConfig("OSSL");

            config.Set("DebuggerSafe", false);
            config.Set("AllowOSFunctions", "true");
            config.Set("OSFunctionThreatLevel", "Severe");

            m_scene = new SceneHelpers().SetupScene("My Test", TestHelpers.ParseTail(0x9999), 1000, 1000, configSource);
            SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine);
            m_scene.StartScripts();
        }
示例#43
0
        public override void SetUp()
        {
            base.SetUp();

            m_archiverModule = new ArchiverModule();
            m_serialiserModule = new SerialiserModule();
            TerrainModule terrainModule = new TerrainModule();

            m_sceneHelpers = new SceneHelpers();
            m_scene = m_sceneHelpers.SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, m_serialiserModule, terrainModule);
        }
示例#44
0
        public override void SetUp()
        {
            base.SetUp();

            IConfigSource config = new IniConfigSource();

            config.AddConfig("Messaging");
            config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule());
        }
示例#45
0
        public void TestCreateChildScenePresence()
        {
            TestHelpers.InMethod();
//            log4net.Config.XmlConfigurator.Configure();

            LocalSimulationConnectorModule lsc = new LocalSimulationConnectorModule();

            IConfigSource configSource = new IniConfigSource();
            IConfig       config       = configSource.AddConfig("Modules");

            config.Set("SimulationServices", "LocalSimulationConnectorModule");

            SceneHelpers sceneHelpers = new SceneHelpers();
            TestScene    scene        = sceneHelpers.SetupScene();

            SceneHelpers.SetupSceneModules(scene, configSource, lsc);

            UUID             agentId = TestHelpers.ParseTail(0x01);
            AgentCircuitData acd     = SceneHelpers.GenerateAgentData(agentId);

            acd.child = true;

            GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName);
            string     reason;

            // *** This is the first stage, when a neighbouring region is told that a viewer is about to try and
            // establish a child scene presence.  We pass in the circuit code that the client has to connect with ***
            // XXX: ViaLogin may not be correct here.
            EntityTransferContext ctx = new EntityTransferContext();

            scene.SimulationService.CreateAgent(null, region, acd, (uint)TeleportFlags.ViaLogin, ctx, out reason);

            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));

            // There's no scene presence yet since only an agent circuit has been established.
            Assert.That(scene.GetScenePresence(agentId), Is.Null);

            // *** This is the second stage, where the client established a child agent/scene presence using the
            // circuit code given to the scene in stage 1 ***
            TestClient client = new TestClient(acd, scene);

            scene.AddNewAgent(client, PresenceType.User);

            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));

            ScenePresence sp = scene.GetScenePresence(agentId);

            Assert.That(sp, Is.Not.Null);
            Assert.That(sp.UUID, Is.EqualTo(agentId));
            Assert.That(sp.IsChildAgent, Is.True);
        }
示例#46
0
        protected override void BeginTransitionOn()
        {
            scene = kernel.Get<TestScene>();

            var renderer = scene.Scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<GeometryBufferComponent>()
                .Then<EdgeDetectComponent>()
                .Show("edges")
                .Apply();

            base.OnShown();
        }
        public void SetUp()
        {
            IConfigSource config = new IniConfigSource();

            config.AddConfig("Modules");
            config.Configs["Modules"].Set("AssetCaching", "FlotsamAssetCache");
            config.AddConfig("AssetCache");
            config.Configs["AssetCache"].Set("FileCacheEnabled", "false");
            config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");

            m_cache = new FlotsamAssetCache();
            m_scene = SceneSetupHelpers.SetupScene();
            SceneSetupHelpers.SetupSceneModules(m_scene, config, m_cache);
        }
示例#48
0
        public void SetUp()
        {
            MainServer.Instance = new BaseHttpServer(9999, false, 9998, "");

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Startup");
            config.Configs["Startup"].Set("EventQueue", "true");

            CapabilitiesModule capsModule = new CapabilitiesModule();
            EventQueueGetModule eqgModule = new EventQueueGetModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
        }
示例#49
0
 void Awake( )
 {
    #if !(UNITY_FLASH)
    useGUILayout = false;
    #endif
    ExposedVariables.Awake( );
    ExposedVariables.SetParent( this.gameObject );
    if ( "1.PLE" != uScript_MasterComponent.Version )
    {
       uScriptDebug.Log( "The generated code is not compatible with your current uScript Runtime " + uScript_MasterComponent.Version, uScriptDebug.Type.Error );
       ExposedVariables = null;
       UnityEngine.Debug.Break();
    }
 }
示例#50
0
        public override void SetUp()
        {
            base.SetUp();

            // FIXME: Do something about this - relying on statics in unit tests causes trouble sooner or later
            new SceneManager();

            m_archiverModule = new ArchiverModule();
            m_serialiserModule = new SerialiserModule();
            TerrainModule terrainModule = new TerrainModule();

            m_sceneHelpers = new SceneHelpers();
            m_scene = m_sceneHelpers.SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, m_serialiserModule, terrainModule);
        }
示例#51
0
        public override void OnShown()
        {
            scene = kernel.Get<TestScene>();

            var renderer = scene.Scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<GeometryBufferComponent>()
                .Then<EdgeDetectComponent>()
                .Then<Ssao>()
                .Then<LightingComponent>()
                .Show("ssao")
                .Apply();

            base.OnShown();
        }
示例#52
0
        public void Init()
        {
            IConfigSource config = new IniConfigSource();
            config.AddConfig("Modules");
            // Not strictly necessary since FriendsModule assumes it is the default (!)
            config.Configs["Modules"].Set("FriendsModule", "FriendsModule");
            config.AddConfig("Friends");
            config.Configs["Friends"].Set("Connector", "OpenSim.Services.FriendsService.dll");
            config.AddConfig("FriendsService");
            config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll");

            m_scene = SceneHelpers.SetupScene();
            m_fm = new FriendsModule();
            SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
        }
示例#53
0
        public void Init()
        {
            IConfigSource config = new IniConfigSource();
            config.AddConfig("NPC");
            config.Configs["NPC"].Set("Enabled", "true");
            config.AddConfig("Modules");
            config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");

            afm = new AvatarFactoryModule();
            umm = new UserManagementModule();
            am = new AttachmentsModule();

            scene = SceneHelpers.SetupScene();
            SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule());
        }
示例#54
0
        protected override void BeginTransitionOn()
        {
            _scene = _kernel.Get<TestScene>();

            var renderer = _scene.Scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<GeometryBufferComponent>()
                .Then<EdgeDetectComponent>()
                .Then<Ssao>()
                .Then<LightingComponent>()
                .Then<Phase>()
                //.Show("shadowmap")
                .Apply();

            base.OnShown();
        }
        public void SetUpLoginEnviroment()
        {
            m_capsEndPoint = new IPEndPoint(IPAddress.Loopback, 9123);
            m_commsManager = new TestCommunicationsManager(new NetworkServersInfo(42, 43));
            m_regionConnector = new TestLoginToRegionConnector();
            m_testScene = SceneSetupHelpers.SetupScene(m_commsManager, "");

            m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName));

            //IInventoryService m_inventoryService = new TestInventoryService();

            m_localUserServices = (LocalUserServices) m_commsManager.UserService;
            m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","*****@*****.**",42,43);

            m_loginService = new LLStandaloneLoginService((UserManagerBase) m_localUserServices, "Hello folks", m_testScene.InventoryService,
                  m_commsManager.NetworkServersInfo, true, new LibraryRootFolder(String.Empty), m_regionConnector);

            m_userProfileData = m_localUserServices.GetUserProfile(m_firstName, m_lastName);
        }
示例#56
0
        public void Init()
        {
            // We must clear friends data between tests since Data.Null holds it in static properties.  This is necessary
            // so that different services and simulator can share the data in standalone mode.  This is pretty horrible
            // effectively the statics are global variables.
            NullFriendsData.Clear();
                
            IConfigSource config = new IniConfigSource();
            config.AddConfig("Modules");
            // Not strictly necessary since FriendsModule assumes it is the default (!)
            config.Configs["Modules"].Set("FriendsModule", "FriendsModule");
            config.AddConfig("Friends");
            config.Configs["Friends"].Set("Connector", "OpenSim.Services.FriendsService.dll");
            config.AddConfig("FriendsService");
            config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll");

            m_scene = new SceneHelpers().SetupScene();
            m_fm = new FriendsModule();
            SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
        }
        public void SetUp()
        {
            m_iam = new BasicInventoryAccessModule();

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Modules");
            config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
            
            m_scene = SceneHelpers.SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
            
            // Create user
            string userFirstName = "Jock";
            string userLastName = "Stirrup";
            string userPassword = "******";
            UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);                        
            
            AgentCircuitData acd = new AgentCircuitData();
            acd.AgentID = m_userId;
            m_tc = new TestClient(acd, m_scene);            
        }
示例#58
0
 public void SetUp()
 {
     m_pcm = new PrimCountModule();
     LandManagementModule lmm = new LandManagementModule();
     m_scene = SceneHelpers.SetupScene();            
     SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm);             
                 
     int xParcelDivider = (int)Constants.RegionSize - 1;
     
     ILandObject lo = new LandObject(m_userId, false, m_scene);
     lo.LandData.Name = "m_lo";
     lo.SetLandBitmap(
         lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize));
     m_lo = lmm.AddLandObject(lo);          
     
     ILandObject lo2 = new LandObject(m_userId, false, m_scene);
     lo2.SetLandBitmap(
         lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
     lo2.LandData.Name = "m_lo2";
     m_lo2 = lmm.AddLandObject(lo2);
 } 
 public void Init()
 {
     m_scene = SceneHelpers.SetupScene();
 }
示例#60
0
 public void SetUp()
 {
     m_module = new MoapModule();
     m_scene = new SceneHelpers().SetupScene();
     SceneHelpers.SetupSceneModules(m_scene, m_module);            
 }